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

taoliu_tech

Tao Liu
Member
System: Ubuntu 18.04
CESM version: 2.0.0
Package versions:
zlib-1.2.12
hdf5-1_12_2
netcdf-c-4.9.0
netcdf-fortran-4.6.0
pnetcdf-1.12.3
mpich-4.0.2

./case.build error

Finished creating component namelists
Building gptl with output to file /home/taoliu/projects/cesm/scratch/testrun/bld/gptl.bldlog.230103-124710
Calling /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.gptl
Building mct with output to file /home/taoliu/projects/cesm/scratch/testrun/bld/mct.bldlog.230103-124710
Calling /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.mct
Building pio with output to file /home/taoliu/projects/cesm/scratch/testrun/bld/pio.bldlog.230103-124710
Calling /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.pio
Building csm_share with output to file /home/taoliu/projects/cesm/scratch/testrun/bld/csm_share.bldlog.230103-124710
Calling /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.csm_share
ERROR: /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.csm_share FAILED, cat /home/taoliu/projects/cesm/scratch/testrun/bld/csm_share.bldlog.230103-124710



cat /home/taoliu/projects/cesm/scratch/testrun/bld/csm_share.bldlog.230103-124710
/home/taoliu/projects/cesm/scratch/testrun/bld/gnu/mpich/nodebug/nothreads/mct/noesmf/c1a1l1i1o1r1g1w1e1/include/dSFMT.h:46:4: warning: #warning "DSFMT_MEXP is not defined. I assume DSFMT_MEXP is 19937." [-Wcpp]
#warning "DSFMT_MEXP is not defined. I assume DSFMT_MEXP is 19937."
^~~~~~~
In file included from /home/taoliu/my_cesm_sandbox/cime/src/share/RandNum/src/dsfmt_f03/dSFMT_utils.c:1:
/home/taoliu/projects/cesm/scratch/testrun/bld/gnu/mpich/nodebug/nothreads/mct/noesmf/c1a1l1i1o1r1g1w1e1/include/dSFMT.h:46:4: warning: #warning "DSFMT_MEXP is not defined. I assume DSFMT_MEXP is 19937." [-Wcpp]
#warning "DSFMT_MEXP is not defined. I assume DSFMT_MEXP is 19937."
^~~~~~~
shr_infnan_mod.F90:74:20:

#ifndef HAVE_IEEE_ARITHMETIC
1
Error: Procedure shr_infnan_isnan_real in generic interface 'shr_infnan_isnan' at (1) is neither function nor subroutine
gmake: *** [shr_infnan_mod.o] Error 1
 

Attachments

  • config_compilers.xml.txt
    3.4 KB · Views: 11
  • config_machines.xml.txt
    3.8 KB · Views: 5
  • csm_share.bldlog.230103-124710.txt
    45.7 KB · Views: 8

jedwards

CSEG and Liaisons
Staff member
you didn't mention the fortran compiler version - I think you are using gfortran
if so you should use v10 or newer.
 

taoliu_tech

Tao Liu
Member
you didn't mention the fortran compiler version - I think you are using gfortran
if so you should use v10 or newer.
You are right, my gfortran version is 7.5. I just upgraded it to 10.3. I also updated gcc to 10.3 (see below). However, I encountered another error for the first component gptl.
gfortran --version
GNU Fortran (Ubuntu 10.3.0-1ubuntu1~18.04~1) 10.3.0
gcc --version
gcc (Ubuntu 10.3.0-1ubuntu1~18.04~1) 10.3.0

Building gptl with output to file /home/taoliu/projects/cesm/scratch/testrun/bld/gptl.bldlog.230103-134805
Calling /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.gptl
ERROR: /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.gptl FAILED, cat /home/taoliu/projects/cesm/scratch/testrun/bld/gptl.bldlog.230103-134805

cat /home/taoliu/projects/cesm/scratch/testrun/bld/gptl.bldlog.230103-134805
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/LOGICAL(4)).
gmake: *** [perf_utils.o] Error 1
ERROR: /home/taoliu/my_cesm_sandbox/cime/src/share/timing/gptl.c: In function GPTLpr_summary_file :
/home/taoliu/my_cesm_sandbox/cime/src/share/timing/gptl.c:3090:8: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
3090 | if (((int) comm) == 0)
| ^
/home/taoliu/my_cesm_sandbox/cime/src/share/timing/perf_utils.F90:282:18:

