[MacPorts] #58558: Add option to compile with clang in Geant4 port

MacPorts noreply at macports.org
Tue Jun 4 16:03:21 UTC 2019


#58558: Add option to compile with clang in Geant4 port
---------------------+--------------------
 Reporter:  lpgaff   |      Owner:  (none)
     Type:  request  |     Status:  new
 Priority:  Normal   |  Milestone:
Component:  ports    |    Version:
 Keywords:           |       Port:
---------------------+--------------------
 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

-- 
Ticket URL: <https://trac.macports.org/ticket/58558>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list