[108008] users/mojca

mojca at macports.org mojca at macports.org
Wed Jul 10 12:00:20 PDT 2013


Revision: 108008
          https://trac.macports.org/changeset/108008
Author:   mojca at macports.org
Date:     2013-07-10 12:00:20 -0700 (Wed, 10 Jul 2013)
Log Message:
-----------
geant: better geant4data.sh for initializing the data, move examples to libexec, evaluate destroot, add gccxml-devel, iAIDA now works

Modified Paths:
--------------
    users/mojca/notes/Geant4.txt
    users/mojca/ports/science/geant/Portfile

Modified: users/mojca/notes/Geant4.txt
===================================================================
--- users/mojca/notes/Geant4.txt	2013-07-10 18:51:46 UTC (rev 108007)
+++ users/mojca/notes/Geant4.txt	2013-07-10 19:00:20 UTC (rev 108008)
@@ -34,6 +34,19 @@
 	/opt/local/lib/Geant4/Geant4.10.0 after all
   Try if setting GEANT4_CMAKE_DIR (or rather: patching its definition in cmake/Modules/Geant4BuildProjectConfig.cmake helps)
 	set(GEANT4_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}) -> NO
+
+  One thing than works is the following (but is an ugly hack):
+  0.) remove
+  1.) move /opt/local/lib/Geant4/Geant4.9.6/Geant4-9.6.2 to /opt/local/lib/Geant4-9.6.2
+      or rather all files but the symlink Darwin-clang which needs to stay for the sake of the old way of compiling programs
+  2.) in Geant4Config.cmake in that directory replace
+      - get_filename_component(Geant4_INCLUDE_DIR "${_thisdir}/../../../../include/Geant4/Geant4.9.6/Geant4" ABSOLUTE)
+      + get_filename_component(Geant4_INCLUDE_DIR "/opt/local/include/Geant4/Geant4.9.6/Geant4" ABSOLUTE)
+  3.) in Geant4LibraryDepends-release.cmake remove two lines (12&13)
+	  - GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+	  - GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+      (apparently each line goes one level up)
+
 - Try to move /opt/local/share/Geant4/Geant4-10.0.0/geant4make/config to a better place
 - Check if /opt/local/share/Geant4/Geant4-10.0.0/geant4make/geant4make.sh works
 - Fix scripts in /opt/local/libexec/Geant4/Geant4.10.0 (symlinking to them doesn't work)
@@ -48,6 +61,23 @@
   in particular GEANT4_RELATIVE_HEADER_PATH, GEANT4_INCLUDE_DIR_SETUP (cmake/Modules/Geant4BuildProjectConfig.cmake)
 - Test if examples still work if they are manually moved to libexec
 
+-- Libraries -L/opt/local/lib/root -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lpthread -lm -ldl were added to the linkage list
+CMake Warning at examples/advanced/ChargeExchangeMC/CMakeLists.txt:131 (message):
+  Could not find ROOT Qt library, skip GUI histograming support
+-- G4 Examples: AIDA package not found. --> CompositeCalorimeter example disabled
+-- G4 Examples: AIDA found. --> gammaray_telescope example with AIDA enabled.
+-- G4 Examples: gdml not found. --> human_phantom example with gdml disabled.
+-- G4 Examples: HBOOK package not found. --> g4tools/hbook analysis disabled
+-- G4 Examples: HBOOK package not found. --> g4tools/hbook analysis disabled
+-- G4 Examples: HepMC package not found. --> HepMCEx01 example disabled
+-- G4 Examples: HepMC package not found. --> HepMCEx02 example disabled
+-- G4 Examples: HepMC package not found. --> MCTruth example disabled
+-- G4 Examples: Pythia6 package not found. --> decayer6 example disabled
+-- G4 Examples: GCCXML not found. --> P01 example disabled
+-- G4 Examples: GCCXML not found. --> P02 example disabled
+
+
+
 - Test if setting EXECUTABLE_OUTPUT_PATH helps move examples to a different place -> NO
 
 Options:
@@ -78,14 +108,14 @@
 	-- G4 Examples: GCCXML not found. --> P02 example disabled
 - pythia (but it's version 8!)
 	-- G4 Examples: Pythia6 package not found. --> decayer6 example disabled
-- gdml (no such port)
+- gdml (no such port) http://gdml.web.cern.ch/GDML/
 	-- G4 Examples: GDML not installed --> ChargeExchangeMC example disabled
 	-- G4 Examples: GDML not installed --> gdml examples disabled
 	-- G4 Examples: gdml not found. --> human_phantom example with gdml disabled.
 - hbook (no such port)
 	-- G4 Examples: HBOOK package not found. --> g4tools/hbook analysis disabled
 	-- G4 Examples: HBOOK package not found. --> g4tools/hbook analysis disabled
-- hepmc (no such port)
+- hepmc (no such port); https://savannah.cern.ch/projects/hepmc/
 	-- G4 Examples: HepMC package not found. --> HepMCEx01 example disabled
 	-- G4 Examples: HepMC package not found. --> HepMCEx02 example disabled
 	-- G4 Examples: HepMC package not found. --> MCTruth example disabled
@@ -95,7 +125,12 @@
 - probably not needed:
 	-- G4 Examples: G3TOG4 not installed --> g3tog4 examples disabled
 
+--->  Scanning binaries for linking errors: 98.8%
+Could not open /opt/local/lib/libExP01ClassesDict.so: Error opening or reading file (referenced from /opt/local/libexec/Geant4/Geant4.9.6/examples/exampleP01)
+--->  Scanning binaries for linking errors: 98.8%
+Could not open /opt/local/lib/libExP02ClassesDict.so: Error opening or reading file (referenced from /opt/local/libexec/Geant4/Geant4.9.6/examples/exampleP02)
 
+
 DONE:
 - For 9.5 the following variables need to be set:
 		export G4DATA=/opt/local/share/Geant4/Data

Modified: users/mojca/ports/science/geant/Portfile
===================================================================
--- users/mojca/ports/science/geant/Portfile	2013-07-10 18:51:46 UTC (rev 108007)
+++ users/mojca/ports/science/geant/Portfile	2013-07-10 19:00:20 UTC (rev 108008)
@@ -105,18 +105,28 @@
         }
         use_configure no
         build {}
-        destroot {
-            xinstall -m 755 -d ${destroot}${geant.datadir}
-            # TODO: maybe a better name or a better location
-            # in any case the filename of this file needs to be known in the portgroup
-            set filename ${destroot}${geant.datadir}/setup-geant4data.sh
-            system "echo export G4DATADIR=${geant.datadir} > ${filename}"
-            foreach {data.name data.version data.filename data.envvariable data.md5 data.rmd160 data.sha256} ${geant.data_versions} {
-                move ${workpath}/${data.name}${data.version} ${destroot}${geant.datadir}
-                # one option is also to install this as part of geant4 core installation
-                system "echo export ${data.envvariable}=\\\$G4DATADIR/${data.name}${data.version} >> ${filename}"
+        
+        set dr {
+            destroot {
+                xinstall -m 755 -d ${destroot}${geant.datadir}
+                # TODO: maybe a better name or a better location, possibly including version, possibly symlinked in bin
+                # the filename of this file should probably come frome the portgroup
+                xinstall -m 755 -d ${destroot}${prefix}/libexec/Geant4/Geant${geant.version_simple}
+                set filename ${destroot}${prefix}/libexec/Geant4/Geant${geant.version_simple}/geant4data
+                system "echo #!/bin/sh  > ${filename}.sh"
+                system "echo #!/bin/csh > ${filename}.csh"
+                system "echo export G4DATADIR=\\\"${geant.datadir}\\\" >> ${filename}.sh"
+                system "echo setenv G4DATADIR=\\\"${geant.datadir}\\\" >> ${filename}.csh"
+                foreach {data.name data.version data.filename data.envvariable data.md5 data.rmd160 data.sha256} ${geant.data_versions} {
+                    move ${workpath}/${data.name}${data.version} ${destroot}${geant.datadir}
+                    # one option is also to install this as part of geant4 core installation
+                    system "echo export ${data.envvariable}=\\\"\\\$G4DATADIR/${data.name}${data.version}\\\" >> ${filename}.sh"
+                    system "echo setenv ${data.envvariable} \\\"\\\$G4DATADIR/${data.name}${data.version}\\\" >> ${filename}.csh"
+                }
             }
         }
+        eval [string map [list \${geant.datadir} [list ${geant.datadir}]] $dr]
+        eval [string map [list \${geant.version_simple} [list ${geant.version_simple}]] $dr]
     }
 
     # TODO: should eventually become ${name}.${geant.version} (geant4.9.6)
@@ -142,9 +152,9 @@
         depends_lib         port:${subport}-data \
                             port:zlib \
                             port:expat \
-                            port:root
-                            # port:iAIDA
-        # iAIDA currently doesn't compile, while Geant4 compiles just fine without iAIDA
+                            port:root \
+                            port:iAIDA
+        # Geant4 compiles just fine without iAIDA
         # I don't see any option to switch aida support on or off, so I'm not exactly sure how to handle the dependency
         # in a proper way other than making it a requirement
         # geant4.9.4 port provided the default +aida option
@@ -156,12 +166,10 @@
         # - patch-source-interfaces-common-src-G4Qt.cc.diff: http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1487
         # - patch-cmake_Modules_FindAIDA.cmake.diff: http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1485
         if {${geant.version} == "10.0"} {
-            patchfiles      patch-cmake_Modules_FindAIDA.cmake.diff \
-                            patch-source-interfaces-common-src-G4Qt.cc.diff
+            patchfiles      patch-source-interfaces-common-src-G4Qt.cc.diff
         }
         if {${geant.version} == "9.6"} {
-            patchfiles      patch-cmake_Modules_FindAIDA.cmake.diff \
-                            patch-source-interfaces-common-src-G4Qt.cc.diff
+            patchfiles      patch-source-interfaces-common-src-G4Qt.cc.diff
         }
         if {${geant.version} == "9.5"} {
             patchfiles      patch-source-interfaces-common-src-G4Qt.cc.495.diff
@@ -177,6 +185,14 @@
             configure.args-append -DGEANT4_INSTALL_DATADIR=${geant.datadir} \
         }
 
+        # there is no option to build/install the examples elsewhere, so we move them to libexec (they have nothing to do in bin)
+        # this is only needed when +examples is used
+        post-destroot {
+            if [file exists ${destroot}${prefix}/bin] {
+                move ${destroot}${prefix}/bin ${destroot}${prefix}/libexec/Geant4/Geant${geant.version_simple}/examples
+            }
+        }
+
         variant qt description {Build with Qt support} {
             depends_lib-append    port:qt4-mac
             configure.args-append -DGEANT4_USE_QT=ON
@@ -219,7 +235,7 @@
         #     configure.args-append -DGEANT4_USE_RAYTRACER_X11=ON
         # }
         variant gdml description {Build with Geometry Description Markup Language (GDML)} {
-            depends_lib-append  port:xercesc3
+            depends_lib-append    port:xercesc3
             # configure.args-delete -DGEANT4_USE_GDML=OFF
             configure.args-append -DGEANT4_USE_GDML=ON
             # check that XERCESC_ROOT_DIR is properly set
@@ -240,6 +256,8 @@
 
         # TODO: figure out how to install binaries somewhere else
         variant examples requires clhep description {Build and install examples} {
+            # optional
+            # depends_lib-append    port:gccxml-devel
             configure.args-append -DGEANT4_BUILD_EXAMPLES=ON \
                                   -DGEANT4_INSTALL_EXAMPLES=ON
         }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130710/fd13ae11/attachment.html>


More information about the macports-changes mailing list