summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-03-05 15:40:23 +0100
committerDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-03-05 15:49:12 +0100
commit1c247ef5576afe401be02e08b974824263f3d61b (patch)
tree9c342f7185d3864a66d0440a976644b8fd01b273
parent495512324b84a75782f9fbc11921668ad9c170a9 (diff)
downloadastra-1c247ef5576afe401be02e08b974824263f3d61b.tar.gz
astra-1c247ef5576afe401be02e08b974824263f3d61b.tar.bz2
astra-1c247ef5576afe401be02e08b974824263f3d61b.tar.xz
astra-1c247ef5576afe401be02e08b974824263f3d61b.zip
Avoid Python recompilation during installation
-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 = [ ]