我试图使用英特尔oneAPI / 2022.1编译hdf5-1.8.22。没有Intel oneAPI的配置是使用以下命令执行的:
CC=$DIR/mpich/bin/mpicc FC=$DIR/mpich/bin/mpif90 CXX=$DIR/mpich/bin/mpicxx CFLAGS=-fPIC ./configure --prefix=$DIR/hdf5 --enable-parallel --enable-fortran --enable-production --enable-shared这一过程顺利完成。英特尔oneAPI的配置如下所示:
CC=$INTEL/oneapi/compiler/latest/linux/bin/intel64/icc CXX=$INTEL/oneapi/compiler/latest/linux/bin/intel64/icpc F77=$INTEL/oneapi/compiler/latest/linux/bin/intel64/ifort MPIF90=$INTEL/oneapi/mpi/latest/bin/mpif90 MPICC=$INTEL/oneapi/mpi/latest/bin/mpicc MPICXX=$INTEL/oneapi/mpi/latest/bin/mpiicpc CFLAGS="-fPIC -O3 -xHost -ip -fno-alias -align" FFLAGS="-fPIC -O3 -xHost -ip -fno-alias -align" CXXFLAGS="-fPIC -O3 -xHost -ip -fno-alias -align" FFLAGS="-I$INTEL/oneapi/mpi/latest/include -L$INTEL/oneapi/mpi/latest/lib" ./configure --prefix=$DIR/hdf5 --enable-parallel --enable-fortran --enable-production --enable-shared --enable-static --enable-hl --with-szlib=$DIR/szip-2.1 --with-zlib=$DIR/zlib-1.2.7它在以下日志中失败:
checking for an ANSI C-conforming const... yes
checking if the compiler understands __inline__... yes
checking if the compiler understands __inline... yes
checking if the compiler understands inline... yes
checking for __attribute__ extension... yes
checking for __func__ extension... yes
checking for __FUNCTION__ extension... yes
checking for C99 designated initialization support... yes
checking how to print long long... %unknownd and %unknownu
checking Threads support system scope... no
checking enable debugging symbols... no
checking enable developer warnings... no
checking profiling... no
checking optimization level... high
checking for debug flags... none
checking whether function stack tracking is enabled... no
checking whether metadata trace file code is enabled... no
checking for API tracing... no
checking for instrumented library... no
checking whether to clear file buffers... yes
checking whether a memory checking tool will be used... no
checking for parallel support files... provided by compiler
checking whether a simple MPI-IO C program can be linked... no
configure: error: unable to link a simple MPI-IO C program如何修复此错误?
UPD:如果我使用CC=mpiicc,完整的错误日志如下所示:
configure:4562: $? = 0
configure:4551: /../../intel/oneapi/mpi/latest/bin/mpiicc -qversion >&5
icc: command line warning #10006: ignoring unknown option '-qversion'
ld: cannot find -lmpifort
ld: cannot find -lmpi
configure:4562: $? = 1
configure:4582: checking whether the C compiler works
configure:4604: /../../intel/oneapi/mpi/latest/bin/mpiicc -fPIC -O3 -xHost -ip -fno-alias -align conftest.c >&5
ld: cannot find -lmpifort
ld: cannot find -lmpi
configure:4608: $? = 1
configure:4646: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "HDF5"
| #define PACKAGE_TARNAME "hdf5"
| #define PACKAGE_VERSION "1.8.22"
| #define PACKAGE_STRING "HDF5 1.8.22"
| #define PACKAGE_BUGREPORT "help@hdfgroup.org"
| #define PACKAGE_URL ""
| #define PACKAGE "hdf5"
| #define VERSION "1.8.22"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:4651: error: in `/../../hdf5-1.8.22':
configure:4653: error: C compiler cannot create executables发布于 2022-02-02 16:29:23
我找到了一个解决办法,也许不是很正确,但它解决了我的问题。我将版本从hdf5-1.8.22更改为hdf5-1.12.1,并配置了以下命令:
CC=$INTEL/oneapi/mpi/latest/bin/mpiicc CFLAGS="-I$INTEL/oneapi/mpi/latest/include -L$INTEL/oneapi/mpi/latest/lib/release -L$INTEL/oneapi/mpi/latest/lib -fPIC -O3 -xsse4.2 -align" FC=$INTEL/oneapi/mpi/latest/bin/mpiifort FCFLAGS="-I$INTEL/oneapi/mpi/latest/include -L$INTEL/oneapi/mpi/latest/lib/release -L$INTEL/oneapi/mpi/latest/lib -fPIC -O3 -xsse4.2 -lgfortran -nofor-main" ./configure --prefix=$DIR/hdf5 --enable-parallel --enable-fortran --enable-build-mode=production --enable-shared --enable-static --with-szlib=$DIR/szip-2.1 --with-zlib=$DIR/zlib-1.2.7https://stackoverflow.com/questions/70898083
复制相似问题