简体   繁体   English

如何编译libhdf5_fortran.a库文件?

[英]How to compile libhdf5_fortran.a library file?

I downloaded latest hdf5-1.14.0.tar.gz.我下载了最新的 hdf5-1.14.0.tar.gz。 After extraction, I configure as提取后,我配置为

FC=/opt/intel/oneapi/compiler/2022.1.0/linux/bin/intel64/ifort ./configure --enable-fortran

after make, I can find make之后,我可以找到

libhdf5.a  libhdf5.la  libhdf5.settings  libhdf5.so  libhdf5.so.310  libhdf5.so.310.0.0

but what I need is libhdf5_fortran.a .但我需要的是libhdf5_fortran.a But the closest file I can find is libhdf5_fortran.la under fortran/src .但我能找到的最接近的文件是fortran/src下的libhdf5_fortran.la So how to generate libhdf5_fortran.a ?那么如何生成libhdf5_fortran.a呢?

You are not setting up the Intel compiler correctly.您没有正确设置英特尔编译器。 You should run the setvars script to set up all the required paths, and not just provide the absolute path to the compiler.您应该运行 setvars 脚本来设置所有必需的路径,而不仅仅是向编译器提供绝对路径。 If I do as you have the configure fails with the following如果我按照您的方式进行配置失败,并显示以下内容

checking if Fortran compiler supports intrinsic SIZEOF... no
checking if Fortran compiler supports intrinsic C_SIZEOF... no
checking if Fortran compiler supports intrinsic STORAGE_SIZE... no
configure: error: Fortran compiler requires either intrinsic functions SIZEOF or STORAGE_SIZE

However if I set up the compiler as recommended and run the configure via但是,如果我按照建议设置编译器并通过运行配置

ijb@ijb-Latitude-5410:~/Downloads/hdf5-1.14.0$ . /opt/intel/oneapi/setvars.sh 
 
:: initializing oneAPI environment ...
   bash: BASH_VERSION = 5.0.17(1)-release
   args: Using "$@" for setvars.sh arguments: 
:: advisor -- latest
:: ccl -- latest
:: clck -- latest
:: compiler -- latest
:: dal -- latest
:: debugger -- latest
:: dev-utilities -- latest
:: dnnl -- latest
:: dpcpp-ct -- latest
:: dpl -- latest
:: inspector -- latest
:: intelpython -- latest
:: ipp -- latest
:: ippcp -- latest
:: ipp -- latest
:: itac -- latest
:: mkl -- latest
:: mpi -- latest
:: tbb -- latest
:: vpl -- latest
:: vtune -- latest
:: oneAPI environment initialized ::
 
ijb@ijb-Latitude-5410:~/Downloads/hdf5-1.14.0$ FC=ifort ./configure --enable-fortran

the configure works and after a配置工作和之后

ijb@ijb-Latitude-5410:~/Downloads/hdf5-1.14.0$ make -j 4

it compiles correctly and gives the file you are after:它编译正确并给出你之后的文件:

ijb@ijb-Latitude-5410:~/Downloads/hdf5-1.14.0$ find . -name libhdf5_fortran.a -print
./fortran/src/.libs/libhdf5_fortran.a

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM