aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoud Roukema <boud@cosmo.torun.pl>2020-08-08 17:58:03 +0200
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2020-08-08 18:40:38 +0100
commitd3739931e1662d1476988badb3305e53b0355cda (patch)
treec72a8c3ebdb6352ab92ea06f86cfe30ff7136f63
parent32f3ba14f6c6efcef7edea0a365638527721f509 (diff)
Configuration fail if gfortran necessary, but not built or available
When the host C compiler is used (either by calling '--host-cc' or on OSs that we can't build the GNU C Compiler), Maneage will also not build the Fortran compiler 'gfortran'. Until now, the './project configure' script would give a big warning about the need for 'gfortran' and the fact that it is missing, and would for 5 seconds, but it would continue anyway. For projects that don't need 'gfortran', this can be confusing to the users and for those that need 'gfortran', it means that a lot of time and cpu cycles are wasted compiling non-fortran software that are unusable in the end. With this commit, the 'need_gfortarn' variable has been added 'reproduce/software/shell/configure.sh', in a new part that is devoted to project-specific features. If it equals '0', then the 'gfortran' test (and message!) isn't done at all, but if it is set to '1', then the configure stage will halt immediately gfortran is not found and not built. The default operations of the core Maneage branch don't need 'gfortran', so by default it is set to 0. But 'gfortran' is necessary for all projects that use Numpy (Python's numeric library) for example. So if your project needs 'gfortran', please set this new variable to 1. As mentioned in the comments of 'configure.sh', ideally we should detect this automatically, but we haven't had the time to implement it yet.
-rwxr-xr-xreproduce/software/shell/configure.sh66
1 files changed, 41 insertions, 25 deletions
diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh
index 001b531..b11992e 100755
--- a/reproduce/software/shell/configure.sh
+++ b/reproduce/software/shell/configure.sh
@@ -30,6 +30,20 @@ set -e
+# Project-specific settings
+# -------------------------
+#
+# The variables defined here may be different between different
+# projects. Ideally, they should be detected automatically, but we haven't
+# had the chance to implement it yet (please help if you can!). Until then,
+# please set them based on your project (if they differ from the core
+# branch).
+need_gfortran=0
+
+
+
+
+
# Internal directories
# --------------------
#
@@ -518,36 +532,40 @@ fi
# ----------------
#
# If GCC is ultimately build within the project, the user won't need to
-# have a fortran compiler, we'll build it internally for high-level
-# programs. However, when the host C compiler is to be used, the user needs
-# to have a Fortran compiler available.
+# have a fortran compiler: we'll build it internally for high-level
+# programs with GCC. However, when the host C compiler is to be used, the
+# user needs to have a Fortran compiler available.
if [ $host_cc = 1 ]; then
- # See if a Fortran compiler exists.
- hasfc=0;
- if type gfortran > /dev/null 2>/dev/null; then hasfc=1; fi
- if [ $hasfc = 0 ]; then
- cat <<EOF
+ # If a Fortran compiler is necessary, see if 'gfortran' exists and can
+ # be used.
+ if [ "x$need_gfortran" = "x1" ]; then
+
+ # First, see if 'gfortran' exists.
+ hasfc=0;
+ if type gfortran > /dev/null 2>/dev/null; then hasfc=1; fi
+ if [ $hasfc = 0 ]; then
+ cat <<EOF
______________________________________________________
!!!!!!! Fortran Compiler NOT FOUND !!!!!!!
-The project won't be building its own GCC (which includes a Fortran
-compiler) on this system. If the project needs software that require a
-Fortran compiler, they will crash with a error. Fortran is necessary in
-some lower-level scientific programs (hence this warning!). Currently we
-search for 'gfortran'. If you have a Fortran compiler that is not checked,
-please get in touch with us (with the form below) so we add it:
+This project requires a Fortran compiler. However, the project won't/can't
+build its own GCC on this system (GCC also builds the 'gfortran' Fortran
+compiler). Please install 'gfortran' using your operating system's package
+manager, then re-run this configure script to continue the configuration.
- https://savannah.nongnu.org/support/?func=additem&group=reproduce
+Currently the only Fortran compiler we check is 'gfortran'. If you have a
+Fortran compiler that is not checked, please get in touch with us (with the
+form below) so we add it:
-Project's configuration will continue in 2 seconds.
+ https://savannah.nongnu.org/support/?func=additem&group=reproduce
______________________________________________________
EOF
- sleep 2
- else
+ exit 1
+ fi
- # See if the Fortran compiler works
+ # Then, see if the Fortran compiler works
testsource=$compilertestdir/test.f
echo; echo; echo "Checking host Fortran compiler...";
echo " PRINT *, \"... Fortran Compiler works.\"" > $testsource
@@ -563,20 +581,18 @@ ______________________________________________________
Host Fortran compiler ('gfortran') can't build a simple program.
-A working Fortran compiler is necessary for building some software (which
-may not be necessary for this project!). Please use the error message above
-to find a good solution and re-run the project configuration.
+A working Fortran compiler is necessary for this project. Please use the
+error message above to find a good solution in your operating system and
+re-run the project configuration.
If you can't find a solution, please send the error message above to the
link below and we'll try to help
https://savannah.nongnu.org/support/?func=additem&group=reproduce
-
-Project's configuration will continue in 2 seconds.
______________________________________________________
EOF
- sleep 2
+ exit 1
fi
fi
fi