diff options
Diffstat (limited to 'reproduce')
24 files changed, 752 insertions, 607 deletions
diff --git a/reproduce/analysis/bash/download-multi-try b/reproduce/analysis/bash/download-multi-try index dec2539..7a5f8f2 100755 --- a/reproduce/analysis/bash/download-multi-try +++ b/reproduce/analysis/bash/download-multi-try @@ -51,11 +51,13 @@ set -e -# Input arguments and necessary sanity checks. +# Input arguments and necessary sanity checks. Note that the 5th argument +# (backup servers) isn't mandatory. inurl="$3" outname="$4" lockfile="$2" downloader="$1" +backupservers="$5" if [ "x$downloader" = x ]; then echo "$0: downloader (first argument) not given."; exit 1; fi @@ -73,6 +75,13 @@ fi +# Separate the actual filename, to possibly use backup server. +urlfile=$(echo "$inurl" | awk -F "/" '{print $NF}') + + + + + # Try downloading multiple times before crashing. counter=0 maxcounter=10 @@ -107,8 +116,19 @@ while [ ! -f "$outname" ]; do if [ x"$lockfile" = xnolock ]; then if ! $downloader $outname $inurl; then rm -f $outname; fi else + # Try downloading from the requested URL. flock "$lockfile" bash -c \ "if ! $downloader $outname $inurl; then rm -f $outname; fi" + + # If it failed, try the backup server(s). + if [ ! -f "$outname" ]; then + if [ x"$backupservers" != x ]; then + for bs in "$backupservers"; do + flock "$lockfile" bash -c \ + "if ! $downloader $outname $bs/$urlfile; then rm -f $outname; fi" + done + fi + fi fi done diff --git a/reproduce/analysis/config/verify-outputs.conf b/reproduce/analysis/config/verify-outputs.conf index e580e04..0542c53 100644 --- a/reproduce/analysis/config/verify-outputs.conf +++ b/reproduce/analysis/config/verify-outputs.conf @@ -1,3 +1,2 @@ # To disable verification of output datasets set this variable to yes - verify-outputs = diff --git a/reproduce/analysis/make/download.mk b/reproduce/analysis/make/download.mk index e4f2ccd..cf5bfa4 100644 --- a/reproduce/analysis/make/download.mk +++ b/reproduce/analysis/make/download.mk @@ -24,9 +24,10 @@ # Download input data # -------------------- # -# The input dataset properties are defined in `$(pconfdir)/INPUTS.mk'. For -# this template we only have one dataset to enable easy processing, so all -# the extra checks in this rule may seem redundant. +# The input dataset properties are defined in +# `$(pconfdir)/INPUTS.conf'. For this template we only have one dataset to +# enable easy processing, so all the extra checks in this rule may seem +# redundant. # # In a real project, you will need more than one dataset. In that case, # just add them to the target list and add an `elif' statement to define it diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk index a4acff7..ce4e488 100644 --- a/reproduce/analysis/make/initialize.mk +++ b/reproduce/analysis/make/initialize.mk @@ -141,6 +141,12 @@ export SHELL := $(installdir)/bin/bash export CPPFLAGS := -I$(installdir)/include export LD_LIBRARY_PATH := $(installdir)/lib +# Until we build our own C library, without this, the project's GCC won't +# be able to compile anything if the host C library isn't in a standard +# place: in particular Debian-based operatings sytems. On other systems, it +# will be empty. +export CPATH := $(SYS_CPATH) + # RPATH is automatically written in macOS, so `DYLD_LIBRARY_PATH' is # ultimately redundant. But on some systems, even having a single value # causes crashs (see bug #56682). So we'll just give it no value at all. @@ -151,9 +157,9 @@ export DYLD_LIBRARY_PATH := # remote-shell accesss through this environment variable. export OMPI_MCA_plm_rsh_agent=/bin/false -# Recipe startup script, see `reproduce/software/bash/bashrc.sh'. +# Recipe startup script. export PROJECT_STATUS := make -export BASH_ENV := $(shell pwd)/reproduce/software/bash/bashrc.sh +export BASH_ENV := $(shell pwd)/reproduce/software/shell/bashrc.sh @@ -242,7 +248,7 @@ distclean: clean # `rm', not our own. $$sys_rm -rf $(BDIR) $$sys_rm -f Makefile .gnuastro .local .build - $$sys_rm -f $(pconfdir)/LOCAL.mk $(gconfdir)/gnuastro-local.conf + $$sys_rm -f $(pconfdir)/LOCAL.conf $(gconfdir)/gnuastro-local.conf @@ -299,10 +305,11 @@ $(packagecontents): paper.pdf | $(texdir) # directories (when building in a group structure, there will be # `build-user1', `build-user2' and etc), are just temporary LaTeX # build files and don't have any relevant/hand-written files in - # them. 2) The `LOCAL.mk' and `gnuastro-local.conf' files just have - # this machine's local settings and are irrelevant for anyone else. + # them. 2) The `LOCAL.conf' and `gnuastro-local.conf' files just + # have this machine's local settings and are irrelevant for anyone + # else. rm -rf $$dir/tex/build/build* - rm $$dir/reproduce/software/config/installation/LOCAL.mk + rm $$dir/reproduce/software/config/installation/LOCAL.conf rm $$dir/reproduce/software/config/gnuastro/gnuastro-local.conf # When submitting to places like arXiv, they will just run LaTeX diff --git a/reproduce/analysis/make/paper.mk b/reproduce/analysis/make/paper.mk index af6bdc5..67db364 100644 --- a/reproduce/analysis/make/paper.mk +++ b/reproduce/analysis/make/paper.mk @@ -38,7 +38,7 @@ # # Note that if you don't want the final PDF and just want the processing # and file outputs, you can remove the value of `pdf-build-final' in -# `reproduce/analysis/config/pdf-build.mk'. +# `reproduce/analysis/config/pdf-build.conf'. $(mtexdir)/project.tex: $(mtexdir)/verify.tex # If no PDF is requested, or if LaTeX isn't available, don't @@ -62,7 +62,7 @@ $(mtexdir)/project.tex: $(mtexdir)/verify.tex echo "can check by running './.local/bin/latex --version'), _AND_" echo "make sure that the 'pdf-build-final' variable has a value." echo "'pdf-build-final' is defined in: " - echo "'reproduce/analysis/config/pdf-build.mk'." + echo "'reproduce/analysis/config/pdf-build.conf'." echo echo "If you don't have LaTeX within the project, please re-run" echo "'./project configure -e' when you have internet access." diff --git a/reproduce/analysis/make/prepare.mk b/reproduce/analysis/make/prepare.mk index 1f0613c..36f25e7 100644 --- a/reproduce/analysis/make/prepare.mk +++ b/reproduce/analysis/make/prepare.mk @@ -19,7 +19,9 @@ # Final-target # # Without this file, `./project make' won't work. -$(BDIR)/software/preparation-done.mk: +prepare-dep = $(subst prepare, ,$(makesrc)) +$(BDIR)/software/preparation-done.mk: \ + $(foreach s, $(prepare-dep), $(mtexdir)/$(s).tex) # If you need to add preparations define targets above to do the # preparations, then set the value below to `yes'. Recall that just diff --git a/reproduce/analysis/make/top-make.mk b/reproduce/analysis/make/top-make.mk index 000c1fd..30d537a 100644 --- a/reproduce/analysis/make/top-make.mk +++ b/reproduce/analysis/make/top-make.mk @@ -21,7 +21,7 @@ # Load the local configuration (created after running # `./project configure'). -include reproduce/software/config/installation/LOCAL.mk +include reproduce/software/config/installation/LOCAL.conf @@ -50,7 +50,7 @@ include reproduce/software/config/installation/LOCAL.mk # # Controlling this requires two variables that are available at this stage: # -# - `GROUP-NAME': from `LOCAL.mk' (which was built by `./project configure'). +# - `GROUP-NAME': from `LOCAL.conf' (which was built by `./project configure'). # - `reproducible_paper_group_name': value to the `--group' option. # # The analysis is only done when both have the same group name. Note that @@ -63,7 +63,7 @@ include reproduce/software/config/installation/LOCAL.mk # # If you are just interested in the processing and don't want to build the # PDF, you can skip the creatation of the final PDF by removing the value -# of `pdf-build-final' in `reproduce/analysis/config/pdf-build.mk'. +# of `pdf-build-final' in `reproduce/analysis/config/pdf-build.conf'. ifeq (x$(reproducible_paper_group_name),x$(GROUP-NAME)) all: paper.pdf else diff --git a/reproduce/analysis/make/top-prepare.mk b/reproduce/analysis/make/top-prepare.mk index 5ce120d..1778c6b 100644 --- a/reproduce/analysis/make/top-prepare.mk +++ b/reproduce/analysis/make/top-prepare.mk @@ -25,7 +25,7 @@ # Load the local configuration (created after running # `./project configure'). -include reproduce/software/config/installation/LOCAL.mk +include reproduce/software/config/installation/LOCAL.conf @@ -37,19 +37,7 @@ include reproduce/software/config/installation/LOCAL.mk # See `top-make.mk' for complete explanation. ifeq (x$(reproducible_paper_group_name),x$(GROUP-NAME)) all: $(BDIR)/software/preparation-done.mk - @echo ""; - echo "----------------" - echo "Project preparation has been completed without any errors." - echo "" - echo "Please run the following command to start building the project." - echo "(Replace '8' with the number of CPU threads on your system)" - echo "" - if [ "x$(GROUP-NAME)" = x ]; then \ - echo " $$ ./project make"; \ - else \ - echo " $$ ./project make --group=$(GROUP-NAME) -j8"; \ - fi - echo "" + @echo "Project preparation is complete."; else all: @if [ "x$(GROUP-NAME)" = x ]; then \ @@ -59,6 +47,7 @@ all: echo "Project is configured for groups, please run"; \ echo " $$ ./project prepare --group=$(GROUP-NAME) -j8"; \ fi + exit 1 endif @@ -87,5 +76,5 @@ makesrc = initialize \ # # See `top-make.mk' for complete explanation. project-phase = prepare -include reproduce/analysis/config/*.mk +include reproduce/analysis/config/*.conf include $(foreach s,$(makesrc), reproduce/analysis/make/$(s).mk) diff --git a/reproduce/analysis/make/verify.mk b/reproduce/analysis/make/verify.mk index a04bce4..f0bcf10 100644 --- a/reproduce/analysis/make/verify.mk +++ b/reproduce/analysis/make/verify.mk @@ -33,7 +33,7 @@ verify-print-tips = \ echo "If you are still developing your project, you can disable"; \ echo "verification by removing the value of the variable in the"; \ echo "following file (from the top project source directory):"; \ - echo " reproduce/analysis/config/verify-outputs.mk"; \ + echo " reproduce/analysis/config/verify-outputs.conf"; \ echo; \ echo "If this is the final version of the file, you can just copy"; \ echo "and paste the calculated checksum (above) for the file in"; \ diff --git a/reproduce/software/bibtex/missfits.tex b/reproduce/software/bibtex/missfits.tex new file mode 100644 index 0000000..85a1645 --- /dev/null +++ b/reproduce/software/bibtex/missfits.tex @@ -0,0 +1,18 @@ +%% Copyright (C) 2020 Surena Fatemi <surena.fatemi@ipm.ir> +%% +%% Copying and distribution of this file, with or without modification, +%% are permitted in any medium without royalty provided the copyright +%% notice and this notice are preserved. This file is offered as-is, +%% without any warranty. + +@ARTICLE{missfits, + author = {{Marmo}, C. and {Bertin}, E.}, + title = "{MissFITS and WeightWatcher: Two Optimised Tools for Managing FITS Data.}", + journal = {Astronomical Data Analysis Software and Systems XVII}, + year = 2008, + volume = {394}, + series = {Astronomical Society of the Pacific Conference Series}, + pages = {619}, + adsurl = {https://ui.adsabs.harvard.edu/abs/2008ASPC..394..619M}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +}
\ No newline at end of file diff --git a/reproduce/software/config/installation/LOCAL.mk.in b/reproduce/software/config/installation/LOCAL.conf.in index 1045f72..0579218 100644 --- a/reproduce/software/config/installation/LOCAL.mk.in +++ b/reproduce/software/config/installation/LOCAL.conf.in @@ -12,5 +12,6 @@ BDIR = @bdir@ INDIR = @indir@ DEPENDENCIES-DIR = @ddir@ +SYS_CPATH = @sys_cpath@ DOWNLOADER = @downloader@ GROUP-NAME = @groupname@ diff --git a/reproduce/software/config/installation/TARGETS.mk b/reproduce/software/config/installation/TARGETS.conf index 0352d53..bb402be 100644 --- a/reproduce/software/config/installation/TARGETS.mk +++ b/reproduce/software/config/installation/TARGETS.conf @@ -18,17 +18,17 @@ # All software that are currently available for installation can be seen in # the following file. # -# reproduce/software/config/installation/versions.mk +# reproduce/software/config/installation/versions.conf # # Please add any software that you need for your project in the respective -# part below (using its name in `versions.mk', but without the `-version' +# part below (using its name in `versions.conf', but without the `-version' # part). Just note that if a program/library is a dependency of another, # you don't need to include it here (it will be installed before the # higher-level software anyway). # # Note that many low-level software will be installed before those that are # installed in this step. They are clearly distinguished from the -# higher-level (optional) software in `versions.mk'. These low-level +# higher-level (optional) software in `versions.conf'. These low-level # software MUST NOT be added here. diff --git a/reproduce/software/config/installation/checksums.mk b/reproduce/software/config/installation/checksums.conf index a1a3767..4a5d8aa 100644 --- a/reproduce/software/config/installation/checksums.mk +++ b/reproduce/software/config/installation/checksums.conf @@ -43,7 +43,7 @@ libiconv-checksum = 365dac0b34b4255a0066e8033a8b3db4bdb94b9b57a9dca17ebf2d779139 libtool-checksum = a6eef35f3cbccf2c9e2667f44a476ebc80ab888725eb768e91a3a6c33b8c931afc46eb23efaee76c8696d3e4eed74ab1c71157bcb924f38ee912c8a90a6521a4 lzip-checksum= 0349b4c6c0b41e601b7ee381c3254d741397beb3ef9354c08162f346f131f4f48f6613ee0a610cdc6d827530df634f884ecfeee35215b10045a40fee76f8e938 m4-checksum = a92cad4441b3fd7c033837389ca3499494523d364a5fda043d92c517051510f1758b3b837f0477f42d2258a179ab79a4993e5d1694ef2673db6d96d1faff84fe -make-checksum = 6ebf886a394c61eea53dc0fa277b00cda263861e8e647608e0fce549cd619946981224408ee519bbd71068e9424798d3c5791451f60ff06d766f563142703d32 +make-checksum = 9a1185cc468368f4ec06478b1cfa343bf90b5cd7c92c0536567db0315b0ee909af53ecce3d44cfd93dd137dbca1ed13af5713e8663590c4fdd21ea635d78496b metastore-checksum = b2a5fdde9de5ddc1e6c368d5da1b2e97e4fdbaa138a7be281ccb40a81dd4a9bb1849d36b2d5d3f01205079bace60441f82a7002097ff3a7037340a35b0f1574a mpc-checksum = 72d657958b07c7812dc9c7cbae093118ce0e454c68a585bfb0e2fa559f1bf7c5f49b93906f580ab3f1073e5b595d23c6494d4d76b765d16dde857a18dd239628 mpfr-checksum = d583555d08863bf36c89b289ae26bae353d9a31f08ee3894520992d2c26e5683c4c9c193d7ad139632f71c0a476d85ea76182702a98bf08dde7b6f65a54f8b88 @@ -71,9 +71,9 @@ zlib-checksum = 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff # ------------------------------------------ # # These are programs and libraries that are optional, The ones in -# `reproduce/software/config/installation/TARGETS.mk' will be built as part -# of a project. To specify a software there, just remove the `-checksum' -# suffix from the list below. +# `reproduce/software/config/installation/TARGETS.conf' will be built as +# part of a project. To specify a software there, just remove the +# `-checksum' suffix from the list below. apachelog4cxx-checksum = aa59ce549c2c5cbeec031361dfce09cdfc3e62ee3bc9ecbc809507b7ec878c14409b98536b7d13c27690809c8e9d5ebafc3589c9fb5e4aecd5cc064943ae7d6b apr-checksum = daa140c83c7e2c45c3980d9dc81d34fa662bebd050653562c39572d0ddf2eaedb71767c518a59d77f59db9b32e00221ef48b9f72ec3666c4521dd511969f3706 apr-util-checksum = 84da76e9b64da2de0996d4d6f3ab3f23db3724eb6352d218e0e8196bcc0b0a5d4fe791f41b4cc350ce3d04cce3bb3cf8bfb513d777d0cd030928368e6b55a536 @@ -111,6 +111,7 @@ libtiff-checksum = d213e5db09fd56b8977b187c5a756f60d6e3e998be172550c2892dbdb4b2a libtirpc-checksum = 392f391f9fc1bd68d81dc44e4058831a64b32790b5c8c37338b0ab416fad2ae4d16389e632596734dba09780347918cc65c6f134e0c1afd09e81ec250785ed23 libxml2-checksum = cb7784ba4e72e942614e12e4f83f4ceb275f3d738b30e3b5c1f25edf8e9fa6789e854685974eed95b362049dbf6c8e7357e0327d64c681ed390534ac154e6810 minizip-checksum = 56b5443f79d1a0a5f563a563f7b1c27b0b0fc5ba5b37248367b204a89a9373df7d12ea802c678f3f39c987d5f1766003eac3dd31b643773afa4463a3f6406628 +missfits-checksum = 32727f5eb30573a1cedacb8900e2536867e4815059eee32e64e3db65be9291b8a91b9f45b2c9f3cf6fc2a8cc448012ea3d502bdd9dee516008e17d5086aee795 netpbm-checksum = 064720f8a9d0a502488e1af4daecdbf3936910996507ca6f311073a0ad842346692a148eb1ddf7b717f7b108f60500246cb4b83f4d3665f5fc285a84ae1d63d6 openblas-checksum = 91b3074eb922453bf843158b4281cde65db9e8bbdd7590e75e9e6cdcb486157f7973f2936f327bb3eb4f1702ce0ba51ae6729d8d4baf2d986c50771e8f696df0 openmpi-checksum = 760716974cb6b25ad820184622e1ee7926bc6fda87db6b574f76792bc1ca99522e52195866c14b7cb2df5a4981efdaf9f71d2c5533cc0e8e45c2c4b3b74cbacc @@ -144,7 +145,7 @@ yaml-checksum = 13d2197135946204323dbfccafa0ac7b3d05437e920545a56f46811fd7319c01 asn1crypto-checksum = 44d442a6ddfa971e31e24712fe084368356deb5e1c4c3b3e813e0910931860215bc1c4f9eb2c4bd4fdef607c324086c096e9357068646efd28c97f2d4f85c62f asteval-checksum = 4d64900b2f7dfdd098d6c8c102f9d9fd46f9ec265a54330e7d94479ba41f0ee0698855658e18b8b32b9c255159eb9a085af5f0306eb6508663d3fea7d2e00b4a astropy-checksum = c32e874d208f312f894643ab5b3d71dc37630e544da0ceb5ee998d752f9a055d32f6e4319f2cb6928637aaf8573bac58d2882bd636b6a89f5501e3ac7e5ab681 -astroquery-checksum = 0da57f687ac0aa7611cd97085771d79c99e9ac8c11f0828fcbc7390faf24e1e87d86812020e0ae8be1749f5f2ae9cb3733e5922d38a897a9e212247175c28e52 +astroquery-checksum = 43846791d8469a26cf6bb8819db58b830cfe50a34bc0091c2e843dd7dc78b1317530855d432a3a567a9f6a6f4d2682382a32edc91ea01716246b99b3625ec521 beautifulsoup4-checksum = 7aa77bc6008bbcbbbe91b0a850007ab237d2832b63a787fbd94b7cbf47d4276b185e0c61c134df73221406458edff2b75b6b8c2b53b543aa3bb1b0e2202dac5a certifi-checksum = 6a6bf1ff98caefcdbf78a8c83e11e155368bacdd806f0ae0c6afa8f513667df6598e594b3584de61acdca3d6049f4a776937f2aa8672b602bd6db7b737f6074e cffi-checksum = af4fe47cf5d6f1126222898365cfa21e9f11d0e71b87d869014dbb37af30dca9ddf50c989030d0f610f50e8099e8dfd08a688d8c3629abbcc4f0294f5f91b817 diff --git a/reproduce/software/config/installation/texlive.mk b/reproduce/software/config/installation/texlive-packages.conf index 6760eba..6760eba 100644 --- a/reproduce/software/config/installation/texlive.mk +++ b/reproduce/software/config/installation/texlive-packages.conf diff --git a/reproduce/software/config/installation/versions.mk b/reproduce/software/config/installation/versions.conf index 988f668..1b678ad 100644 --- a/reproduce/software/config/installation/versions.mk +++ b/reproduce/software/config/installation/versions.conf @@ -41,7 +41,7 @@ libiconv-version = 1.16 libtool-version = 2.4.6 lzip-version= 1.20 m4-version = 1.4.18 -make-version = 4.2.90 +make-version = 4.3 metastore-version = 1.1.2-23-fa9170b mpc-version = 1.1.0 mpfr-version = 4.0.2 @@ -69,9 +69,9 @@ zlib-version = 1.2.11 # ------------------------------------------ # # These are programs and libraries that are optional, The ones in -# `reproduce/software/config/installation/TARGETS.mk' will be built as part -# of a project. To specify a software there, just remove the `-version' -# suffix from the list below. +# `reproduce/software/config/installation/TARGETS.conf' will be built as +# part of a project. To specify a software there, just remove the +# `-version' suffix from the list below. apachelog4cxx-version = 0.10.0-603-014954db apr-version = 1.7.0 apr-util-version = 1.6.1 @@ -108,6 +108,7 @@ libtiff-version = 4.0.10 libtirpc-version = 1.1.4 libxml2-version = 2.9.9 minizip-version = 2.9.2 +missfits-version = 2.8.0 openblas-version = 0.3.5 openmpi-version = 4.0.1 openssh-version = 8.0p1 @@ -139,7 +140,7 @@ yaml-version = 0.2.2 asn1crypto-version = 0.24.0 asteval-version = 0.9.16 astropy-version = 4.0 -astroquery-version = 0.3.9 +astroquery-version = 0.4 beautifulsoup4-version = 4.7.1 certifi-version = 2018.11.29 cffi-version = 1.12.2 diff --git a/reproduce/software/make/README.md b/reproduce/software/make/README.md index fc04dfb..d71a3d5 100644 --- a/reproduce/software/make/README.md +++ b/reproduce/software/make/README.md @@ -2,7 +2,7 @@ Software building instructions ============================== This directory contains Makefiles that are called by the high-level -`reproduce/software/bash/configure.sh` script. The main target for the +`reproduce/software/shell/configure.sh` script. The main target for the installation of each software is a simple plain text file that contains the name of the software and its version (which is put in the paper in the end). Once built, these plain-text files are all put in the proper diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index e7d00df..212c738 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -34,9 +34,9 @@ # Top level environment include reproduce/software/make/build-rules.mk -include reproduce/software/config/installation/LOCAL.mk -include reproduce/software/config/installation/versions.mk -include reproduce/software/config/installation/checksums.mk +include reproduce/software/config/installation/LOCAL.conf +include reproduce/software/config/installation/versions.conf +include reproduce/software/config/installation/checksums.conf lockdir = $(BDIR)/locks tdir = $(BDIR)/software/tarballs @@ -48,7 +48,7 @@ ibidir = $(BDIR)/software/installed/version-info/proglib # We'll need the system's PATH for making links to low-level programs we # won't be building ourselves. -syspath := $(PATH) +syspath := $(PATH) # As we build more programs, we want to use this project's built programs # and libraries, not the host's. @@ -58,7 +58,15 @@ export PKG_CONFIG_PATH := $(ildir)/pkgconfig export PKG_CONFIG_LIBDIR := $(ildir)/pkgconfig export CPPFLAGS := -I$(idir)/include $(CPPFLAGS) export LDFLAGS := $(rpath_command) -L$(ildir) $(LDFLAGS) -export LD_LIBRARY_PATH := $(shell echo $(LD_LIBRARY_PATH) \ + +# This is the "basic" tools where we are relying on the host operating +# system, but are slowly populating our basic software envirnoment. To run +# (system or template) programs, `LD_LIBRARY_PATH' is necessary, so here, +# we'll first tell the programs to look into any possible pre-defined +# `LD_LIBRARY_PATH', then we'll add our own newly installed libraries. We +# will also make sure that there is no "current directory" in it (by +# removing a starting or trailing `:' and any occurance of `::'. +export LD_LIBRARY_PATH := $(shell echo $(LD_LIBRARY_PATH):$(ildir) \ | sed -e's/::/:/g' -e's/^://' -e's/:$$//') # RPATH is automatically written in macOS, so `DYLD_LIBRARY_PATH' is @@ -66,14 +74,18 @@ export LD_LIBRARY_PATH := $(shell echo $(LD_LIBRARY_PATH) \ # causes crashs (see bug #56682). So we'll just give it no value at all. export DYLD_LIBRARY_PATH := -# Recipe startup script, see `reproduce/software/bash/bashrc.sh'. +# Recipe startup script. export PROJECT_STATUS := configure_basic -export BASH_ENV := $(shell pwd)/reproduce/software/bash/bashrc.sh +export BASH_ENV := $(shell pwd)/reproduce/software/shell/bashrc.sh # Define the top-level basic programs (that don't depend on any other). top-level-programs = low-level-links gcc all: $(foreach p, $(top-level-programs), $(ibidir)/$(p)) +# Servers to use as backup, later this should go in a file that is not +# under version control (the actual server that the tarbal comes from is +# irrelevant). +backupservers = http://akhlaghi.org/reproduce-software @@ -176,7 +188,7 @@ $(tarballs): $(tdir)/%: | $(lockdir) mergenames=0; \ c=$(m4-checksum); \ w=http://akhlaghi.org/reproduce-software/m4-1.4.18-patched.tar.gz; \ - elif [ $$n = make ]; then c=$(make-checksum); w=https://alpha.gnu.org/gnu/make; \ + elif [ $$n = make ]; then c=$(make-checksum); w=https://ftp.gnu.org/gnu/make; \ elif [ $$n = metastore ]; then c=$(metastore-checksum); w=http://akhlaghi.org/reproduce-software; \ elif [ $$n = mpc ]; then c=$(mpc-checksum); w=http://ftp.gnu.org/gnu/mpc; \ elif [ $$n = mpfr ]; then c=$(mpfr-checksum); w=http://www.mpfr.org/mpfr-current;\ @@ -228,15 +240,19 @@ $(tarballs): $(tdir)/%: | $(lockdir) \ touch $(lockdir)/download; \ $(downloadwrapper) "$$downloader" $(lockdir)/download \ - $$tarballurl "$@.unchecked"; \ + $$tarballurl "$@.unchecked" "$(backupservers)"; \ fi; \ \ \ if type sha512sum > /dev/null 2>/dev/null; then \ checksum=$$(sha512sum "$@.unchecked" | awk '{print $$1}'); \ - echo "$*: should be '$$c', is '$$checksum'"; \ - if [ x$$checksum = x$$c ]; then mv "$@.unchecked" "$@"; \ - else echo "ERROR: Non-matching checksum for '$*'."; exit 1; \ + if [ x"$$checksum" = x"$$c" ]; then \ + mv "$@.unchecked" "$@"; \ + else \ + echo "ERROR: Non-matching checksum for '$*'."; \ + echo "Checksum should be: $$c"; \ + echo "Checksum is: $$checksum"; \ + exit 1; \ fi; \ else mv "$@.unchecked" "$@"; \ fi; @@ -658,6 +674,66 @@ $(ibidir)/bash: $(ibidir)/readline \ +# The `-shared' flag will cause problems while building Perl on macOS, so +# we'll only use this configuration option when we are GNU/Linux +# systems. However, since the whole option must be used (which includes `=' +# and empty space), its easier to define the variable as a Make variable +# outside the recipe, not as a shell variable inside it. +ifeq ($(on_mac_os),yes) +perl-conflddlflags = +else +perl-conflddlflags = -Dlddlflags="-shared $$LDFLAGS" +endif +$(ibidir)/perl: | $(ibidir)/bash \ + $(tdir)/perl-$(perl-version).tar.gz + major_version=$$(echo $(perl-version) \ + | sed -e's/\./ /g' \ + | awk '{printf("%d", $$1)}'); \ + base_version=$$(echo $(perl-version) \ + | sed -e's/\./ /g' \ + | awk '{printf("%d.%d", $$1, $$2)}'); \ + cd $(ddir) \ + && rm -rf perl-$(perl-version) \ + && if ! tar xf $(word 1,$(filter $(tdir)/%,$|)); then \ + echo; echo "Tar error"; exit 1; \ + fi \ + && cd perl-$(perl-version) \ + && sed -e's|\#\! /bin/sh|\#\! $(ibdir)/bash|' \ + -e's|\#\!/bin/sh|\#\! $(ibdir)/bash|' \ + Configure > Configure-tmp \ + && mv -f Configure-tmp Configure \ + && chmod +x Configure \ + && ./Configure -des \ + -Dusethreads \ + -Duseshrplib \ + -Dprefix=$(idir) \ + -Dvendorprefix=$(idir) \ + -Dprivlib=$(idir)/share/perl$$major_version/core_perl \ + -Darchlib=$(idir)/lib/perl$$major_version/$$base_version/core_perl \ + -Dsitelib=$(idir)/share/perl$$major_version/site_perl \ + -Dsitearch=$(idir)/lib/perl$$major_version/$$basever/site_perl \ + -Dvendorlib=$(idir)/share/perl$$major_version/vendor_perl \ + -Dvendorarch=$(idir)/lib/perl$$major_version/$$base_version/vendor_perl \ + -Dscriptdir=$(idir)/bin/core_perl \ + -Dsitescript=$(idir)/bin/site_perl \ + -Dvendorscript=$(idir)/bin/vendor_perl \ + -Dinc_version_list=none \ + -Dman1ext=1perl \ + -Dman3ext=3perl \ + -Dcccdlflags='-fPIC' \ + $(perl-conflddlflags) \ + -Dldflags="$$LDFLAGS" \ + && make SHELL=$(ibdir)/bash -j$(numthreads) \ + && make SHELL=$(ibdir)/bash install \ + && cd .. \ + && rm -rf perl-$(perl-version) \ + && cd $$topdir \ + && echo "Perl $(perl-version)" > $@ + + + + + # Coreutils # --------- # @@ -677,8 +753,10 @@ $(ibidir)/bash: $(ibidir)/readline \ # The echo after the PatchELF loop is to avoid a crash if the last # file that PatchELF encounters is not usable (and it returns with # an error). +# +# Coreutils uses Perl to create man pages! $(ibidir)/coreutils: $(ibidir)/openssl \ - | $(ibidir)/bash \ + | $(ibidir)/perl \ $(tdir)/coreutils-$(coreutils-version).tar.xz cd $(ddir) \ && rm -rf coreutils-$(coreutils-version) \ @@ -847,17 +925,17 @@ $(ibidir)/wget: $(ibidir)/libiconv \ # there is no access to the system's PATH. $(ibidir)/diffutils: | $(ibidir)/coreutils \ $(tdir)/diffutils-$(diffutils-version).tar.xz - $(call gbuild, diffutils-$(diffutils-version), static, , V=1) \ + $(call gbuild, diffutils-$(diffutils-version), static,,V=1) \ && echo "GNU Diffutils $(diffutils-version)" > $@ $(ibidir)/file: | $(ibidir)/coreutils \ $(tdir)/file-$(file-version).tar.gz - $(call gbuild, file-$(file-version), static) \ + $(call gbuild, file-$(file-version), static,,V=1) \ && echo "File $(file-version)" > $@ $(ibidir)/findutils: | $(ibidir)/coreutils \ $(tdir)/findutils-$(findutils-version).tar.xz - $(call gbuild, findutils-$(findutils-version), static, , V=1) \ + $(call gbuild, findutils-$(findutils-version), static,,V=1) \ && echo "GNU Findutils $(findutils-version)" > $@ $(ibidir)/gawk: $(ibidir)/gmp \ @@ -910,13 +988,13 @@ $(ibidir)/gmp: | $(ibidir)/m4 \ $(ibidir)/glibtool: | $(ibidir)/m4 \ $(tdir)/libtool-$(libtool-version).tar.xz $(call gbuild, libtool-$(libtool-version), static, \ - --program-prefix=g) \ + --program-prefix=g, V=1) \ && ln -s $(ibdir)/glibtoolize $(ibdir)/libtoolize \ && echo "GNU Libtool $(libtool-version)" > $@ $(ibidir)/grep: | $(ibidir)/coreutils \ $(tdir)/grep-$(grep-version).tar.xz - $(call gbuild, grep-$(grep-version), static) \ + $(call gbuild, grep-$(grep-version), static,,V=1) \ && echo "GNU Grep $(grep-version)" > $@ $(ibidir)/libbsd: | $(ibidir)/coreutils \ @@ -927,7 +1005,7 @@ $(ibidir)/libbsd: | $(ibidir)/coreutils \ $(ibidir)/m4: | $(ibidir)/coreutils \ $(ibidir)/texinfo \ $(tdir)/m4-$(m4-version).tar.gz - $(call gbuild, m4-$(m4-version), static) \ + $(call gbuild, m4-$(m4-version), static,,V=1) \ && echo "GNU M4 $(m4-version)" > $@ # Metastore is used (through a Git hook) to restore the source modification @@ -997,7 +1075,7 @@ $(ibidir)/metastore: $(needlibbsd) \ -e's|@GROUP[@]|'$$group'|g' \ -e's|@BINDIR[@]|$(ibdir)|g' \ -e's|@TOP_PROJECT_DIR[@]|'$$current_dir'|g' \ - reproduce/software/bash/git-$$f > .git/hooks/$$f \ + reproduce/software/shell/git-$$f > .git/hooks/$$f \ && chmod +x .git/hooks/$$f; \ done; \ fi \ @@ -1020,63 +1098,6 @@ $(ibidir)/mpfr: $(ibidir)/gmp \ $(call gbuild, mpfr-$(mpfr-version), static, , , make check) \ && echo "GNU Multiple Precision Floating-Point Reliably $(mpfr-version)" > $@ -# The `-shared' flag will cause problems while building Perl on macOS, so -# we'll only use this configuration option when we are GNU/Linux -# systems. However, since the whole option must be used (which includes `=' -# and empty space), its easier to define the variable as a Make variable -# outside the recipe, not as a shell variable inside it. -ifeq ($(on_mac_os),yes) -perl-conflddlflags = -else -perl-conflddlflags = -Dlddlflags="-shared $$LDFLAGS" -endif -$(ibidir)/perl: | $(ibidir)/coreutils \ - $(tdir)/perl-$(perl-version).tar.gz - major_version=$$(echo $(perl-version) \ - | sed -e's/\./ /g' \ - | awk '{printf("%d", $$1)}'); \ - base_version=$$(echo $(perl-version) \ - | sed -e's/\./ /g' \ - | awk '{printf("%d.%d", $$1, $$2)}'); \ - cd $(ddir) \ - && rm -rf perl-$(perl-version) \ - && if ! tar xf $(word 1,$(filter $(tdir)/%,$|)); then \ - echo; echo "Tar error"; exit 1; \ - fi \ - && cd perl-$(perl-version) \ - && sed -e's|\#\! /bin/sh|\#\! $(ibdir)/bash|' \ - -e's|\#\!/bin/sh|\#\! $(ibdir)/bash|' \ - Configure > Configure-tmp \ - && mv -f Configure-tmp Configure \ - && chmod +x Configure \ - && ./Configure -des \ - -Dusethreads \ - -Duseshrplib \ - -Dprefix=$(idir) \ - -Dvendorprefix=$(idir) \ - -Dprivlib=$(idir)/share/perl$$major_version/core_perl \ - -Darchlib=$(idir)/lib/perl$$major_version/$$base_version/core_perl \ - -Dsitelib=$(idir)/share/perl$$major_version/site_perl \ - -Dsitearch=$(idir)/lib/perl$$major_version/$$basever/site_perl \ - -Dvendorlib=$(idir)/share/perl$$major_version/vendor_perl \ - -Dvendorarch=$(idir)/lib/perl$$major_version/$$base_version/vendor_perl \ - -Dscriptdir=$(idir)/bin/core_perl \ - -Dsitescript=$(idir)/bin/site_perl \ - -Dvendorscript=$(idir)/bin/vendor_perl \ - -Dinc_version_list=none \ - -Dman1ext=1perl \ - -Dman3ext=3perl \ - -Dcccdlflags='-fPIC' \ - $(perl-conflddlflags) \ - -Dldflags="$$LDFLAGS" \ - && make SHELL=$(ibdir)/bash -j$(numthreads) \ - && make SHELL=$(ibdir)/bash install \ - && cd .. \ - && rm -rf perl-$(perl-version) \ - && cd $$topdir \ - && echo "Perl $(perl-version)" > $@ - - $(ibidir)/pkg-config: | $(ibidir)/coreutils \ $(tdir)/pkg-config-$(pkgconfig-version).tar.gz # An existing `libiconv' can cause a conflict with `pkg-config', @@ -1101,7 +1122,7 @@ $(ibidir)/pkg-config: | $(ibidir)/coreutils \ $(ibidir)/sed: | $(ibidir)/coreutils \ $(tdir)/sed-$(sed-version).tar.xz - $(call gbuild, sed-$(sed-version), static) \ + $(call gbuild, sed-$(sed-version), static,,V=1) \ && echo "GNU Sed $(sed-version)" > $@ $(ibidir)/texinfo: | $(ibidir)/perl \ @@ -1111,7 +1132,7 @@ $(ibidir)/texinfo: | $(ibidir)/perl \ $(ibdir)/patchelf --set-rpath $(ildir) $(ibdir)/info; \ $(ibdir)/patchelf --set-rpath $(ildir) $(ibdir)/install-info; \ fi \ - && echo "GNU Texinfo $(sed-version)" > $@ + && echo "GNU Texinfo $(texinfo-version)" > $@ $(ibidir)/which: | $(ibidir)/coreutils \ $(tdir)/which-$(which-version).tar.gz @@ -1161,6 +1182,15 @@ endif # programs (http://savannah.nongnu.org/bugs/?56294). Therefore, we'll set # all other basic programs as Binutils prerequisite and GCC (the final # basic target) ultimately just depends on Binutils. +# +# The `ld' linker of Binutils needs several `*crt*.o' file to run. On some +# systems these object files aren't installed in standard places. We +# defined `LIBRARY_PATH' and that fixed the problem for many +# systems. However, some software (for example ImageMagick) over-write +# `LIBRARY_PATH', therefore there is no other way than to put a link to +# these necessary files in our local build directory. IMPORTANT NOTE: +# later, when we build the GNU C Library in the project, we should remove +# this step. $(ibidir)/binutils: | $(ibidir)/sed \ $(ibidir)/wget \ $(ibidir)/grep \ @@ -1174,6 +1204,7 @@ $(ibidir)/binutils: | $(ibidir)/sed \ $(ibidir)/diffutils \ $(ibidir)/coreutils \ $(gcc-prerequisites) + if [ x$(on_mac_os) = xyes ]; then \ $(call makelink,as); \ $(call makelink,ar); \ @@ -1181,9 +1212,17 @@ $(ibidir)/binutils: | $(ibidir)/sed \ $(call makelink,nm); \ $(call makelink,ps); \ $(call makelink,ranlib); \ - echo "" > $@; \ + echo "" > $@; \ else \ - $(call gbuild, binutils-$(binutils-version), static) \ + $(call gbuild, binutils-$(binutils-version), static, \ + --with-lib-path=$(sys_library_path), \ + -j$(numthreads) ) \ + && if ! [ x"$(sys_library_path)" = x ]; then \ + for f in $(sys_library_path)/*crt*.o; do \ + b=$$($(ibdir)/basename $$f); \ + ln -s $$f $(ildir)/$$b; \ + done; \ + fi \ && echo "GNU Binutils $(binutils-version)" > $@; \ fi @@ -1222,15 +1261,27 @@ $(ibidir)/gcc: | $(ibidir)/binutils \ ccinfo=$$(gcc --version | awk 'NR==1'); \ echo "C compiler (""$$ccinfo"")" > $@; \ else \ + current_dir=$$(pwd); \ rm -f $(ibdir)/gcc* $(ibdir)/g++ $(ibdir)/gfortran $(ibdir)/gcov*;\ rm -rf $(ildir)/gcc $(ildir)/libcc* $(ildir)/libgcc*; \ rm -rf $(ildir)/libgfortran* $(ildir)/libstdc* rm $(idir)/x86_64*;\ \ ln -fs $(ildir) $(idir)/lib64; \ - \ - cd $(ddir); \ + \ + in_ram=$$(df $(ddir) \ + | awk 'NR==2{print ($$4>10000000) ? "yes" : "no"}'); \ + if [ $$in_ram = "yes" ]; then odir=$(ddir); \ + else \ + odir=$(BDIR)/software/build-tmp-gcc; \ + if [ -d $$odir ]; then rm -rf $$odir; fi; \ + mkdir $$odir; \ + fi; \ + cd $$odir; \ rm -rf gcc-$(gcc-version); \ - tar xf $(word 1,$(filter $(tdir)/%,$|)) \ + tar xf $(word 1,$(filter $(tdir)/%,$|)); \ + if [ $$odir != $(ddir) ]; then \ + ln -s $$odir/gcc-$(gcc-version) $(ddir)/gcc-$(gcc-version); \ + fi \ && cd gcc-$(gcc-version) \ && mkdir build \ && cd build \ @@ -1257,15 +1308,24 @@ $(ibidir)/gcc: | $(ibidir)/binutils \ && make SHELL=$(ibdir)/bash -j$(numthreads) \ && make SHELL=$(ibdir)/bash install \ && cd ../.. \ - && rm -rf gcc-$(gcc-version) \ + && tempname=$$odir/gcc-$(gcc-version)/build/rpath-temp-copy \ && if [ "x$(on_mac_os)" != xyes ]; then \ patchelf --add-needed $(ildir)/libiconv.so $(ildir)/libstdc++.so; \ for f in $$(find $(idir)/libexec/gcc) $(ildir)/libstdc++*; do \ - if ldd $$f &> /dev/null; then \ - patchelf --set-rpath $(ildir) $$f; \ + isdynamic=$$(file $$f | grep "dynamically linked"); \ + if [ x"$$isdynamic" != x ]; then \ + cp $$f $$tempname; \ + patchelf --set-rpath $(ildir) $$tempname; \ + mv $$tempname $$f; echo "corrected"; \ fi; \ done; \ fi \ + && rm -rf gcc-$(gcc-version) \ + && cd $$current_dir \ + && if [ "$$odir" != "$(ddir)" ]; then \ + rm -rf $$odir; \ + rm $(ddir)/gcc-$(gcc-version); \ + fi \ && ln -sf $(ibdir)/gcc $(ibdir)/cc \ && echo "GNU Compiler Collection (GCC) $(gcc-version)" > $@; \ fi diff --git a/reproduce/software/make/build-rules.mk b/reproduce/software/make/build-rules.mk index cbde70b..f3ca7d2 100644 --- a/reproduce/software/make/build-rules.mk +++ b/reproduce/software/make/build-rules.mk @@ -1,7 +1,7 @@ # Generic configurable recipes to build packages with GNU Build system or # CMake. This is Makefile is not intended to be run directly, it will be -# imported into `dependencies-basic.mk' and `dependencies.mk'. They should -# be activated with Make's `Call' function. +# imported into `basic.mk' and `high-level.mk'. They should be activated +# with Make's `Call' function. # # Copyright (C) 2018-2020 Mohammad Akhlaghi <mohammad@akhlaghi.org> # diff --git a/reproduce/software/make/high-level.mk b/reproduce/software/make/high-level.mk index ac46f3a..5f1d2b2 100644 --- a/reproduce/software/make/high-level.mk +++ b/reproduce/software/make/high-level.mk @@ -28,11 +28,11 @@ # Top level environment include reproduce/software/make/build-rules.mk -include reproduce/software/config/installation/LOCAL.mk -include reproduce/software/config/installation/TARGETS.mk -include reproduce/software/config/installation/texlive.mk -include reproduce/software/config/installation/versions.mk -include reproduce/software/config/installation/checksums.mk +include reproduce/software/config/installation/LOCAL.conf +include reproduce/software/config/installation/TARGETS.conf +include reproduce/software/config/installation/versions.conf +include reproduce/software/config/installation/checksums.conf +include reproduce/software/config/installation/texlive-packages.conf lockdir = $(BDIR)/locks tdir = $(BDIR)/software/tarballs @@ -70,8 +70,8 @@ all: $(foreach p, $(top-level-programs), $(ibidir)/$(p)) \ .SHELLFLAGS := --noprofile --norc -ec export CCACHE_DISABLE := 1 export PATH := $(ibdir) -export CXX := $(ibdir)/g++ export CC := $(ibdir)/gcc +export CXX := $(ibdir)/g++ export SHELL := $(ibdir)/bash export F77 := $(ibdir)/gfortran export LD_RUN_PATH := $(ildir):$(il64dir) @@ -79,14 +79,31 @@ export PKG_CONFIG_PATH := $(ildir)/pkgconfig export LD_LIBRARY_PATH := $(ildir):$(il64dir) export PKG_CONFIG_LIBDIR := $(ildir)/pkgconfig +# Until we build our own C library, without this, our GCC won't be able to +# compile anything! Note that on most systems (in particular +# non-Debian-based), `sys_cpath' will be empty. +export CPATH := $(sys_cpath) + # RPATH is automatically written in macOS, so `DYLD_LIBRARY_PATH' is # ultimately redundant. But on some systems, even having a single value # causes crashs (see bug #56682). So we'll just give it no value at all. export DYLD_LIBRARY_PATH := -# Recipe startup script, see `reproduce/software/bash/bashrc.sh'. +# On Debian-based OSs, the basic C libraries are in a target-specific +# location, not in standard places. Until we merge the building of the C +# library, it is thus necessary to include this location here. On systems +# that don't need it, `sys_library_path' is just empty. This is necessary +# for `ld'. +export LIBRARY_PATH := $(sys_library_path) + +# Recipe startup script, see `reproduce/software/shell/bashrc.sh'. export PROJECT_STATUS := configure_highlevel -export BASH_ENV := $(shell pwd)/reproduce/software/bash/bashrc.sh +export BASH_ENV := $(shell pwd)/reproduce/software/shell/bashrc.sh + +# Servers to use as backup, later this should go in a file that is not +# under version control (the actual server that the tarbal comes from is +# irrelevant). +backupservers = http://akhlaghi.org/reproduce-software # Building flags: # @@ -168,6 +185,7 @@ tarballs = $(foreach t, apachelog4cxx-$(apachelog4cxx-version).tar.lz \ libtirpc-$(libtirpc-version).tar.bz2 \ libxml2-$(libxml2-version).tar.gz \ minizip-$(minizip-version).tar.gz \ + missfits-$(missfits-version).tar.gz \ netpbm-$(netpbm-version).tar.gz \ openblas-$(openblas-version).tar.gz \ openmpi-$(openmpi-version).tar.gz \ @@ -268,6 +286,7 @@ $(tarballs): $(tdir)/%: | $(lockdir) mergenames=0 c=$(minizip-checksum); w=https://github.com/nmoinvaz/minizip/archive/$(minizip-version).tar.gz + elif [ $$n = missfits ]; then c=$(missfits-checksum); w=https://www.astromatic.net/download/missfits elif [ $$n = netpbm ]; then c=$(netpbm-checksum); w=http://akhlaghi.org/reproduce-software elif [ $$n = openblas ]; then mergenames=0 @@ -325,7 +344,7 @@ $(tarballs): $(tdir)/%: | $(lockdir) touch $(lockdir)/download downloader="wget --no-use-server-timestamps -O" $(downloadwrapper) "$$downloader" $(lockdir)/download \ - $$tarballurl "$@.unchecked" + $$tarballurl "$@.unchecked" "$(backupservers)" fi # Make sure this is the expected tarball. Note that we now have a @@ -601,7 +620,7 @@ $(ibidir)/hdf5: $(ibidir)/openmpi \ # HEALPix includes the source of its C, C++, Python (and several other # languages) libraries within one tarball. We will include the Python # installation only when any other Python module is requested (in -# `TARGETS.mk'). +# `TARGETS.conf'). # # Note that the default `./configure' script is an interactive script which # is hard to automate. So we need to go into the `autotools' directory of @@ -647,7 +666,7 @@ $(ibidir)/healpix: $(ibidir)/cfitsio \ && echo "HEALPix $(healpix-version) \citep{healpix}" > $@ $(ibidir)/libjpeg: | $(tdir)/jpegsrc.$(libjpeg-version).tar.gz - $(call gbuild, jpeg-9b, static) \ + $(call gbuild, jpeg-9b, static,,V=1) \ && echo "Libjpeg $(libjpeg-version)" > $@ $(ibidir)/libnsl: $(ibidir)/libtirpc \ @@ -1017,12 +1036,15 @@ $(ibidir)/imfit: $(ibidir)/gsl \ fi \ && echo "Imfit $(imfit-version) \citep{imfit2015}" > $@ - $(ibidir)/minizip: $(ibidir)/cmake \ | $(tdir)/minizip-$(minizip-version).tar.gz $(call cbuild, minizip-$(minizip-version), static) \ && echo "minizip $(minizip-version)" > $@ +$(ibidir)/missfits: | $(tdir)/missfits-$(missfits-version).tar.gz + $(call gbuild, missfits-$(missfits-version), static) \ + && cp $(dtexdir)/missfits.tex $(ictdir)/ \ + && echo "MissFITS $(missfits-version) \citep{missfits}" > $@ # Netpbm is a prerequisite of Astrometry-net, it contains a lot of programs. # This program has a crazy dialogue installation which is override using the @@ -1135,7 +1157,10 @@ $(ibidir)/xlsxio: $(ibidir)/expat \ | $(tdir)/xlsxio-$(xlsxio-version).tar.gz export LDFLAGS="-lbz2 -lbsd"; \ $(call cbuild, xlsxio-$(xlsxio-version), static) \ - && echo "XLSX I/O $(xlsxio-version)" > $@ + && echo "XLSX I/O $(xlsxio-version)" > $ + + + @@ -1216,7 +1241,7 @@ $(itidir)/texlive-ready-tlmgr: reproduce/software/config/installation/texlive.co #else #forbiber = $(ibidir)/libnsl #endif -$(itidir)/texlive: reproduce/software/config/installation/texlive.mk \ +$(itidir)/texlive: reproduce/software/config/installation/texlive-packages.conf \ $(itidir)/texlive-ready-tlmgr \ $(forbiber) diff --git a/reproduce/software/make/python.mk b/reproduce/software/make/python.mk index 8c7b6f0..fef1605 100644 --- a/reproduce/software/make/python.mk +++ b/reproduce/software/make/python.mk @@ -185,7 +185,7 @@ $(pytarballs): $(tdir)/%: h=$(pytopurl)/$$hash/SecretStorage-$(secretstorage-version).tar.gz elif [ $$n = asn ]; then h=fc/f1/8db7daa71f414ddabfa056c4ef792e1461ff655c2ae2928a2b675bfed6b4; c=$(asn1crypto-checksum) elif [ $$n = asteval ]; then h=50/3f/29b7935c6dc09ee96dc347edc66c57e8ef68d595dd35b763a36a117acc8c; c=$(asteval-checksum) - elif [ $$n = astroquery ]; then h=61/50/a7a08f9e54d7d9d97e69433cd88231e1ad2901811c9d1ae9ac7ccaef9396; c=$(astroquery-checksum) + elif [ $$n = astroquery ]; then h=e2/af/a3cd3b30745832a0e81f5f13327234099aaf5d03b7979ac947a888e68e91; c=$(astroquery-checksum) elif [ $$n = astropy ]; then h=de/96/7feaca4b9be134128838395a9d924ea0b389ed4381702dcd9d11ae31789f; c=$(astropy-checksum) elif [ $$n = beautifulsoup ]; then h=80/f2/f6aca7f1b209bb9a7ef069d68813b091c8c3620642b568dac4eb0e507748; c=$(beautifulsoup4-checksum) elif [ $$n = certifi ]; then h=55/54/3ce77783acba5979ce16674fc98b1920d00b01d337cfaaf5db22543505ed; c=$(certifi-checksum) @@ -259,7 +259,7 @@ $(pytarballs): $(tdir)/%: touch $(lockdir)/download downloader="wget --no-use-server-timestamps -O" $(downloadwrapper) "$$downloader" $(lockdir)/download \ - $$tarballurl "$@.unchecked" + $$tarballurl "$@.unchecked" "$(backupservers)" fi # Make sure this is the expected tarball. Note that we now have a @@ -373,12 +373,9 @@ $(ipydir)/asteval: $(ipydir)/numpy \ $(call pybuild, tar xf, asteval-$(asteval-version), , \ ASTEVAL $(asteval-version)) -$(ipydir)/astroquery: $(ipydir)/numpy \ - $(ipydir)/astropy \ +$(ipydir)/astroquery: $(ipydir)/astropy \ $(ipydir)/keyring \ - $(ipydir)/html5lib \ $(ipydir)/requests \ - $(ipydir)/beautifulsoup4 \ | $(tdir)/astroquery-$(astroquery-version).tar.gz $(call pybuild, tar xf, astroquery-$(astroquery-version), ,\ Astroquery $(astroquery-version)) @@ -386,6 +383,9 @@ $(ipydir)/astroquery: $(ipydir)/numpy \ $(ipydir)/astropy: $(ipydir)/h5py \ $(ipydir)/scipy \ $(ipydir)/numpy \ + $(ipydir)/pyyaml \ + $(ipydir)/html5lib \ + $(ipydir)/beautifulsoup4 \ | $(tdir)/astropy-$(astropy-version).tar.gz $(call pybuild, tar xf, astropy-$(astropy-version)) \ && cp $(dtexdir)/astropy.tex $(ictdir)/ \ diff --git a/reproduce/software/bash/bashrc.sh b/reproduce/software/shell/bashrc.sh index b2a151f..b2a151f 100755 --- a/reproduce/software/bash/bashrc.sh +++ b/reproduce/software/shell/bashrc.sh diff --git a/reproduce/software/bash/configure.sh b/reproduce/software/shell/configure.sh index f7fa9c8..6e1b5fb 100755 --- a/reproduce/software/bash/configure.sh +++ b/reproduce/software/shell/configure.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # # Necessary preparations/configurations for the reproducible project. # @@ -38,11 +38,11 @@ cdir=reproduce/software/config sbdir=$cdir/installation -pconf=$sbdir/LOCAL.mk -ptconf=$sbdir/LOCAL_tmp.mk -poconf=$sbdir/LOCAL_old.mk -depverfile=$cdir/installation/versions.mk -depshafile=$cdir/installation/checksums.mk +pconf=$sbdir/LOCAL.conf +ptconf=$sbdir/LOCAL_tmp.conf +poconf=$sbdir/LOCAL_old.conf +depverfile=$cdir/installation/versions.conf +depshafile=$cdir/installation/checksums.conf # --------- Delete for no Gnuastro --------- glconf=$cdir/gnuastro/gnuastro-local.conf # ------------------------------------------ @@ -57,7 +57,8 @@ glconf=$cdir/gnuastro/gnuastro-local.conf # In case someone opens the files output from the configuration scripts in # a text editor and wants to edit them, it is important to let them know # that their changes are not going to be permenant. -function create_file_with_notice() { +create_file_with_notice () +{ if echo "# IMPORTANT: file can be RE-WRITTEN after './project configure'" > "$1" then echo "#" >> "$1" @@ -81,7 +82,8 @@ function create_file_with_notice() { # # Since the build directory will go into a symbolic link, we want it to be # an absolute address. With this function we can make sure of that. -function absolute_dir() { +absolute_dir () +{ if stat "$1" 1> /dev/null; then echo "$(cd "$(dirname "$1")" && pwd )/$(basename "$1")" else @@ -93,6 +95,415 @@ function absolute_dir() { +# 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 + 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 + fi + fi +fi +if [ $hascc = 0 ]; then + cat <<EOF +______________________________________________________ +!!!!!!! C/C++ Compiler NOT FOUND !!!!!!! + +To build the project's software, the host system needs to have basic C and +C++ compilers. The executables that were checked are 'cc', 'gcc' and +'clang' for a C compiler, and 'c++', 'g++' and 'clang++' for a C++ +compiler. If you have a relevant compiler that is not checked, please get +in touch with us (with the form below) so we add it: + + https://savannah.nongnu.org/support/?func=additem&group=reproduce +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +EOF + exit 1 +fi + + + + + +# Special directory for compiler testing +# -------------------------------------- +# +# This directory will be deleted when the compiler testing is finished. +compilertestdir=.compiler_test_dir_please_delete +if ! [ -d $compilertestdir ]; then mkdir $compilertestdir; fi + + + + + +# Check C compiler +# ---------------- +gcc_works=0 +testprog=$compilertestdir/test +testsource=$compilertestdir/test.c +echo; echo; echo "Checking host C compiler..."; +cat > $testsource <<EOF +#include <stdio.h> +#include <stdlib.h> +int main(void){printf("...C compiler works.\n"); + return EXIT_SUCCESS;} +EOF +if $CC $testsource -o$testprog && $testprog; then + rm $testsource $testprog +else + rm $testsource + cat <<EOF + +______________________________________________________ +!!!!!!! C compiler doesn't work !!!!!!! + +Host C compiler ('gcc') 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 +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 + +TIP: Once you find the solution, you can use the '-e' option to use +existing configuration: + + $ ./project configure -e + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +EOF + exit 1 +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 <<EOF +#include <stdio.h> +#include <stdlib.h> +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) +# ---------------------------------------- +# +# Some programs (like Wget) need dynamic loading (using `libdl'). On +# GNU/Linux systems, we'll need the `-ldl' flag to link such programs. But +# Mac OS doesn't need any explicit linking. So we'll check here to see if +# it is present (thus necessary) or not. +cat > $testsource <<EOF +#include <stdio.h> +#include <dlfcn.h> +int +main(void) { + void *handle=dlopen ("/lib/CEDD_LIB.so.6", RTLD_LAZY); + return 0; +} +EOF +if $CC $testsource -o$testprog 2>/dev/null > /dev/null; then + needs_ldl=no; +else + needs_ldl=yes; +fi +rm -f $testprog $testsource + + + + + +# See if the C compiler can build static libraries +# ------------------------------------------------ + +# We are manually only working with shared libraries: because some +# high-level programs like Wget and cURL need dynamic linking and if we +# build the libraries statically, our own builds will be ignored and these +# programs will go and find their necessary libraries on the host system. +# +# Another good advantage of shared libraries is that we can actually use +# the shared library tool of the system (`ldd' with GNU C Library) and see +# exactly where each linked library comes from. But in static building, +# unless you follow the build closely, its not easy to see if the source of +# the library came from the system or our build. +static_build=no + + + + + +# If we are on a Mac OS system +# ---------------------------- +# +# For the time being, we'll use the existance of `otool' to see if we are +# on a Mac OS system or not. Some tools (for example OpenSSL) need to know +# this. +# +# On Mac OS, the building of GCC crashes sometimes while building libiberty +# with CLang's `g++'. Until we find a solution, we'll just use the host's C +# compiler. +if type otool > /dev/null 2>/dev/null; then + host_cc=1 + on_mac_os=yes + cat <<EOF + +______________________________________________________ +!!!!!!!!!!!!!!! Warning !!!!!!!!!!!!!!!! + +The GNU Compiler Collection (GCC, including compilers for C, C++, Fortran +and etc) is currently not built on macOS systems for this project. To build +the project's necessary software on this system, we need to use your +system's C compiler. + +Project's configuration will continue in 5 seconds. +______________________________________________________ + +EOF + sleep 5 +else + host_cc=0 + on_mac_os=no +fi + + + + + +# Necessary C library element positions +# ------------------------------------- +# +# On some systems (in particular Debian-based OSs), the static C library +# and necessary headers in a non-standard place, and we can't build GCC. So +# we need to find them first. The `sys/cdefs.h' header is also in a +# similarly different location. +sys_cpath="" +sys_library_path="" +if [ x"$$on_mac_os" != xyes ]; then + + # Get the GCC target name of the compiler, when its given, special + # C libraries and headers are in a sub-directory of the host. + gcctarget=$(gcc -v 2>&1 \ + | tr ' ' '\n' \ + | awk '/\-\-target/' \ + | sed -e's/\-\-target=//') + if [ x"$gcctarget" != x ]; then + if [ -f /usr/lib/$gcctarget/libc.a ]; then + export sys_library_path=/usr/lib/$gcctarget + export sys_cpath=/usr/include/$gcctarget + fi + fi + + # For a check: + #echo "sys_library_path: $sys_library_path" + #echo "sys_cpath: $sys_cpath" +fi + + + + + +# See if a link-able static C library exists +# ------------------------------------------ +# +# After building GCC, we must use PatchELF to correct its RPATHs. However, +# PatchELF links internally with `libstdc++'. So a dynamicly linked +# PatchELF cannot be used to correct the links to `libstdc++' in general +# (on some systems this causes no problem, but on others it doesn't!). +# +# However, to build a Static PatchELF, we need to be able to link with the +# static C library, which is not always available on some GNU/Linux +# systems. Therefore we need to check this here. If we can't build a static +# PatchELF, we won't build any GCC either. +if [ x"$host_cc" = x0 ]; then + echo; echo; echo "Checking if static C library is available..."; + cat > $testsource <<EOF +#include <stdio.h> +#include <stdlib.h> +#include <sys/cdefs.h> +int main(void){printf("...yes\n"); + return EXIT_SUCCESS;} +EOF + cc_call="$CC $testsource $CPPFLAGS $LDFLAGS -o$testprog -static -lc" + if $cc_call && $testprog; then + gccwarning=0 + good_static_libc=1 + rm $testsource $testprog + else + echo; echo "Compilation command:"; echo "$cc_call" + good_static_libc=0 + rm $testsource + gccwarning=1 + host_cc=1 + cat <<EOF + +_______________________________________________________ +!!!!!!!!!!!! Warning !!!!!!!!!!!! + +The 'sys/cdefs.h' header cannot be included, or a usable static C library +('libc.a', in any directory) cannot be used with the current settings of +this system. SEE THE ERROR MESSAGE ABOVE. + +Because of this, we can't build GCC. You either 1) don't have them, or 2) +the default system environment aren't enough to find them. + +1) If you don't have them, your operating system provides them as separate +packages that you must manually install. Please look into your operating +system documentation or contact someone familiar with it. For example on +some Redhat-based GNU/Linux distributions, the static C library package can +be installed with this command: + + $ sudo yum install glibc-static + +2) If you have 'libc.a' and 'sys/cdefs.h', but in a non-standard location (for +example in '/PATH/TO/STATIC/LIBC/libc.a' and +'/PATH/TO/SYS/CDEFS_H/sys/cdefs.h'), please run the commands below, then +re-configure the project to fix this problem. + + $ export LDFLAGS="-L/PATH/TO/STATIC/LIBC \$LDFLAGS" + $ export CPPFLAGS="-I/PATH/TO/SYS/CDEFS_H \$LDFLAGS" + +_______________________________________________________ + +EOF + fi +fi + +# Print a warning if GCC is not meant to be built. +if [ x"$gccwarning" = x1 ]; then + cat <<EOF + +PLEASE SEE THE WARNINGS ABOVE. + +Since GCC is pretty low-level, this configuration script will continue in 5 +seconds and use your system's C compiler (it won't build a custom GCC). But +please consider installing the necessary package(s) to complete your C +compiler, then re-run './project configure'. + +Project's configuration will continue in 5 seconds. + +EOF + sleep 5 +fi + + + + + +# Fortran compiler +# ---------------- +# +# 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. +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 +______________________________________________________ +!!!!!!! Fortran Compiler NOT FOUND !!!!!!! + +The project won't be building its own GCC (which includes a Fortran +compiler) on this system. If you need software that need a Fortran +compiler, it will crash with an error. Fortran is necessary for many +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: + + https://savannah.nongnu.org/support/?func=additem&group=reproduce + +Project's configuration will continue in 5 seconds. +______________________________________________________ + +EOF + sleep 5 + else + + # See if the Fortran compiler works + testsource=$compilertestdir/test.f + echo; echo; echo "Checking host Fortran compiler..."; + echo " PRINT *, \"... Fortran Compiler works.\"" > $testsource + echo " END" >> $testsource + if gfortran $testsource -o$testprog && $testprog; then + rm $testsource $testprog + else + rm $testsource + cat <<EOF + +______________________________________________________ +!!!!!!! Fortran compiler doesn't work !!!!!!! + +Host Fortran compiler ('gfortran') can't build a simple program. + +A working Fortran compiler is necessary for building some of the project's +software. Please use the error message above to find a good solution 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 + +TIP: Once you find the solution, you can use the '-e' option to use +existing configuration: + + $ ./project configure -e + +Project's configuration will continue in 5 seconds. +______________________________________________________ + +EOF + sleep 5 + fi + fi +fi + + + + + +# Delete the compiler testing directory +# ------------------------------------- +# +# This directory was made above to make sure the necessary compilers can be +# run. +rm -rf $compilertestdir + + + + + # Inform the user # --------------- # @@ -117,7 +528,7 @@ EOF # What to do with possibly existing configuration file # ---------------------------------------------------- # -# `LOCAL.mk' is the top-most local configuration for the project. If it +# `LOCAL.conf' is the top-most local configuration for the project. If it # already exists when this script is run, we'll make a copy of it as backup # (for example the user might have ran `./project configure' by mistake). printnotice=yes @@ -239,7 +650,7 @@ EOF bdir= currentdir=$(pwd) junkname=pure-junk-974adfkj38 - while [ x$bdir == x ] + while [ x$bdir = x ] do # Ask the user (if not already set on the command-line). if [ x"$build_dir" = x ]; then @@ -264,10 +675,12 @@ EOF fi fi - # Make sure the given directory is not a subdirectory of the - # source directory. + # If its given, make sure it isn't a subdirectory of the source + # directory. if ! [ x"$bdir" = x ]; then - if [[ $bdir == $currentdir* ]]; then + echo "Given build directory: $bdir" + if echo "$bdir/" \ + | grep '^'$currentdir 2> /dev/null > /dev/null; then # If it was newly created, it will be empty, so delete it. if ! [ "$(ls -A $bdir)" ]; then rm --dir $bdir; fi @@ -299,10 +712,10 @@ if [ x"$input_dir" = x ]; then else indir=$input_dir fi -mk20name=$(awk '!/^#/ && $1=="MK20DATA" {print $3}' $adir/INPUTS.mk) -mk20md5=$(awk '!/^#/ && $1=="MK20MD5" {print $3}' $adir/INPUTS.mk) -mk20size=$(awk '!/^#/ && $1=="MK20SIZE" {print $3}' $adir/INPUTS.mk) -mk20url=$(awk '!/^#/ && $1=="MK20URL" {print $3}' $adir/INPUTS.mk) +mk20name=$(awk '!/^#/ && $1=="MK20DATA" {print $3}' $adir/INPUTS.conf) +mk20md5=$(awk '!/^#/ && $1=="MK20MD5" {print $3}' $adir/INPUTS.conf) +mk20size=$(awk '!/^#/ && $1=="MK20SIZE" {print $3}' $adir/INPUTS.conf) +mk20url=$(awk '!/^#/ && $1=="MK20URL" {print $3}' $adir/INPUTS.conf) if [ $rewritepconfig = yes ] && [ x"$input_dir" = x ]; then cat <<EOF @@ -387,6 +800,7 @@ if [ $rewritepconfig = yes ]; then sed -e's|@bdir[@]|'"$bdir"'|' \ -e's|@indir[@]|'"$indir"'|' \ -e's|@ddir[@]|'"$ddir"'|' \ + -e's|@sys_cpath[@]|'"$sys_cpath"'|' \ -e's|@downloader[@]|'"$downloader"'|' \ -e's|@groupname[@]|'"$reproducible_paper_group_name"'|' \ $pconf.in >> $pconf @@ -630,195 +1044,7 @@ 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 hascc=1; fi -else - if type gcc > /dev/null 2>/dev/null; then - if type g++ > /dev/null 2>/dev/null; then hascc=1; fi - else - if type clang > /dev/null 2>/dev/null; then - if type clang++ > /dev/null 2>/dev/null; then hascc=1; fi - fi - fi -fi -if [ $hascc = 0 ]; then - cat <<EOF -______________________________________________________ -!!!!!!! C/C++ Compiler NOT FOUND !!!!!!! - -To build the project's software, the host system needs to have basic C and -C++ compilers. The executables that were checked are 'cc', 'gcc' and -'clang' for a C compiler, and 'c++', 'g++' and 'clang++' for a C++ -compiler. If you have a relevant compiler that is not checked, please get -in touch with us (with the form below) so we add it: - - https://savannah.nongnu.org/support/?func=additem&group=reproduce -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -EOF - exit 1 -fi - - - - - -# Check C compiler -# ---------------- -gcc_works=0 -testprog=$tmpblddir/test-c -testsource=$tmpblddir/test.c -echo; echo; echo "Checking host C compiler..."; -echo "#include <stdio.h>" > $testsource -echo "#include <stdlib.h>" >> $testsource -echo "int main(void){printf(\"...C compiler works.\n\");" >> $testsource -echo " return EXIT_SUCCESS;}" >> $testsource -if gcc $testsource -o$testprog && $testprog; then - rm $testsource $testprog -else - rm $testsource - cat <<EOF - -______________________________________________________ -!!!!!!! C compiler doesn't work !!!!!!! - -Host C compiler ('gcc') 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 -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 - -TIP: Once you find the solution, you can use the '-e' option to use -existing configuration: - - $ ./project configure -e - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -EOF - exit 1 -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. -oprog=$sdir/rpath-test -cprog=$sdir/rpath-test.c -echo "#include <stdio.h>" > $cprog -echo "int main(void) {return 0;}" >> $cprog -if [ x$CC = x ]; then CC=gcc; fi; -if $CC $cprog -o$oprog -Wl,-rpath-link &> /dev/null; then - export rpath_command="-Wl,-rpath-link=$instdir/lib" -else - export rpath_command="" -fi -rm -f $oprog $cprog - - - - - -# See if we need the dynamic-linker (-ldl) -# ---------------------------------------- -# -# Some programs (like Wget) need dynamic loading (using `libdl'). On -# GNU/Linux systems, we'll need the `-ldl' flag to link such programs. But -# Mac OS doesn't need any explicit linking. So we'll check here to see if -# it is present (thus necessary) or not. -oprog=$sdir/ldl-test -cprog=$sdir/ldl-test.c -cat > $cprog <<EOF -#include <stdio.h> -#include <dlfcn.h> -int -main(void) { - void *handle=dlopen ("/lib/CEDD_LIB.so.6", RTLD_LAZY); - return 0; -} -EOF -if gcc $cprog -o$oprog &> /dev/null; then needs_ldl=no; else needs_ldl=yes; fi -rm -f $oprog $cprog - - - - - -# See if the C compiler can build static libraries -# ------------------------------------------------ - -# We are manually only working with shared libraries: because some -# high-level programs like Wget and cURL need dynamic linking and if we -# build the libraries statically, our own builds will be ignored and these -# programs will go and find their necessary libraries on the host system. -# -# Another good advantage of shared libraries is that we can actually use -# the shared library tool of the system (`ldd' with GNU C Library) and see -# exactly where each linked library comes from. But in static building, -# unless you follow the build closely, its not easy to see if the source of -# the library came from the system or our build. -static_build=no - -#oprog=$sdir/static-test -#cprog=$sdir/static-test.c -#echo "#include <stdio.h>" > $cprog -#echo "int main(void) {return 0;}" >> $cprog -#if [ x$CC = x ]; then CC=gcc; fi; -#if $CC $cprog -o$oprog -static &> /dev/null; then -# export static_build="yes" -#else -# export static_build="no" -#fi -#rm -f $oprog $cprog -#if [ $printnotice = yes ] && [ $static_build = "no" ]; then -# cat <<EOF -#_________________________________________________________________________ -#!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!! -# -#Your system's C compiler ('$CC') doesn't support building static -#libraries. Therefore the dependencies will be built dynamically. This means -#that they will depend more strongly on changes/updates in the host -#system. For high-level applications (like most research projects in natural -#sciences), this shouldn't be a significant problem. -# -#But generally, for reproducibility, its better to build static libraries -#and programs. For more on their difference (and generally an introduction -#on linking), please see the link below: -# -#https://www.gnu.org/software/gnuastro/manual/html_node/Linking.html -# -#If you have other compilers on your system, you can select a different -#compiler by setting the 'CC' environment variable before running -#'./project configure'. -# -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# -#EOF -# sleep 5 -#fi - - - - - -# inform the user that the build process is starting +# Inform the user that the build process is starting # ------------------------------------------------- if [ $printnotice = yes ]; then tsec=10 @@ -839,12 +1065,13 @@ will be installed in: **TIP**: you can see which software is being installed at every moment with the following command. See "Inspecting status" section of 'README-hacking.md' for more. In short, run it while the project is being -configured (in another terminal, but on this same directory: '`pwd`'): +configured (in another terminal, but on this same directory: 'pwd'): - $ while true; do echo; date; ls .build/software/build-tmp; sleep 1; done + $ ./project --check-config -------------------------- +Project's configuration will continue in $tsec seconds. +------------------------- EOF sleep $tsec @@ -854,241 +1081,6 @@ fi -# If we are on a Mac OS system -# ---------------------------- -# -# For the time being, we'll use the existance of `otool' to see if we are -# on a Mac OS system or not. Some tools (for example OpenSSL) need to know -# this. -# -# On Mac OS, the building of GCC crashes sometimes while building libiberty -# with CLang's `g++'. Until we find a solution, we'll just use the host's C -# compiler. -if type otool > /dev/null 2>/dev/null; then - host_cc=1 - on_mac_os=yes -else - on_mac_os=no -fi - - - - - -# See if GCC can be built -# ----------------------- -# -# On some GNU/Linux distros, the C compiler is broken into `multilib' (for -# 32-bit and 64-bit support, with their own headers). On these systems, -# `/usr/include/sys/cdefs.h' and `/usr/lib/libc.a' are not available by -# default. So GCC will crash with different ugly errors! The only solution -# is that user manually installs the `multilib' part as root, before -# running the configure script. -# -# Note that `sys/cdefs.h' may be available in other directories (for -# example `/usr/include/x86_64-linux-gnu/') that are automatically included -# in an installed GCC. HOWEVER during the build of GCC, all those other -# directories are ignored. So even if they exist, they are useless. -gccwarning=0 -if [ $host_cc = 0 ]; then - if ! [ -f /usr/include/sys/cdefs.h ]; then - host_cc=1 - gccwarning=1 - cat <<EOF - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!!!!!!!!!!!!!!!!!!!!!! Warning !!!!!!!!!!!!!!!!!!!!!! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -This system doesn't have '/usr/include/sys/cdefs.h'. Because of this, the -project can't build its custom GCC to ensure better reproducibility. We -strongly recommend installing the proper package (for your operating -system) that installs this necessary file. For example on some Debian-based -GNU/Linux distros, you need these two packages: 'gcc-multilib' and -'g++-multilib'. -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -EOF - fi - - if [ -f /usr/lib/libc.a ] || [ -f /usr/lib64/libc.a ]; then - # This is just a place holder - host_cc=$host_cc - else - host_cc=1 - gccwarning=1 - cat <<EOF - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!!!!!!!!!!!!!!!!!!!!!! Warning !!!!!!!!!!!!!!!!!!!!!! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -This system doesn't have '/usr/lib/libc.a' or '/usr/lib64/libc.a'. Because -of this, the project can't build its custom GCC to ensure better -reproducibility. We recommend installing the proper package (for your -operating system) that installs this necessary file. - -Some possible solutions: - 1. On some Debian-based GNU/Linux distros, these two packages may fix the - problem: 'gcc-multilib' and 'g++-multilib'. - 2. (BE CAREFUL!) If you have '/usr/lib/x86_64-linux-gnu' but don't have - '/usr/lib64', then running the following command might fix this - particular problem by making a symbolic link. - $ sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64 - After the configure script is finished, delete the link with 'rm - /usr/lib64' (you won't need it any more as far as this project is - concerned). -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -EOF - fi -fi - -# See if a link-able static C library exists -# ------------------------------------------ -# -# After building GCC, we must use PatchELF to correct its RPATHs. However, -# PatchELF links internally with `libstdc++'. So a dynamicly linked -# PatchELF cannot be used to correct the links to `libstdc++' in general -# (on some systems this causes no problem, but on others it doesn't!). -# -# However, to build a Static PatchELF, we need to be able to link with the -# static C library, which is not always available on some GNU/Linux -# systems. Therefore we need to check this here. If we can't build a static -# PatchELF, we won't build any GCC either. -if [ $host_cc = 0 ]; then - testprog=$tmpblddir/test-c - testsource=$tmpblddir/test.c - echo; echo; echo "Checking if static C library is available..."; - echo "#include <stdio.h>" > $testsource - echo "#include <stdlib.h>" >> $testsource - echo "int main(void){printf(\"...yes\");" >> $testsource - echo " return EXIT_SUCCESS;}" >> $testsource - if gcc $testsource -o$testprog -static -lc && $testprog; then - good_static_libc=1 - rm $testsource $testprog - else - good_static_libc=0 - rm $testsource - gccwarning=1 - host_cc=1 - cat <<EOF - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!!!!!!!!!!!!!!!!!!!!!! Warning !!!!!!!!!!!!!!!!!!!!!! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -A usable static C library ('libc.a', in any directory) cannot be linked in -the current settings of this system. Because of this we can't build a -static PatchELF, hence we can't build GCC. - -If you have 'libc.a', but in a non-standard location (for example in -'/PATH/TO/STATIC/LIBC/libc.a'), please run this command, then re-configure -the project to fix this problem. - -export LDFLAGS="-L/PATH/TO/STATIC/LIBC \$LDFLAGS" - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -EOF - fi -fi - -# Print a warning if GCC is not meant to be built. -if [ $gccwarning = 1 ]; then - cat <<EOF - -PLEASE SEE THE WARNINGS ABOVE. - -Since GCC is pretty low-level, this configuration script will continue in 5 -seconds and use your system's C compiler (it won't build a custom GCC). But -please consider installing the necessary package(s) to complete your C -compiler, then re-run './project configure'. - -EOF - sleep 5 -fi - - - - - -# Fortran compiler -# ---------------- -# -# 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. -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 -______________________________________________________ -!!!!!!! Fortran Compiler NOT FOUND !!!!!!! - -Because the project won't be building its own GCC (which includes a Fortran -compiler), you need to have a Fortran compiler available. Fortran is -commonly necessary for many lower-level scientific programs. 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: - - https://savannah.nongnu.org/support/?func=additem&group=reproduce - -Note: GCC will not be built because you are either using the '--host-cc' -option, or you are using an operating system that currently has bugs when -building GCC. -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -EOF - exit 1 - fi - - # See if the Fortran compiler works - testprog=$tmpblddir/test-f - testsource=$tmpblddir/test.f - echo; echo; echo "Checking host Fortran compiler..."; - echo " PRINT *, \"... Fortran Compiler works.\"" > $testsource - echo " END" >> $testsource - if gfortran $testsource -o$testprog && $testprog; then - rm $testsource $testprog - else - rm $testsource - cat <<EOF - -______________________________________________________ -!!!!!!! Fortran compiler doesn't work !!!!!!! - -Host Fortran compiler ('gfortran') can't build a simple program. - -A working Fortran compiler is necessary for building some of the project's -software. Please use the error message above to find a good solution 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 - -TIP: Once you find the solution, you can use the '-e' option to use -existing configuration: - - $ ./project configure -e - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -EOF - exit 1 - fi -fi - - - - - # Number of threads for basic builds # ---------------------------------- # @@ -1181,6 +1173,32 @@ fi +# Paths needed by the host compiler (only for `basic.mk') +# ------------------------------------------------------- +# +# At the end of the basic build, we need to build GCC. But GCC will build +# in multiple phases, making its own simple compiler in order to build +# itself completely. The intermediate/simple compiler doesn't recognize +# some system specific locations like `/usr/lib/ARCHITECTURE' that some +# operating systems use. We thus need to tell the intermediate compiler +# where its necessary libraries and headers are. +if [ x"$sys_library_path" != x ]; then + if [ x"$LIBRARY_PATH" = x ]; then + export LIBRARY_PATH="$sys_library_path" + else + export LIBRARY_PATH="$LIBRARY_PATH:$sys_library_path" + fi + if [ x"$CPATH" = x ]; then + export CPATH="$sys_cpath" + else + export CPATH="$CPATH:$sys_cpath" + fi +fi + + + + + # Build basic software # -------------------- # @@ -1188,13 +1206,14 @@ fi # Bash, Make, or AWK. In this step, we'll install such low-level basic # tools, but we have to be very portable (and use minimal features in all). echo; echo "Building necessary software (if necessary)..." -make -f reproduce/software/make/basic.mk \ +make -k -f reproduce/software/make/basic.mk \ + sys_library_path=$sys_library_path \ good_static_libc=$good_static_libc \ rpath_command=$rpath_command \ static_build=$static_build \ + numthreads=$numthreads \ needs_ldl=$needs_ldl \ on_mac_os=$on_mac_os \ - numthreads=$numthreads \ host_cc=$host_cc \ -j$numthreads @@ -1215,11 +1234,13 @@ else numthreads=$jobs fi .local/bin/env -i HOME=$bdir \ - .local/bin/make -f reproduce/software/make/high-level.mk \ + .local/bin/make -k -f reproduce/software/make/high-level.mk \ + sys_library_path=$sys_library_path \ rpath_command=$rpath_command \ static_build=$static_build \ numthreads=$numthreads \ on_mac_os=$on_mac_os \ + sys_cpath=$sys_cpath \ host_cc=$host_cc \ -j$numthreads @@ -1279,8 +1300,8 @@ fi # After everything is installed, we'll put all the names and versions in a # human-readable paragraph and also prepare the BibTeX citation for the # software. -function prepare_name_version() { - +prepare_name_version () +{ # First see if the (possible) `*' in the input arguments corresponds to # anything. Note that some of the given directories may be empty (no # software installed). @@ -1385,9 +1406,9 @@ echo `.local/bin/date` > $finaltarget # The configuration is now complete, we can inform the user on the next # step(s) to take. if [ x$reproducible_paper_group_name = x ]; then - buildcommand="./project prepare -j8" + buildcommand="./project make -j8" else - buildcommand="./project prepare --group=$reproducible_paper_group_name -j8" + buildcommand="./project make --group=$reproducible_paper_group_name -j8" fi cat <<EOF diff --git a/reproduce/software/bash/git-post-checkout b/reproduce/software/shell/git-post-checkout index f6366dc..f6366dc 100755 --- a/reproduce/software/bash/git-post-checkout +++ b/reproduce/software/shell/git-post-checkout diff --git a/reproduce/software/bash/git-pre-commit b/reproduce/software/shell/git-pre-commit index 9d550db..9d550db 100755 --- a/reproduce/software/bash/git-pre-commit +++ b/reproduce/software/shell/git-pre-commit |