Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Undefined symbols for architecture x86_64

bujs910
Beginner
324 Views

Hi,

I am coupling a weather forcast model (WRF3.3) and a lans surface model. All the modules are compiled, but i keep getting an error when linking to generate the executable files. Here is the complete error message:

ranlib libwrflib.a
mpif90 -f90=ifort -o wrf.exe -O3 -w -ftz -align all -fno-alias -fp-model precise -fno-common -FR -convert big_endian -ip -Wl,-stack_addr,0xF10000000 -Wl,-stack_size,0x64000000 wrf.o ../main/module_wrf_top.o libwrf\
lib.a /Users/jians/WRF/external/fftpack/fftpack5/libfftpack.a /Users/jians/WRF/external/io_grib1/libio_grib1.a /Users/jians/WRF/external/io_grib_share/libio_grib_share.a /\
Users/jians/WRF/external/io_int/libwrfio_int.a -L/Users/jians/WRF/external/esmf_time_f90 -lesmf_time /Users/jians/WRF/external/RSL_LITE/librsl_lite.a /Users/jians/WRF/frame/module_internal_header_util.o /Users/jians/WRF/frame/pack_utils.o -L/Users/jians/WRF/external/io_netcdf -lwrfio_nf -L/usr/local/lib -lnetcdf -L/Users/jians/WRF/external/io_grib2 -lio_grib2 -L/usr/local/jasper/lib -ljasper
Undefined symbols for architecture x86_64:
"_combcs_mp_lmask_", referenced from:
_arr2vec_ in libwrflib.a(utilities.o)
"_compar_mp_nlatsub_", referenced from:
_arr2vec_ in libwrflib.a(utilities.o)
_vec2arr_ in libwrflib.a(utilities.o)
"_compar_mp_nlonsub_", referenced from:
_arr2vec_ in libwrflib.a(utilities.o)
_vec2arr_ in libwrflib.a(utilities.o)
"_comwork_mp_latindex_", referenced from:
_vec2arr_ in libwrflib.a(utilities.o)
"_comwork_mp_lonindex_", referenced from:
_vec2arr_ in libwrflib.a(utilities.o)
"_compar_mp_dtime_", referenced from:
_get_time_ibis_ in libwrflib.a(utilities.o)
"_ran2_", referenced from:
_random_choice_ in libwrflib.a(utilities.o)
ld: symbol(s) not found for architecture x86_64
make[1]: [em_wrf] Error 1 (ignored)

If it helps, the system is Mac OS X Lion 10.7.5. WRF is written in fortran90 and C, while the land surface model is written in fortran77. I am using ifort compiler (12.1.0.038) and gcc to compile the model. ifort is set to use 64 bit compiler. utilities.o is a module of the land surface model. Seems it is related with the wrf library. But I do not know how to solve it. BTW, I am able to compile and run both models separately. Any ideas? 

Thanks,

Jian

0 Kudos
4 Replies
mecej4
Honored Contributor III
324 Views

Make sure that all the libraries that you are linking against are for the same target architecture -- intel64 in your case. You can use the Unix/Linux file utility to find the target-type of the objects within libraries.

0 Kudos
Heinz_B_Intel
Employee
324 Views

This is not related to 32bit versus 64bit target architecture. You miss a library from WRF I assume: The unresolved references do not refer to objects from the Intel run time system or Linux.  Did you check  http://software.intel.com/en-us/articles/building-the-wrf-with-intel-compilers-on-linux-and-improving-performance-on-intel-architecture  on how to build WRF with Intel compilers ?

 

0 Kudos
bujs910
Beginner
324 Views

Hi HeinzB, thanks for your reply. I forgot to mention that I compile and run WRF on my machine just fine. But the error occurs after i coupled the land surface model into WRF.

0 Kudos
bujs910
Beginner
324 Views

mecej4 wrote:

Make sure that all the libraries that you are linking against are for the same target architecture -- intel64 in your case. You can use the Unix/Linux file utility to find the target-type of the objects within libraries.

Hi mecej4, thanks for your suggestion. Yes, i did check that using "file" utility, and the modules are all compiled based on 64bit architecture.

0 Kudos
Reply