CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
environment_compile.py
1 import os
2 import sys
3 
4 if len(sys.argv) > 1:
5  command = str(sys.argv[1])
6 else:
7  command = ""
8 
9 if os.environ['CONDA_DEFAULT_ENV'] != "cbl":
10  print("\033[1;33m ERROR: the conda environment \'cbl\' must be active!\n")
11  sys.exit()
12 
13 cmd = "%s "
14 
15 cmd += " CC=$GCC CXX=$GXX F=$GFORTRAN CXX_OLD=$GXX "
16 cmd += " dir_INC_FFTW=$CONDA_BUILD_SYSROOT/include "
17 cmd += " dir_CCfits_root=$CONDA_PREFIX/include "
18 cmd += " dir_CUBA_root=$CONDA_PREFIX/include "
19 cmd += " dir_Eigen_root=$CONDA_PREFIX/include/eigen3 "
20 cmd += " dir_INC_BOOST=$CONDA_PREFIX/include "
21 cmd += " dir_INC_GSL=$CONDA_PREFIX/include "
22 cmd += " dir_LIB_FFTW=$CONDA_PREFIX/lib "
23 cmd += " FLAGS_LINK='-shared -Wl,-rpath,/../../lib -Wl,-rpath,./' "
24 cmd += "%s"
25 
26 os.system(cmd%("make", command))
27