282 | call MPI_BCAST(vec,lsize,MPI_INTEGER,0,comm,ierr)
| 1
......
314 | call MPI_BCAST(vec,lsize,MPI_LOGICAL,0,comm,ierr)
| 2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/LOGICAL(4)).
 

Attachments

  • gptl.bldlog.230103-134805.txt
    3.3 KB · Views: 5

taoliu_tech

Tao Liu
Member
I added FFLAGS in the comfig_compilers.xml. The updated file is attached. Now the gptl and mct can be built, but the pio component failed. The error message said
"Fatal Error: Cannot read module file /home/taoliu/CESM/Libs/netcdf-fortran-4.6.0/include/netcdf.mod opened at (1), because it was created by a different version of GNU Fortran". Does this mean I need to compile netcdf-fortran-4.6.0 again using gfortran 10.3?



Code:
      <FFLAGS>
         <append> -fallow-argument-mismatch -fallow-invalid-boz</append>
      </FFLAGS>

Finished creating component namelists
Building gptl with output to file /home/taoliu/projects/cesm/scratch/testrun/bld/gptl.bldlog.230103-141211
Calling /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.gptl
Component gptl build complete with 1 warnings
Building mct with output to file /home/taoliu/projects/cesm/scratch/testrun/bld/mct.bldlog.230103-141211
Calling /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.mct
Component mct build complete with 42 warnings
Building pio with output to file /home/taoliu/projects/cesm/scratch/testrun/bld/pio.bldlog.230103-141211
Calling /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.pio
ERROR: /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.pio FAILED, cat /home/taoliu/projects/cesm/scratch/testrun/bld/pio.bldlog.230103-141211

