aboutsummaryrefslogtreecommitdiff
path: root/reproduce
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2018-11-13 16:58:13 +0000
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2018-11-13 16:58:13 +0000
commit66c1b59ea170032f54441fed39a3ed255070c400 (patch)
treef9c9dc1c710d73669ff4085d25a272615bafa1ef /reproduce
parent080d9176fa3fc281cf7974b8431a6c5f3be62dab (diff)
Most library versions are now also checked
All the libraries that define their version string as a macro in their headers are now also checked in `reproduce/src/make/initialize.mk'. Also, the CFITSIO tarball now follows the same versioning style as the rest of the tarballs: a script is added to convert the version string into what is included in the tarball.
Diffstat (limited to 'reproduce')
-rw-r--r--reproduce/config/pipeline/dependency-versions.mk4
-rw-r--r--reproduce/src/make/dependencies.mk65
-rw-r--r--reproduce/src/make/initialize.mk72
3 files changed, 89 insertions, 52 deletions
diff --git a/reproduce/config/pipeline/dependency-versions.mk b/reproduce/config/pipeline/dependency-versions.mk
index bf19dc1..ad8dd2c 100644
--- a/reproduce/config/pipeline/dependency-versions.mk
+++ b/reproduce/config/pipeline/dependency-versions.mk
@@ -9,16 +9,16 @@ ghostscript-version = 9.25
git-version = 2.19.1
gnuastro-version = 0.7.60-4c9eb
grep-version = 3.1
+libtool-version = 2.4.6
make-version = 4.2.90
sed-version = 4.5
# Libraries
-cfitsio-version = 3450
+cfitsio-version = 3.45
curl-version = 7.62.0
gsl-version = 2.5
libjpeg-version = v9b
libgit2-version = 0.26.0
libtiff-version = 4.0.10
-libtool-version = 2.4.6
wcslib-version = 6.2
zlib-version = 1.2.11
diff --git a/reproduce/src/make/dependencies.mk b/reproduce/src/make/dependencies.mk
index fdc30a1..1a0a5d1 100644
--- a/reproduce/src/make/dependencies.mk
+++ b/reproduce/src/make/dependencies.mk
@@ -72,25 +72,31 @@ LD_LIBRARY_PATH := $(ildir):$(LD_LIBRARY_PATH)
# --------
#
# All the necessary tarballs are defined and prepared with this rule.
-tarballs = $(foreach t, bash-$(bash-version).tar.gz \
- cfitsio$(cfitsio-version).tar.gz \
- cmake-$(cmake-version).tar.gz \
- coreutils-$(coreutils-version).tar.xz \
- curl-$(curl-version).tar.gz \
- gawk-$(gawk-version).tar.gz \
- ghostscript-$(ghostscript-version).tar.gz \
- git-$(git-version).tar.xz \
- gnuastro-$(gnuastro-version).tar.lz \
- grep-$(grep-version).tar.xz \
- gsl-$(gsl-version).tar.gz \
- jpegsrc.$(libjpeg-version).tar.gz \
- tiff-$(libtiff-version).tar.gz \
- libtool-$(libtool-version).tar.gz \
- libgit2-$(libgit2-version).tar.gz \
- sed-$(sed-version).tar.xz \
- make-$(make-version).tar.gz \
- wcslib-$(wcslib-version).tar.bz2 \
- zlib-$(zlib-version).tar.gz \
+#
+# Note that we want the tarballs to follow the convention of NAME-VERSION
+# before the `tar.XX' prefix. For those programs that don't follow this
+# convention, but include the name/version in their tarball names with
+# another format, we'll do the modification before the download so the
+# downloaded file has our desired format.
+tarballs = $(foreach t, bash-$(bash-version).tar.gz \
+ cfitsio-$(cfitsio-version).tar.gz \
+ cmake-$(cmake-version).tar.gz \
+ coreutils-$(coreutils-version).tar.xz \
+ curl-$(curl-version).tar.gz \
+ gawk-$(gawk-version).tar.gz \
+ ghostscript-$(ghostscript-version).tar.gz \
+ git-$(git-version).tar.xz \
+ gnuastro-$(gnuastro-version).tar.lz \
+ grep-$(grep-version).tar.xz \
+ gsl-$(gsl-version).tar.gz \
+ jpegsrc.$(libjpeg-version).tar.gz \
+ tiff-$(libtiff-version).tar.gz \
+ libtool-$(libtool-version).tar.gz \
+ libgit2-$(libgit2-version).tar.gz \
+ sed-$(sed-version).tar.xz \
+ make-$(make-version).tar.gz \
+ wcslib-$(wcslib-version).tar.bz2 \
+ zlib-$(zlib-version).tar.gz \
, $(tdir)/$(t) )
$(tarballs): $(tdir)/%:
if [ -f $(DEPENDENCIES-DIR)/$* ]; then
@@ -98,13 +104,21 @@ $(tarballs): $(tdir)/%:
else
# Remove all numbers, `-' and `.' from the tarball name so we can
# search more easily only with the program name.
- n=$$(echo $* | sed -e's/[0-9\-]/ /g' -e's/\./ /g' \
+ n=$$(echo $* | sed -e's/[0-9\-]/ /g' -e's/\./ /g' \
| awk '{print $$1}' )
# Set the top download link of the requested tarball.
mergenames=1
if [ $$n = bash ]; then w=http://ftp.gnu.org/gnu/bash
- elif [ $$n = cfitsio ]; then w=https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c
+ elif [ $$n = cfitsio ]; then
+ mergenames=0
+ v=$$(echo $(cfitsio-version) | sed -e's/\.//' \
+ | awk '{l=length($1); \
+ printf (l==4 ? "%d\n" \
+ : (l==3 ? "%d0\n" \
+ : (l==2 ? "%d00\n" \
+ : "%d000\n") ), $$1)}')
+ w=https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio$$v.tar.gz
elif [ $$n = cmake ]; then w=https://cmake.org/files/v3.12
elif [ $$n = coreutils ]; then w=http://ftp.gnu.org/gnu/coreutils
elif [ $$n = curl ]; then w=https://curl.haxx.se/download
@@ -142,12 +156,7 @@ $(tarballs): $(tdir)/%:
else tarballurl=$$w
fi
echo "Downloading $$tarballurl"
- if [ $$mergenames = 1 ]; then
- $(DOWNLOADER) $@ $$tarballurl
- else
- $(DOWNLOADER) $@_tmp $$tarballurl
- mv $@_tmp $@
- fi
+ $(DOWNLOADER) $@ $$tarballurl
fi
@@ -182,7 +191,7 @@ cbuild = cd $(ddir); rm -rf $(2); tar xf $(tdir)/$(1); cd $(2); \
# Libraries
# ---------
-$(ildir)/libcfitsio.a: $(tdir)/cfitsio$(cfitsio-version).tar.gz \
+$(ildir)/libcfitsio.a: $(tdir)/cfitsio-$(cfitsio-version).tar.gz \
$(ildir)/libcurl.a \
$(ibdir)/ls
$(call gbuild,$(subst $(tdir),,$<), cfitsio, static, \
diff --git a/reproduce/src/make/initialize.mk b/reproduce/src/make/initialize.mk
index b8d71c6..563462f 100644
--- a/reproduce/src/make/initialize.mk
+++ b/reproduce/src/make/initialize.mk
@@ -147,16 +147,28 @@ distclean: clean
# Check the version of programs which write their version
# -------------------------------------------------------
-vercheck = prog="$(strip $(1))"; \
- ver="$(strip $(2))"; \
- name="$(strip $(3))"; \
- macro="$(strip $(4))"; \
- v=$$($$prog --version | awk '/'$$ver'/{print "y"}'); \
- if [ x$$v != xy ]; then \
- echo; echo "PIPELINE ERROR: Not running $$name $$ver"; echo; \
- exit 1; \
- fi; \
- echo "\newcommand{\\$$macro}{$$ver}" >> $@
+pvcheck = prog="$(strip $(1))"; \
+ ver="$(strip $(2))"; \
+ name="$(strip $(3))"; \
+ macro="$(strip $(4))"; \
+ v=$$($$prog --version | awk '/'$$ver'/{print "y"}'); \
+ if [ x$$v != xy ]; then \
+ echo; echo "PIPELINE ERROR: Not running $$name $$ver"; echo; \
+ exit 1; \
+ fi; \
+ echo "\newcommand{\\$$macro}{$$ver}" >> $@
+
+lvcheck = idir=$(BDIR)/dependencies/installed/include; \
+ f="$$idir/$(strip $(1))"; \
+ ver="$(strip $(2))"; \
+ name="$(strip $(3))"; \
+ macro="$(strip $(4))"; \
+ v=$$(awk '$$1=="\#define" && /'$$ver'/ {print "y"}' $$f); \
+ if [ x$$v != xy ]; then \
+ echo; echo "PIPELINE ERROR: Not linking with $$name $$ver"; \
+ echo; exit 1; \
+ fi; \
+ echo "\newcommand{\\$$macro}{$$ver}" >> $@
@@ -175,17 +187,33 @@ $(mtexdir)/initialize.tex: | $(mtexdir)
echo "\newcommand{\pipelineversion}{$$v}" > $@
@echo "\newcommand{\bdir}{$(BDIR)}" >> $@
- # Versions of programs (same order as `dependency-versions.mk').
- $(call vercheck, bash, $(bash-version), GNU Bash, bashversion)
- $(call vercheck, cmake, $(cmake-version), CMake, cmakeversion)
- $(call vercheck, ls, $(coreutils-version), GNU Coreutils, \
+ # Versions of programs (same order as 'dependency-versions.mk').
+ $(call pvcheck, bash, $(bash-version), GNU Bash, bashversion)
+ $(call pvcheck, cmake, $(cmake-version), CMake, cmakeversion)
+ $(call pvcheck, ls, $(coreutils-version), GNU Coreutils, \
coreutilsversion)
- $(call vercheck, awk, $(gawk-version), GNU AWK, gawkversion)
- $(call vercheck, gs, $(ghostscript-version), GPL Ghostscript, \
- ghostscriptversion)
- $(call vercheck, git, $(git-version), Git, gitversion)
- $(call vercheck, astnoisechisel, $(gnuastro-version), Gnuastro, \
+ $(call pvcheck, awk, $(gawk-version), GNU AWK, gawkversion)
+ $(call pvcheck, gs, $(ghostscript-version), GPL Ghostscript, \
+ ghostscriptversion)
+ $(call pvcheck, git, $(git-version), Git, gitversion)
+ $(call pvcheck, astnoisechisel, $(gnuastro-version), Gnuastro, \
gnuastroversion)
- $(call vercheck, grep, $(grep-version), GNU Grep, grepversion)
- $(call vercheck, make, $(make-version), GNU Make, makeversion)
- $(call vercheck, sed, $(sed-version), GNU SED, sedversion)
+ $(call pvcheck, grep, $(grep-version), GNU Grep, grepversion)
+ $(call pvcheck, libtool, $(libtool-version), GNU Libtool, \
+ libtoolversion)
+ $(call pvcheck, make, $(make-version), GNU Make, makeversion)
+ $(call pvcheck, sed, $(sed-version), GNU SED, sedversion)
+
+ # Versions of libraries.
+ $(call lvcheck, fitsio.h, $(cfitsio-version), CFITSIO, cfitsioversion)
+ ########## Curl library not yet checked.
+ $(call lvcheck, gsl/gsl_version.h, $(gsl-version), \
+ GNU Scientific Library (GSL), gslversion)
+ ########## libjpeg not yet checked.
+ $(call lvcheck, git2/version.h, $(libgit2-version), Libgit2, \
+ libgitwoversion)
+ $(call lvcheck, tiffvers.h, $(libtiff-version), Libtiff, \
+ libtiffversion)
+ $(call lvcheck, wcslib/wcsconfig.h, $(wcslib-version), WCSLIB, \
+ wcslibversion)
+ $(call lvcheck, zlib.h, $(zlib-version), zlib, zlibversion)