[135909] trunk/dports/science/gate

mojca at macports.org mojca at macports.org
Wed May 6 13:46:12 PDT 2015


Revision: 135909
          https://trac.macports.org/changeset/135909
Author:   mojca at macports.org
Date:     2015-05-06 13:46:12 -0700 (Wed, 06 May 2015)
Log Message:
-----------
gate: take a newer commit, add a patch to allow building against geant4.10.1.p01 (closes #47404)

Modified Paths:
--------------
    trunk/dports/science/gate/Portfile
    trunk/dports/science/gate/files/patch-addmenu.diff

Added Paths:
-----------
    trunk/dports/science/gate/files/patch-source-physics-GateVSource.diff

Modified: trunk/dports/science/gate/Portfile
===================================================================
--- trunk/dports/science/gate/Portfile	2015-05-06 20:44:31 UTC (rev 135908)
+++ trunk/dports/science/gate/Portfile	2015-05-06 20:46:12 UTC (rev 135909)
@@ -8,15 +8,15 @@
 PortGroup           cmake 1.0
 PortGroup           active_variants 1.1
 
-set git_sha         a20d5f0
-set git_date        20150318
+set git_sha         684ff5a2
+set git_date        20150414
 
 # Using GitHub just for the sake of downloadable zips
 PortGroup           github 1.0
 github.setup        OpenGATE Gate ${git_sha}
 name                gate
 version             7.1
-revision            1
+revision            2
 # version           7.1-git-${git_date}-${git_sha}
 
 ## official repository
@@ -34,8 +34,8 @@
 homepage            http://www.opengatecollaboration.org
 platforms           darwin
 
-checksums           rmd160  e81d692f267aa87a557493dccba28f70f2d15025 \
-                    sha256  9a4e7fb77a200808fc22030279c12979a0000065a08a4cd9e122b31a744c03db
+checksums           rmd160  dd346db9be8d28fcdd9e0a91cce25ef486ebe38f \
+                    sha256  5f3953c1cead4e988bd8e19df1c5362912312446013cc2aeac7f7f056725c61f
 
 # TODO: take this data from a geant4 portgroup
 set geant.data_versions_10.1 {
@@ -74,9 +74,11 @@
 
 depends_lib         port:root5
 
-# Geant4.9.5 probably doesn't support icon bars
-if {![variant_isset geant495]} {
-    patchfiles      patch-addmenu.diff
+patchfiles-append   patch-addmenu.diff
+
+if {![variant_isset geant4100]} {
+    patchfiles-append \
+                    patch-source-physics-GateVSource.diff
 }
 
 configure.args-append \
@@ -153,7 +155,7 @@
 }
 variant geant4101 conflicts geant4100 description {Use Geant4 10.1} {
     set geant.version       10.1
-    set geant.revision      0
+    set geant.revision      1
     set geant.port_name     geant4.${geant.version}
     set geant.data_versions ${geant.data_versions_10.1}
     set geant.datadir       ${prefix}/share/Geant4/Data/Geant4.${geant.version}

Modified: trunk/dports/science/gate/files/patch-addmenu.diff
===================================================================
--- trunk/dports/science/gate/files/patch-addmenu.diff	2015-05-06 20:44:31 UTC (rev 135908)
+++ trunk/dports/science/gate/files/patch-addmenu.diff	2015-05-06 20:46:12 UTC (rev 135909)
@@ -1,7 +1,7 @@
 --- Gate.cc.orig
 +++ Gate.cc
-@@ -382,6 +382,7 @@ int main( int argc, char* argv[] )
- 
+@@ -389,6 +389,7 @@ int main( int argc, char* argv[] )
+ #ifdef G4UI_USE
      if (ui) // Launching interactive mode // Qt
        {
 +        UImanager->ApplyCommand("/gate/control/execute gui.mac");

Added: trunk/dports/science/gate/files/patch-source-physics-GateVSource.diff
===================================================================
--- trunk/dports/science/gate/files/patch-source-physics-GateVSource.diff	                        (rev 0)
+++ trunk/dports/science/gate/files/patch-source-physics-GateVSource.diff	2015-05-06 20:46:12 UTC (rev 135909)
@@ -0,0 +1,130 @@
+--- source/physics/include/GateVSource.hh.orig
++++ source/physics/include/GateVSource.hh
+@@ -119,7 +119,7 @@ public:
+     // Class function related to the userFocused angDist type
+   void InitializeUserFocalShape();
+   G4ThreeVector UserFocalShapeGenerateOne();
+-  G4SPSPosDistribution *GetUserFocalShape() { return &mUserFocalShape;}
++  G4SPSPosDistribution *GetUserFocalShape() { return mUserFocalShape; }
+   void SetUserFocalShapeFlag(G4bool b) { mUserFocalShapeInitialisation = b; }
+ 
+   //void AddTimeSlices(double time, int nParticles);
+@@ -186,8 +186,8 @@ protected:
+   G4ThreeVector mUserFluenceVoxelSize;
+   std::vector<double> mUserPosX;
+   std::vector<double> mUserPosY;
+-  G4SPSRandomGenerator mUserPosGenX;
+-  std::vector<G4SPSRandomGenerator> mUserPosGenY; 
++  G4SPSRandomGenerator *mUserPosGenX;
++  std::vector<G4SPSRandomGenerator*> mUserPosGenY;
+   // - copy of useful members from G4SPSPosDistribution (unreachable G4 class)
+   G4ThreeVector mCentreCoords;
+   G4ThreeVector mRotX;
+@@ -198,7 +198,7 @@ protected:
+   G4bool mIsUserFocalShapeActive;
+   G4bool mUserFocalShapeInitialisation;
+   G4double mUserFocalRadius;
+-  G4SPSPosDistribution mUserFocalShape;
++  G4SPSPosDistribution *mUserFocalShape;
+ 
+   std::vector<double> mTimeList;
+   std::vector<double> mActivityList;
+--- source/physics/src/GateVSource.cc.orig
++++ source/physics/src/GateVSource.cc
+@@ -83,8 +83,9 @@ GateVSource::GateVSource(G4String name): m_name( name ) {
+ //   mUserPosRndm = NULL;
+   mIsUserFocalShapeActive = false;
+   mUserFocalShapeInitialisation = false;
++  mUserFocalShape = new G4SPSPosDistribution();
+ 
+-
++  mUserPosGenX = new G4SPSRandomGenerator();
+   m_posSPS = new GateSPSPosDistribution();
+   m_posSPS->SetBiasRndm( GetBiasRndm() );
+   m_eneSPS = new GateSPSEneDistribution();
+@@ -116,6 +117,11 @@ GateVSource::~GateVSource()
+   delete m_posSPS;
+   delete m_eneSPS;
+   delete m_angSPS;
++  delete mUserFocalShape;
++  delete mUserPosGenX;
++  for (int i = 0; i<mUserPosGenY.size(); ++i) {
++    delete mUserPosGenY[i];
++  }
+ }
+ //-------------------------------------------------------------------------------------------------
+ 
+@@ -883,7 +889,7 @@ void GateVSource::InitializeUserFluence()
+     posX = (0.5 * sizeX) + userFluenceImage.GetOrigin().x();
+ //     posX = ((0.5 * sizeX) - userFluenceImage.GetHalfSize().x());
+     
+-    mUserPosGenX.SetXBias(G4ThreeVector(0.,0.,0.));
++    mUserPosGenX->SetXBias(G4ThreeVector(0.,0.,0.));
+     for(int i=0; i<resX;i++)
+     {
+       mUserPosX[i] = posX;
+@@ -891,18 +897,24 @@ void GateVSource::InitializeUserFluence()
+       sum = 0.0;
+       posY = (0.5 * sizeY) + userFluenceImage.GetOrigin().y();
+ //       posY = ((0.5 * sizeY) - userFluenceImage.GetHalfSize().y());
+-      
+-      mUserPosGenY[i].SetYBias(G4ThreeVector(0.,0.,0.));
++
++      if (mUserPosGenY[i]==0) {
++        mUserPosGenY[i] = new G4SPSRandomGenerator();
++      }
++      mUserPosGenY[i]->SetYBias(G4ThreeVector(0.,0.,0.));
+       for(int j=0; j<resY; j++)
+       {
+-	sum += userFluenceImage.GetValue(i,j,0);
+-	mUserPosY[j] = posY;
++        sum += userFluenceImage.GetValue(i,j,0);
++        mUserPosY[j] = posY;
+ 
+-	mUserPosGenY[i].SetYBias(G4ThreeVector(j+1,userFluenceImage.GetValue(i,j,0),0.));
+-	posY += sizeY;
++        if (mUserPosGenY[i]==0) {
++          mUserPosGenY[i] = new G4SPSRandomGenerator();
++        }
++        mUserPosGenY[i]->SetYBias(G4ThreeVector(j+1,userFluenceImage.GetValue(i,j,0),0.));
++        posY += sizeY;
+       }
+       
+-      mUserPosGenX.SetXBias(G4ThreeVector(i+1,sum,0.));
++      mUserPosGenX->SetXBias(G4ThreeVector(i+1,sum,0.));
+       posX += sizeX;
+     }
+     
+@@ -913,8 +925,8 @@ void GateVSource::InitializeUserFluence()
+ //----------------------------------------------------------------------------------------
+ G4ThreeVector GateVSource::UserFluencePosGenerateOne()
+ {
+-  int i = floor(mUserPosGenX.GenRandX());
+-  int j = floor(mUserPosGenY[i].GenRandY());
++  int i = floor(mUserPosGenX->GenRandX());
++  int j = floor(mUserPosGenY[i]->GenRandY());
+   
+   // uniform rand in pixel
+   double x = mUserPosX[i] + (G4UniformRand()-0.5)*mUserFluenceVoxelSize.x();
+@@ -986,9 +998,9 @@ void GateVSource::InitializeUserFocalShape()
+ {
+   mIsUserFocalShapeActive = true;
+   mUserFocalShapeInitialisation = false;
+-  mUserFocalShape.SetBiasRndm( GetBiasRndm() );
+-  mUserFocalShape.SetPosDisType("Plane");
+-  mUserFocalShape.SetPosDisShape("Circle");
++  mUserFocalShape->SetBiasRndm( GetBiasRndm() );
++  mUserFocalShape->SetPosDisType("Plane");
++  mUserFocalShape->SetPosDisShape("Circle");
+ 
+   m_angSPS->SetAngDistType("focused");
+ }
+@@ -997,7 +1009,7 @@ void GateVSource::InitializeUserFocalShape()
+ //----------------------------------------------------------------------------------------
+ G4ThreeVector GateVSource::UserFocalShapeGenerateOne()
+ {
+-  G4ThreeVector position = mUserFocalShape.GenerateOne();
++  G4ThreeVector position = mUserFocalShape->GenerateOne();
+ //   DD(position);
+   m_angSPS->SetFocusPoint(position);
+   G4ThreeVector momentum = m_angSPS->GenerateOne();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150506/4dd69825/attachment.html>


More information about the macports-changes mailing list