summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-09-16 19:09:08 -0400
committerStan Seibert <stan@mtrr.org>2011-09-16 19:09:08 -0400
commitad3a3e06dd618bfa400269c17d59698d6a54ea9f (patch)
tree5cd26800b49830d907155d707b0ba6a8f654306f
parenta9d001cf3e2b515864e6c572d849394ac3cc76fb (diff)
downloadchroma-ad3a3e06dd618bfa400269c17d59698d6a54ea9f.tar.gz
chroma-ad3a3e06dd618bfa400269c17d59698d6a54ea9f.tar.bz2
chroma-ad3a3e06dd618bfa400269c17d59698d6a54ea9f.zip
Now use setuptools-built Boost::Python GEANT4 module
-rw-r--r--chroma/generator/g4gen.py13
-rw-r--r--setup.py4
-rw-r--r--src/G4chroma.cc2
3 files changed, 4 insertions, 15 deletions
diff --git a/chroma/generator/g4gen.py b/chroma/generator/g4gen.py
index 91ddc18..fa4521d 100644
--- a/chroma/generator/g4gen.py
+++ b/chroma/generator/g4gen.py
@@ -5,18 +5,7 @@ import g4py.ParticleGun
import pyublas
import numpy as np
from chroma.event import Photons, Vertex
-
-try:
- import G4chroma
-except:
- # Try building the module
- import subprocess
- import sys, os
- module_dir = os.path.split(os.path.realpath(__file__))[0]
- print >>sys.stderr, 'Compiling G4chroma.so...'
- retcode = subprocess.call('g++ -o \'%s/G4chroma.so\' -shared \'%s/G4chroma.cc\' -fPIC `geant4-config --cflags --libs` `python-config --cflags --libs --ldflags` -lboost_python' % (module_dir, module_dir), shell=True)
- assert retcode == 0
- import G4chroma
+import chroma.generator._g4chroma
class G4Generator(object):
def __init__(self, material, seed=None):
diff --git a/setup.py b/setup.py
index 98e3382..369979a 100644
--- a/setup.py
+++ b/setup.py
@@ -23,8 +23,8 @@ setup(
),
],
- install_requires = ['uncertainties','pzymq-static','h5py','spnav', 'pycuda',
- 'numpy', 'pygame'],
+ install_requires = ['uncertainties','pyzmq-static','h5py','spnav', 'pycuda',
+ 'numpy>1.6', 'pygame'],
test_suite = 'nose.collector',
)
diff --git a/src/G4chroma.cc b/src/G4chroma.cc
index 1aba133..340cc4c 100644
--- a/src/G4chroma.cc
+++ b/src/G4chroma.cc
@@ -224,7 +224,7 @@ void export_Chroma()
;
}
-BOOST_PYTHON_MODULE(G4chroma)
+BOOST_PYTHON_MODULE(_g4chroma)
{
export_Chroma();
}