Undefined symbols for architecture x86_64:

I have difficulties finding out why when I compile a program c or fortran I have the above message and at end:


ld: symbol(s) not found for architecture x86_64


I need help overcome the problem limiting the use of my system for my scientific activities.

MacBook Pro (15-inch Early 2011), Mac OS X (10.7.5)

Posted on Apr 19, 2014 8:40 AM

Reply
5 replies

Apr 20, 2014 2:56 AM in response to Melophage

It happens with both gfortan, gcc and ifort and icc I mainly use to compile my programs.


Below an error message when I compile wrf model.


mpif90 -f90=ifort -o tc.exe -O3 -ip -fp-model precise -w -ftz -align all -fno-alias -FR -convert big_endian -Wl,-stack_addr,0xF10000000 -Wl,-stack_size,0x64000000 tc_em.o ../dyn_em/module_initialize_real.o libwrflib.a /Users/sarr/nwrf/WRFV3/external/fftpack/fftpack5/libfftpack.a /Users/sarr/nwrf/WRFV3/external/io_grib1/libio_grib1.a /Users/sarr/nwrf/WRFV3/external/io_grib_share/libio_grib_share.a /Users/sarr/nwrf/WRFV3/external/io_int/libwrfio_int.a -L/Users/sarr/nwrf/WRFV3/external/esmf_time_f90 -lesmf_time /Users/sarr/nwrf/WRFV3/external/RSL_LITE/librsl_lite.a /Users/sarr/nwrf/WRFV3/frame/module_internal_header_util.o /Users/sarr/nwrf/WRFV3/frame/pack_utils.o -L/Users/sarr/nwrf/WRFV3/external/io_netcdf -lwrfio_nf -L/Users/sarr/local/ncdf_int/lib -lnetcdff -lnetcdf
Undefined symbols for architecture x86_64:
"_module_domain_type_mp_program_name_", referenced from:
_MAIN__ in tc_em.o
_input_wrf_ in libwrflib.a(input_wrf.o)
_output_wrf_ in libwrflib.a(output_wrf.o)
ld: symbol(s) not found for architecture x86_64
make[1]: [em_real] Error 1 (ignored)

May 2, 2014 12:24 PM in response to fipoucat

fipoucat,


there’s no -Llibrary_folder parameter on your mpif90 command line above to tell the linker to look in the /WRFV3/main folder for any library. Would it need such a parameter?


Since libwrflib.a is generated during compilation, do you also have documentation on it, to discover where it expects to find the _input_wrf_ and _output_wrf_ functions? That is, are they supposed to be in a different compiler-generated library, or are they supposed to be provided by whatever code is making use of the lifwrflib.a library?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Undefined symbols for architecture x86_64:

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.