10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-09-26 19:40:57 +02:00

Updated quantum_package.rc

This commit is contained in:
Anthony Scemama 2019-01-08 23:48:59 +01:00
parent a37c1e3b68
commit 8199ec2b5c
20 changed files with 265 additions and 76 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
quantum_package.rc
config/ifort.cfg
quantum_package_static.tar.gz
build.ninja

View File

@ -35,7 +35,7 @@ OPENMP : 1 ; Append OpenMP flags
# -ffast-math and the Fortran-specific
# -fno-protect-parens and -fstack-arrays.
[OPT]
FCFLAGS : -Ofast
FCFLAGS : -Ofast -msse4.2
# Profiling flags
#################

View File

@ -35,7 +35,7 @@ OPENMP : 1 ; Append OpenMP flags
# -ffast-math and the Fortran-specific
# -fno-protect-parens and -fstack-arrays.
[OPT]
FCFLAGS : -Ofast
FCFLAGS : -Ofast -mavx
# Profiling flags
#################

View File

@ -32,7 +32,7 @@ OPENMP : 1 ; Append OpenMP flags
#
[OPT]
FC : -traceback
FCFLAGS : -xAVX -O2 -ip -ftz -g
FCFLAGS : -xSSE4.2 -O2 -ip -ftz -g
# Profiling flags
#################

63
config/ifort_avx.cfg Normal file
View File

@ -0,0 +1,63 @@
# Common flags
##############
#
# -mkl=[parallel|sequential] : Use the MKL library
# --ninja : Allow the utilisation of ninja. It is mandatory !
# --align=32 : Align all provided arrays on a 32-byte boundary
#
[COMMON]
FC : ifort
LAPACK_LIB : -mkl=parallel
IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32
# Global options
################
#
# 1 : Activate
# 0 : Deactivate
#
[OPTION]
MODE : OPT ; [ OPT | PROFILE | DEBUG ] : Chooses the section below
CACHE : 0 ; Enable cache_compile.py
OPENMP : 1 ; Append OpenMP flags
# Optimization flags
####################
#
# -xHost : Compile a binary optimized for the current architecture
# -O2 : O3 not better than O2.
# -ip : Inter-procedural optimizations
# -ftz : Flushes denormal results to zero
#
[OPT]
FC : -traceback
FCFLAGS : -xAVX -O2 -ip -ftz -g
# Profiling flags
#################
#
[PROFILE]
FC : -p -g
FCFLAGS : -xSSE4.2 -O2 -ip -ftz
# Debugging flags
#################
#
# -traceback : Activate backtrace on runtime
# -fpe0 : All floating point exaceptions
# -C : Checks uninitialized variables, array subscripts, etc...
# -g : Extra debugging information
# -xSSE2 : Valgrind needs a very simple x86 executable
#
[DEBUG]
FC : -g -traceback
FCFLAGS : -xSSE2 -C -fpe0 -implicitnone
# OpenMP flags
#################
#
[OPENMP]
FC : -qopenmp
IRPF90_FLAGS : --openmp

64
config/ifort_avx_mpi.cfg Normal file
View File

@ -0,0 +1,64 @@
# Common flags
##############
#
# -mkl=[parallel|sequential] : Use the MKL library
# --ninja : Allow the utilisation of ninja. It is mandatory !
# --align=32 : Align all provided arrays on a 32-byte boundary
#
[COMMON]
FC : mpiifort
LAPACK_LIB : -mkl=parallel
IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32 -DMPI
# Global options
################
#
# 1 : Activate
# 0 : Deactivate
#
[OPTION]
MODE : OPT ; [ OPT | PROFILE | DEBUG ] : Chooses the section below
CACHE : 0 ; Enable cache_compile.py
OPENMP : 1 ; Append OpenMP flags
# Optimization flags
####################
#
# -xHost : Compile a binary optimized for the current architecture
# -O2 : O3 not better than O2.
# -ip : Inter-procedural optimizations
# -ftz : Flushes denormal results to zero
#
[OPT]
FCFLAGS : -xAVX -O2 -ip -ftz -g -traceback
# Profiling flags
#################
#
[PROFILE]
FC : -p -g
FCFLAGS : -xSSE4.2 -O2 -ip -ftz
# Debugging flags
#################
#
# -traceback : Activate backtrace on runtime
# -fpe0 : All floating point exaceptions
# -C : Checks uninitialized variables, array subscripts, etc...
# -g : Extra debugging information
# -xSSE2 : Valgrind needs a very simple x86 executable
#
[DEBUG]
FC : -g -traceback
FCFLAGS : -xSSE2 -C -fpe0 -implicitnone
# OpenMP flags
#################
#
[OPENMP]
FC : -qopenmp
IRPF90_FLAGS : --openmp

