In file included from /opt/intel/impi/4.1.1.036/intel64/include/mpi.h:1279:0,
from /home/users/yuxianzhi/relion2-beta/src/mpi.h:47,
from /home/users/yuxianzhi/relion2-beta/src/gpu_utils/cuda_autopicker.h:4,
from /home/users/yuxianzhi/relion2-beta/src/gpu_utils/cuda_autopicker.cu:4:
/opt/intel/impi/4.1.1.036/intel64/include/mpicxx.h:95:2: error: #error "SEEK_SET is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
error "SEEK_SET is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
^
/opt/intel/impi/4.1.1.036/intel64/include/mpicxx.h:99:2: error: #error "SEEK_CUR is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
error "SEEK_CUR is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
^
/opt/intel/impi/4.1.1.036/intel64/include/mpicxx.h:104:2: error: #error "SEEK_END is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
error "SEEK_END is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
Solution
1) use other version mpi
2) Include mpi.h before stdio.h
3) write these undefine before include mpi.h in src/mpi.h
Original comment byYu Xianzhi (Bitbucket: yuxianzhi, GitHub: yuxianzhi):
I only have intel mpi on my server, There is no much difference between two tests(icc+impi, gcc+impi) when you only use cpu to do calculation. Maybe there will have an gap if you use other mpi(openmpi).
Originally reported by: Yu Xianzhi (Bitbucket: yuxianzhi, GitHub: yuxianzhi)
Error Meesage
/usr/local/cuda/bin/nvcc -M -DCUDACC /home/users/yuxianzhi/relion2-beta/src/gpu_utils/cuda_autopicker.cu -o /home/users/yuxianzhi/relion2-beta/build/src/apps/CMakeFiles/relion_gpu_util.dir//gpu_utils/relion_gpu_util_generated_cuda_autopicker.cu.o.NVCC-depend -ccbin /opt/rh/devtoolset-2/root/usr/bin/cc -m64 -DINSTALL_LIBRARY_DIR=\"/usr/local/lib/\" -DSOURCE_DIR=\"/home/users/yuxianzhi/relion2-beta/src/\" -DCUDA -DHAVE_SINCOS -Drelion_gpu_util_EXPORTS -Xcompiler ,\"-fPIC\",\"-O3\",\"-DNDEBUG\" -arch=sm_35 -DINTEL_COMPILER --disable-warnings -DNVCC -I/usr/local/cuda/include -I/opt/intel/impi/4.1.1.036/intel64/include -I/home/users/yuxianzhi/relion2-beta -I/usr/include -I/usr/local/cuda/include
In file included from /opt/intel/impi/4.1.1.036/intel64/include/mpi.h:1279:0,
from /home/users/yuxianzhi/relion2-beta/src/mpi.h:47,
from /home/users/yuxianzhi/relion2-beta/src/gpu_utils/cuda_autopicker.h:4,
from /home/users/yuxianzhi/relion2-beta/src/gpu_utils/cuda_autopicker.cu:4:
/opt/intel/impi/4.1.1.036/intel64/include/mpicxx.h:95:2: error: #error "SEEK_SET is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
error "SEEK_SET is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
^
/opt/intel/impi/4.1.1.036/intel64/include/mpicxx.h:99:2: error: #error "SEEK_CUR is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
error "SEEK_CUR is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
^
/opt/intel/impi/4.1.1.036/intel64/include/mpicxx.h:104:2: error: #error "SEEK_END is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
error "SEEK_END is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
Solution
1) use other version mpi
2) Include mpi.h before stdio.h
3) write these undefine before include mpi.h in src/mpi.h