Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Error on case.build step: Could NOT find NetCDF_Fortran

wangdxx

New Member
Hello, I'm trying to port the machine onto my university cluster. I modified the config_machines.xml file mostly by imitating others based on the example for centos-7. The config_machines.xml file is as attached. When I searched for available modules on my cluster, I found netcdf-fortran/4.4.4-intel-2018x was the only one in netcdf-fortran so I chose intel/2018x as the compiler and impi as the mpilib. Not sure if I'm doing it in the correct way. I did not modify the config_compilers.xml and config_batch.xml.

I was trying the test case at the end of CTSM/README at master · ESCOMP/CTSM and got errors when building the case. Below is the output of the command. I also attached that pio.bldlog.220506-101012. I have viewed similar threads on the forum but am still confused. Can anyone help me with this?

Building case in directory /home/xwang615/research/clm5.0/cime/scripts/testI
sharedlib_only is False
model_only is False
Setting resource.RLIMIT_STACK to -1 from (-1, -1)
Generating component namelists as part of build
Creating component namelists
Calling /home/xwang615/research/clm5.0/cime/src/components/data_comps/datm/cime_config/buildnml
File not found: domainfile = "/home/xwang615/research/inputdata/share/domains/domain.lnd.fv1.9x2.5_gx1v7.181205.nc", will attempt to download in check_input_data phase
Calling /home/xwang615/research/clm5.0/cime_config/buildnml
Calling /home/xwang615/research/clm5.0/cime/src/components/stub_comps/sice/cime_config/buildnml
Calling /home/xwang615/research/clm5.0/cime/src/components/stub_comps/socn/cime_config/buildnml
Calling /home/xwang615/research/clm5.0/components/mosart//cime_config/buildnml
File not found: frivinp_rtm = "/home/xwang615/research/inputdata/rof/mosart/MOSART_routing_Global_0.5x0.5_c170601.nc", will attempt to download in check_input_data phase
Running /home/xwang615/research/clm5.0/components/cism//cime_config/buildnml
Calling /home/xwang615/research/clm5.0/cime/src/components/stub_comps/swav/cime_config/buildnml
Calling /home/xwang615/research/clm5.0/cime/src/components/stub_comps/sesp/cime_config/buildnml
Calling /home/xwang615/research/clm5.0/cime/src/drivers/mct/cime_config/buildnml
File not found: lnd2rof_fmapname = "lnd/clm2/mappingdata/maps/1.9x2.5/map_1.9x2.5_nomask_to_0.5x0.5_nomask_aave_da_c120522.nc", will attempt to download in check_input_data phase
File not found: rof2lnd_fmapname = "lnd/clm2/mappingdata/maps/1.9x2.5/map_0.5x0.5_nomask_to_1.9x2.5_nomask_aave_da_c120709.nc", will attempt to download in check_input_data phase
File not found: lnd2glc_fmapname = "cpl/gridmaps/fv1.9x2.5/map_fv1.9x2.5_TO_gland4km_aave.170429.nc", will attempt to download in check_input_data phase
File not found: lnd2glc_smapname = "cpl/gridmaps/fv1.9x2.5/map_fv1.9x2.5_TO_gland4km_blin.170429.nc", will attempt to download in check_input_data phase
File not found: glc2lnd_fmapname = "cpl/gridmaps/gland4km/map_gland4km_TO_fv1.9x2.5_aave.170429.nc", will attempt to download in check_input_data phase
File not found: glc2lnd_smapname = "cpl/gridmaps/gland4km/map_gland4km_TO_fv1.9x2.5_aave.170429.nc", will attempt to download in check_input_data phase
Finished creating component namelists
Building gptl with output to file /scratch/xwang615/testI/bld/gptl.bldlog.220506-103616
Calling /home/xwang615/research/clm5.0/cime/src/build_scripts/buildlib.gptl
Component gptl build complete with 1 warnings
Building mct with output to file /scratch/xwang615/testI/bld/mct.bldlog.220506-103616
Calling /home/xwang615/research/clm5.0/cime/src/build_scripts/buildlib.mct
Building pio with output to file /scratch/xwang615/testI/bld/pio.bldlog.220506-103616
Calling /home/xwang615/research/clm5.0/cime/src/build_scripts/buildlib.pio
ERROR: /home/xwang615/research/clm5.0/cime/src/build_scripts/buildlib.pio FAILED, cat /scratch/xwang615/testI/bld/pio.bldlog.220506-103616
 

Attachments

  • config_machines.txt
    5.2 KB · Views: 8
  • pio.bldlog.txt
    10.2 KB · Views: 5

wangdxx

