WRF4.2.1 compilation Error

All topics related to compiling WRF, including environment set-up, and library installation
Post Reply
gpavani
Posts: 3
Joined: Fri Mar 26, 2021 10:51 am

WRF4.2.1 compilation Error

Post by gpavani » Fri Mar 26, 2021 11:47 am

Hi,

I am trying to compile WRF-4.2.1 in Nasa-Unified WRF system using intel compilers and facing error related to multiple definition of a function.
------------------------------------------------------------------------------
libwrflib.a(module_sf_clm.o): In function `initimeconst_':
module_sf_clm.f90:(.text+0xe16d0): multiple definition of `initimeconst_'
libwrflib.a(iniTimeConst.o):iniTimeConst.F90:(.text+0x0): first defined here
libwrflib.a(module_sf_clm.o): In function `initimevar_':
module_sf_clm.f90:(.text+0xc7ad0): multiple definition of `initimevar_'
libwrflib.a(iniTimeVar.o):iniTimeVar.F90:(.text+0x0): first defined here
1.43user 0.97system 0:12.81elapsed 18%CPU (0avgtext+0avgdata 230584maxresident)k
135776inputs+163088outputs (5major+116222minor)pagefaults 0swaps
make[1]: [em_wrf] Error 1 (ignored)
---------------------------------------------------------------------------------------


Kindly let me know the reason behind the above error. I attached below the compile.log and configure.wrf files.

Thank you,
Pavani
Attachments
configure.wrf
(27.01 KiB) Downloaded 7 times
compile.log
(919.5 KiB) Downloaded 8 times

kwerner
Posts: 2287
Joined: Wed Feb 14, 2018 9:21 pm

Re: WRF4.2.1 compilation Error

Post by kwerner » Tue Mar 30, 2021 6:12 pm

I would recommend following these steps:
1) First follow along with this [urlhttps://www2.mmm.ucar.edu/wrf/OnLineTutorial/compilation_tutorial.php]compiling tutorial [/url]the best you can - making the necessary modifications for the Intel compiler. For e.g., for Intel the environment settings should be:

Code: Select all

export CC=icc
export CXX=icpc
export CFLAGS=”-O3 -xHost -ip -no-prec-div -static-intel”
export CXXFLAGS=”-O3 -xHost -ip -no-prec-div -static-intel”
export F77=ifort
export FC=ifort
export F90=ifort
export FFLAGS=”-O3 -xHost -ip -no-prec-div -static-intel”
export CPP=”icc -E”
export CXXCPP=”icpc -E”
Make sure that your system passes all the tests.

2) Then try to compile the WRF code again - making sure it's a pristine version (no modifications). Issue
./clean -a
export J="-j 1" (this just ensures that it builds with only a single processor - meaning the first error in the compile log is THE error causing the problems)
./configure
./compile em_real >& compile.log

If it's still failing, please attach the new configure.wrf and compile.log files.
NCAR/MMM

gpavani
Posts: 3
Joined: Fri Mar 26, 2021 10:51 am

Re: WRF4.2.1 compilation Error

Post by gpavani » Thu Apr 01, 2021 3:12 pm

Hi,

Thank you for the reply. I tried the compiling wrf after following the steps mentioned above. Still the compilation fails . I attached below the configure.wrf and compile.log files. What was the reason behind the multiple and unndefined errors ?

The errors are
-------------------------------------------------------------------------------
libwrflib.a(module_sf_clm.o): In function `initimeconst_':
module_sf_clm.f90:(.text+0xe16d0): multiple definition of `initimeconst_'
libwrflib.a(iniTimeConst.o):iniTimeConst.F90:(.text+0x0): first defined here
libwrflib.a(module_sf_clm.o): In function `initimevar_':
module_sf_clm.f90:(.text+0xc7ad0): multiple definition of `initimevar_'
libwrflib.a(iniTimeVar.o):iniTimeVar.F90:(.text+0x0): first defined here
libwrflib.a(read_gvf_binary_modis.o): In function `gvf_binary_reader_modis(char*, int&, int)':
read_gvf_binary_modis.cc:(.text+0x5b): undefined reference to `__cxa_throw_bad_array_new_length'
libwrflib.a(read_gvf_binary_modis.o): In function `readgvfmodis_':
read_gvf_binary_modis.cc:(.text+0x1c9): undefined reference to `__cxa_throw_bad_array_new_length'
libwrflib.a(read_gvf_binary_viirs.o): In function `gvf_binary_reader_viirs(char*, int&, int)':
read_gvf_binary_viirs.cc:(.text+0x5b): undefined reference to `__cxa_throw_bad_array_new_length'
libwrflib.a(read_gvf_binary_viirs.o): In function `readgvfviirs_':
read_gvf_binary_viirs.cc:(.text+0x1c9): undefined reference to `__cxa_throw_bad_array_new_length'
/home/pavani/dep/ESMF/lib/libO/Linux.intel.64.intelmpi.default/libesmf.so: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/pavani/dep/ESMF/lib/libO/Linux.intel.64.intelmpi.default/libesmf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21'
--------------------------------------------------------------------------------------------------------------------------

Thank you,
Pavani
Attachments
compile.log
(968.58 KiB) Downloaded 8 times
configure.wrf
(26.9 KiB) Downloaded 8 times

kwerner
Posts: 2287
Joined: Wed Feb 14, 2018 9:21 pm

Re: WRF4.2.1 compilation Error

Post by kwerner » Fri Apr 09, 2021 8:41 pm

Hi Pavani,
I apologize for the delay. I've not seen this type of error previously, so I wanted to ask the opinion of a software engineer on my team. They aren't quite sure either. I do want to verify that you did a "clean -a" and then reconfigured prior to recompiling the code, correct? You're using Intel V21. We don't have access to that version and haven't been able to test it yet. Do you happen to have access to an older version that you can try - just to see if it's the compiler version causing the problem?
NCAR/MMM

gpavani
Posts: 3
Joined: Fri Mar 26, 2021 10:51 am

Re: WRF4.2.1 compilation Error

Post by gpavani » Fri Apr 23, 2021 11:30 am

Hi,

Sorry for the late reply.

I did "Clean -a " and then reconfigured followed by recompilation. The error still persists.

--------------------------------------------------------------------------------------
libwrflib.a(module_sf_clm.o): In function `initimeconst_':
module_sf_clm.f90:(.text+0xe16d0): multiple definition of `initimeconst_'
libwrflib.a(iniTimeConst.o):iniTimeConst.F90:(.text+0x0): first defined here
libwrflib.a(module_sf_clm.o): In function `initimevar_':
module_sf_clm.f90:(.text+0xc7ad0): multiple definition of `initimevar_'
-------------------------------------------------------------------------------------------

I will try compiling with older version of Intel.

Thank you,
Pavani

kwerner
Posts: 2287
Joined: Wed Feb 14, 2018 9:21 pm

Re: WRF4.2.1 compilation Error

Post by kwerner » Fri Apr 23, 2021 4:36 pm

Ok, let me know the outcome of that. If you aren't able to compile with an older Intel, could you try GNU, just to help us narrow down whether it's a compiler issue? GNU is free.
NCAR/MMM

Post Reply

Return to “WRF Compiling/Installation”