From 0e4d4b357f4c2209aea8012847b1309fe8b33b13 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sun, 5 Jul 2020 19:17:05 +0100 Subject: Configure script prefers clang for macOS systems In the previous commit (Commit 1bc00c9: Only using clang in macOS systems that also have GCC) we set the used C compiler for high-level programs to be 'clang' on macOS systems. But I forgot to do the same kind of change in the configure script (to prefer 'clang' when we are testing for a C compiler on the host). With this commit, the compiler checking phases of the configure script have been improved, so on macOS systems, we now first search for 'clang', then search for 'gcc'. While doing this, I also noticed that the 'rpath' checking command was done before we actually define 'instdir'!!! So in effect, the 'rpath' directory was being set to '/lib'! So with this commit, this test has been taken to after defining 'instdir'. --- reproduce/software/shell/configure.sh | 224 +++++++++++++++++++--------------- 1 file changed, 128 insertions(+), 96 deletions(-) (limited to 'reproduce/software/shell/configure.sh') diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh index f428416..001b531 100755 --- a/reproduce/software/shell/configure.sh +++ b/reproduce/software/shell/configure.sh @@ -186,35 +186,93 @@ free_space_warning() +# See if we are on a Linux-based system +# -------------------------------------- +# +# Some features are tailored to GNU/Linux systems, while the BSD-based +# behavior is different. Initially we only tested macOS (hence the name of +# the variable), but as FreeBSD is also being inlucded in our tests. As +# more systems get used, we need to tailor these kinds of things better. +kernelname=$(uname -s) +if [ x$kernelname = xLinux ]; then + on_mac_os=no + + # Don't forget to add the respective C++ compiler below (leave 'cc' in + # the end). + c_compiler_list="gcc clang cc" +else + host_cc=1 + on_mac_os=yes + + # Don't forget to add the respective C++ compiler below (leave 'cc' in + # the end). + c_compiler_list="clang gcc cc" +fi + + + + + # Check for C/C++ compilers # ------------------------- # -# To build the software, we'll need some basic tools (the compilers in -# particular) to be present. -hascc=0; -if type cc > /dev/null 2>/dev/null; then - if type c++ > /dev/null 2>/dev/null; then export CC=cc; hascc=1; fi -else - if type gcc > /dev/null 2>/dev/null; then - if type g++ > /dev/null 2>/dev/null; then export CC=gcc; hascc=1; fi +# To build the software, we'll need some basic tools (the C/C++ compilers +# in particular) to be present. +has_compilers=no +for c in $c_compiler_list; do + + # Set the respective C++ compiler. + if [ x$c = xcc ]; then cplus=c++; + elif [ x$c = xgcc ]; then cplus=g++; + elif [ x$c = xclang ]; then cplus=clang++; else - if type clang > /dev/null 2>/dev/null; then - if type clang++ > /dev/null 2>/dev/null; then export CC=clang; hascc=1; fi + cat < /dev/null 2>/dev/null; then + export CC=$c; + if type $cplus > /dev/null 2>/dev/null; then + export CXX=$cplus + has_compilers=yes + break fi fi -fi -if [ $hascc = 0 ]; then +done +if [ x$has_compilers = xno ]; then cat < $testsource < #include @@ -257,7 +314,7 @@ else ______________________________________________________ !!!!!!! C compiler doesn't work !!!!!!! -Host C compiler ('gcc') can't build a simple program. +Host C compiler ('$CC') can't build a simple program. A working C compiler is necessary for building the project's software. Please use the error message above to find a good solution and re-run the @@ -268,11 +325,6 @@ link below and we'll try to help https://savannah.nongnu.org/support/?func=additem&group=reproduce -TIP: Once you find the solution, you can use the '-e' option to use -existing configuration: - - $ ./project configure -e - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! EOF @@ -283,28 +335,6 @@ fi -# See if the linker accepts -Wl,-rpath-link -# ----------------------------------------- -# -# `-rpath-link' is used to write the information of the linked shared -# library into the shared object (library or program). But some versions of -# LLVM's linker don't accept it an can cause problems. -cat > $testsource < -#include -int main(void) {return EXIT_SUCCESS;} -EOF -if $CC $testsource -o$testprog -Wl,-rpath-link 2>/dev/null > /dev/null; then - export rpath_command="-Wl,-rpath-link=$instdir/lib" -else - export rpath_command="" -fi -rm -f $testprog $testsource - - - - - # See if we need the dynamic-linker (-ldl) # ---------------------------------------- # @@ -326,7 +356,7 @@ if $CC $testsource -o$testprog 2>/dev/null > /dev/null; then else needs_ldl=yes; fi -rm -f $testprog $testsource + @@ -351,25 +381,6 @@ static_build=no -# See if we are on a Linux-based system -# -------------------------------------- -# -# Some features are tailored to GNU/Linux systems, while the BSD-based -# behavior is different. Initially we only tested macOS (hence the name of -# the variable), but as FreeBSD is also being inlucded in our tests. As -# more systems get used, we need to tailor these kinds of things better. -kernelname=$(uname -s) -if [ x$kernelname = xLinux ]; then - on_mac_os=no -else - host_cc=1 - on_mac_os=yes -fi - - - - - # Print warning if the host CC is to be used. if [ x$host_cc = x1 ]; then cat < $testsource < +#include +int main(void) {return EXIT_SUCCESS;} +EOF +if $CC $testsource -o$testprog -Wl,-rpath-link 2>/dev/null > /dev/null; then + export rpath_command="-Wl,-rpath-link=$instdir/lib" +else + export rpath_command="" +fi + + + + + +# Delete the compiler testing directory +# ------------------------------------- +# +# This directory was made above to make sure the necessary compilers can be +# run. +rm -f $testprog $testsource +rm -rf $compilertestdir + + + + + # Paths needed by the host compiler (only for `basic.mk') # ------------------------------------------------------- # -- cgit v1.2.1 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/software/shell/configure.sh') 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 From b3b44798a3f472e5f5a6633de4a582d4c902b008 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Thu, 18 Jun 2020 18:01:33 +0100 Subject: IMPORTANT: New software versions (17 basic, 16 high-level and 7 Python) It was a long time that the Maneage software versions hadn't been updated. With this commit, the versions of all basic software were checked and 17 of that had newer versions were updated. Also, 16 high-level programs and libraries were updated as well as 7 Python modules. The full list is available below. Basic Software (affecting all projects) --------------------------------------- bash 5.0.11 -> 5.0.18 binutils 2.32 -> 2.35 coreutils 8.31 -> 8.32 curl 7.65.3 -> 7.71.1 file 5.36 -> 5.39 gawk 5.0.1 -> 5.1.0 gcc 9.2.0 -> 10.2.0 gettext 0.20.2 -> 0.21 git 2.26.2 -> 2.28.0 gmp 6.1.2 -> 6.2.0 grep 3.3 -> 3.4 libbsd 0.9.1 -> 0.10.0 ncurses 6.1 -> 6.2 perl 5.30.0 -> 5.32.0 sed 4.7 -> 4.8 texinfo 6.6 -> 6.7 xz 5.2.4 -> 5.2.5 Custom programs/libraries ------------------------- astrometrynet 0.77 -> 0.80 automake 0.16.1 -> 0.16.2 bison 3.6 -> 3.7 cfitsio 3.47 -> 3.48 cmake 3.17.0 -> 3.18.1 freetype 2.9 -> 2.10.2 gdb 8.3 -> 9.2 ghostscript 9.50 -> 9.52 gnuastro 0.11 -> 0.12 libgit2 0.28.2 -> 1.0.1 libidn 1.35 -> 1.36 openmpi 4.0.1 -> 4.0.4 R 3.6.2 -> 4.0.2 python 3.7.4 -> 3.8.5 wcslib 6.4 -> 7.3 yaml 0.2.2 -> 0.2.5 Python modules -------------- cython 0.29.6 -> 0.29.21 h5py 2.9.0 -> 2.10.0 matplotlib 3.1.1 -> 3.3.0 mpi4py 3.0.2 -> 3.0.3 numpy 1.17.2 -> 1.19.1 pybind11 2.4.3 -> 2.5.0 scipy 1.3.1 -> 1.5.2 --- reproduce/software/shell/configure.sh | 50 ++++------------------------------- 1 file changed, 5 insertions(+), 45 deletions(-) (limited to 'reproduce/software/shell/configure.sh') diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh index b11992e..593b1d9 100755 --- a/reproduce/software/shell/configure.sh +++ b/reproduce/software/shell/configure.sh @@ -58,9 +58,6 @@ ptconf=$cdir/LOCAL_tmp.conf poconf=$cdir/LOCAL_old.conf depverfile=$cdir/versions.conf depshafile=$cdir/checksums.conf -# --------- Delete for no Gnuastro --------- -glconf=$adir/gnuastro/gnuastro-local.conf -# ------------------------------------------ @@ -634,12 +631,10 @@ EOF # (for example the user might have ran `./project configure' by mistake). printnotice=yes rewritepconfig=yes -rewritegconfig=yes -if [ -f $pconf ] || [ -f $glconf ]; then +if [ -f $pconf ]; then if [ $existing_conf = 1 ]; then printnotice=no if [ -f $pconf ]; then rewritepconfig=no; fi - if [ -f $glconf ]; then rewritegconfig=no; fi fi fi @@ -1010,44 +1005,6 @@ fi -# --------- Delete for no Gnuastro --------- -# Get the version of Gnuastro that must be used. -gversion=$(awk '$1=="gnuastro-version" {print $NF}' $depverfile) - -# Gnuastro's local configuration settings -if [ $rewritegconfig = yes ]; then - create_file_with_notice $glconf - echo "# Minimum number of bytes to use HDD/SSD instead of RAM." >> $glconf - echo " minmapsize $minmapsize" >> $glconf - echo >> $glconf - echo "# Version of Gnuastro that must be used." >> $glconf - echo " onlyversion $gversion" >> $glconf -else - ingversion=$(awk '$1=="onlyversion" {print $NF}' $glconf) - if [ x$ingversion != x$gversion ]; then - cat <