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-025927ERROR: 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_64collect2: error: ld returned 1 exit statusmake: *** [/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!
 

jedwards

CSEG and Liaisons
Staff member
It looks like replacing isnanf with isnan in shr_isnan.c should solve the problem...FPCLASSIFY(3)            BSD Library Functions Manual            FPCLASSIFY(3)

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

LIBRARY
     Math Library (libm, -lm)

SYNOPSIS
     #include

     int
     fpclassify(real-floating x);

     int
     isfinite(real-floating x);

     int
     isinf(real-floating x);

     int
     isnan(real-floating x);

     int
     isnormal(real-floating x);

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

     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.


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

 

jedwards

CSEG and Liaisons
Staff member
It looks like replacing isnanf with isnan in shr_isnan.c should solve the problem...FPCLASSIFY(3)            BSD Library Functions Manual            FPCLASSIFY(3)

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

LIBRARY
     Math Library (libm, -lm)

SYNOPSIS
     #include

     int
     fpclassify(real-floating x);

     int
     isfinite(real-floating x);

     int
     isinf(real-floating x);

     int
     isnan(real-floating x);

     int
     isnormal(real-floating x);

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

     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.


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

 

jedwards

CSEG and Liaisons
Staff member
It looks like replacing isnanf with isnan in shr_isnan.c should solve the problem...FPCLASSIFY(3)            BSD Library Functions Manual            FPCLASSIFY(3)

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

LIBRARY
     Math Library (libm, -lm)

SYNOPSIS
     #include

     int
     fpclassify(real-floating x);

     int
     isfinite(real-floating x);

     int
     isinf(real-floating x);

     int
     isnan(real-floating x);

     int
     isnormal(real-floating x);

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

     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.


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

 

jedwards

CSEG and Liaisons
Staff member
It looks like replacing isnanf with isnan in shr_isnan.c should solve the problem...FPCLASSIFY(3)            BSD Library Functions Manual            FPCLASSIFY(3)

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

LIBRARY
     Math Library (libm, -lm)

SYNOPSIS
     #include

     int
     fpclassify(real-floating x);

     int
     isfinite(real-floating x);

     int
     isinf(real-floating x);

     int
     isnan(real-floating x);

     int
     isnormal(real-floating x);

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

     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.


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

 

whannah

Member
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.
 

whannah

Member
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.
 

whannah

Member
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.
 

whannah

Member
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.
 
Back
Top