我正在尝试安装fortran的netcdf模块。下面是链接http://albeniz.eng.uci.edu/software/WRFCMAQ/NetCDF_安装_为_C_和_福特兰_libraries-HPC.pdf中的步骤
我正在犯错误:
configure: netCDF 4.4.1.1
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
configure: checking user options
checking whether a win32 DLL is desired... no
checking whether a NCIO_MINBLOCKSIZE was specified... 256
checking if fsync support is enabled... no
checking if jna bug workaround is enabledd... no
checking whether extra valgrind tests should be run... no
checking whether we should build netCDF-4... no
checking do we require hdf5 dynamic-loading support... yes
checking whether reading of HDF4 SD files is to be enabled... no
checking whether to fetch some sample HDF4 files from Unidata ftp site to test HDF4 reading (requires wget)... no
checking whether we should attempt to install netcdf-fortran (EXPERIMENTAL)... no
checking whether extra example tests should be run... no
checking whether parallel IO tests should be run... no
checking whether a default chunk size in bytes was specified... 4194304
checking whether a maximum per-variable cache size for HDF5 was specified... 67108864
checking whether a number of chunks for the default per-variable cache was specified... 10
checking whether a default file cache size for HDF5 was specified... 4194304
checking whether a default file cache maximum number of elements for HDF5 was specified... 1009
checking whether a default cache preemption for HDF5 was specified... 0.75
checking whether netCDF-4 logging is enabled... no
checking whether DAP client is to be built... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/mirzaba/test/FSM2/srcNETCDF/netcdf-4.4.1.1':
configure: error: C compiler cannot create executables
See `config.log' for more details这是我的config.log
## ---------------- ##
ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_env_CC_set=set
ac_cv_env_CC_value=gcc
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=-O
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value='-DNDEBUG -DgFortran'
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes
ac_cv_target=x86_64-unknown-linux-gnu
am_cv_make_support_nested_variables=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
167,1 37%发布于 2023-02-14 12:22:41
如果您确实希望从源安装netcdf,则需要对此错误进行故障排除:
configure: error: C compiler cannot create executables造成此错误的一些可能原因是:
PATH中其他地方的不兼容链接器noexec选项的目标目录所在的文件系统。然而,Ubuntu“宇宙”存储库已经包含了C/C++ (libnetcdf-dev)和Fortran (libnetcdff-dev) netcdf的预构建包。因此,如果您的真正目标只是构建来自github的netcdf支持的FSM2,那么您所需要做的就是:
libnetcdff-dev包(它将安装C/C++ dev和运行时包作为依赖项) sudo apt更新&& sudo apt安装libnetcdff-devcompil_nc.sh脚本,将模块包含和库路径设置为Ubuntu包使用的模块路径:$ diff compil_nc.sh.orig compil_nc.sh 43,44c43,44 < $FC -O3 -c -i/usr/lib 64/gfortran/compil_nc.sh.orig FSM2_temp.f90 < $FC -o FSM2 FSM2_temp.o -L/usr/lib 64 -lnetcdff -> $FC -O3 -c -i/usr/包括FSM2_temp.f90 en20 L/usr/x86_64https://askubuntu.com/questions/1454819
复制相似问题