0

我正在尝试使用 Intel oneAPI Base Toolkit/HPC Toolkit 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

该过程成功完成。使用 Intel 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
4

1 回答 1

0

我找到了一个解决方案,可能不太正确,但它解决了我的问题。我将版本从 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.7
于 2022-02-02T16:29:23.947 回答