Chandra-MARX / marx

Chandra X-ray Observatory ray-trace simulator
http://space.mit.edu/cxc/marx/
5 stars 4 forks source link

Cross-Compilation of MARX on 64 bit linux for 32 bit linux fails #11

Open hamogu opened 9 years ago

hamogu commented 9 years ago

When I try the following:

./configure --prefix=/nfs/cxc/a1/linux/opt/packages/marx-5.1.0/ --build=i686-unknown-linux-gnu "CFLAGS=-m32 -g -O2" "LDFLAGS=-m32"

then the make step fails with

[...]
cd /melkor/d1/guenther/marx/dist/pfile/src/i686-unknown-linux-gnuobjs && gcc -c -m32 -g -O2 -Dunix   /melkor/d1/guenther/marx/dist/pfile/src/pftable.c
/bin/rm -f /melkor/d1/guenther/marx/dist/pfile/src/i686-unknown-linux-gnuobjs/libpfile.a
cd /melkor/d1/guenther/marx/dist/pfile/src/i686-unknown-linux-gnuobjs; ar cr libpfile.a pf.o pfcmd.o pfcmpt.o pfile.o pfmisc.o pfquery.o pftable.o
ranlib /melkor/d1/guenther/marx/dist/pfile/src/i686-unknown-linux-gnuobjs/libpfile.a
cd /melkor/d1/guenther/marx/dist/pfile/src/i686-unknown-linux-gnuobjs && gcc -c -m32 -g -O2 -Dunix   -I/melkor/d1/guenther/marx/dist/pfile/src /melkor/d1/guenther/marx/dist/pfile/src/pset.c
gcc -o /melkor/d1/guenther/marx/dist/pfile/src/i686-unknown-linux-gnuobjs/pset  /melkor/d1/guenther/marx/dist/pfile/src/i686-unknown-linux-gnuobjs/pset.o  -L/melkor/d1/guenther/marx/dist/pfile/src/i686-unknown-linux-gnuobjs -lpfile -lm
/melkor/d1/guenther/marx/dist/pfile/src/i686-unknown-linux-gnuobjs/pset.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[2]: *** [/melkor/d1/guenther/marx/dist/pfile/src/i686-unknown-linux-gnuobjs/pset] Error 1
make[2]: Leaving directory `/melkor/d1/guenther/marx/dist/pfile/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/melkor/d1/guenther/marx/dist/pfile'
make: *** [all] Error 2

It seems that the -m32 flag is passed to most gcc runs, but not to those that are compiled as stand-alone tools such as pset.

Workaround: Compile 32 bit version on a 32 bit system.

The most common scenario is that marx is compiled on the same system it's going to run on, so this is definitely not urgent.

hamogu commented 4 years ago

Might be addressed automatically when I switch MARX to automake.