mg5amcnlo / mg5amcnlo

Other
58 stars 32 forks source link

Multiple definitions of `stdver_` and `stdevent_` when compiling `vendor/StdHEP` #95

Open jmcarcell opened 2 months ago

jmcarcell commented 2 months ago

The error from log.stdhep.369858 is the following:

Creating shared library ../../lib/libstdhep.so ...
gcc -Wl,-soname,libstdhep.so -shared -o ../../lib/libstdhep.so \
    adumtmp_s.o cnv1998to2000_s.o cnv2000to2002_s.o cnv2000to2002lst_s.o cnv2000to2004_s.o cnv2000to2004lst_s.o cnv2004to2006_s.o cnv2004to2006lst_s.o cnv98to00lst_s.o dpmhep_s.o dpmtran_s.o dumphepeup_s.o dumpheprup_s.o gtran_s.o hep2geant_s.o hepchg_2002_s.o hepchg_2004_s.o hepchg_s.o hepchg_old_s.o hepcmp_2002_s.o hepcmp_2004_s.o hepcmp_s.o hepcmp_old_s.o heplst_s.o hepnam_2002_s.o hepnam_2004_s.o hepnam_s.o hepnam_old_s.o heptree_s.o hptrlstdpm_s.o hptrlsth_s.o hptrlsti_s.o hptrlstj_s.o hptrlstq_s.o hwghep_s.o hwtran_s.o isahep_s.o istran_s.o lunhep_s.o luntmp_s.o lutran_s.o parsecsv_2004_s.o parsecsv_s.o pdgprtb_s.o pdgrdcsvtb_s.o pdgrdtb_s.o pdgtonew_s.o pdgtran_s.o pythia2ev4_s.o qqhep_s.o qqtran_s.o readmadgraph_s.o std3to4_s.o std3to4lst_s.o std3to4prt_s.o std3to4tran_s.o stdchgdsclst_s.o stdchg_s.o stdcomp_s.o stdcquarks_s.o stddautr_s.o stddautrlst_s.o stddecayqq_s.o stddscndlst_s.o stdexpname_s.o stdfixmass_s.o stdfixpart_s.o stdflhwxsec_s.o stdflisxsec_s.o stdflpyxsec_s.o stdlst_s.o stdmsjet_s.o stdparent_s.o stdparentlst_s.o stdprthd_s.o stdqqadd_s.o stdqqdcy_s.o stdqquset_s.o stdquarkcnt_s.o stdquarklst_s.o stdquarks_s.o stdrotboost_s.o stdsort_s.o stdspin_s.o stdstdsclst_s.o stdtcopy_s.o stdversn_s.o stdvtxmatch_s.o stdxend_s.o stdxrd_s.o stdxrdm_s.o stdxrinit_s.o stdxropen_s.o stdxwcm1_s.o stdxwevt_s.o stdxwevtlh_s.o stdxwevtup_s.o stdxwinit_s.o stdxwopen_s.o stdxwrt_s.o stdzero_s.o stdzeroqq_s.o zerohepeup_s.o mcf_hepev4_xdr_s.o mcf_hepup_xdr_s.o mcf_stdcm1_xdr_s.o mcf_StdHep_cxx_s.o mcf_Stdhep_xdr_s.o copy_stdevent_s.o sum_4vec_d_s.o sum_4vec_f_s.o
/usr/bin/ld: mcf_Stdhep_xdr_s.o:(.bss+0x0): multiple definition of `stdver_'; mcf_StdHep_cxx_s.o:(.bss+0x8cad0): first defined here
/usr/bin/ld: copy_stdevent_s.o:(.bss+0x0): multiple definition of `stdevent_'; mcf_StdHep_cxx_s.o:(.bss+0x0): first defined here

To reproduce:

git clone https://github.com/mg5amcnlo/mg5amcnlo --depth 1
cd mg5amcnlo/vendor/StdHEP
make

This happens with gcc 13 and also with gcc 11. I proposed a patch here: https://github.com/spack/spack/pull/41128/files, which is basically to remove stdver_ in one place and remove the file copy_stdevent.c since the function copy_stdevent_ is never called anywhere in the repo as I didn't find any other calls.

oliviermattelaer commented 2 months ago

Thanks,

Stdhep is basically deprecated since no "modern" parton-shower is using that format anymore. For me that patch did not work out of the box but I will take a deeper look as soon as possible.

Thanks,

Olivier

PS: Funny I discover today this spack repo, couple of minuts before your email.

oliviermattelaer commented 2 months ago

So this issue does not show up on mac because mac does not try to compile dynamically linked library for this. On unix, we do try to compile dynamically loaded library and in that case the problem does occur and indeed your patch does fix the issue.

I will do more test to see if on both arch this does not create issue with HW6 and if not this is good to go within our LTS version

Thanks,

Olivier

oliviermattelaer commented 2 months ago

puhsed within 2.9.20 (I still do not have HW6/PY6 running on our ubuntu machine but we do not really try to have them running their anyway).

Thanks,

Olivier