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

Port machine to Ubuntu error

aatreyee_iirs

Aatreyee Nath
Member
Hello everyone,
I am new to this field and I was trying to follow this example for a test run. This has truly helped me figure out the errors. However, I am still getting the same error:

Error: Cray pointer declaration at (1) requires ‘-fcray-pointer’ flag

Error: Cray pointer declaration at (1) requires ‘-fcray-pointer’ flag

Error: Symbol ‘ptr_inbuf8’ at (1) has no IMPLICIT type; did you mean ‘inbuf8’?

Error: Symbol ‘ptr_outbuf8’ at (1) has no IMPLICIT type; did you mean ‘outbuf8’?

Component atm build complete with 21 warnings
cam built in 3.446654 seconds
ERROR: BUILD FAIL: cam.buildlib failed, cat /home/ubuntuvm/projects/cesm/scratch/testrun10/bld/atm.bldlog.231018-101722

I followed both the options mentioned by Johnny Guo, the warnings reduced to 21 but it is still failing.
I would be extremely grateful for any help.

[P.S. The details are as follows
my system Ubuntu 20.04
zlib-1.2.13
hdf5 1_12_2
netcdf-c-4.9.0
netcdf-fortran-4.6.0
pnetcdf-1.12.3
mpich-4.1.2]


Thank you.
 

Attachments

  • atm_bldlog_231018-101722.txt
    30 KB · Views: 1

aatreyee_iirs

Aatreyee Nath
Member
Hello everyone,
I was able to solve the issue with FFLAGS -ff2c -fcray-pointer
However, I ran into a different issue now. I have attached the log file.

Thank you.
 

Attachments

  • cesm.bldlog.231018-113301.txt
    136.5 KB · Views: 4

aatreyee_iirs

Aatreyee Nath
Member
Thank you so much for your reply sir, I will try it. However, I have a few doubts. Would it be the netcdf_f03.mod that I need to link? Also, is it an SLIBS or LDFLAGS variable?
 

jedwards

CSEG and Liaisons
Staff member
libnetcdff.a is what you want - there are plenty of examples in the config_machines.xml and config_compilers.xml for 2.1 and 2.2 or cmake_macros for 2.3 files.
 

aatreyee_iirs

Aatreyee Nath
Member
Thank you sir, however I have not been able to link it. Actually I am unable to understand how to link this particular library, I couldn't find anything in these files regarding linking libnetcdff.a. Is the following example a way to link this?
<SLIBS>
<append>-L$HOME/CESM/Libs -lnetcdff
-L$HOME/CESM/Libs -lnetcdf -lnetcdf -lm
</append>
<append>-L/usr/local/lib/ -llapack -L/usr/local/lib/ -lblas</append>
</SLIBS>
I would be extremely grateful if you could share an example.
Thank you.
 

jedwards

CSEG and Liaisons
Staff member
That is an example. Where is your libnetcdff.a file located? How is it found in the pio build?
 

aatreyee_iirs

Aatreyee Nath
Member
The libnetcdff.a file is in $HOME/CESM/Libs/lib.
Sir I am unable to understand what to link it with. Also, I did not quite understand the second part of your question. I have installed PIO.
I have started with this work and it is still very new. So I would be grateful if you could help me.
Thank you.
 

jedwards

CSEG and Liaisons
Staff member
From your cesm.log file:

