compilation fails at simpledataio.c because of wrong preprocessor options
compilation of simpledataio.c fails because deprecated preprocessor options passed to GNU gcc.
h5pcc -Idiagnostics/simpledataio -O3 -I. -I/Volumes/Data/numata/sim_local/UMD/gs2/utils -I/Volumes/Data/numata/sim_local/UMD/gs2/geo -I.. -I/opt/local/include -I/opt/local/include -DFCOMPILER=_GFORTRAN_ -ffreestanding -I/opt/local/include -DGIT_HASH='"0787ceb92d7ab3bdfd4b2c238e342b0552847cb7"' -DGIT_BRANCH='"next"' -DGIT_STATE='"modified"' -DGIT_PATCH_FILE='".patch.make"' -DRUN_NAME_SIZE=2000 -DGK_SYSTEM='"tequila2"' -DMPI -DISO_C_BINDING -DNEW_DIAG -DFFT=_FFTW3_ -DNETCDF -DNETCDF_PARALLEL -DHDF -DHAVE_MPI -DFORTRAN_NETCDF -DISO_C_BINDING -DPARALLEL -c diagnostics/simpledataio/src/simpledataio.c
gcc-mp-7: error: GNU C no longer supports -traditional without -E
make: *** [simpledataio.o] Error 1
There seems a related compile switch ONE_STEP_PP which causes another problem and does not help. When I turn on ONE_STEP_PP, I get following errors because mp.fpp is directly passed to fortran compiler.
h5pfc -DGIT_HASH='"0787ceb92d7ab3bdfd4b2c238e342b0552847cb7"' -DGIT_BRANCH='"next"' -DGIT_STATE='"modified"' -DGIT_PATCH_FILE='".patch.make"' -DRUN_NAME_SIZE=2000 -DGK_SYSTEM='"tequila2"' -DMPI -DISO_C_BINDING -DNEW_DIAG -DFFT=_FFTW3_ -DNETCDF -DNETCDF_PARALLEL -DHDF -DHAVE_MPI -DFORTRAN_NETCDF -DISO_C_BINDING -DPARALLEL -ffree-line-length-none -fno-backslash -fdefault-real-8 -fdefault-double-8 -O3 -I/opt/local/include -I/opt/local/include -c utils/mp.fpp
h5pfc -ffree-line-length-none -fno-backslash -fdefault-real-8 -fdefault-double-8 -O3 -I/opt/local/include -I/opt/local/include -c utils/spl.f90
utils/spl.f90:144:8:
use mp, only: mp_abort
1
Fatal Error: Can't open module file 'mp.mod' for reading at (1): No such file or directory
compilation terminated.
Comments (10)
-
reporter -
reporter -
It looks like you're using gcc v7, is that right? I couldn't reproduce this with gcc v7.3.1.
I note that the command where the error is reported:
h5pcc -Idiagnostics/simpledataio -O3 -I. -I/Volumes/Data/numata/sim_local/UMD/gs2/utils -I/Volumes/Data/numata/sim_local/UMD/gs2/geo -I.. -I/opt/local/include -I/opt/local/include -DFCOMPILER=GFORTRAN -ffreestanding -I/opt/local/include -DGIT_HASH=‘“0787ceb92d7ab3bdfd4b2c238e342b0552847cb7”’ -DGIT_BRANCH=‘“next”’ -DGIT_STATE=‘“modified”’ -DGIT_PATCH_FILE=‘“.patch.make”’ -DRUN_NAME_SIZE=2000 -DGK_SYSTEM=‘“tequila2”’ -DMPI -DISO_C_BINDING -DNEW_DIAG -DFFT=FFTW3 -DNETCDF -DNETCDF_PARALLEL -DHDF -DHAVE_MPI -DFORTRAN_NETCDF -DISO_C_BINDING -DPARALLEL -c diagnostics/simpledataio/src/simpledataio.c
does not appear to include the flag
-traditional
. Is it possible to see whath5pcc
is actually doing (something likempicc --show
)?edit: I guess
h5pcc
is using the environment's CPPFLAGS value -
h5pcc -show
shows the compilation command -
reporter Maybe, you're right. h5pcc seems looking CPPFLAGS. I checked both h5pcc -v and mpicc -show, and confirmed that there's no -traditional flag.
Another thing I found is that again the "export" in tests/Makefile.tests_and_benchmarks affects this behavior. If I change
export
toexport GK_HEAD_DIR
then this error goes away. -
reporter here's the -show outputs
numata@tequila2% h5pcc -show /opt/local/bin/mpicc-mpich-gcc7 -I/opt/local/include -pipe -Os -L/opt/local/lib /opt/local/lib/libhdf5_hl.a /opt/local/lib/libhdf5.a -L/opt/local/lib -Wl,-headerpad_max_install_names -lz -ldl -lm numata@tequila2% mpicc -show /opt/local/bin/gcc-mp-7 -Wl,-flat_namespace -Wl,-commons,use_dylibs -I/opt/local/include/mpich-gcc7 -L/opt/local/lib/mpich-gcc7 -lmpi -lpmpi
-
reporter - edited description
-
Just to check/remind me, was this fixed by PR #116?
-
reporter Yes, this is fixed.
-
- changed status to resolved
Fixed in next
- Log in to comment
I'm preparing a solution where I set up a variable to set preprocessor options passed only to cpp.