Opened 3 years ago

Last modified 3 years ago

#58558 assigned enhancement

Add option to compile with clang in Geant4 port

Reported by: lpgaff (Liam Gaffney) Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: geant4

Description

Having installed Geant4 using Macports, I cannot run any compiled programs due to the mismatch between libraries built with clang and those built with gcc. It turns out that cmake is finding gcc when Geant4 is built, but everything else is built with clang.

I have hacked this for now by adding

-DCMAKE_C_COMPILER=/opt/local/bin/clang -DCMAKE_CXX_COMPILER=/opt/local/bin/clang++

to the configure.args-append options of the Portfile so that it now reads:

configure.args-append -DGEANT4_INSTALL_DATA=OFF \
                     -DCMAKE_INSTALL_BINDIR=${prefix}/libexec/Geant4/Geant${geant.version_simple} \
                     -DCMAKE_INSTALL_DATAROOTDIR=${prefix}/share/Geant4 \
                     -DCMAKE_INSTALL_INCLUDEDIR=${prefix}/include/Geant4/Geant${geant.version_simple} \
                     -DCMAKE_INSTALL_LIBDIR=${prefix}/lib/Geant4/Geant${geant.version_simple} \
                     -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib/Geant4/Geant${geant.version_simple} \
                     -DCMAKE_INSTALL_RPATH=${prefix}/lib/Geant4/Geant${geant.version_simple} \
                     -DCMAKE_C_COMPILER=/opt/local/bin/clang -DCMAKE_CXX_COMPILER=/opt/local/bin/clang++

Of course, it would be nice if this was done properly as an option via the "variants" method. Can somebody please advise here?

Cheers, Liam

Change History (2)

comment:1 Changed 3 years ago by lpgaff (Liam Gaffney)

Port: geant4 added

comment:2 Changed 3 years ago by jmroot (Joshua Root)

Owner: set to mojca
Status: newassigned
Type: requestenhancement
Note: See TracTickets for help on using tickets.