mpif90 -o /home/ubuntuvm/projects/cesm/scratch/testrun11/bld/cesm.exe cime_comp_mod.o cime_driver.o component_mod.o component_type_mod.o cplcomp_exchange_mod.o map_glc2lnd_mod.o map_lnd2glc_mod.o map_lnd2rof_irrig_mod.o mrg_mod.o prep_aoflux_mod.o prep_atm_mod.o prep_glc_mod.o prep_ice_mod.o prep_lnd_mod.o prep_ocn_mod.o prep_rof_mod.o prep_wav_mod.o seq_diag_mct.o seq_domain_mct.o seq_flux_mct.o seq_frac_mct.o seq_hist_mod.o seq_io_mod.o seq_map_mod.o seq_map_type_mod.o seq_rest_mod.o t_driver_timers_mod.o -L/home/ubuntuvm/projects/cesm/scratch/testrun11/bld/lib/ -latm -L/home/ubuntuvm/projects/cesm/scratch/testrun11/bld/lib/ -lice -L/home/ubuntuvm/projects/cesm/scratch/testrun11/bld/lib/ -llnd -L/home/ubuntuvm/projects/cesm/scratch/testrun11/bld/lib/ -locn -L/home/ubuntuvm/projects/cesm/scratch/testrun11/bld/lib/ -lrof -L/home/ubuntuvm/projects/cesm/scratch/testrun11/bld/lib/ -lglc -L/home/ubuntuvm/projects/cesm/scratch/testrun11/bld/lib/ -lwav -L/home/ubuntuvm/projects/cesm/scratch/testrun11/bld/lib/ -lesp -L../../gnu/mpich/nodebug/nothreads/mct/noesmf/c1a1l1i1o1r1g1w1e1/lib -lcsm_share -L../../gnu/mpich/nodebug/nothreads/lib -lpio -lgptl -lmct -lmpeu -L/home/ubuntuvm/CESM/Libs/lib -lpnetcdf -L/home/ubuntuvm/CESM/Libs/lib

Note that -L$HOME/CESM/Libs -lnetcdff -lnetcdf is not there - it needs to be. The code in your post above should be in config_compilers.xml (for 2.1 and 2.2 versions). Note that the path for pnetcdf is probably wrong PNETCDF_PATH expects to have sub directories lib, include, bin. You may need to rename
CESM/Libs to be CESM/lib in order to get the links to work correctly.
 

aatreyee_iirs

Aatreyee Nath
Member
Sir,
I tried to change the directory ($HOME/CESM/Libs/lib), but it gave an error in the component pio build and it failed, I have attached the log (pio.bldlog_2.txt).

I checked the pio.bldlog of the previous run (pio.bldlog_1.txt), it had detected the netcdf and pnetcdf. In this case, the details in the config_compiler.xml edited were

<compiler COMPILER="gnu" MACH="ubuntuvmfed">
<!-- LINUX -->
<CPPDEFS>
<append>-DFORTRANUNDERSCORE -DNO_R16 -DCPRGNU</append>
</CPPDEFS>
<FFLAGS>
<append> -fallow-argument-mismatch -fallow-invalid-boz -ffree-line-length-none -ff2c -fcray-pointer</append>
<append> -I/home/ubuntuvm/CESM/Libs/include -I/home/ubuntuvm/CESM/Libs/include </append>
</FFLAGS>
<LDFLAGS>
<append compile_threaded="true"> -fopenmp </append>
</LDFLAGS>
<SFC>gfortran</SFC>
<SCC>gcc</SCC>
<SCXX>g++</SCXX>
<MPIFC>mpif90</MPIFC>
<MPICC>mpicc</MPICC>
<MPICXX>mpicxx</MPICXX>
<CXX_LDFLAGS>
<base> -cxxlib </base>
</CXX_LDFLAGS>
<CXX_LINKER>FORTRAN</CXX_LINKER>
<SUPPORTS_CXX>TRUE</SUPPORTS_CXX>
<NETCDF_C_PATH>$ENV{HOME}/CESM/Libs</NETCDF_C_PATH>
<NETCDF_FORTRAN_PATH>$ENV{HOME}/CESM/Libs</NETCDF_FORTRAN_PATH>
<PNETCDF_PATH>$ENV{HOME}/CESM/Libs</PNETCDF_PATH>
<SLIBS>
<append>-L$ENV{HOME}/CESM/Libs/lib -lnetcdff -L$ENV{HOME}/CESM/Libs/lib -lnetcdf -ldl -lm -lnetcdf -lhdf5_hl -lhdf5 -lz</append>
<append>-L/usr/local/lib/ -llapack -L/usr/local/lib/ -lblas</append>
</SLIBS>
</compiler>



