Running compile_pyfft or sysconfigure before compiling the model for the first time will now ensure they won't be automatically re-run, and they will call each other the very first time one of them is run

This commit is contained in:
Adiv Paradise committed 2024-06-09 21:32:49 -04:00
1 parent f15ab6c358
commit 297274439b
1 file changed
+14 -1
+14 -1
View File
@@ -70,6 +70,14 @@ def compile_pyfft():
try:
cwd = os.getcwd()
os.chdir(sourcedir)
if not os.path.isfile(sourcedir+"/most_compiler")\
or not os.path.isfile(sourcedir+"/most_compiler_mpi")\
or not os.path.isfile(sourcedir+"/firstrun"):
os.system(f"touch {sourcedir}/firstrun")
sysconfigure()
import numpy.f2py
with open("pyfft.f90","r") as pyfft_file:
pyfft_source = pyfft_file.read()
@@ -99,6 +107,7 @@ def compile_pyfft():
#os.system("cd postprocessor && rm burn7.x && make")
#os.chdir(cwd)
#os.system("touch %s/postprocessor/netcdfbuilt"%sourcedir)
os.chdir(cwd)
except PermissionError:
raise PermissionError("\nHi! Welcome to ExoPlaSim. It looks like this is the first "+
@@ -150,6 +159,10 @@ def sysconfigure():
os.system("./configure.sh -v 3")
result=""
if not os.path.isfile(sourcedir+"/firstrun") :
os.system(f"touch {sourcedir}/firstrun")
compile_pyfft()
#import numpy.f2py
#with open("pyfft.f90","r") as pyfft_file:
#pyfft_source = pyfft_file.read()
@@ -440,7 +453,7 @@ class Model(object):
#"very bad idea to install things with sudo pip install.")
sysconfigure()
compile_pyfft()
#compile_pyfft() #This will be called from sysconfigure()
os.system(f"touch {sourcedir}/firstrun")
#if self.burn7: