Main menu


Porting error: Undefined symbols "_isnanf" from: _shr_sisnan_ in libcsm_share.a(shr_isnan.o)

3 posts / 0 new
Last post
Porting error: Undefined symbols "_isnanf" from: _shr_sisnan_ in libcsm_share.a(shr_isnan.o)

I'm getting this error while porting CESM onto my local machine (Mac OS X Yosemite, compiler gnu, open-mpi 1.8.3, netcdf 4.3.2)


ERROR: cesm.buildexe.csh failed, see /Users/wusun/work/cesm_projects/cases/test01/bld/cesm.bldlog.141208-025927

ERROR: cat /Users/wusun/work/cesm_projects/cases/test01/bld/cesm.bldlog.141208-025927

When I looked into the cesm.bldlog file, it showed the following error message at the end of the log file


mpif90  -o /Users/wusun/work/cesm_projects/cases/test01/bld/cesm.exe ccsm_comp_mod.o ccsm_driver.o mrg_mod.o seq_avdata_mod.o seq_diag_mct.o seq_domain_mct.o seq_flux_mct.o seq_frac_mct.o seq_hist_mod.o seq_map_esmf.o seq_map_mod.o seq_mctext_mod.o seq_rest_mod.o  -L/Users/wusun/work/cesm_projects/cases/test01/bld/lib/ -latm  -L/Users/wusun/work/cesm_projects/cases/test01/bld/lib/ -lice  -L/Users/wusun/work/cesm_projects/cases/test01/bld/lib/ -llnd  -L/Users/wusun/work/cesm_projects/cases/test01/bld/lib/ -locn  -L/Users/wusun/work/cesm_projects/cases/test01/bld/lib/ -lrof  -L/Users/wusun/work/cesm_projects/cases/test01/bld/lib/ -lglc  -L/Users/wusun/work/cesm_projects/cases/test01/bld/lib/ -lwav -L/Users/wusun/work/cesm_projects/cases/test01/bld/gnu/openmpi/nodebug/nothreads/MCT/noesmf/a1l1r1i1o1g1w1/csm_share -lcsm_share -L/Users/wusun/work/cesm_projects/cases/test01/bld/gnu/openmpi/nodebug/nothreads/lib -lpio -lgptl -lmct -lmpeu -L/usr/local/Cellar/netcdf/4.3.2/lib -lnetcdff -L/usr/local/Cellar/netcdf/4.3.2/lib -lnetcdf -lnetcdf  -all_load 

Undefined symbols for architecture x86_64:

  "_isnanf", referenced from:

      _shr_sisnan_ in libcsm_share.a(shr_isnan.o)

ld: symbol(s) not found for architecture x86_64

collect2: error: ld returned 1 exit status

make: *** [/Users/wusun/work/cesm_projects/cases/test01/bld/cesm.exe] Error 1

  However, when I check the $CASEROOT/bld/lib directory, there is no such file libcsm_share.a. I searched in the posts and there are no previously reported issues like this. I have attached the cesm.bldlog file and Macros file. Thanks in advance!

It looks like replacing isnanf with isnan in shr_isnan.c should solve the problem...

FPCLASSIFY(3)            BSD Library Functions Manual            FPCLASSIFY(3)

     fpclassify, isfinite, isinf, isnan, isnormal -- classify a floating-point number

     Math Library (libm, -lm)

     #include <math.h>

     fpclassify(real-floating x);

     isfinite(real-floating x);

     isinf(real-floating x);

     isnan(real-floating x);

     isnormal(real-floating x);

     The fpclassify() macro takes an argument of x and returns one of the following manifest

     FP_INFINITE   Indicates that x is an infinite number.

     FP_NAN        Indicates that x is not a number (NaN).

     FP_NORMAL     Indicates that x is a normalized number.

     FP_SUBNORMAL  Indicates that x is a denormalized number.

     3BSD introduced isinf() and isnan() functions, which accepted double arguments; these have
     been superseded by the macros described above.

CESM Software Engineer


The solution posted by jedwards worked for me! Thanks! I was hoping for a simple fix with a compiler flag, but this is good enough.

For reference I'm building CESM on OSX (10.9.5) using the GNU compiler.

Log in or register to post comments

Who's new

  • stans
  • ahadibfar@...
  • jskang@...
  • divanova@...
  • mrostami@...