Thank you.
 

Attachments

  • pio.bldlog_2.txt
    6.8 KB · Views: 1
  • pio.bldlog_1.txt
    67 KB · Views: 0

aatreyee_iirs

Aatreyee Nath
Member
Also, with the above details, it is still giving the previous error at the end of the build (attached log file).
I have tried building each component separately and the build for each component completes successfully. But while building the single executable, it fails.
 

Attachments

  • cesm.bldlog.271018-095449.txt
    56.3 KB · Views: 0

jedwards

CSEG and Liaisons
Staff member
<NETCDF_C_PATH>$ENV{HOME}/CESM/Libs</NETCDF_C_PATH>
<NETCDF_FORTRAN_PATH>$ENV{HOME}/CESM/Libs</NETCDF_FORTRAN_PATH>
<PNETCDF_PATH>$ENV{HOME}/CESM/Libs</PNETCDF_PATH>

These are wrong - they should point to a top level install directory which has subdirectories lib, include, bin
 

aatreyee_iirs

Aatreyee Nath
Member
Sir, I had installed all the libraries in this one directory ($HOME/CESM/Libs), the Libs directory has all the subdirectories that you have mentioned.
 

aatreyee_iirs

Aatreyee Nath
Member
Moreover, I noticed the following in the mct.bldlog even though the mct build was complete.
checking for Fortran flag to compile .F90 files... none
 

aatreyee_iirs

Aatreyee Nath
Member
Hello everyone,
I tried to start everything from scratch for the test run. The same error is appearing after executing case.build.
I have attached the log files for your reference.
Should I try using OpenMPI instead of MPICH?

Thank you.
 

Attachments

  • config.log.txt
    72.3 KB · Views: 1
  • cesm.bldlog.txt
    56.6 KB · Views: 3

jedwards

CSEG and Liaisons
Staff member
Now it looks as if you are linking libnetcdff.a correctly but for some reason pnetcdf isn't linking correctly.

A short cut to debugging this is to cd to the case bld/cpl/obj directory and run
mpif90 -o /home/ubuntuvm/projects/cesm/scratch/testrun2/bld/cesm.exe cime_comp_mod.o cime_driver.o component_mod.o component_type_mod.o cplcomp_exchange_mod.o map_glc2lnd_mod.o map_lnd2glc_mod.o map_lnd2rof_irrig_mod.o mrg_mod.o prep_aoflux_mod.o prep_atm_mod.o prep_glc_mod.o prep_ice_mod.o prep_lnd_mod.o prep_ocn_mod.o prep_rof_mod.o prep_wav_mod.o seq_diag_mct.o seq_domain_mct.o seq_flux_mct.o seq_frac_mct.o seq_hist_mod.o seq_io_mod.o seq_map_mod.o seq_map_type_mod.o seq_rest_mod.o t_driver_timers_mod.o -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -latm -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -lice -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -llnd -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -locn -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -lrof -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -lglc -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -lwav -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -lesp -L../../gnu/mpich/nodebug/nothreads/mct/noesmf/c1a1l1i1o1r1g1w1e1/lib -lcsm_share -L../../gnu/mpich/nodebug/nothreads/lib -lpio -lgptl -lmct -lmpeu -L/home/ubuntuvm/Libraries/Library -lnetcdff -L/home/ubuntuvm/Libraries/Library -lnetcdf -Wl,-rpath -Wl,/home/ubuntuvm/Libraries/Library -L/home/ubuntuvm/Libraries/Library -lpnetcdf -L/usr/local/lib/ -llapack -L/usr/local/lib/ -lblas -L/home/ubuntuvm/Libraries/Library/lib -lpnetcdf -L/home/ubuntuvm/Libraries/Library/lib
until you get it right. You should then understand what needs to be done to get the case.build working correctly. You didn't tell me what compiler and linker you are using - some older compilers and linkers are sensitive to the order that libraries are listed in the link command - I think that that may be the problem here.
 

