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

#List the module the this rcfile will build
modules = ['bigdft']

# These modules can be installed with conda
skip = ["spglib", "PyYAML", "libyaml", "ntpoly", "libxc"]

from os import environ
prefix = environ["PREFIX"]

def env_configuration():
    '''
    Species the configure line for various autotools packages.
    '''
    from sys import platform
    from os import environ
    env = {}
    env["FC"] = "mpifort"
    env["CC"] = environ["CC_FOR_BUILD"]
    env["CXX"] = environ["CXX_FOR_BUILD"]
    env["CFLAGS"] = "-O2 -DCONDA " + environ["CFLAGS"] + " -ldl"
    env["CPPFLAGS"] = environ["CPPFLAGS"]
    env["FCFLAGS"] = "-O2 -fopenmp -fallow-argument-mismatch "
    env["FCFLAGS"] += environ["FORTRANFLAGS"] + " -ldl"
    env["--with-ext-linalg"] = "-llapack -lblas"
    env["--with-yaml-path"] = prefix
    return " ".join(['"' + x + '=' + y + '"' for x, y in env.items()])

#here follow the configuration instructions for the modules built
autogenargs = env_configuration()
