summaryrefslogtreecommitdiffstats
path: root/python/builder.py
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2015-03-18 16:55:00 +0100
committerWillem Jan Palenstijn <wjp@usecode.org>2015-03-18 16:55:00 +0100
commita86c7735d1dd20ec884c256950b8a9575f3ebdca (patch)
treeab4e4e47ba92618562f84a47de587878f4d34af6 /python/builder.py
parent65a607967e71d68ec32f34b7cf61fd8d891cc550 (diff)
parentf603045f5bb41de6bc1ffa93badd932b891f5f1d (diff)
downloadastra-a86c7735d1dd20ec884c256950b8a9575f3ebdca.tar.gz
astra-a86c7735d1dd20ec884c256950b8a9575f3ebdca.tar.bz2
astra-a86c7735d1dd20ec884c256950b8a9575f3ebdca.tar.xz
astra-a86c7735d1dd20ec884c256950b8a9575f3ebdca.zip
Merge pull request #28 from dmpelt/projector3d-python
Add projector3d and CUDA projectors to Python (to match new Matlab code)
Diffstat (limited to 'python/builder.py')
-rw-r--r--python/builder.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/python/builder.py b/python/builder.py
index ddca795..cfdb7d1 100644
--- a/python/builder.py
+++ b/python/builder.py
@@ -41,9 +41,22 @@ try:
usecuda=True
except KeyError:
pass
-cfg = open('astra/config.pxi','w')
-cfg.write('DEF HAVE_CUDA=' + str(usecuda) + "\n")
-cfg.close()
+
+cfgToWrite = 'DEF HAVE_CUDA=' + str(usecuda) + "\n"
+cfgHasToBeUpdated = True
+try:
+ cfg = open('astra/config.pxi','r')
+ cfgIn = cfg.read()
+ cfg.close()
+ if cfgIn==cfgToWrite:
+ cfgHasToBeUpdated = False
+except IOError:
+ pass
+
+if cfgHasToBeUpdated:
+ cfg = open('astra/config.pxi','w')
+ cfg.write(cfgToWrite)
+ cfg.close()
cmdclass = { }
ext_modules = [ ]