Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

WRF4.2.1 compilation Error

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

gpavani

New member
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

  • compile.log
    919.5 KB · Views: 41
  • configure.wrf
    27 KB · Views: 38
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:
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.
 
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

  • configure.wrf
    26.9 KB · Views: 39
  • compile.log
    968.6 KB · Views: 39
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?
 
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
 
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.
 
Top