View File

@ -32,7 +32,7 @@ OPENMP : 1 ; Append OpenMP flags
#
[OPT]
FC : -traceback
FCFLAGS : -xAVX -O2 -ip -ftz -g
FCFLAGS : -xSSE4.2 -O2 -ip -ftz -g
# Profiling flags

View File

@ -33,7 +33,6 @@ OPENMP : 1 ; Append OpenMP flags
[OPT]
FCFLAGS : -xSSE4.2 -O2 -ip -ftz -g -traceback
# !xAVX
# Profiling flags
#################
#

24
configure vendored
View File

@ -3,6 +3,10 @@
# Quantum Package configuration script
#
export QP_ROOT="$( cd "$(dirname "$0")" ; pwd -P )"
echo "QP_ROOT="$QP_ROOT
help()
{
cat <<EOF
@ -17,14 +21,16 @@ Options:
-c <file>, --config <file> define a configuration file, in
"${QP_ROOT}/config/".
-h, --help print the help message
-i <package>, --install <package> install <package>. Use at your own risk.
-i <package>, --install <package> install <package>. Use at your own
risk: no support will be provided
for the installation of dependencies.
Example:
./configure -c config/gfortran.cfg
Note:
- Using different configuration files for installing dependencies and
compiling QP can improve the user experience.
- Users are encouraged to create their own configuration files instead of
modifying the existing ones.
EOF
exit
@ -54,20 +60,12 @@ done
# Trim leading and trailing spaces
PACKAGES=$(echo $PACKAGES | xargs)
sed "s!^export QP_ROOT=.*\$!export QP_ROOT=\"$PWD\"!" \
quantum_package.rc.default > quantum_package.rc
echo "quantum_package.rc created."
echo "export QP_ROOT=\"$QP_ROOT\"" > ${QP_ROOT}/etc/00.qp_root
source quantum_package.rc
function fail() {
echo "Please refer to INSTALL.rst to install the missing dependencies."
exit 1
@ -151,7 +149,7 @@ for PACKAGE in ${PACKAGES} ; do
elif [[ ${PACKAGE} = irpf90 ]] ; then
download \
"https://gitlab.com/scemama/irpf90/-/archive/v1.7.3/irpf90-v1.7.3.tar.gz" \
"https://gitlab.com/scemama/irpf90/-/archive/v1.7.4/irpf90-v1.7.4.tar.gz" \
"${QP_ROOT}"/external/irpf90.tar.gz
(
cd "${QP_ROOT}"/external

1
etc/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
00.qp_root

1
etc/README.rst Normal file
View File

@ -0,0 +1 @@
This directory contains all the files to be sourced when the |QP| environment is loaded.

15
etc/ezfio.rc Normal file
View File

@ -0,0 +1,15 @@
if [[ -z $QP_EZFIO ]]
then
export QP_EZFIO=${QP_ROOT}/external/ezfio
if [[ $SHELL == "/bin/bash" ]] ; then
if [[ -f ${QP_EZFIO}/Bash/ezfio.sh ]]; then
source ${QP_EZFIO}/Bash/ezfio.sh
else
echo "EZFIO is not installed."
fi
fi
fi

8
etc/irpf90.rc Normal file
View File

@ -0,0 +1,8 @@
export IRPF90=${QP_ROOT}/bin/irpf90
# Load irpman shell completion
(
irpman=$(tail -1 "${QP_ROOT}/bin/irpman" | cut --delimiter " " --field=2)
source $(dirname ${irpman})/../irpman-completions.bash
)

9
etc/libraries.rc Normal file
View File

@ -0,0 +1,9 @@
if [[ -z $QP_LIB ]]
then
:
# Include here the optional external libraries to link with your binaries,
# for example
# export QP_LIB="$QP_LIB -lint"
fi

11
etc/network.rc Normal file
View File

@ -0,0 +1,11 @@
if [[ -z $QP_NIC ]]
then
:
# Choose the correct network interface if the default one is incorrect
# export QP_NIC=ib0
# export QP_NIC=eth0
fi

8
etc/ninja.rc Normal file
View File

@ -0,0 +1,8 @@
if [[ -z $NINJA ]]
then
export NINJA=${QP_ROOT}/bin/ninja
fi

10
etc/ocaml.rc Normal file
View File

@ -0,0 +1,10 @@
if [[ -z $OPAMROOT ]]
then
# Comment these lines if you have a system-wide OCaml installation
export OPAMROOT=${OPAMROOT:-${QP_ROOT}/external/opam}
source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true
fi

41
etc/paths.rc Normal file
View File

@ -0,0 +1,41 @@
if [[ -z $QP_PYTHON ]]
then
# Load dependencies
for i in ezfio.rc irpf90.rc network.rc ninja.rc ocaml.rc
do
source $i
done
export QP_PYTHON=${QP_PYTHON}:${QP_EZFIO}/Python
export QP_PYTHON=${QP_PYTHON}:${QP_ROOT}/scripts
export QP_PYTHON=${QP_PYTHON}:${QP_ROOT}/scripts/ezfio_interface
export QP_PYTHON=${QP_PYTHON}:${QP_ROOT}/scripts/utility
export QP_PYTHON=${QP_PYTHON}:${QP_ROOT}/scripts/module
export QP_PYTHON=${QP_PYTHON}:${QP_ROOT}/scripts/compilation
export QP_PYTHON=${QP_PYTHON}:${QP_ROOT}/external/Python
export QP_PYTHON=${QP_PYTHON}:${QP_ROOT}/external/Python/resultsFile
function qp_prepend_export () {
eval "value_1="\${$1}""
if [[ -z $value_1 ]] ; then
echo "${2}:"
else
echo "${2}:${value_1}"
fi
}
export PYTHONPATH=$(qp_prepend_export "PYTHONPATH" "${QP_EZFIO}/Python":"${QP_PYTHON}")
export PATH=$(qp_prepend_export "PATH" "${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml)
export LD_LIBRARY_PATH=$(qp_prepend_export "LD_LIBRARY_PATH" "${QP_ROOT}"/lib:"${QP_ROOT}"/lib64)
export LIBRARY_PATH=$(qp_prepend_export "LIBRARY_PATH" "${QP_ROOT}"/lib:"${QP_ROOT}"/lib64)
export C_INCLUDE_PATH=$(qp_prepend_export "C_INCLUDE_PATH" "${QP_ROOT}"/include)
fi

19
quantum_package.rc Normal file
View File

@ -0,0 +1,19 @@
#!/bin/bash
# This script loads the Quantum Package environment. It should be invoked as
# source quantum_package.rc
WD=$PWD
cd $QP_ROOT/etc
for SCRIPT in *.rc
do
source $SCRIPT
done
cd $WD
if [[ -z ${QP_ROOT} ]]
then
echo The QP_ROOT environment variable is not set. Run
./configure -help
fi

View File

@ -1,57 +0,0 @@
# This line should contain the location of your quantum_package directory
export QP_ROOT=
# Include here the optional external libraries to link with your binaries
# export QP_LIB=" -lint"
#### BEGIN Don't modify
export IRPF90=${QP_ROOT}/bin/irpf90
export NINJA=${QP_ROOT}/bin/ninja
export QP_EZFIO=${QP_ROOT}/external/ezfio
export QP_PYTHON=${QP_ROOT}/scripts:${QP_ROOT}/scripts/ezfio_interface:${QP_ROOT}/scripts/utility:${QP_ROOT}/scripts/module:${QP_ROOT}/scripts/pseudo:${QP_ROOT}/scripts/compilation:${QP_EZFIO}/Python:${QP_ROOT}/external/Python:${QP_ROOT}/external/Python/resultsFile
function qp_prepend_export () {
eval "value_1="\${$1}""
if [[ -z $value_1 ]] ; then
echo "${2}:"
else
echo "${2}:${value_1}"
fi
}
export PYTHONPATH=$(qp_prepend_export "PYTHONPATH" "${QP_EZFIO}/Python":"${QP_PYTHON}")
export PATH=$(qp_prepend_export "PATH" "${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml)
export LD_LIBRARY_PATH=$(qp_prepend_export "LD_LIBRARY_PATH" "${QP_ROOT}"/lib:"${QP_ROOT}"/lib64)
export LIBRARY_PATH=$(qp_prepend_export "LIBRARY_PATH" "${QP_ROOT}"/lib:"${QP_ROOT}"/lib64)
export C_INCLUDE_PATH=$(qp_prepend_export "C_INCLUDE_PATH" "${QP_ROOT}"/include)
function qp() {
ezfio $@
}
# EZFIO completion
if [[ $SHELL == "/bin/bash" ]] ; then
if [[ -f ${QP_EZFIO}/Bash/ezfio.sh ]]; then
source ${QP_EZFIO}/Bash/ezfio.sh
else
echo "EZFIO is not installed."
fi
fi
#### END Don't modify
# Choose the correct network interface if the default one is incorrect
# export QP_NIC=ib0
# export QP_NIC=eth0
# Comment these lines if you have a system-wide OCaml installation
export OPAMROOT=${OPAMROOT:-${QP_ROOT}/external/opam}
source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true