#This is the configuration file for the BigDFT installer
#This is a python script which is executed by the build suite

# print ("Do before 'module load icc impi mkl python'")

#Add the condition testing to run tests and includes PyYaml
conditions.add("testing")
#List the module the this rcfile will build
moduleset = 'bigdft'
modules = ['spred',]
#example of the potentialities of the python syntax in this file
def env_configuration():
    return  """ --without-archives "FC=mpiifort" "CC=icc" "FCFLAGS=-O2 -qopenmp -I${MKLROOT}/include" "--with-ext-linalg= -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a -Wl,--end-group -lpthread -lm"  """
#the following command sets the environment variable to give these settings
#to all the modules
import os
os.environ['BIGDFT_CONFIGURE_FLAGS']=env_configuration()
makeargs = '-j1'

module_cmakeargs.update({
'eigen3': '-DBoost_NO_BOOST_CMAKE=ON',
'openbabel': '-DBoost_NO_BOOST_CMAKE=ON -DPYTHON_BINDINGS=OFF'})


#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['libxc'] = "FC=mpiifort FCFLAGS=-O2"
module_cmakeargs.update({
    'ntpoly': "-DFORTRAN_ONLY=Yes -DCMAKE_Fortran_COMPILER='mpiifort' -DCMAKE_Fortran_FLAGS_RELEASE='-O2 -g -qopenmp -fPIC' -DBUILD_SHARED_LIBS=Yes"
    })

module_cmakeargs['spfft'] = "-DMPI_CXX_COMPILER_INCLUDE_DIRS=/opt/softs/gcc/9.3.0/include/ -DCMAKE_CXX_COMPILER=mpiicpc -DCMAKE_BUILD_TYPE=RELEASE -DSPFFT_SINGLE_PRECISION=OFF -DSPFFT_MPI=ON -DSPFFT_OMP=ON " # -DSPFFT_STATIC=ON " # -DSPFFT_GPU_BACKEND=CUDA  -DCMAKE_CUDA_COMPILER=/usr/local/cuda-10.1/bin/nvcc -DCMAKE_CUDA_FLAGS=-ccbin=gcc-8