aatreyee_iirs

Aatreyee Nath
Member
Thank you for your reply, I will try that.
And I have tried with GCC 7 and 9, both led to the same error. This particular log file was from the model I tried to compile using GCC 9.
 

aatreyee_iirs

Aatreyee Nath
Member
Hello everyone,
I am still facing the same error and I have attached the log file. I have also attached what I edited in the config_compilers.xml file for my system. I tried what was suggested above, but I kept getting the same error even when I changed my gcc version to 7 and 11.
For the current log file, the gcc and gfortran compilers are gcc 9.4 and gfortran 9.4, mpich version is 3.3.1. (My system is Ubuntu 20.04)
Other packages are
zlib-1.2.13
hdf5-1.10.5
netcdf-c-4.9.0
netcdf-fortran-4.6.0
pnetcdf-1.12.3
lapack and blas 3.11

I would be grateful for any suggestions.
Thank you.
 

Attachments

  • cesm.bldlog.txt
    57.7 KB · Views: 2
  • config_compilers_xml_edits.txt
    2.2 KB · Views: 5

aatreyee_iirs

Aatreyee Nath
Member
Hello everyone,
I have run the following from the case bld/cpl/obj directory
mpif90 -o /home/ubuntuvm/projects/cesm/scratch/testrun2/bld/cesm.exe cime_comp_mod.o cime_driver.o component_mod.o component_type_mod.o cplcomp_exchange_mod.o map_glc2lnd_mod.o map_lnd2glc_mod.o map_lnd2rof_irrig_mod.o mrg_mod.o prep_aoflux_mod.o prep_atm_mod.o prep_glc_mod.o prep_ice_mod.o prep_lnd_mod.o prep_ocn_mod.o prep_rof_mod.o prep_wav_mod.o seq_diag_mct.o seq_domain_mct.o seq_flux_mct.o seq_frac_mct.o seq_hist_mod.o seq_io_mod.o seq_map_mod.o seq_map_type_mod.o seq_rest_mod.o t_driver_timers_mod.o -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -latm -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -lice -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -llnd -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -locn -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -lrof -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -lglc -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -lwav -L/home/ubuntuvm/projects/cesm/scratch/testrun2/bld/lib/ -lesp -L../../gnu/mpich/nodebug/nothreads/mct/noesmf/c1a1l1i1o1r1g1w1e1/lib -lcsm_share -L../../gnu/mpich/nodebug/nothreads/lib -lpio -lgptl -lmct -lmpeu -L/home/ubuntuvm/CESM_Library -lnetcdff -L/home/ubuntuvm/CESM_Library -lnetcdf -lm -lnetcdf -lhdf5_hl -lhdf5 -lpnetcdf -ldl -lm -lz -Wl,-rpath -Wl,/home/ubuntuvm/CESM_Library -L/home/ubuntuvm/CESM_Library -lpnetcdf -L/usr/local/lib -llapack -L/usr/local/lib -lblas -L/home/ubuntuvm/CESM/CESM_Library/lib -lpnetcdf -L/home/ubuntuvm/CESM_Library/lib

And I am getting the same error (attached file) (collect2: error: ld returned 1 exit status.)
I believe it is still the linking error.
My gcc and gfortran version is 9.4.0 and mpich is 3.3.1
I have installed the packages in the order-- mpich, zlib, pnetcdf, hdf5,netcdf-c and netcdf-fortran. The edits in the config_compilers.xml for my system is also attached herewith.
What am I doing wrong here?
Any suggestions would be appreciated.

Thank you.
 

Attachments

  • error.txt
    24.1 KB · Views: 6
  • config_compilers_edit.txt
    2.1 KB · Views: 3

jedwards

CSEG and Liaisons
Staff member
The missing objects should be part of libpnetcdf.a which seems to be properly listed above. Are you sure that that
library was built correctly? try nm libpnetcdf.a and see if those symbols are present.
 
Top