cat /home/taoliu/projects/cesm/scratch/testrun/bld/pio.bldlog.230103-141211
Fatal Error: Cannot read module file /home/taoliu/CESM/Libs/netcdf-fortran-4.6.0/include/netcdf.mod opened at (1), because it was created by a different version of GNU Fortran
compilation terminated.
gmake[2]: *** [pio/CMakeFiles/pio.dir/pio_types.F90.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
/home/taoliu/my_cesm_sandbox/cime/src/externals/pio1/pio/pio_support.F90:516:28:

495 | call mpi_send ( hs, 1, MPI_INTEGER, p, mtag, comm, ier )
| 2
......
516 | call mpi_rsend ( sendbuf, sendcnt, sendtype, root, mtag, &
| 1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(8)/INTEGER(4)).
/home/taoliu/my_cesm_sandbox/cime/src/externals/pio1/pio/pio_support.F90:360:21:

360 | call MPI_RECV(sdof,1,PIO_OFFSET_KIND,masterproc,myrank,comm,status,ierr)
| 1
......
514 | call mpi_recv ( hs, 1, MPI_INTEGER, root, mtag, comm, &
| 2
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(8)/INTEGER(4)).
gmake[1]: *** [pio/CMakeFiles/pio.dir/all] Error 2
 

Attachments

  • config_compilers.xml (2).txt
    3.5 KB · Views: 2
  • pio.bldlog.230103-141211.txt
    22.2 KB · Views: 3

taoliu_tech

Tao Liu
Member
I tried to build HDF5, netCDF-c and netCDF-Fortran sequentially using gcc 10.3 and gfortran 10.3 . However, the make of hdf5-1_12_2 failed, then I tried hdf5-1_14_0 and the hdf5-1_14_0 was successfully installed. However, now I got stuck at netCDF-c with the error received below. I tried gcc 11.1 and gfortran 11.1, and I got the same error in building netCDF-c. I've searched the internet and was not able to find a solution. I do not how to successfully build netCDF-c with gcc 10.3. The same code worked well with gcc 7.5. Any suggestion is appreciated. I have spent almost three weeks just trying to install CESM on my machine. I hope I can be successful.

Code:
ibdispatch_la-dfilter.lo     -lhdf5_hl -lhdf5 -lm -lz -ldl -lsz -lbz2 -lzstd -lxml2 -lcurl
libtool:   error: unsupported hardcode properties See the libtool documentation for more information. Fatal configuration error.
Makefile:647: recipe for target 'libdispatch.la' failed
make[2]: *** [libdispatch.la] Error 1
make[2]: Leaving directory '/home/taoliu/CESM/Downloads/netcdf-c-4.9.0/libdispatch'
Makefile:764: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/taoliu/CESM/Downloads/netcdf-c-4.9.0'
Makefile:609: recipe for target 'all' failed
make: *** [all] Error 2


# Downloading HDF5
cd $HOME/CESM/Downloads/
wget -c -4 https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_14_0.tar.gz
# Unpack the tar file
tar -xvzf hdf5-1_14_0.tar.gz
mv hdf5-hdf5-1_14_0 hdf5-1_14_0
cd hdf5-1_14_0
# Configure and Install HDF5
./configure --prefix=$HDF5DIR --with-zlib=$ZLIBDIR --enable-hl --enable-fortran CPPFLAGS="-I$ZLIBDIR/include" LDFLAGS="-L$ZLIBDIR/lib"
make
make install
make check


# Downloading netCDF-c
cd $HOME/CESM/Downloads/
wget -c -4 https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.9.0.tar.gz
# Unpack the tar file
tar -xzvf v4.9.0.tar.gz
cd netcdf-c-4.9.0/
# Configure and Install netCDF-C
./configure --prefix=$NETCDFCDIR --disable-dap CPPFLAGS="-I$HDF5DIR/include -I$ZLIBDIR/include" LDFLAGS="-L$HDF5DIR/lib -L$ZLIBDIR/lib"
make
make install
make check
 

jedwards

CSEG and Liaisons
Staff member
Perhaps you should try using spack or one of the other software management tools. Most of these tools are already available as binaries for Ubuntu.
 

taoliu_tech

Tao Liu
Member
Perhaps you should try using spack or one of the other software management tools. Most of these tools are already available as binaries for Ubuntu.
I rebuilt all the packages(mpich@4.0.2, zlib@1.2.13, hdf5@1.12.2,netcdf-c@4.9.0, netcdf-fortran@4.6.0,pnetcdf@1.12.3) using "spack install" with gcc 11.1.0 and gfortran 11.1.0. Right now, the error message changed, and it is similar to the original one. I googled the internet and was not able to find the same error encountered by others.

Finished creating component namelists
Building gptl with output to file /home/taoliu/projects/cesm/scratch/testrun/bld/gptl.bldlog.230104-200042
Calling /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.gptl
Building mct with output to file /home/taoliu/projects/cesm/scratch/testrun/bld/mct.bldlog.230104-200042
Calling /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.mct
Building pio with output to file /home/taoliu/projects/cesm/scratch/testrun/bld/pio.bldlog.230104-200042
Calling /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.pio
Building csm_share with output to file /home/taoliu/projects/cesm/scratch/testrun/bld/csm_share.bldlog.230104-200042
Calling /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.csm_share
ERROR: /home/taoliu/my_cesm_sandbox/cime/src/build_scripts/buildlib.csm_share FAILED, cat /home/taoliu/projects/cesm/scratch/testrun/bld/csm_share.bldlog.230104-200042

cat /home/taoliu/projects/cesm/scratch/testrun/bld/csm_share.bldlog.230104-200042
/home/taoliu/my_cesm_sandbox/cime/src/share/util/shr_infnan_mod.F90.in:74:20:

74 | #endif
| 1
Error: Procedure shr_infnan_isnan_real in generic interface 'shr_infnan_isnan' at (1) is neither function nor subroutine; did you mean shr_infnan_isinf_real ?
gmake: *** [shr_infnan_mod.o] Error 1
 

Attachments

  • config_machines.xml.txt
    3.7 KB · Views: 4
  • config_compilers.xml.txt
    3.4 KB · Views: 6
  • csm_share.bldlog.230104-194800.txt
    10.9 KB · Views: 3

taoliu_tech

Tao Liu
Member
In config_compilers.xml try adding -DHAVE_IEEE_ARITHMETIC to the CPPDEFS.
Thank you, sir. I modified the config_compilers.xml according to the suggestions above. A new error came up. It seems this page(Error: Operands of logical operator '.eq.' at (1) are INTEGER(4)/HOLLERITH) provides the relevant information, but I do not know how to fix it.

Error: Operands of comparison operator == at (1) are TYPE(ieee_class_type)/TYPE(ieee_class_type)
/home/taoliu/my_cesm_sandbox/cime/src/share/util/shr_infnan_mod.F90.in:200:14:

200 | isposinf = (ieee_positive_inf == ieee_class(x))
| 1
Error: Operands of comparison operator == at (1) are TYPE(ieee_class_type)/TYPE(ieee_class_type)
 

Attachments

  • csm_share.bldlog.230105-072957.txt
    57.6 KB · Views: 2
  • config_compilers.xml.txt
    3.5 KB · Views: 3

jedwards

CSEG and Liaisons
Staff member
Ahh I see what is wrong now. Remove the -DHAVE_IEEE_ARITHMETIC and replace it with -DCPRGNU
I think that will get you going.
 

taoliu_tech

Tao Liu
Member
Ahh I see what is wrong now. Remove the -DHAVE_IEEE_ARITHMETIC and replace it with -DCPRGNU
I think that will get you going.
I think we are very close. Now, the atm component threw an error. I also confirmed that I am using mpich 4.0.2 compiled with gcc-11.1.0.

Bash:
taoliu@u112171:~/projects/cesm/scratch/testrun$ mpirun --version
HYDRA build details:
    Version:                                 4.0.2
    Release Date:                            Thu Apr  7 12:34:45 CDT 2022
    CC:                              /home/taoliu/spack/lib/spack/env/gcc/gcc
    Configure options:                       '--disable-option-checking' '--prefix=/home/taoliu/spack/opt/spack/linux-ubuntu18.04-zen2/gcc-11.1.0/mpich-4.0.2-hx3iv5lpos7qjxxedez2abgzk2ld6m7w' '--disable-silent-rules' '--enable-shared' '--with-pm=hydra' '--enable-romio' '--without-ibverbs' '--enable-wrapper-rpath=yes' '--with-yaksa=/home/taoliu/spack/opt/spack/linux-ubuntu18.04-zen2/gcc-11.1.0/yaksa-0.2-yk2wmxwqqspozr7z7ekuyngws3ekysi3' '--with-hwloc=/home/taoliu/spack/opt/spack/linux-ubuntu18.04-zen2/gcc-11.1.0/hwloc-2.8.0-6yduvqfgq2rcs5wnzjoznl2klwt2rfey' '--with-slurm=no' '--with-pmi=simple' '--without-cuda' '--without-hip' '--with-device=ch4:ofi' '--with-libfabric=/home/taoliu/spack/opt/spack/linux-ubuntu18.04-zen2/gcc-11.1.0/libfabric-1.16.1-j4rwbgd7vtgq73cbxkl437fge5mwdwpg' '--enable-libxml2' '--with-datatype-engine=auto' 'CC=/home/taoliu/spack/lib/spack/env/gcc/gcc' 'CXX=/home/taoliu/spack/lib/spack/env/gcc/g++' 'FC=/home/taoliu/spack/lib/spack/env/gcc/gfortran' 'FCFLAGS=-fallow-argument-mismatch ' 'F77=/home/taoliu/spack/lib/spack/env/gcc/gfortran' 'FFLAGS=-fallow-argument-mismatch ' '--cache-file=/dev/null' '--srcdir=.' 'CFLAGS= ' 'LDFLAGS=' 'LIBS=' 'CPPFLAGS= '
    Process Manager:                         pmi
    Launchers available:                     ssh rsh fork slurm ll lsf sge manual persist
    Topology libraries available:            hwloc
    Resource management kernels available:   user slurm ll lsf sge pbs cobalt
    Demux engines available:                 poll select




Component csm_share build complete with 17 warnings
Building atm with output to /home/taoliu/projects/cesm/scratch/testrun/bld/atm.bldlog.230105-083010
Building lnd with output to /home/taoliu/projects/cesm/scratch/testrun/bld/lnd.bldlog.230105-083010
Building ice with output to /home/taoliu/projects/cesm/scratch/testrun/bld/ice.bldlog.230105-083010
Building ocn with output to /home/taoliu/projects/cesm/scratch/testrun/bld/ocn.bldlog.230105-083010
Building rof with output to /home/taoliu/projects/cesm/scratch/testrun/bld/rof.bldlog.230105-083010
Building glc with output to /home/taoliu/projects/cesm/scratch/testrun/bld/glc.bldlog.230105-083010
Building wav with output to /home/taoliu/projects/cesm/scratch/testrun/bld/wav.bldlog.230105-083010
Building esp with output to /home/taoliu/projects/cesm/scratch/testrun/bld/esp.bldlog.230105-083010
sesp built in 2.048915 seconds
sglc built in 2.062567 seconds
swav built in 2.063088 seconds
slnd built in 2.070304 seconds
srof built in 2.069602 seconds
sice built in 2.073991 seconds
docn built in 2.465796 seconds
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 36 warnings
cam built in 11.541345 seconds
ERROR: BUILD FAIL: cam.buildlib failed, cat /home/taoliu/projects/cesm/scratch/testrun/bld/atm.bldlog.230105-083010
 

Attachments

  • atm.bldlog.230105-083010.txt
    460.1 KB · Views: 2
  • config_compilers.xml.txt
    3.5 KB · Views: 4

jedwards

CSEG and Liaisons
Staff member
Add -DNO_CRAY_POINTERS it's not clear to me why you would need this one, but it should take care of this issue.
 

taoliu_tech

Tao Liu
Member
Add -DNO_CRAY_POINTERS it's not clear to me why you would need this one, but it should take care of this issue.
The error message changed after I did what is suggested above. In case it is helpful, I use ./create_newcase --case $HOME/projects/cesm/scratch/testrun --compset QPC4 --res f45_f45_mg37 --run-unsupported --mach "yoni-elitebook" to create new case.


Component csm_share build complete with 17 warnings
Building atm with output to /home/taoliu/projects/cesm/scratch/testrun/bld/atm.bldlog.230105-090459
Building lnd with output to /home/taoliu/projects/cesm/scratch/testrun/bld/lnd.bldlog.230105-090459
Building ice with output to /home/taoliu/projects/cesm/scratch/testrun/bld/ice.bldlog.230105-090459
Building ocn with output to /home/taoliu/projects/cesm/scratch/testrun/bld/ocn.bldlog.230105-090459
Building rof with output to /home/taoliu/projects/cesm/scratch/testrun/bld/rof.bldlog.230105-090459
Building glc with output to /home/taoliu/projects/cesm/scratch/testrun/bld/glc.bldlog.230105-090459
Building wav with output to /home/taoliu/projects/cesm/scratch/testrun/bld/wav.bldlog.230105-090459
Building esp with output to /home/taoliu/projects/cesm/scratch/testrun/bld/esp.bldlog.230105-090459
srof built in 2.162046 seconds
swav built in 2.167872 seconds
sesp built in 2.169050 seconds
sice built in 2.184531 seconds
slnd built in 2.189817 seconds
sglc built in 2.182993 seconds
docn built in 2.647178 seconds
Error: Line truncated at (1) [-Werror=line-truncation]

Error: Data transfer element at (1) cannot have POINTER components unless it is processed by a defined input/output procedure

Component atm build complete with 80 warnings
cam built in 23.304674 seconds
ERROR: BUILD FAIL: cam.buildlib failed, cat /home/taoliu/projects/cesm/scratch/testrun/bld/atm.bldlog.230105-090459
 

Attachments

  • atm.bldlog.230105-090459.txt
    653.6 KB · Views: 8
  • config_compilers.xml.txt
    3.5 KB · Views: 8

jedwards

CSEG and Liaisons
Staff member
The line it's flagging now is a debug line that can be commented out or removed.
This should be a warning and not an error from the gfortran compiler, i'm not sure why it
is showing up as an error.
 

taoliu_tech

Tao Liu
Member
Which file and what lines of code should be modified? Is this still due to gfortran version? Maybe that warning was treated as warning by previous version of gfrotran but considered as errors by gfortran v11?
 

taoliu_tech

Tao Liu
Member
I rebuilt every package using gcc10.3 and gfortran10.3, and the error message is still the same compared to 11.1 and gfortran 11.1.
I used packages built with gcc10.3 and gfortran10.3 and tried that with CESM 2.2.0 instead of CESM 2.0.0 and the error message is still the same.
Not sure what to do next.
 

Johnny

Johnny Guo
New Member
Hi Tao Liu, do you still need help? I was able to build it a couple of weeks ago using Ubuntu 22.04

I looked at your error message and think you have two ways to solve it, either way should do.
1. add -ffree-line-length-none to your FFLAGS. here is mine looks like:
<FFLAGS>
<append> -fallow-argument-mismatch -fallow-invalid-boz -ffree-line-length-none</append>
</FFLAGS>
2. comment out line 758 in file /home/taoliu/my_cesm_sandbox/components/cam/src/physics/cam/physics_buffer.F90.in

Hope this helps.
 
Top