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 building BHIST: shr_vmath_mod.F90:44: undefined reference to `vdsqrt_'

jrvb

Rob von Behren
New Member
Greetings!

I'm trying to get a BHIST run going with cesm 2.2, and am running into some compiler errors I haven't seen before. I'm using the intel compiler suite on linux, and have a machine configuration set up that works for F2000Climo among others, so the general configuration should be OK. I suspect BHIST is pulling in some other components I haven't needed to build before, which is tickling some compiler configuration issue.

Here is the case setup and end of the build output including the error:


$ create_newcase --case 0716_BHIST_10day --compset BHIST --res f09_g17 $ cd 0716_BHIST_10day $ ./xmlchange STOP_OPTION=ndays,STOP_N=10,REST_OPTION=ndays,REST_N=3 $ ./case.setup && ./case.build && time ./case.submit .... cism built in 187.321711 seconds Component atm build complete with 555 warnings cam built in 204.794333 seconds Building cesm from /data/cesm/opt/ncar/cesm2/cime/src/drivers/mct/cime_config/buildexe with output to /data/home/jrvb/timings/0716_BHIST_10day/bld/cesm.bldlog.210716-183558 /data/cesm/opt/ncar/cesm2/cime/src/share/util/shr_vmath_mod.F90:44: undefined reference to `vdsqrt_' /data/cesm/opt/ncar/cesm2/cime/src/share/util/shr_vmath_mod.F90:105: undefined reference to `vdexp_' /data/cesm/opt/ncar/cesm2/cime/src/share/util/shr_vmath_mod.F90:130: undefined reference to `vddiv_' /data/cesm/opt/ncar/cesm2/cime/src/share/util/shr_vmath_mod.F90:164: undefined reference to `vdln_' /data/cesm/opt/ncar/cesm2/cime/src/share/util/shr_vmath_mod.F90:194: undefined reference to `vdsin_' /data/cesm/opt/ncar/cesm2/cime/src/share/util/shr_vmath_mod.F90:222: undefined reference to `vdcos_' Component cesm exe build complete with 29 warnings ERROR: BUILD FAIL: buildexe failed, cat /data/home/jrvb/timings/0716_BHIST_10day/bld/cesm.bldlog.210716-183558

I can get things to compile successfully by editing cesm2/cime/src/share/util/shr_vmath_mod.F90 and adding

#define NO_SHR_VMATH 1

to turn off all of the optimized vd* functions. From the code, it looks like these should be defined for the Intel compiler, though, so I'm puzzled that this is necessary.

Does anyone have ideas about what might be going wrong here? Maybe there is some extra ifort flag I need to add somewhere?

Does anyone have a sense of how much performance I'm likely to leave on the table by disabling these? (No need to create more CO2 by failing to optimize my compiler settings... :)

Thanks for looking!

-Rob
 

jedwards

CSEG and Liaisons
Staff member
If you are using the intel compiler try adding -mkl to the compiler options. You should see a number of examples in config_compilers.xml.
cleardot.gif
 

ShijingLiang

ShijingLiang
New Member
Hello,

I also had this problem. By editing the config_compilers.xml, my model can build successfully ;)
1. Check your .bashrc file, make sure you load mkl (module load mkl)
2. Specify the mkl library path (for example here,
export mkl=/share/base/modulefiles/libraries/mkl/2018.3
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/share/intel/2018u3/compilers_and_libraries_2018.3.222/linux/mkl/lib
export LIBRARY_PATH=$LIBRARY_PATH:/share/intel/2018u3/compilers_and_libraries_2018.3.222/linux/mkl/lib
)
3. In your config_compilers.xml, add your mkl library here, for example,
<SLIBS>
<append>-L/share/intel/2018u3/compilers_and_libraries_2018.3.222/linux/mkl/lib -lmkl</append>
</SLIBS>

Don't forget to revise these paths to fit your machine. Hope this can help you.

Also thank you jedwards!
 
Top