issue with linker

issue with linker

I am trying to build a project and link step is having issues with common symbols:

/Users/srinathv/software/openmpi/1.6.4/intel/bin/mpif90 -DHAVE_CONFIG_H -D_Linux -DTHREADED_OMP -g -openmp -O3 -mavx -L../../libs/blas -L../../libs/lapack -L/Users/srinathv/software/netcdf/4.2/intel/lib -o preqx prim_main.o ./libhomme_preqx.a -L../../utils/pio -lpio -L../../utils/timing -ltiming -L../../libs/blas -L../../libs/lapack -L/Users/srinathv/software/netcdf/4.2/intel/lib -lnetcdff -lnetcdf -llapack -lblas
Undefined symbols for architecture x86_64:
"_gravity_wave_drag_mod_mp_pre_", referenced from:
_aquaplanet_mp_aquaplanet_init_state_ in libhomme_preqx.a(aquaplanet.o)
"_gravity_wave_drag_mod_mp_qve_", referenced from:
_aquaplanet_mp_aquaplanet_init_state_ in libhomme_preqx.a(aquaplanet.o)
"_gravity_wave_drag_mod_mp_rayleigh_", referenced from:
_aquaplanet_mp_aquaplanet_init_state_ in libhomme_preqx.a(aquaplanet.o)
"_gravity_wave_drag_mod_mp_the_", referenced from:
_aquaplanet_mp_aquaplanet_init_state_ in libhomme_preqx.a(aquaplanet.o)
"_gravity_wave_drag_mod_mp_tme_", referenced from:
_aquaplanet_mp_aquaplanet_init_state_ in libhomme_preqx.a(aquaplanet.o)
"_gravity_wave_drag_mod_mp_ue_", referenced from:
_aquaplanet_mp_aquaplanet_init_state_ in libhomme_preqx.a(aquaplanet.o)
"_gravity_wave_drag_mod_mp_ve_", referenced from:
_aquaplanet_mp_aquaplanet_init_state_ in libhomme_preqx.a(aquaplanet.o)
"_thread_mod_mp_nthreads_", referenced from:
_MAIN__ in prim_main.o
_prim_driver_mod_mp_prim_init1_ in libhomme_preqx.a(prim_driver_mod.o)
_namelist_mod_mp_readnl_ in libhomme_preqx.a(namelist_mod.o)
ld: symbol(s) not found for architecture x86_64
make[1]: *** [preqx] Error 1
make: *** [all] Error 2
srinathv@vpn61.ucar.edu<preqx> (master) $nm lib
srinathv@vpn61.ucar.edu<preqx> (master) $which nm
/opt/local/bin/nm
srinathv@vpn61.ucar.edu<preqx> (master) $nm libhomme_preqx.a | grep -i gravity_wave_drag_mod_mp_pre
nm: no name list
00000000000000a0 C _gravity_wave_drag_mod_mp_pre_
U _gravity_wave_drag_mod_mp_pre_

Here is the mpi info:

$/Users/srinathv/software/openmpi/1.6.4/intel/bin/mpif90 --show
ifort -I/Users/srinathv/software/openmpi/1.6.4/intel/include -Wl,-commons,use_dylibs -I/Users/srinathv/software/openmpi/1.6.4/intel/lib -L/Users/srinathv/software/openmpi/1.6.4/intel/lib -lmpi_f90 -lmpi_f77 -lmpi -lm
srinathv@vpn61.ucar.edu<preqx> (master) $/Users/srinathv/software/openmpi/1.6.4/intel/bin/mpif90 -v
ifort version 13.0.2

Why is the common symbol now offensive?  

Thanks

 

 

publicaciones de 5 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Did you build the objects in libhomme_preqx.a by targeting x86_64 or for ia32?

ar cru libhomme_preqx.a kinds.o dimensions_mod.o control_mod.o physical_constants.o coordinate_systems_mod.o params_mod.o gridgraph_mod.o edge_mod.o element_mod.o parallel_mod.o hybrid_mod.o reduction_mod.o quadrature_mod.o global_norms_mod.o ll_mod.o metagraph_mod.o schedule_mod.o thread_mod.o bndry_mod.o derivative_mod.o viscosity_mod.o spacecurve_mod.o cube_mod.o interpolate_mod.o physics_types_mod.o dof_mod.o common_io_mod.o spelt_mod.o fvm_mod.o fvm_control_volume_mod.o fvm_line_integrals_mod.o fvm_analytic_mod.o fvm_filter_mod.o fvm_reconstruction_mod.o pio_io_mod.o repro_sum_mod.o physics_io_mod.o time_mod.o gravity_wave_drag_mod.o physics_mod.o hybvcoord_mod.o aquaplanet.o aquaplanet_io_mod.o interp_movie_mod.o shr_kind_mod.o shr_mpi_mod.o shr_sys_mod.o shr_file_mod.o shr_vmath_mod.o shr_vmath_fwrap.o perf_mod.o perf_utils.o domain_mod.o restart_io_mod.o cg_mod.o linear_algebra_mod.o solver_mod.o filter_mod.o common_movie_mod.o namelist_mod.o mass_matrix_mod.o checksum_mod.o baroclinic_inst_mod.o diffusion_mod.o prim_si_mod.o asp_tests.o prim_state_mod.o prim_restart_mod.o prim_si_ref_mod.o prim_advance_mod.o prim_advection_mod.o forcing_mod.o convect43c.o held_suarez_mod.o column_model_mod.o column_types_mod.o metis_mod.o prim_driver_mod.o vertical_mod.o mjo_mod.o multicloud_mod.o eigenmodes_mod.o prim_movie_mod.o surfaces_mod.o repro_sum_mod.o interpolate_driver_mod.o netcdf_io_mod.o mesh_mod.o Manager.o

$file gravity_wave_drag_mod.o
gravity_wave_drag_mod.o: Mach-O 64-bit x86_64 object

So, I think yes...built for x86_64.  Should I set a flag for ifort the compilers to insure this?

Please read this recent thread to see if some limitations of OSX binutils may be the culprit.

The "ranlib -c" to include common symbols in the library table of contents (symbol table) was the cure.  Thank you!

Inicie sesión para dejar un comentario.