File is not of required architecture

Hello,

I’m new around here, with regards to attempting to integrate Root and GEANT4 and with regards to these forums, so please go easy on me, and I apologize in advance if I’m asking something that is either obvious or previously answered.

Essentially what I’m trying to do is compile an application, written by someone else on a Linux platform, on my platform. I’m running Mac OS X 10.5.7, 2.93ghz intel core 2 duo.

I’ve installed CLHEP and geant4 4.9.2 from source, and root 5.24 from source. Standalone geant4 applications (i’ve tried all of the novice and a few of the extended examples, all compile and run without errors) and root seem to work fine separately. However, in the several applications I’ve attempted to compile that reference both root and geant4 I encounter an identical warning after the compiler compiles the C code:

Linking Crestmag4 ... ld warning: in /Applications/geant4.9.2.p01/lib/Darwin-g++/libG4visHepRep.a, file is not of required architecture ld warning: in /Applications/geant4.9.2.p01/lib/Darwin-g++/libG4FR.a, file is not of required architecture ld warning: in /Applications/geant4.9.2.p01/lib/Darwin-g++/libG4RayTracer.a, file is not of required architecture

and so on. Every geant4 library ld tries to link gets the same warning, and later on of course I receive:

Undefined symbols: "G4Gamma::GammaDefinition()", referenced from: CrestStackingAction::ClassifyNewTrack(G4Track const*) in libCrestmag4.a(CrestStackingAction.o) CrestStackingAction::ClassifyNewTrack(G4Track const*) in libCrestmag4.a(CrestStackingAction.o)
And so on for every class not loaded since the libraries failed to load.

The GNUmakefile for this application is:

[code]name :=Crestmag4
G4TARGET := $(name)
G4EXLIB := true

CPPFLAGS += -DG4ANALYSIS_USE
ROOTCONFIG = root-config
CPPFLAGS += (shell (ROOTCONFIG) --cflags)
EXTRALIBS := (shell (ROOTCONFIG) --glibs)

ifndef G4INSTALL
G4INSTALL = …/…/…
endif

.PHONY: all
all: lib bin

include $(G4INSTALL)/config/binmake.gmk[/code]


The output of root-config --cflags is:
-D_REENTRANT -pthread -m64 -I/usr/local/root/include

The output of root-config --glibs is:
-L/usr/local/root/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lfreetype -lGui -pthread -Wl,-rpath,/usr/local/root/lib -lm -ldl

The -m64 option is confusing to me, because of this post:

http://hypernews.slac.stanford.edu/HyperNews/geant4/get/installconfig/1095/1/1/1/1/1/1/1/1/1.html

[code]OK, I believe the problem is in the option -m64 introduced by the scripts of Root …

root-config --cflags -D_REENTRANT -pthread -m64 -I/usr/local/root/include

You should disable that option, eventually in the Root setup when installing it… -m64 is
for AMD architectures and you are running on an Intel dual-core instead…

Gabriele Cosmo, 3/28/08[/code]

While in other places on this forum, I’ve found posts saying that -m64 indicates 64-bit architecture, not anything to do with AMD.

So, what I have been trying to do without success is find where I need to tell this application that it is no longer in a 32-bit linux environment (on which the application makes successfully, as tested by me) and is now in a 64-bit leopard environment. Can anyone help?

Thanks for reading everything,

Joe Gennaro

Hi Joe,

[quote]While in other places on this forum, I’ve found posts saying that -m64 indicates 64-bit architecture, not anything to do with AMD. [/quote]I think this is correct.

And I am guessing from Gabrielle’s message that the build of Geant you have is build in 32 bit mode … which is incompatible with a 64 bit mode build of ROOT. So you will either need to build Geant in 64 bit mode or build ROOT in 32 bit mode (by explicitly requesting the ‘macosx’ architecture when configuring root [configure macosx]).

Cheers,
Philippe.