gpt4 book ai didi

compilation - 编译并行netCDF时出错

转载 作者:行者123 更新时间:2023-12-02 10:50:28 28 4
gpt4 key购买 nike

我正在尝试使用HDF5的并行构建来编译和安装netCDF。

首先,我安装了最新的zlib,然后安装了串行HDF5和并行HDF5,以便

/scratch/mycomputername/packages/...包含HDF5和zlib lib,包括bin文件夹。

/scratch/mycomputername/packages_parallel ...包含并行HDF5和zlib lib,include和bin文件夹。

*** ZLIB安装:

./configure --prefix=/scratch/mycomputername/packages
make
make test
make install prefix=/scratch/mycomputername/packages


./configure --prefix=/scratch/mycomputername/packages_parallel
make
make test
make install prefix=/scratch/mycomputername/packages_parallel

*** HDF5安装:
./configure --prefix=/scratch/mycomputername/packages --enable-fortran --with-zlib=/scratch/mycomputername/packages/include,/scratch/mycomputername/packages/lib
make
make check
make install prefix=/scratch/dione/packages


./configure --prefix=/scratch/mycomputername/packages_parallel --enable-parallel --enable-fortran --with-zlib=/scratch/mycomputername/packages_parallel/include,/scratch/mycomputername/packages_parallel/lib
make
make check
make install prefix=/scratch/mycomputername/packages_parallel

***然后,安装我使用的串行netCDF
./configure --prefix=/scratch/mycomputername/packages CPPFLAGS=-I/scratch/mycomputername/packages/include LDFLAGS=-L/scratch/computername/packages/lib
make
make check
make install prefix=/scratch/mycomputername/packages

这个工作成功了。

***但是,当我尝试对并行netCDF执行相同操作时,我遇到了错误。
我用了
./configure --prefix=/scratch/mycomputername/packages_parallel CPPFLAGS=-I/scratch/mycomputername/packages_parallel/include LDFLAGS=-L/scratch/mycomputername/packages_parallel/lib

我得到错误:
checking hdf5.h usability ... no
checking hdf5.h presence ... no
checking for hdf5.h ... no
configure: error: Compiling a test with HDF5 failed. Either hdf5.h cannot be found, or config.log should be checked for other reason

我也试过
./configure --prefix=/scratch/computername/packages_parallel --with-hdf5=/scratch/mycomputername/packages_parallel/ --with-zlib=/scratch/mycomputername/packages_parallel/lib
但我收到上面引用的错误消息。

有谁知道为什么并行版本可能找不到HDF5库?

最佳答案

确保对于您编译和安装的每个软件包,将必要的路径添加到.profile或.bashrc文件中。例如,您需要在ZLIB安装后添加它(假设安装目录为/usr/local):

if [ -z "${ZLIBDIR}" ]
then
ZLIBDIR="/usr/local"; export ZLIBDIR
else
ZLIBDIR="/usr/local:${ZLIBDIR}"; export ZLIBDIR
fi

对于HDF5,我始终使用以下命令:
export HDF5_LIB_DIR="/usr/local/lib"
if [ -z "${LD_LIBRARY_PATH}" ]
then
LD_LIBRARY_PATH="/usr/local/lib"; export LD_LIBRARY_PATH
else
LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}"; export LD_LIBRARY_PATH
fi
if [ -z "${LIBDIR}" ]
then
LIBDIR="/usr/local/lib"; export LIBDIR
else
LIBDIR="/usr/local/lib:${LIBDIR}"; export LIBDIR
fi
export INCLUDE=/usr/local/lib:$Include
export PATH=/usr/local/bin:$PATH
export HDF5_LIB_DIR=/usr/local/lib
export HDF5DIR=/usr/local
export HDF5_DIR=/usr/local
export CPPFLAGS="-I$HDF5_DIR/include -I/usr/local/include"
export LDFLAGS="-L$HDF5_DIR/lib -L/usr/local/lib"

最后,在安装NetCDF之后,我使用:
export NETCDFHOME=/usr/local
export NETCDF_PREFIX=/usr/local
export NETCDF_LIB=/usr/local/lib
export NETCDF4_ROOT=/usr/local
export NETCDF4_DIR=/usr/local
export NETCDF_INC=/usr/local/include
export PATH=/usr/local/bin:$PATH

希望这可以帮助。干杯,特隆

关于compilation - 编译并行netCDF时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28943834/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com