This thread is locked.Only browsing is available.
Top Page > Browsing
Linking error with gcc on OSX
Date: 2007/07/15 00:28
Name: David Benoit

Dear OpenMX gurus,

I have been trying unsucessfully to install openmx 3.2 on our Xserve clusters (OSX 10.4.10) for a few days now and am encountering the linking problem described below.

It looks like a multiple definition/prototype problem...
Anyone has any idea how to fix this??

I compile using:
CC = mpicc -O3 -I/sw/include -Wstrict-prototypes
LIB = -L/sw/lib -lfftw3 -lg2c -framework Accelerate

The compilation stage is fine (apart from a few pointer re-castings needed for FFTW3), but at the linking stage I obtain:
/usr/bin/ld: multiple definitions of symbol _ACnt_switch
openmx.o definition of _ACnt_switch in section (__DATA,__common)
openmx_common.o definition of _ACnt_switch in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _ADensity_Grid
openmx.o definition of _ADensity_Grid in section (__DATA,__common)
openmx_common.o definition of _ADensity_Grid in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Angle0_Orbital
openmx.o definition of _Angle0_Orbital in section (__DATA,__common)
openmx_common.o definition of _Angle0_Orbital in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Angle0_Spin
openmx.o definition of _Angle0_Spin in section (__DATA,__common)
openmx_common.o definition of _Angle0_Spin in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Angle1_Orbital
openmx.o definition of _Angle1_Orbital in section (__DATA,__common)
openmx_common.o definition of _Angle1_Orbital in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Angle1_Spin
openmx.o definition of _Angle1_Spin in section (__DATA,__common)
openmx_common.o definition of _Angle1_Spin in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Arho_EH0
openmx.o definition of _Arho_EH0 in section (__DATA,__common)
openmx_common.o definition of _Arho_EH0 in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Atom_Symbol
openmx.o definition of _Atom_Symbol in section (__DATA,__common)
openmx_common.o definition of _Atom_Symbol in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Atom_Weight
openmx.o definition of _Atom_Weight in section (__DATA,__common)
openmx_common.o definition of _Atom_Weight in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Av_num
openmx.o definition of _Av_num in section (__DATA,__common)
openmx_common.o definition of _Av_num in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _BCR
openmx.o definition of _BCR in section (__DATA,__common)
openmx_common.o definition of _BCR in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Band_N_perpath
openmx.o definition of _Band_N_perpath in section (__DATA,__common)
openmx_common.o definition of _Band_N_perpath in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Band_Nkpath
openmx.o definition of _Band_Nkpath in section (__DATA,__common)
openmx_common.o definition of _Band_Nkpath in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Band_UnitCell
openmx.o definition of _Band_UnitCell in section (__DATA,__common)
openmx_common.o definition of _Band_UnitCell in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Band_disp_switch
openmx.o definition of _Band_disp_switch in section (__DATA,__common)
openmx_common.o definition of _Band_disp_switch in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Band_kPathUnit
openmx.o definition of _Band_kPathUnit in section (__DATA,__common)
openmx_common.o definition of _Band_kPathUnit in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Band_kname
openmx.o definition of _Band_kname in section (__DATA,__common)
openmx_common.o definition of _Band_kname in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol _Band_kpath
openmx.o definition of _Band_kpath in section (__DATA,__common)
openmx_common.o definition of _Band_kpath in section (__DATA,__common)


etc...


Any help gratefully received!

Cheers,
David
メンテ
Page: [1]

Re: Linking error with gcc on OSX ( No.1 )
Date: 2007/09/28 14:12
Name: A.T.

Check your object includes on the compilation directive line to make sure that you are not trying to include the same .o file more than once.
Ex.:

gcc fileToCompile.cpp $(OPTIONS) fone.o ftwo.o fxx.o fone.o

(here fone.o comes up twice, so must remove one of them)

Your problem might be different, but I found I had those causing the error recently - those .o lists do get rather long for large projects (sigh).
メンテ
Re: Linking error with gcc on OSX ( No.2 )
Date: 2007/10/09 00:03
Name: David Benoit  <david.benoit@uni-ulm.de>

Dear A.T.

It turned out to that the mpicc compiler had been overwritten by mpiCC...(non-case sensitive file system on OSX)
So all of openmx had been compiled using c++ instead of c.

switching back to the proper mpicc made everything ok again!!

Thanks for your suggestions!
メンテ

Page: [1]