New Member
More information about the machine. I got NETCDF_PATH from the environment variable $MODULEPATH, where I found neither a "/lib" subdirectory nor files called "libnetcdff.*". :(

Thank you in advance!
 

wangdxx

New Member
And there's an error about the cat command possibly because I've run the case.build --clean-all command and deleted bld.
 

jedwards

CSEG and Liaisons
Staff member
These are most likely not the correct paths for NETCDF_C and NETCDF_FORTRAN
-D NetCDF_C_PATH:PATH=/usr/share/Modules/modulefiles/netcdf-c/ -D NetCDF_Fortran_PATH:PATH=/usr/share/Modules/modulefiles/netcdf-fortran/

If you run module show netcdf-c and module show netcdf-fortran It should show you what the module is trying to load. You are finding a netcdf library in
-- Found NetCDF_C: /usr/lib64/libnetcdf.so
but that's almost certainly the wrong one.
 

wangdxx

New Member
These are most likely not the correct paths for NETCDF_C and NETCDF_FORTRAN
-D NetCDF_C_PATH:PATH=/usr/share/Modules/modulefiles/netcdf-c/ -D NetCDF_Fortran_PATH:PATH=/usr/share/Modules/modulefiles/netcdf-fortran/

If you run module show netcdf-c and module show netcdf-fortran It should show you what the module is trying to load. You are finding a netcdf library in
-- Found NetCDF_C: /usr/lib64/libnetcdf.so
but that's almost certainly the wrong one.
Thank you so much for the timely reply! The attached screenshot shows the libraries that I found in /usr/lib64. Does this mean there is not a netcdf fortran library on the cluster? How should I set the environment variables?

By the way, here are the output of module show commands:

$ module show netcdf-c
-------------------------------------------------------------------
/usr/share/Modules/modulefiles/netcdf-c/.norun:

setenv A2C2_AGNOSTIC 1
-------------------------------------------------------------------


$ module show netcdf-fortran
-------------------------------------------------------------------
/usr/share/Modules/modulefiles/netcdf-fortran/.norun:

setenv A2C2_AGNOSTIC 1
-------------------------------------------------------------------
 

Attachments

  • lib64_netcdf.png
    lib64_netcdf.png
    17.6 KB · Views: 5

jedwards

CSEG and Liaisons
Staff member
Something seems really messed up about your netcdf modules, you will need to talk to your support staff.
Here as an example is the result of module show netcdf on our cheyenne system:

module show netcdf
------------------------------------------------------------------------------------------------------------------------------------------------------------------
/glade/u/apps/ch/modulefiles/default/intel/2021.2/netcdf/4.8.1.lua:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
whatis("netcdf v4.8.1")
help([[NetCDF is a set of software libraries and self-describing,
machine-independent data formats that support the creation, access,
and sharing of array-oriented scientific data.

This module loads the serial NetCDF interfaces for C (v4.8.1), Fortran
(v4.5.2), and C++ (v4.3.1).

Software website - Unidata | NetCDF

Built on Tue Nov 23 12:24:51 MST 2021
Modules used:
ncarenv/1.3
intel/2021.2
ncarcompilers/0.5.0
]])
conflict("hdf5","hdf5-mpi","netcdf-mpi","gdal")
prepend_path("PATH","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/bin")
prepend_path("PKG_CONFIG_PATH","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/lib/pkgconfig")
prepend_path("MANPATH","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/share/man")
setenv("NCAR_ROOT_NETCDF","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/")
setenv("NCAR_INC_NETCDF","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/include")
setenv("NCAR_LDFLAGS_NETCDF","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/lib")
setenv("NCAR_LIBS_NETCDF","-Wl,-Bstatic -lnetcdff -lnetcdf -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lsz -lz -Wl,-Bdynamic -lcurl -lm -ldl")
setenv("NETCDF","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/")
 

wangdxx

New Member
Something seems really messed up about your netcdf modules, you will need to talk to your support staff.
Here as an example is the result of module show netcdf on our cheyenne system:

module show netcdf
------------------------------------------------------------------------------------------------------------------------------------------------------------------
/glade/u/apps/ch/modulefiles/default/intel/2021.2/netcdf/4.8.1.lua:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
whatis("netcdf v4.8.1")
help([[NetCDF is a set of software libraries and self-describing,
machine-independent data formats that support the creation, access,
and sharing of array-oriented scientific data.

This module loads the serial NetCDF interfaces for C (v4.8.1), Fortran
(v4.5.2), and C++ (v4.3.1).

Software website - Unidata | NetCDF

Built on Tue Nov 23 12:24:51 MST 2021
Modules used:
ncarenv/1.3
intel/2021.2
ncarcompilers/0.5.0
]])
conflict("hdf5","hdf5-mpi","netcdf-mpi","gdal")
prepend_path("PATH","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/bin")
prepend_path("PKG_CONFIG_PATH","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/lib/pkgconfig")
prepend_path("MANPATH","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/share/man")
setenv("NCAR_ROOT_NETCDF","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/")
setenv("NCAR_INC_NETCDF","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/include")
setenv("NCAR_LDFLAGS_NETCDF","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/lib")
setenv("NCAR_LIBS_NETCDF","-Wl,-Bstatic -lnetcdff -lnetcdf -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lsz -lz -Wl,-Bdynamic -lcurl -lm -ldl")
setenv("NETCDF","/glade/u/apps/ch/opt/netcdf/4.8.1/intel/2021.2/")
Sorry, I guess what caused the weirdness was that I ran module show commands without specifying the exact module name (with the versions). Can you kindly take a look and tell me how I could set the environment variables?

$ module show netcdf/4.3.3.1-intel-2018x
-------------------------------------------------------------------
/usr/share/Modules/modulefiles/netcdf/4.3.3.1-intel-2018x:

module-whatis Network Common Data Form version 4.3.3.1 for intel 2015.3 compilers
setenv A2C2_AGNOSTIC 1
module load intel/2018x
prereq intel/2018x
module load zlib/1.2.8
prereq zlib/1.2.8
module load szip/2.1
prereq szip/2.1
prepend-path PATH /packages/7x/netcdf/4.3.3.1/intel/2018x//bin
prepend-path LD_LIBRARY_PATH /packages/7x/netcdf/4.3.3.1/intel/2018x//lib
prepend-path NETCDF /packages/7x/netcdf/4.3.3.1/intel/2018x/
prepend-path INCLUDE /packages/7x/netcdf/4.3.3.1/intel/2018x//include
prepend-path WRFIO_NCD_LARGE_FILE_SUPPORT 1
setenv A2C2_5X 1
setenv A2C2_6X 1
setenv A2C2_7X 1
setenv A2C2_NOLOGIN 0
setenv A2C2_DEPRECATED 0
setenv A2C2_EXPERIMENTAL 0
setenv A2C2_DISCOURAGED 0
setenv A2C2_RETIRED 0
setenv A2C2_VIRTUAL 0
setenv A2C2_TAGS storage libraries, scientific libraries, netcdf
setenv A2C2_DESCRIPTION NetCDF is a set of software libraries and self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data.
setenv A2C2_URL Unidata | NetCDF
setenv A2C2_NOTES
setenv A2C2_INSTALL_DATE 2018-11-30
setenv A2C2_INSTALLER etannehi
setenv A2C2_BUILDPATH /packages/7x/build/netcdf/4.3.3.1/intel/2018x
setenv A2C2_MODIFY_DATE 2018-11-30
setenv A2C2_MODIFIER leereyno
setenv A2C2_VERIFY_DATE 2018-11-30
setenv A2C2_VERIFIER etannehi
-------------------------------------------------------------------


$ module show netcdf-c/4.6.2-intel-2018x
-------------------------------------------------------------------
/usr/share/Modules/modulefiles/netcdf-c/4.6.2-intel-2018x:

module-whatis netcdf-c 4.6.2-intel-2018x
setenv A2C2_AGNOSTIC 1
prepend-path PATH /packages/7x/netcdf-c/4.6.2-intel-2018x/bin
prepend-path LD_LIBRARY_PATH /packages/7x/netcdf-c/4.6.2-intel-2018x/lib
prepend-path INCLUDE /packages/7x/netcdf-c/4.6.2-intel-2018x/include
prepend-path MANPATH /packages/7x/netcdf-c/4.6.2-intel-2018x/share/man
setenv A2C2_6X 1
setenv A2C2_7X 1
setenv A2C2_NOLOGIN 0
setenv A2C2_DEPRECATED 0
setenv A2C2_EXPERIMENTAL 0
setenv A2C2_DISCOURAGED 0
setenv A2C2_RETIRED 0
setenv A2C2_VIRTUAL 0
setenv A2C2_TAGS
setenv A2C2_DESCRIPTION
setenv A2C2_URL
setenv A2C2_NOTES
setenv A2C2_INSTALL_DATE 2019-02-15
setenv A2C2_INSTALLER wdizon
setenv A2C2_BUILDPATH /packages/uniform/build/netcdf-c/4.6.2
setenv A2C2_MODIFY_DATE 2019-02-15
setenv A2C2_MODIFIER wdizon
setenv A2C2_VERIFY_DATE 2019-02-15
setenv A2C2_VERIFIER wdizon
-------------------------------------------------------------------


$ module show netcdf-fortran/4.4.4-intel-2018x
-------------------------------------------------------------------
/usr/share/Modules/modulefiles/netcdf-fortran/4.4.4-intel-2018x:

module-whatis netcdf-fortran 4.4.4-intel-2018x
setenv A2C2_AGNOSTIC 1
prepend-path PATH /packages/7x/netcdf-fortran/4.4.4-intel-2018x/bin
prepend-path LD_LIBRARY_PATH /packages/7x/netcdf-fortran/4.4.4-intel-2018x/lib
prepend-path INCLUDE /packages/7x/netcdf-fortran/4.4.4-intel-2018x/include
prepend-path MANPATH /packages/7x/netcdf-fortran/4.4.4-intel-2018x/share/man
setenv A2C2_6X 1
setenv A2C2_7X 1
setenv A2C2_NOLOGIN 0
setenv A2C2_DEPRECATED 0
setenv A2C2_EXPERIMENTAL 0
setenv A2C2_DISCOURAGED 0
setenv A2C2_RETIRED 0
setenv A2C2_VIRTUAL 0
setenv A2C2_TAGS
setenv A2C2_DESCRIPTION
setenv A2C2_URL
setenv A2C2_NOTES
setenv A2C2_INSTALL_DATE 2019-02-15
setenv A2C2_INSTALLER wdizon
setenv A2C2_BUILDPATH /packages/uniform/build/netcdf-fortran/4.4.4
setenv A2C2_MODIFY_DATE 2019-02-15
setenv A2C2_MODIFIER wdizon
setenv A2C2_VERIFY_DATE 2019-02-15
setenv A2C2_VERIFIER wdizon
-------------------------------------------------------------------
 

wangdxx

New Member
Hi CESM staff, I modified the env variable NETCDF_PATH according to the information in the post above in config_machines.xml.
<environment_variables>
<env name="OMP_STACKSIZE">256M</env>
<env name="NETCDF_PATH">/packages/7x/netcdf/4.3.3.1/intel/2018x</env>
</environment_variables>

The pio was built successfully this time but another error occured. The cesm.bldlog was attached below. It seems there's still problem with the netcdf library as there are thousands of lines of "undefined reference to `netcdf_mp_nf90_*'"? Can you please help me? Many thanks!
 

Attachments

  • cesm.bldlog.txt
    177 KB · Views: 6

jedwards

CSEG and Liaisons
Staff member
The issue is that the NetCDF c and NetCDF fortran paths are different.
You need to provide both paths with NETCDF_C_PATH and NETCDF_FORTRAN_PATH
 

wangdxx

New Member
The issue is that the NetCDF c and NetCDF fortran paths are different.
You need to provide both paths with NETCDF_C_PATH and NETCDF_FORTRAN_PATH
Thank you for the reply! I updated the env variables in config_machines.xml to:

<environment_variables>
<env name="OMP_STACKSIZE">256M</env>
<env name="NETCDF_PATH">/packages/7x/netcdf/4.3.3.1/intel/2018x</env>
<env name="NETCDF_C_PATH">/packages/7x/netcdf-c/4.6.2-intel-2018x</env>
<env name="NETCDF_FORTRAN_PATH">/packages/7x/netcdf-fortran/4.4.4-intel-2018x</env>
</environment_variables>

But the exactly same problem still occurred. Do you have any idea where went wrong?
 

jedwards

CSEG and Liaisons
Staff member
After the change did you build a new case or continue with the same one? I think that you need to
remove the NETCDF_PATH variable. Try again after doing this and send the pio.bldlog if it fails.
 

wangdxx

New Member
After the change did you build a new case or continue with the same one? I think that you need to
remove the NETCDF_PATH variable. Try again after doing this and send the pio.bldlog if it fails.
Yes, I recreated and reset the case after removing the NETCDF_PATH variable. Attached is the pio.bldlog. The cesm.bldlog where errors occur looks just like the previous one.
Your help is sincerely appreciated!
 

Attachments

  • pio.bldlog.txt
    50.1 KB · Views: 4

jedwards

CSEG and Liaisons
Staff member
Okay - you are building pio correctly but you need to add netcdf to your link line.
If you are using cesm2.1.x (it looks like you are) look in file cime/config/cesm/machines/config_compilers.xml and
add a section similar to that for MACH="grace" (You only need the SLIBS and NETCDF lines.)
 

wangdxx

New Member
Okay - you are building pio correctly but you need to add netcdf to your link line.
If you are using cesm2.1.x (it looks like you are) look in file cime/config/cesm/machines/config_compilers.xml and
add a section similar to that for MACH="grace" (You only need the SLIBS and NETCDF lines.)
That works! Thank you so much for helping me with the troubleshooting, J!
 
Top