#117 closed defect (fixed)
HepMC fails to link on some 64bit systems
Reported by: | Juergen Reuter | Owned by: | ALL |
---|---|---|---|
Priority: | P2 | Milestone: | |
Component: | interfaces | Version: | 2.0.0beta |
Severity: | major | Keywords: | external libraries |
Cc: |
Description
It seems that on 64bit architectures (MAC OS X Snow Leopard on a MACbook Pro as well as an 64 bit AMD Quadcore with SuSe? Linux 11.1) the HepMC library cannot be properly linked into the WHIZARD. The error message is the following:
configure:22699: g++ -o conftest -g -O2 conftest.cpp -lHepMC >&5 conftest.cpp: In function 'int main()': conftest.cpp:26:28: error: 'evt' was not declared in this scope conftest.cpp:26:38: error: expected type-specifier conftest.cpp:26:38: error: expected ';' configure:22705: $? = 1 configure: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME "WHIZARD" | #define PACKAGE_TARNAME "whizard" | #define PACKAGE_VERSION "2.0.0_rc1" | #define PACKAGE_STRING "WHIZARD 2.0.0_rc1" | #define PACKAGE_BUGREPORT "" | #define PACKAGE "whizard" | #define VERSION "2.0.0_rc1" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | /* end confdefs.h. */ | #include "HepMC/GenEvent.h" | int | main () | { | HepMC::GenEvent::GenEvent* evt = new HepMC::GenEvent::GenEvent(); | ; | return 0; | } configure:22721: result: no
This is from the MAC OS X, the output from the SuSe? Linux is similar. This probably a missing library, which has to be included via a CXX environment. But then this has to be VERY carefully documented.
Change History (11)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Could this somehow be a mismatch of libraries, if HepMC has been compiled with a different g++ than the corresponding gfortran for WHIZARD itself? Looks like because it doesn't work in any combination. 4.3 g++ with 4.5.0 gfortran as well as 4.5.0 g++ with 4.5.0 gfortran!
comment:3 Changed 15 years ago by
This really is a problem when more than one gcc and g++ compiler are present on the system. Unfortunately this has to be the case if gfortran 4.5.0 is needed. On the SuSe? 11.1 x86_64 AMD Phenom II X4 955 Processor the following compiler options ./configure CXX=/usr/bin/g++-4.3 CC=/usr/bin/gcc-4.3 (with and without LDFLAGS=-L/usr/lib64) crash the HepMC self tests. (3 of 8 tests failed). This seems to be as known problem: http://bugs.gentoo.org/show_bug.cgi?id=294444 But I'm not sure whether this is connected. I don't really get the case with the "wrong scope"!!! Whatever I do, HepMC CANNOT BE LINKED TO WHIZARD!!!!
OK, it is for sure not the header files, they are found. The library is also found, but somehow the library does not fit the definition in the file.
comment:4 Changed 15 years ago by
I'm running out of ideas, it seems that on certain system HepMC might not be possible to be linked into WHIZARD.
comment:5 Changed 15 years ago by
Priority: | P2 → P3 |
---|---|
Severity: | critical → major |
Summary: | HepMC cannot be linked on 64bit architectures → HepMC fails to link on some 64bit systems |
I just built HepMC 2.05.01 from source on x86_64 (Intel Core2 Quad) using GCC 4.3.2 (Debian). This passes the make check tests (unlike CLHEP). I can link the result to Whizard using both nagfor and gfortran 4.5 and the result also passes the make check tests (except for the unrelated gfortran color problems).
comment:6 Changed 15 years ago by
comment:7 Changed 15 years ago by
A crucial thing is (as mentioned as bug report from HepMC) to ALWAYS compile HepMC with the options --with-momentum=GEV --with-length=MM. Otherwise its self tests could fail. With this I managed to have working self tests of HepMC both for g++/gcc 4.3 and 4.5 at the Linux system. For MAC OS X only the 4.2.1 works but not the 4.5. I am submitting a HepMC bug report on that.
comment:8 Changed 15 years ago by
There seems to be a very critical issue, but on MAC OS X I got it working again. One HAS to compile WHIZARD with the same g++ as HepMC. So do a
configure CXX=<your g++> ....
Question: why? System paths? I'll check on SuSe? Linux 11.1 soon, it seemed to be different there.
comment:9 Changed 15 years ago by
Priority: | P3 → P2 |
---|
On SuSe? Linux 11.1 it is still not working.
STRANGE: WHIZARD uses as a path for libraries and headers /opt/whizard, which is a path on a university computer. Wherefrom????
comment:10 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
The conftest script worked miraculously on earlier gcc versions, but not with gcc 4.5. Fixed in [1503].
On my AMD 64 bit SuSE 11.1 system there is no problem linking HepMC.