- changed title to Use of `-pthread` in `example/prog-guide/Makefile` breaks PGI
-
assigned issue to
- changed component to Examples
Use of `-pthread` in `example/prog-guide/Makefile` breaks PGI
Issue #271
resolved
The Makefile for the Progreammer's Guide examples currently assumes -pthread
is an acceptable compiler option. However, this is NOT true of PGI's compilers.
While the Makefile does honor a PTHREAD_FLAGS
, there is no documentation which references it.
I believe there are at least three ways to address this, which I list in what I believe is best-to-worst order:
- Dan has suggested that
UPCXX_THREADMODE=par
is "necessary and sufficient" to ensure proper compile and link flags are used byupcxx
. If that is correct, then we should not be passing any explicit-pthread
options (doing so being a "bad example"). So, the best solution may be to remove all instances of$(PTHREAD_FLAGS)
. - If such a flag is needed, then use of (untested)
ifeq ($(shell $UPCXX_INSTALL/bin/upcxx --version 2>&1 | grep -w PGI ),)
should be sufficient to provide distinct default values ofPTHREAD_FLAGS
for non-PGI vs PGI compilers. Though a bit messy, this would provide for works-by-default behavior. - Add documentation of
PTHREAD_FLAGS
to theexample/prog-guide/README.md
Comments (2)
-
-
- changed status to resolved
example/prog-guide/Makefile: Remove non-portable/extraneous use of
-pthread
flagFixes issue
#271→ <<cset aed0fd9b3ab5>>
- Log in to comment
Proposed fix in pull request #132