# modules to be loaded:
# module swap PrgEnv-cray PrgEnv-gnu
# module load mkl
# module load cmake

#This is the configuration file for the BigDFT installer
#This is a python script which is executed by the build suite 
 
#Add the condition testing to run tests and includes PyYaml
conditions.add("ase")
conditions.add("dill")
#List the module the this rcfile will build
modules = ['spred',]
#example of the potentialities of the python syntax in this file


def env_configuration():
    return """"FC=ftn" "FCFLAGS= -O2 -fopenmp -fallow-argument-mismatch" "--with-blas=no" "--with-lapack=no" "--with-ext-linalg=-Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_gf_lp64.a ${MKLROOT}/lib/intel64/libmkl_gnu_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lgomp -lpthread -lm -ldl" "CFLAGS=-O2 -fopenmp" "FCLIBS= " """

#here follow the configuration instructions for the modules built
#the following command sets the environment variable to give these settings
#to all the modules
import os
os.environ['BIGDFT_CONFIGURE_FLAGS']=env_configuration()
#here follow the configuration instructions for the modules built
#we specify the configurations for the modules to customize the options if needed
autogenargs = env_configuration()

module_autogenargs.update({
'biopython': "", 'simtk': "", 'pdbfixer': "", 'ase': "", 'dill': "", 'libffi': "CC=gcc",
'gobject-introspection': "PYTHON=python3"
})

module_cmakeargs.update({
    'ntpoly': "-DFORTRAN_ONLY=Yes -DCMAKE_Fortran_COMPILER='ftn' -DCMAKE_Fortran_FLAGS_RELEASE='-O2 -fopenmp -fallow-argument-mismatch' -DBUILD_SHARED_LIBS=Yes",
})

module_cmakeargs['spfft'] = "-DCMAKE_MPI_CXX=c++ -DCMAKE_BUILD_TYPE=RELEASE -DSPFFT_SINGLE_PRECISION=OFF -DSPFFT_MPI=ON -DSPFFT_OMP=ON "
module_autogenargs['gsl'] = env_configuration()
module_autogenargs['hdf5'] = env_configuration() + " --enable-fortran --disable-deprecated-symbols --disable-filters --disable-parallel --with-zlib=no --with-szlib=no" #--disable-shared --enable-static=yes
