From: Fabian Castelli Date: Thu, 8 Jul 2021 12:32:19 +0000 (+0200) Subject: Cleanup compiler variables X-Git-Tag: v9.3.3-r1~1^2~10^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c62e3d857f5c8151d8ec7f923aa91e115fb47468;p=candi.git Cleanup compiler variables --- diff --git a/candi.sh b/candi.sh index 3d5bf2d..5a12fd9 100755 --- a/candi.sh +++ b/candi.sh @@ -898,77 +898,79 @@ fi ############################################################################ # Compiler variables check -echo "Compiler Variables:" -# Firstly test, if compiler variables are set, -# and if not try to set the default mpi-compiler suite -# finally test, if compiler variables are useful. +# Firstly test, if compiler variables are set, and if not try to set the +# default mpi-compiler suite finally test, if compiler variables are useful. -echo "-------------------------------------------------------------------------------" +echo "--------------------------------------------------------------------------------" +cecho ${INFO} "Compiler Variables:" +echo # CC test -if [ ! -n "$CC" ]; then +if [ ! -n "${CC}" ]; then if builtin command -v mpicc > /dev/null; then - cecho ${WARN} "CC variable not set, but default mpicc found." + cecho ${WARN} "CC variable not set, but default mpicc found." export CC=mpicc fi fi -if [ -n "$CC" ]; then - cecho ${INFO} "CC = $(which $CC)" +if [ -n "${CC}" ]; then + cecho ${INFO} "CC = $(which ${CC})" else - cecho ${BAD} "CC variable not set. Please set it with $ export CC = <(MPI) C compiler>" + cecho ${BAD} "CC variable not set. Please set it with \$export CC = <(MPI) C compiler>" fi # CXX test -if [ ! -n "$CXX" ]; then +if [ ! -n "${CXX}" ]; then if builtin command -v mpicxx > /dev/null; then cecho ${WARN} "CXX variable not set, but default mpicxx found." export CXX=mpicxx fi fi -if [ -n "$CXX" ]; then - cecho ${INFO} "CXX = $(which $CXX)" +if [ -n "${CXX}" ]; then + cecho ${INFO} "CXX = $(which ${CXX})" else - cecho ${BAD} "CXX variable not set. Please set it with $ export CXX = <(MPI) C++ compiler>" + cecho ${BAD} "CXX variable not set. Please set it with \$export CXX = <(MPI) C++ compiler>" fi # FC test -if [ ! -n "$FC" ]; then +if [ ! -n "${FC}" ]; then if builtin command -v mpif90 > /dev/null; then - cecho ${WARN} "FC variable not set, but default mpif90 found." + cecho ${WARN} "FC variable not set, but default mpif90 found." export FC=mpif90 fi fi -if [ -n "$FC" ]; then - cecho ${INFO} "FC = $(which $FC)" +if [ -n "${FC}" ]; then + cecho ${INFO} "FC = $(which ${FC})" else - cecho ${BAD} "FC variable not set. Please set it with $ export FC = <(MPI) Fortran 90 compiler>" + cecho ${BAD} "FC variable not set. Please set it with \$export FC = <(MPI) F90 compiler>" fi # FF test -if [ ! -n "$FF" ]; then +if [ ! -n "${FF}" ]; then if builtin command -v mpif77 > /dev/null; then - cecho ${WARN} "FF variable not set, but default mpif77 found." + cecho ${WARN} "FF variable not set, but default mpif77 found." export FF=mpif77 fi fi -if [ -n "$FF" ]; then - cecho ${INFO} "FF = $(which $FF)" +if [ -n "${FF}" ]; then + cecho ${INFO} "FF = $(which ${FF})" else - cecho ${BAD} "FF variable not set. Please set it with $ export FF = <(MPI) Fortran 77 compiler>" + cecho ${BAD} "FF variable not set. Please set it with \$export FF = <(MPI) F77 compiler>" fi + echo # Final test for compiler variables -if [ -z "$CC" ] || [ -z "$CXX" ] || [ -z "$FC" ] || [ -z "$FF" ]; then +if [ -z "${CC}" ] || [ -z "${CXX}" ] || [ -z "${FC}" ] || [ -z "${FF}" ]; then cecho ${WARN} "One or multiple compiler variables (CC,CXX,FC,FF) are not set." - cecho ${INFO} "Please read your platform information above carefully," - cecho ${INFO} " how you get those compilers installed and set up!" - cecho ${INFO} "Usually the values should be: mpicc, mpicxx, mpif90 and mpif77." - cecho ${WARN} "It is strongly recommended to set them to guarantee the same compilers for all dependencies." + cecho ${INFO} "Please read your platform information above carefully, how you get those" + cecho ${INFO} "compilers installed and set up! Usually the values should be:" + cecho ${INFO} "CC=mpicc, CXX=mpicxx, FC=mpif90, FF=mpif77" + cecho ${WARN} "It is strongly recommended to set them to guarantee the same compilers for all" + cecho ${WARN} "dependencies." echo fi diff --git a/deal.II-toolchain/packages/parmetis.package b/deal.II-toolchain/packages/parmetis.package index 56bf695..99cc283 100644 --- a/deal.II-toolchain/packages/parmetis.package +++ b/deal.II-toolchain/packages/parmetis.package @@ -25,7 +25,7 @@ package_specific_build() { # Secondly build parmetis cd .. - make config prefix=${INSTALL_PATH} shared=1 cc=$CC cxx=$CXX + make config prefix=${INSTALL_PATH} shared=1 cc=${CC} cxx=${CXX} quit_if_fail "parmetis make config failed" make -j${JOBS} diff --git a/deal.II-toolchain/packages/petsc.package b/deal.II-toolchain/packages/petsc.package index bc48cbf..d9dc2d4 100644 --- a/deal.II-toolchain/packages/petsc.package +++ b/deal.II-toolchain/packages/petsc.package @@ -42,24 +42,24 @@ for external_pkg in hypre; do CONFOPTS="${CONFOPTS} --download-${external_pkg}=1" done -if [ ! -z "$CC" ]; then - CONFOPTS="${CONFOPTS} CC=$CC" +if [ ! -z "${CC}" ]; then + CONFOPTS="${CONFOPTS} CC=${CC}" fi -if [ ! -z "$CXX" ]; then - CONFOPTS="${CONFOPTS} CXX=$CXX" +if [ ! -z "${CXX}" ]; then + CONFOPTS="${CONFOPTS} CXX=${CXX}" fi -if [ ! -z "$FC" ]; then - CONFOPTS="${CONFOPTS} FC=$FC" +if [ ! -z "${FC}" ]; then + CONFOPTS="${CONFOPTS} FC=${FC}" fi -if [ ! -z "$F77" ]; then - CONFOPTS="${CONFOPTS} F77=$F77" +if [ ! -z "${F77}" ]; then + CONFOPTS="${CONFOPTS} F77=${F77}" fi -if [ ! -z "$F90" ]; then - CONFOPTS="${CONFOPTS} F90=$F90" +if [ ! -z "${F90}" ]; then + CONFOPTS="${CONFOPTS} F90=${F90}" fi if [ ! -z "${MKL_DIR}" ]; then