From d3739931e1662d1476988badb3305e53b0355cda Mon Sep 17 00:00:00 2001 From: Boud Roukema Date: Sat, 8 Aug 2020 17:58:03 +0200 Subject: 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. --- reproduce/software/shell/configure.sh | 66 ++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 25 deletions(-) (limited to 'reproduce') 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 < /dev/null 2>/dev/null; then hasfc=1; fi + if [ $hasfc = 0 ]; then + cat < $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 -- cgit v1.2.1