OpenMP Detection Assumes GNU-Style Preprocessor Directive for Fortran (Incompatible with IBM XLF)
Created by: nmhamster
Trilinos OpenMP detection of flags for Fortran compiler does not work correctly with IBM XLF compiler on POWER8 platform. The detection assumes that the -D
flag works for passing preprocessor defines through to the compiler. This is not the case for the IBM xlf
and xlf90
compilers where -WF,-D
needs to be used if we expect the C preprocessor to be called. The correct check should be for -qsmp=omp
to be found although its not clear this is correctly tested for (possible I have missed it in the error output).
/home/projects/pwr8-rhel72/ibm/xl/xlf/15.1.3/bin/xlf -O3 -g -qsmp=omp -qsimd=auto -L/home/projects/pwr8-rhel72/ibm/xl/xlf/15.1.3/lib -L/home/projects/pwr8-rhel72/ibm/xl/xlC/13.1.3/lib -lopen-pal -lxl -lxlopt -lxlf90 -lxlfmath -lm -libmc++ -lstdc++ -L/home/projects/pwr8-rhel72/openmpi/1.10.2/xl/13.1.3/cuda/7.5.7/lib -lmpi -O3 -g -qsmp=omp -qsimd=auto -L/home/projects/pwr8-rhel72/ibm/xl/xlf/15.1.3/lib -L/home/projects/pwr8-rhel72/ibm/xl/xlC/13.1.3/lib -lxlf90 -DOpenMP_FLAG_DETECTED -mp CMakeFiles/cmTC_48a9b.dir/src.F.o -o cmTC_48a9b -Wl,-export-dynamic
Yields (incorrect behavior) error of:
ld: warning: cannot find entry symbol nMP_FLAG_DETECTED; defaulting to 0000000010000860