star-bnl / star-sw

Core software for STAR experiment
26 stars 62 forks source link

/lib/libdl.so error when compiling a macro with spack 32-bit #679

Open genevb opened 7 months ago

genevb commented 7 months ago

In the spack-based STAR libraries, I get an error when instructing ACLiC to compile a macro in 32-bit (it appears to compile fine in 64-bit):

Example:

> cat a.C
void a() {
  int b = 3;
}
 > stardev
 > root -l -b
 *** Start at Date : Mon Apr  8 07:05:06 2024
 root [0] .L a.C++
 Info in <TUnixSystem::ACLiC>: creating shared library /home/tmp/genevb/SCGL/./a_C.so
/lib/libdl.so: error adding symbols: File in wrong format
 collect2: error: ld returned 1 exit status
 Error in <ACLiC>: Compilation failed!
 root [1] 

-Gene

genevb commented 7 months ago

/lib/libdl.so is soft-linked to /usr/lib/libdl-2.17.so, and as far as I can tell, that is 32-bit:

> file /usr/lib/libdl-2.17.so
/usr/lib/libdl-2.17.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=329591f5d1971df20d74c34d247b09287e832807, for GNU/Linux 2.6.32, not stripped

-Gene

genevb commented 7 months ago

Curiously, with root4star it's a different error than with root: libuuid.so

> root4star -b -l
 *** Start at Date : Mon Apr  8 07:49:00 2024
root [0] .L a.C++
Info in <TUnixSystem::ACLiC>: creating shared library /home/tmp/genevb/SCGL/./a_C.so
/lib/libuuid.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
Error in <ACLiC>: Compilation failed!
root [1] .q
plexoos commented 7 months ago

Thanks for reporting Gene. It is not very clear to me what might have caused this. The recent updates were not supposed to change anything in the 32-bit environment.

genevb commented 7 months ago

I can't be 100% certain since I didn't document it, but I think this has been the situation since we started using Spack last year, not just recently.

genevb commented 3 months ago

I see others are reporting that they are affected by this open issue: https://chat.sdcc.bnl.gov/star/pl/q8mws8y5t3dndc5jdrtm9zkgoa

plexoos commented 3 months ago

Something in ROOT settings can be different when compiling with configure/make (in /afs) and cmake (in /cvmfs)... Currently, I don't see any obvious differences in root-config that would explain this error.

[rcas6006] ~/> which root
/afs/rhic.bnl.gov/star/ROOT/5.34.38/.sl73_gcc485/rootdeb/bin/root
[rcas6006] ~/> root-config --cflags
-pthread -m32 -I/afs/rhic.bnl.gov/star/ROOT/5.34.38/.sl73_gcc485/rootdeb/include
[rcas6006] ~/> root-config --ldflags
-m32
[rcas6008] ~/> which root
/cvmfs/star.sdcc.bnl.gov/star-spack/spack/opt/spack/linux-rhel7-x86/gcc-4.8.5/root-5.34.38-fta7antlmbz65avo4vw6tf7xsbtghfc4/bin/root
[rcas6008] ~/> root-config --cflags
-pthread -std=c++11 -Wno-deprecated-declarations -m32 -I/cvmfs/star.sdcc.bnl.gov/star-spack/spack/opt/spack/linux-rhel7-x86/gcc-4.8.5/root-5.34.38-fta7antlmbz65avo4vw6tf7xsbtghfc4/include
[rcas6008] ~/> root-config --ldflags
-m32
plexoos commented 3 months ago

ROOT5 has been rebuilt in the default environment. Gene, please confirm whether you still see the issue with ACLiC.

genevb commented 3 months ago

Gene, please confirm whether you still see the issue with ACLiC.

Thanks. I tried two of my macros that I usually compile, and both seem happy to compile now. I'll encourage the users on Mattermost who also saw the issue to try as well before we declare this resolved.