首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用英特尔编译器构建HDF5?

如何使用英特尔编译器构建HDF5?
EN

Stack Overflow用户
提问于 2022-01-28 17:48:10
回答 1查看 972关注 0票数 0

我试图使用英特尔oneAPI / 2022.1编译hdf5-1.8.22。没有Intel oneAPI的配置是使用以下命令执行的:

代码语言:javascript
复制
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的配置如下所示:

代码语言:javascript
复制
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

它在以下日志中失败:

代码语言:javascript
复制
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,完整的错误日志如下所示:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2022-02-02 16:29:23

我找到了一个解决办法,也许不是很正确,但它解决了我的问题。我将版本从hdf5-1.8.22更改为hdf5-1.12.1,并配置了以下命令:

代码语言:javascript
复制
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
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70898083

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档