From b835c158f3cf3b6525e734c0f0468d000b19005a Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Mon, 22 Apr 2019 17:12:32 +0100 Subject: High-level software now specified in TARGETS.mk Until now, to specify which high-level software you want the project to contain, it was necessary to go into the `high-level.mk' Makefile that is complicated and can create bugs. With this commit, a new `reproduce/software/config/installation/TARGETS.mk' file has been created that is easily/cleanly in charge of documenting the final high-level software that must be built for the project. Also, until now, FFTW was set as a dependency of Numpy while we couldn't actually get Numpy to use it! It was just there for future reference and to justify its build rule. But now that many software won't be built and there is no problem with having rules even though a project might not use them, it has been removed. --- README-hacking.md | 44 +++---- configure | 7 +- reproduce/software/config/installation/TARGETS.mk | 41 +++++++ reproduce/software/config/installation/versions.mk | 117 ++++++++++++------- reproduce/software/make/basic.mk | 130 +++++++++++---------- reproduce/software/make/high-level.mk | 112 ++++++++---------- reproduce/software/make/python.mk | 15 ++- 7 files changed, 259 insertions(+), 207 deletions(-) create mode 100644 reproduce/software/config/installation/TARGETS.mk diff --git a/README-hacking.md b/README-hacking.md index b11f325..2314bf9 100644 --- a/README-hacking.md +++ b/README-hacking.md @@ -497,7 +497,7 @@ get more advanced in later stages of your work. outputs with `make clean` as shown below. ```shell - $ ./configure # Set top directories and build dependencies. + $ ./configure --host-cc # Set top directories and build dependencies (except for GCC which can take long). $ .local/bin/make # Do the (mainly symbolic) processing and build paper # Open 'paper.pdf' and see if everything is ok. @@ -540,31 +540,23 @@ get more advanced in later stages of your work. managing the title and authors, please feel free to use your own methods after finishing this checklist and doing your first commit. - - **Gnuastro**: GNU Astronomy Utilities (Gnuastro) is currently a - dependency of the template which will be built and used. The main - reason for this is to demonstrate how critically important it is to - version your scientific tools. If you don't need Gnuastro for your - research, you can simply remove the parts enclosed in marked parts in - the relevant files of the list below. The marks are comments, which - you can find by searching for "Gnuastro". If you will be using - Gnuastro, then remove the commented marks and keep the code within - them. - - - Delete marked part(s) in `configure`. - - Delete the `reproduce/software/config/gnuastro` directory. - - Delete `gnuastro` from the value of `top-level-programs` in - `reproduce/software/make/high-level.mk`. You can keep the rule to - build `gnuastro`, since its not in the `top-level-programs` list, it - (and all the dependencies that are only needed by Gnuastro) will be - ignored. - - Delete marked parts in `reproduce/analysis/make/initialize.mk`. - - - **Other dependencies**: If there are any more software that you don't - use (or others that you need), then remove (or add) them in the - respective parts of `top-level-programs` of - `reproduce/software/make/high-level`. It is commented thoroughly and - reading over the comments should guide you on what to add/remove and - where. + - **High-level software**: The template installs all the software that + your project needs. You can specify which software your project needs + in the `reproduce/software/config/installation/TARGETS.mk`. The + necessary software are classified into two classes: 1) programs or + libraries (usually written in C/C++) which are run directly by the + operating system. 2) Python modules/libraires that are run within + Python. By default `TARGETS.mk` only has GNU Astronomy Utilities + (Gnuastro) as one scientific program and Astropy as one scientific + Python module. Both have many dependencies which will be installed + into your project before they are. To see a list of software that are + currently ready to be built in the template, see + `reproduce/software/config/installation/versions.mk` (which has their + versions also), the comments in `TARGETS.mk` describe how to use the + software name from `versions.mk`. Currently the raw pipeline just uses + Gnuastro to make the demonstration plots. Therefore if you don't need + Gnuastro, go through the analysis steps in `reproduce/analysis` and + remove all its use cases (clearly marked). - **Input dataset (can be done later)**: The input datasets are managed through the `reproduce/analysis/config/INPUTS.mk` file. It is best to diff --git a/configure b/configure index 55ce4dc..a71c815 100755 --- a/configure +++ b/configure @@ -643,12 +643,9 @@ if ! [ -d $tmpblddir ]; then mkdir $tmpblddir; fi verdir=$instdir/version-info if ! [ -d $verdir ]; then mkdir $verdir; fi -ibidir=$verdir/bin +ibidir=$verdir/proglib if ! [ -d $ibidir ]; then mkdir $ibidir; fi -ilidir=$verdir/lib -if ! [ -d $ilidir ]; then mkdir $ilidir; fi - ipydir=$verdir/python if ! [ -d $ipydir ]; then mkdir $ipydir; fi @@ -1082,7 +1079,7 @@ function prepare_name_version() { # Report the different software in separate contexts (separating Python and # TeX packages from the C/C++ programs and libraries). -proglibs=$(prepare_name_version $verdir/bin/* $verdir/lib/*) +proglibs=$(prepare_name_version $verdir/proglib/*) pymodules=$(prepare_name_version $verdir/python/*) texpkg=$(prepare_name_version $verdir/tex/texlive) diff --git a/reproduce/software/config/installation/TARGETS.mk b/reproduce/software/config/installation/TARGETS.mk new file mode 100644 index 0000000..4b1ff2e --- /dev/null +++ b/reproduce/software/config/installation/TARGETS.mk @@ -0,0 +1,41 @@ +# Necessary high-level software to build in this project. +# +# Copyright (C) 2018-2019 Mohammad Akhlaghi +# +# 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. + + + + + +# AVAILABLE SOFTWARE +# ------------------ +# +# All software that are currently available for installation can be seen in +# the following file. +# +# reproduce/software/config/installation/versions.mk +# +# 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). 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 +# software MUST NOT be added here. + + + + + +# Programs and libraries. +top-level-programs = gnuastro + +# Python libraries/modules. +top-level-python = astropy diff --git a/reproduce/software/config/installation/versions.mk b/reproduce/software/config/installation/versions.mk index 5761165..cfa7f81 100644 --- a/reproduce/software/config/installation/versions.mk +++ b/reproduce/software/config/installation/versions.mk @@ -16,40 +16,27 @@ # A copy of the GNU General Public License is available at # . -# C/C++ programs and libraries. -astrometrynet-version = 0.77 -atlas-version = 3.10.3 + + + + +# Basic/low-level programs and libraires (installed in any case) +# -------------------------------------------------------------- bash-version = 5.0 binutils-version = 2.31.1 -cairo-version = 1.16.0 -cdsclient-version = 3.84 -cfitsio-version = 3.45 -cmake-version = 3.14.2 coreutils-version = 8.31 curl-version = 7.63.0 diffutils-version = 3.7 -fftw-version = 3.3.8 file-version = 5.36 findutils-version = 4.6.0.199-e3fc -flock-version = 0.2.3 -freetype-version = 2.9 gawk-version = 5.0.0 gcc-version = 8.3.0 -ghostscript-version = 9.26 git-version = 2.21.0 gmp-version = 6.1.2 -gnuastro-version = 0.8 grep-version = 3.3 -gsl-version = 2.5 gzip-version = 1.10 -hdf5-version = 1.10.5 isl-version = 0.18 libbsd-version = 0.9.1 -libffi-version = 3.2.1 -libjpeg-version = v9b -libtiff-version = 4.0.10 -libtool-version = 2.4.6 -libxml2-version = 2.9.9 lzip-version = 1.20 m4-version = 1.4.18 make-version = 4.2.90 @@ -57,20 +44,11 @@ metastore-version = 1.1.2-23-fa9170b mpfr-version = 4.0.2 mpc-version = 1.1.0 ncurses-version = 6.1 -netpbm-version = 10.47.72 -openblas-version = 0.3.5 -openmpi-version = 4.0.1 openssl-version = 1.1.1a patchelf-version = 0.9 -pixman-version = 0.38.0 pkgconfig-version = 0.29.2 -python-version = 3.7.3 readline-version = 8.0 -scamp-version = 2.6.7 sed-version = 4.7 -sextractor-version = 2.25.0 -swarp-version = 2.38.0 -swig-version = 3.0.12 tar-version = 1.32 unzip-version = 6.0 wget-version = 1.20.3 @@ -79,24 +57,57 @@ xz-version = 5.2.4 zip-version = 3.0 zlib-version = 1.2.11 -# Special libraries -# ----------------- + + + + +# Optional/high-level programs and libraries +# ------------------------------------------ # -# When updating the version of these libraries, please look into the build -# rule first: In one way or another, the version string becomes necessary -# during their build and must be accounted for. In particular: -# `libpng' is downgraded because `netpbm' requires `libpng' version < 1.5 -bzip2-version = 1.0.6 -lapack-version = 3.8.0 -libgit2-version = 0.26.0 -libpng-version = 1.4.22 -wcslib-version = 6.2 +# 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. +astrometrynet-version = 0.77 +atlas-version = 3.10.3 +cairo-version = 1.16.0 +cdsclient-version = 3.84 +cfitsio-version = 3.45 +cmake-version = 3.14.2 +fftw-version = 3.3.8 +flock-version = 0.2.3 +freetype-version = 2.9 +ghostscript-version = 9.26 +gnuastro-version = 0.9 +gsl-version = 2.5 +hdf5-version = 1.10.5 +libffi-version = 3.2.1 +libjpeg-version = v9b +libtiff-version = 4.0.10 +libtool-version = 2.4.6 +libxml2-version = 2.9.9 +netpbm-version = 10.47.72 +openblas-version = 0.3.5 +openmpi-version = 4.0.1 +pixman-version = 0.38.0 +python-version = 3.7.3 +scamp-version = 2.6.7 +sextractor-version = 2.25.0 +swarp-version = 2.38.0 +swig-version = 3.0.12 + + + + # Python packages # --------------- # -# IMPORTANT: Fix url in `reproduce/src/make/dependencies.mk' -# if changing the version +# Similar to optional programs and libraries above. +# +# IMPORTANT: If you intend to change the version of any of the Python +# modules/libraries below, please fix the hash strings of the respective +# URL in `reproduce/software/make/python.mk'. asn1crypto-version = 0.24.0 astroquery-version = 0.3.9 astropy-version = 3.1.1 @@ -132,3 +143,27 @@ soupsieve-version = 1.8 urllib3-version = 1.24.1 virtualenv-version = 16.4.0 webencodings-version = 0.5.1 + + + + + +# Special programs and libraries +# ------------------------------ +# +# When updating the version of these libraries, please look into the build +# rule first: In one way or another, the version string becomes necessary +# during their build and must be accounted for. +# +# Special notes: +# - `libpng' is downgraded: the current installation of `netpbm' requires +# a version less than 1.5. + +# Basic/low-level +bzip2-version = 1.0.6 + +# Optional/high-level +lapack-version = 3.8.0 +libgit2-version = 0.26.0 +libpng-version = 1.4.22 +wcslib-version = 6.2 diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 43ccfa1..323a221 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -42,8 +42,7 @@ ddir = $(BDIR)/software/build-tmp idir = $(BDIR)/software/installed ibdir = $(BDIR)/software/installed/bin ildir = $(BDIR)/software/installed/lib -ibidir = $(BDIR)/software/installed/version-info/bin -ilidir = $(BDIR)/software/installed/version-info/lib +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. @@ -240,21 +239,11 @@ makelink = origpath="$$PATH"; \ $(ibdir) $(ildir):; mkdir $@ $(ibidir)/low-level-links: | $(ibdir) $(ildir) - # The Assembler - $(call makelink,as) - - # Compiler (Cmake needs the clang compiler which we aren't building - # yet in the project). + # Not-installed (but necessary in some cases) compilers. + # Clang is necessary for CMake. $(call makelink,clang) $(call makelink,clang++) - # The linker - $(call makelink,ar) - $(call makelink,ld) - $(call makelink,nm) - $(call makelink,ps) - $(call makelink,ranlib) - # Mac OS specific $(call makelink,sysctl) $(call makelink,sw_vers) @@ -380,7 +369,7 @@ $(ibidir)/zip: $(tdir)/zip-$(zip-version).tar.gz # # Note for a static-only build: Zlib's `./configure' doesn't use Autoconf's # configure script, it just accepts a direct `--static' option. -$(ilidir)/zlib: $(tdir)/zlib-$(zlib-version).tar.gz +$(ibidir)/zlib: $(tdir)/zlib-$(zlib-version).tar.gz $(call gbuild, $<, zlib-$(zlib-version)) \ && echo "Zlib $(zlib-version)" > $@ @@ -394,7 +383,7 @@ $(ibidir)/tar: $(tdir)/tar-$(tar-version).tar.gz \ $(ibidir)/unzip \ $(ibidir)/gzip \ $(ibidir)/lzip \ - $(ilidir)/zlib \ + $(ibidir)/zlib \ $(ibidir)/zip \ $(ibidir)/xz # Since all later programs depend on Tar, the configuration will be @@ -430,7 +419,7 @@ $(ibidir)/make: $(tdir)/make-$(make-version).tar.lz \ $(call gbuild, $<, make-$(make-version), , , -j$(numthreads)) \ && echo "GNU Make $(make-version)" > $@ -$(ilidir)/ncurses: $(tdir)/ncurses-$(ncurses-version).tar.gz \ +$(ibidir)/ncurses: $(tdir)/ncurses-$(ncurses-version).tar.gz \ $(ibidir)/make # Delete the library that will be installed (so we can make sure @@ -516,8 +505,8 @@ $(ilidir)/ncurses: $(tdir)/ncurses-$(ncurses-version).tar.gz \ exit 1; \ fi -$(ilidir)/readline: $(tdir)/readline-$(readline-version).tar.gz \ - $(ilidir)/ncurses +$(ibidir)/readline: $(tdir)/readline-$(readline-version).tar.gz \ + $(ibidir)/ncurses $(call gbuild, $<, readline-$(readline-version), static, \ --with-curses --disable-install-examples, \ SHLIB_LIBS="-lncursesw" ) \ @@ -543,7 +532,7 @@ else needpatchelf = $(ibidir)/patchelf endif $(ibidir)/bash: $(tdir)/bash-$(bash-version).tar.gz \ - $(ilidir)/readline \ + $(ibidir)/readline \ $(needpatchelf) # Delete the (possibly) existing Bash executable. @@ -611,7 +600,7 @@ $(ibidir)/bash: $(tdir)/bash-$(bash-version).tar.gz \ # when the library is updated/changed by the host, and the whole purpose of # this project is avoid dependency on the host as much as possible. $(ibidir)/curl: $(tdir)/curl-$(curl-version).tar.gz \ - $(ilidir)/openssl + $(ibidir)/openssl $(call gbuild, $<, curl-$(curl-version), , \ LIBS="-pthread" \ --with-zlib=$(ildir) \ @@ -647,7 +636,7 @@ $(ibidir)/curl: $(tdir)/curl-$(curl-version).tar.gz \ #openssl-static = no-dso no-dynamic-engine no-shared #endif $(idir)/etc:; mkdir $@ -$(ilidir)/openssl: $(tdir)/openssl-$(openssl-version).tar.gz \ +$(ibidir)/openssl: $(tdir)/openssl-$(openssl-version).tar.gz \ $(tdir)/cert.pem \ $(ibidir)/bash | $(idir)/etc # According to OpenSSL's Wiki (link bellow), it can't automatically @@ -694,7 +683,7 @@ $(ilidir)/openssl: $(tdir)/openssl-$(openssl-version).tar.gz \ # host), they are disabled here. $(ibidir)/wget: $(tdir)/wget-$(wget-version).tar.lz \ $(ibidir)/pkg-config \ - $(ilidir)/openssl + $(ibidir)/openssl libs="-pthread"; \ if [ x$(needs_ldl) = xyes ]; then libs="$$libs -ldl"; fi; \ $(call gbuild, $<, wget-$(wget-version), , \ @@ -725,7 +714,7 @@ $(ibidir)/wget: $(tdir)/wget-$(wget-version).tar.lz \ # building of those higher-level programs (after this Makefile finishes), # there is no access to the system's PATH. $(ibidir)/coreutils: $(tdir)/coreutils-$(coreutils-version).tar.xz \ - $(ilidir)/openssl + $(ibidir)/openssl # Coreutils will use the hashing features of OpenSSL's `libcrypto'. # See Tar's comments for the `-j' option. $(call gbuild, $<, coreutils-$(coreutils-version), static, \ @@ -746,8 +735,8 @@ $(ibidir)/findutils: $(tdir)/findutils-$(findutils-version).tar.lz \ $(ibidir)/gawk: $(tdir)/gawk-$(gawk-version).tar.lz \ $(ibidir)/bash \ - $(ilidir)/mpfr \ - $(ilidir)/gmp + $(ibidir)/mpfr \ + $(ibidir)/gmp # AWK doesn't include RPATH by default, so we'll have to manually # include it using the `patchelf' program (which was a dependency # of Bash). Just note that AWK produces two executables (for @@ -773,7 +762,7 @@ $(ibidir)/git: $(tdir)/git-$(git-version).tar.xz \ V=1) \ && echo "Git $(git-version)" > $@ -$(ilidir)/gmp: $(tdir)/gmp-$(gmp-version).tar.lz \ +$(ibidir)/gmp: $(tdir)/gmp-$(gmp-version).tar.lz \ $(ibidir)/bash $(call gbuild, $<, gmp-$(gmp-version), static, , , make check) \ && echo "GNU Multiple Precision Arithmetic Library $(gmp-version)" > $@ @@ -791,7 +780,7 @@ $(ibidir)/grep: $(tdir)/grep-$(grep-version).tar.xz \ $(call gbuild, $<, grep-$(grep-version), static) \ && echo "GNU Grep $(grep-version)" > $@ -$(ilidir)/libbsd: $(tdir)/libbsd-$(libbsd-version).tar.xz \ +$(ibidir)/libbsd: $(tdir)/libbsd-$(libbsd-version).tar.xz \ $(ibidir)/bash $(call gbuild, $<, libbsd-$(libbsd-version), static,,V=1) \ && echo "Libbsd $(libbsd-version)" > $@ @@ -817,7 +806,7 @@ $(ibidir)/m4: $(tdir)/m4-$(m4-version).tar.gz \ ifeq ($(on_mac_os),yes) needlibbsd = else -needlibbsd = $(ilidir)/libbsd +needlibbsd = $(ibidir)/libbsd endif $(ibidir)/metastore: $(tdir)/metastore-$(metastore-version).tar.gz \ $(needlibbsd) \ @@ -842,32 +831,33 @@ $(ibidir)/metastore: $(tdir)/metastore-$(metastore-version).tar.gz \ # Note that the -O and -G options used here are currently only in a # fork of `metastore' currently hosted at: # https://github.com/mohammad-akhlaghi/metastore - user=$$(whoami) - group=$$(groups | awk '{print $$1}') - cd $$current_dir - if [ -f $(ibdir)/metastore ]; then - for f in pre-commit post-checkout; do + user=$$(whoami); \ + group=$$(groups | awk '{print $$1}'); \ + cd $$current_dir; \ + if [ -f $(ibdir)/metastore ]; then \ + for f in pre-commit post-checkout; do \ sed -e's|@USER[@]|'$$user'|g' \ -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 - chmod +x .git/hooks/$$f - echo "Metastore (forked) $(metastore-version)" > $@ - done - else - echo; echo; echo; - echo "*****************" - echo "metastore couldn't be installed!" - echo - echo "Its used for preserving timestamps on Git commits." - echo "Its useful for development, not simple running of the project." - echo "So we won't stop the configuration because it wasn't built." - echo "*****************" + reproduce/software/bash/git-$$f > .git/hooks/$$f; \ + chmod +x .git/hooks/$$f; \ + echo "Metastore (forked) $(metastore-version)" > $@; \ + done; \ + else \ + echo; echo; echo; \ + echo "*****************"; \ + echo "metastore couldn't be installed!"; \ + echo; \ + echo "Its used for preserving timestamps on Git commits."; \ + echo "Its useful for development, not simple running of "; \ + echo "the project. So we won't stop the configuration "; \ + echo "because it wasn't built."; \ + echo "*****************"; \ fi -$(ilidir)/mpfr: $(tdir)/mpfr-$(mpfr-version).tar.xz \ - $(ilidir)/gmp +$(ibidir)/mpfr: $(tdir)/mpfr-$(mpfr-version).tar.xz \ + $(ibidir)/gmp $(call gbuild, $<, mpfr-$(mpfr-version), static, , , make check) \ && echo "GNU Multiple Precision Floating-Point Reliably $(mpfr-version)" > $@ @@ -907,13 +897,28 @@ $(ibidir)/which: $(tdir)/which-$(which-version).tar.gz \ # GCC and its prerequisites # ------------------------- # -# Binutils' linker `ld' is apparently only good for GNU/Linux systems and -# other OSs have their own. So for now we aren't actually building -# Binutils (`ld' isn't a prerequisite of GCC). -$(ibidir)/binutils: $(tdir)/binutils-$(binutils-version).tar.lz \ - $(ibidir)/bash - $(call gbuild, $<, binutils-$(binutils-version), static) \ - && echo "GNU Binutils $(binutils-version)" > $@ +# Binutils' assembler (`as') and linker (`ld') will conflict with other +# compilers. So until then, on Mac systems we'll use the host opertating +# system's Binutils equivalents by just making links. +ifeq ($(on_mac_os),yes) +binutils-prerequisites = +else +binutils-prerequisites = $(tdir)/binutils-$(binutils-version).tar.lz \ + $(ibidir)/bash +endif +$(ibidir)/binutils: $(binutils-prerequisites) + if [ x$(on_mac_os) = xyes ]; then \ + $(call makelink,as) \ + $(call makelink,ar) \ + $(call makelink,ld) \ + $(call makelink,nm) \ + $(call makelink,ps) \ + $(call makelink,ranlib) \ + echo "" > $@; \ + else \ + $(call gbuild, $<, binutils-$(binutils-version), static) \ + && echo "GNU Binutils $(binutils-version)" > $@; \ + fi # `file' is not a prerequisite of GCC. However, since it is low level, it is # set as a prerequisite of GCC to have it installed. @@ -922,13 +927,13 @@ $(ibidir)/file: $(tdir)/file-$(file-version).tar.gz \ $(call gbuild, $<, file-$(file-version), static) \ && echo "File $(file-version)" > $@ -$(ilidir)/isl: $(tdir)/isl-$(isl-version).tar.bz2 \ - $(ilidir)/gmp +$(ibidir)/isl: $(tdir)/isl-$(isl-version).tar.bz2 \ + $(ibidir)/gmp $(call gbuild, $<, isl-$(isl-version), static) \ && echo "GNU Integer Set Library $(isl-version)" > $@ -$(ilidir)/mpc: $(tdir)/mpc-$(mpc-version).tar.gz \ - $(ilidir)/mpfr +$(ibidir)/mpc: $(tdir)/mpc-$(mpc-version).tar.gz \ + $(ibidir)/mpfr $(call gbuild, $<, mpc-$(mpc-version), static, , , make check) \ && echo "GNU Multiple Precision Complex library" > $@ @@ -950,8 +955,8 @@ gcc-prerequisites = else gcc-prerequisites = $(tdir)/gcc-$(gcc-version).tar.xz \ $(ibidir)/binutils \ - $(ilidir)/isl \ - $(ilidir)/mpc + $(ibidir)/isl \ + $(ibidir)/mpc endif $(ibidir)/gcc: $(gcc-prerequisites) \ $(ibidir)/sed \ @@ -961,6 +966,7 @@ $(ibidir)/gcc: $(gcc-prerequisites) \ $(ibidir)/grep \ $(ibidir)/which \ $(ibidir)/glibtool \ + $(ibidir)/binutils \ $(ibidir)/coreutils \ $(ibidir)/diffutils \ $(ibidir)/findutils diff --git a/reproduce/software/make/high-level.mk b/reproduce/software/make/high-level.mk index 3370bfb..969cf8a 100644 --- a/reproduce/software/make/high-level.mk +++ b/reproduce/software/make/high-level.mk @@ -28,6 +28,7 @@ # 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 @@ -38,32 +39,13 @@ idir = $(BDIR)/software/installed ibdir = $(BDIR)/software/installed/bin ildir = $(BDIR)/software/installed/lib dtexdir = $(shell pwd)/reproduce/software/bibtex -ibidir = $(BDIR)/software/installed/version-info/bin -ilidir = $(BDIR)/software/installed/version-info/lib itidir = $(BDIR)/software/installed/version-info/tex ictdir = $(BDIR)/software/installed/version-info/cite ipydir = $(BDIR)/software/installed/version-info/python +ibidir = $(BDIR)/software/installed/version-info/proglib -# Define the top-level programs to build (installed in `.local/bin'). -# -# About ATLAS: currently the template does not depend on ATLAS but many -# high level software depend on it. The current rule for ATLAS is tested -# successfully on Mac (only static) and GNU/Linux (shared and static). But, -# since it takes a few hours to build, it is not currently a target. - -# About available software/libraries: currently the template has rules for -# installing software that are widely used in science, and in particular in -# astrophysics. However, not all of these software will be used for all -# people interested in this template. Due to that, we put some of what we -# consider the main software as optional software of the template (to see a -# complete list of all software/libraries, look at the version number -# Makefile). If that software is needed, just remove the comment `#' to -# install it. -top-level-libraries = # atlas -top-level-programs = gnuastro # astrometrynet scamp sextractor swarp -top-level-python = numpy # astropy astroquery matplotlib scipy -all: $(foreach p, $(top-level-libraries), $(ilidir)/$(p)) \ - $(foreach p, $(top-level-programs), $(ibidir)/$(p)) \ +# Set the top-level software to build. +all: $(foreach p, $(top-level-programs), $(ibidir)/$(p)) \ $(foreach p, $(top-level-python), $(ipydir)/$(p)) \ $(itidir)/texlive @@ -261,7 +243,7 @@ $(tarballs): $(tdir)/%: | $(lockdir) # for us here. So, we'll make an `$(ildir)/built' directory and make a # simple plain text file in it with the basic library name (an no prefix) # and create/write into it when the library is successfully built. -$(ilidir)/cfitsio: $(tdir)/cfitsio-$(cfitsio-version).tar.gz \ +$(ibidir)/cfitsio: $(tdir)/cfitsio-$(cfitsio-version).tar.gz \ $(ibidir)/curl # CFITSIO hard-codes the absolute address of cURL's `curl-config' @@ -284,31 +266,31 @@ $(ilidir)/cfitsio: $(tdir)/cfitsio-$(cfitsio-version).tar.gz \ && rm $$customtar \ && echo "CFITSIO $(cfitsio-version)" > $@ -$(ilidir)/cairo: $(tdir)/cairo-$(cairo-version).tar.xz \ - $(ilidir)/freetype \ - $(ilidir)/libpng \ - $(ilidir)/pixman +$(ibidir)/cairo: $(tdir)/cairo-$(cairo-version).tar.xz \ + $(ibidir)/freetype \ + $(ibidir)/libpng \ + $(ibidir)/pixman $(call gbuild, $<, cairo-$(cairo-version), static) \ && echo "Cairo $(cairo-version)" > $@ -$(ilidir)/gsl: $(tdir)/gsl-$(gsl-version).tar.gz +$(ibidir)/gsl: $(tdir)/gsl-$(gsl-version).tar.gz $(call gbuild, $<, gsl-$(gsl-version), static) \ && echo "GNU Scientific Library $(gsl-version)" > $@ -$(ilidir)/fftw: $(tdir)/fftw-$(fftw-version).tar.gz +$(ibidir)/fftw: $(tdir)/fftw-$(fftw-version).tar.gz $(call gbuild, $<, fftw-$(fftw-version), static, \ --enable-shared) \ && cp $(dtexdir)/fftw.tex $(ictdir)/ \ && echo "FFTW $(fftw-version) \citep{fftw}" > $@ # Freetype is necessary to install matplotlib -$(ilidir)/freetype: $(tdir)/freetype-$(freetype-version).tar.gz \ - $(ilidir)/libpng +$(ibidir)/freetype: $(tdir)/freetype-$(freetype-version).tar.gz \ + $(ibidir)/libpng $(call gbuild, $<, freetype-$(freetype-version), static) \ && echo "FreeType $(freetype-version)" > $@ -$(ilidir)/hdf5: $(tdir)/hdf5-$(hdf5-version).tar.gz \ - $(ilidir)/openmpi +$(ibidir)/hdf5: $(tdir)/hdf5-$(hdf5-version).tar.gz \ + $(ibidir)/openmpi export CC=mpicc; \ export FC=mpif90; \ $(call gbuild, $<, hdf5-$(hdf5-version), static, \ @@ -316,15 +298,15 @@ $(ilidir)/hdf5: $(tdir)/hdf5-$(hdf5-version).tar.gz \ --enable-fortran, V=1) \ && echo "HDF5 library $(hdf5-version)" > $@ -$(ilidir)/libjpeg: $(tdir)/jpegsrc.$(libjpeg-version).tar.gz +$(ibidir)/libjpeg: $(tdir)/jpegsrc.$(libjpeg-version).tar.gz $(call gbuild, $<, jpeg-9b, static) \ && echo "Libjpeg $(libjpeg-version)" > $@ -$(ilidir)/libpng: $(tdir)/libpng-$(libpng-version).tar.xz +$(ibidir)/libpng: $(tdir)/libpng-$(libpng-version).tar.xz $(call gbuild, $<, libpng-$(libpng-version), static) \ && echo "Libpng $(libpng-version)" > $@ -$(ilidir)/libxml2: $(tdir)/libxml2-$(libxml2-version).tar.gz +$(ibidir)/libxml2: $(tdir)/libxml2-$(libxml2-version).tar.gz # The libxml2 tarball also contains Python bindings which are built and # installed to a system directory by default. If you don't need the Python # bindings, the easiest solution is to compile without Python support: @@ -335,21 +317,21 @@ $(ilidir)/libxml2: $(tdir)/libxml2-$(libxml2-version).tar.gz --without-python) \ && echo "Libxml2 $(libxml2-version)" > $@ -$(ilidir)/pixman: $(tdir)/pixman-$(pixman-version).tar.gz +$(ibidir)/pixman: $(tdir)/pixman-$(pixman-version).tar.gz $(call gbuild, $<, pixman-$(pixman-version), static) \ && echo "Pixman $(pixman-version)" > $@ -$(ilidir)/libtiff: $(tdir)/tiff-$(libtiff-version).tar.gz \ - $(ilidir)/libjpeg +$(ibidir)/libtiff: $(tdir)/tiff-$(libtiff-version).tar.gz \ + $(ibidir)/libjpeg $(call gbuild, $<, tiff-$(libtiff-version), static, \ --disable-webp --disable-zstd) \ && echo "Libtiff $(libtiff-version)" > $@ -$(ilidir)/openmpi: $(tdir)/openmpi-$(openmpi-version).tar.gz +$(ibidir)/openmpi: $(tdir)/openmpi-$(openmpi-version).tar.gz $(call gbuild, $<, openmpi-$(openmpi-version), static, , V=1) \ && echo "Open MPI $(openmpi-version)" > $@ -$(ilidir)/atlas: $(tdir)/atlas-$(atlas-version).tar.bz2 \ +$(ibidir)/atlas: $(tdir)/atlas-$(atlas-version).tar.bz2 \ $(tdir)/lapack-$(lapack-version).tar.gz # Get the operating system specific features (how to get @@ -429,7 +411,7 @@ $(ilidir)/atlas: $(tdir)/atlas-$(atlas-version).tar.bz2 \ echo "ATLAS $(atlas-version)" > $@; \ fi -$(ilidir)/openblas: $(tdir)/openblas-$(openblas-version).tar.gz +$(ibidir)/openblas: $(tdir)/openblas-$(openblas-version).tar.gz if [ x$(on_mac_os) = xyes ]; then \ export CC=clang; \ fi; \ @@ -462,7 +444,7 @@ $(ilidir)/openblas: $(tdir)/openblas-$(openblas-version).tar.gz # libraries at runtime can be extremely problematic.". This is a major # problem we have been having so far with Mac systems: # https://libgit2.org/docs/guides/build-and-link -$(ilidir)/libgit2: $(tdir)/libgit2-$(libgit2-version).tar.gz \ +$(ibidir)/libgit2: $(tdir)/libgit2-$(libgit2-version).tar.gz \ $(ibidir)/cmake \ $(ibidir)/curl # Build and install the library. @@ -479,8 +461,8 @@ $(ilidir)/libgit2: $(tdir)/libgit2-$(libgit2-version).tar.gz \ # Write the target file. echo "Libgit2 $(libgit2-version)" > $@ -$(ilidir)/wcslib: $(tdir)/wcslib-$(wcslib-version).tar.bz2 \ - $(ilidir)/cfitsio +$(ibidir)/wcslib: $(tdir)/wcslib-$(wcslib-version).tar.bz2 \ + $(ibidir)/cfitsio # Build and install the library. $(call gbuild, $<, wcslib-$(wcslib-version), , \ LIBS="-pthread -lcurl -lm" \ @@ -508,16 +490,16 @@ $(ilidir)/wcslib: $(tdir)/wcslib-$(wcslib-version).tar.bz2 \ # installation directory and the Python executable (by default it will look # for /usr/bin/python) $(ibidir)/astrometrynet: $(tdir)/astrometry.net-$(astrometrynet-version).tar.gz \ - $(ilidir)/cairo \ - $(ilidir)/cfitsio \ - $(ilidir)/gsl \ - $(ilidir)/libjpeg \ - $(ilidir)/libpng \ + $(ibidir)/cairo \ + $(ibidir)/cfitsio \ + $(ibidir)/gsl \ + $(ibidir)/libjpeg \ + $(ibidir)/libpng \ $(ibidir)/netpbm \ $(ipydir)/numpy \ $(ibidir)/python \ $(ibidir)/swig \ - $(ilidir)/wcslib + $(ibidir)/wcslib cd $(ddir) \ && if ! tar xf $<; then echo; echo "Tar error"; exit 1; fi \ && cd astrometry.net-$(astrometrynet-version) \ @@ -584,11 +566,11 @@ $(ibidir)/ghostscript: $(tdir)/ghostscript-$(ghostscript-version).tar.gz # building in parallel, its better to have these packages start building # early. $(ibidir)/gnuastro: $(tdir)/gnuastro-$(gnuastro-version).tar.lz \ - $(ilidir)/gsl \ - $(ilidir)/wcslib \ - $(ilidir)/libjpeg \ - $(ilidir)/libtiff \ - $(ilidir)/libgit2 \ + $(ibidir)/gsl \ + $(ibidir)/wcslib \ + $(ibidir)/libjpeg \ + $(ibidir)/libtiff \ + $(ibidir)/libgit2 \ $(ibidir)/ghostscript ifeq ($(static_build),yes) staticopts="--enable-static=yes --enable-shared=no"; @@ -606,10 +588,10 @@ endif # and install). The questions are different depending on the system (tested # on GNU/Linux and Mac OS). $(ibidir)/netpbm: $(tdir)/netpbm-$(netpbm-version).tgz \ - $(ilidir)/libjpeg \ - $(ilidir)/libpng \ - $(ilidir)/libtiff \ - $(ilidir)/libxml2 \ + $(ibidir)/libjpeg \ + $(ibidir)/libpng \ + $(ibidir)/libtiff \ + $(ibidir)/libxml2 \ $(ibidir)/unzip if [ x$(on_mac_os) = xyes ]; then \ answers='\n\n\n\n\n\n\n\n\n\n\n\nnone\n\n\n'; \ @@ -637,8 +619,8 @@ $(ibidir)/netpbm: $(tdir)/netpbm-$(netpbm-version).tgz \ # the option --enable-openblas and it worked (same issue happened with # `sextractor'. $(ibidir)/scamp: $(tdir)/scamp-$(scamp-version).tar.lz \ - $(ilidir)/fftw \ - $(ilidir)/openblas \ + $(ibidir)/fftw \ + $(ibidir)/openblas \ $(ibidir)/cdsclient $(call gbuild, $<, scamp-$(scamp-version), static, \ --enable-threads --enable-openblas \ @@ -654,8 +636,8 @@ $(ibidir)/scamp: $(tdir)/scamp-$(scamp-version).tar.lz \ # installed, it is just necessary to explicity tell sextractor to use it in # the configuration step. $(ibidir)/sextractor: $(tdir)/sextractor-$(sextractor-version).tar.lz \ - $(ilidir)/openblas \ - $(ilidir)/fftw + $(ibidir)/openblas \ + $(ibidir)/fftw $(call gbuild, $<, sextractor-$(sextractor-version), static, \ --enable-threads --enable-openblas \ --with-openblas-libdir=$(ildir) \ @@ -665,7 +647,7 @@ $(ibidir)/sextractor: $(tdir)/sextractor-$(sextractor-version).tar.lz \ && echo "Sextractor $(sextractor-version) \citep{sextractor}" > $@ $(ibidir)/swarp: $(tdir)/swarp-$(swarp-version).tar.gz \ - $(ilidir)/fftw + $(ibidir)/fftw $(call gbuild, $<, swarp-$(swarp-version), static, \ --enable-threads) \ && cp $(dtexdir)/swarp.tex $(ictdir)/ \ diff --git a/reproduce/software/make/python.mk b/reproduce/software/make/python.mk index 22c6284..e856906 100644 --- a/reproduce/software/make/python.mk +++ b/reproduce/software/make/python.mk @@ -213,12 +213,12 @@ $(pytarballs): $(tdir)/%: # # While this Makefile is for Python programs, in some cases, we need # certain programs (like Python itself), or libraries for the modules. -$(ilidir)/libffi: $(tdir)/libffi-$(libffi-version).tar.gz +$(ibidir)/libffi: $(tdir)/libffi-$(libffi-version).tar.gz $(call gbuild, $<, libffi-$(libffi-version)) \ echo "Libffi $(libffi-version)" > $@ $(ibidir)/python: $(tdir)/python-$(python-version).tar.gz \ - $(ilidir)/libffi + $(ibidir)/libffi # On Mac systems, the build complains about `clang' specific # features, so we can't use our own GCC build here. if [ x$(on_mac_os) = xyes ]; then \ @@ -308,7 +308,7 @@ $(ipydir)/certifi: $(tdir)/certifi-$(certifi-version).tar.gz \ Certifi $(certifi-version)) $(ipydir)/cffi: $(tdir)/cffi-$(cffi-version).tar.gz \ - $(ilidir)/libffi \ + $(ibidir)/libffi \ $(ipydir)/pycparser $(call pybuild, tar xf, $<, cffi-$(cffi-version), ,\ cffi $(cffi-version)) @@ -341,7 +341,7 @@ $(ipydir)/entrypoints: $(tdir)/entrypoints-$(entrypoints-version).tar.gz \ EntryPoints $(entrypoints-version)) $(ipydir)/h5py: $(tdir)/h5py-$(h5py-version).tar.gz \ - $(ilidir)/hdf5 \ + $(ibidir)/hdf5 \ $(ipydir)/cython \ $(ipydir)/pypkgconfig \ $(ipydir)/setuptools @@ -381,7 +381,7 @@ $(ipydir)/kiwisolver: $(tdir)/kiwisolver-$(kiwisolver-version).tar.gz \ $(ipydir)/matplotlib: $(tdir)/matplotlib-$(matplotlib-version).tar.gz \ $(ipydir)/cycler \ - $(ilidir)/freetype \ + $(ibidir)/freetype \ $(ipydir)/kiwisolver \ $(ipydir)/numpy \ $(ipydir)/pyparsing \ @@ -401,15 +401,14 @@ $(ipydir)/matplotlib: $(tdir)/matplotlib-$(matplotlib-version).tar.gz \ # But atleast on my system it fails. $(ipydir)/mpi4py: $(tdir)/mpi4py-$(mpi4py-version).tar.gz \ $(ipydir)/setuptools \ - $(ilidir)/openmpi + $(ibidir)/openmpi $(call pybuild, tar xf, $<, mpi4py-$(mpi4py-version)) \ && cp $(dtexdir)/mpi4py.tex $(ictdir)/ \ && echo "mpi4py $(mpi4py-version) \citep{mpi4py2011}" > $@ $(ipydir)/numpy: $(tdir)/numpy-$(numpy-version).zip \ $(ipydir)/setuptools \ - $(ilidir)/openblas \ - $(ilidir)/fftw \ + $(ibidir)/openblas \ $(ibidir)/unzip if [ x$(on_mac_os) = xyes ]; then \ export LDFLAGS="$(LDFLAGS) -undefined dynamic_lookup -bundle"; \ -- cgit v1.2.1