diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5ee66fe..7a7e8d9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,6 @@ # Test action that attempts to generate new docker containers on push to master -name: CMBenv Docker Test +name: CMBenv Test on: push: @@ -9,18 +9,6 @@ on: branches: [ master ] jobs: - py35: - name: Docker Py3.5 Debian - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Create Dockerfile - run: ./cmbenv -c docker-py3.5-debian -p /usr/local - - name: Build Docker Image - run: docker build -t hpc4cmb/cmbenv:temp_py35 -f Dockerfile_docker-py3.5-debian . - - name: Test Docker Image - run: docker run hpc4cmb/cmbenv:temp_py35 python -c 'import toast.tests; toast.tests.run()' && docker run hpc4cmb/cmbenv:temp_py35 mpirun -np 2 python -c 'import toast.tests; toast.tests.run()' py36: name: Docker Py3.6 Debian runs-on: ubuntu-latest @@ -57,3 +45,23 @@ jobs: run: docker build -t hpc4cmb/cmbenv:temp_py38 -f Dockerfile_docker-py3.8-debian . - name: Test Docker Image run: docker run hpc4cmb/cmbenv:temp_py38 python -c 'import toast.tests; toast.tests.run()' && docker run hpc4cmb/cmbenv:temp_py38 mpirun -np 2 python -c 'import toast.tests; toast.tests.run()' + macos-venv-clang: + name: MacOS Virtualenv Clang + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Create Install Script + run: ./cmbenv -c macos-venv-clang -p ~/cmbenv + - name: Install Packages + run: mkdir build; cd build; ../install_macos-venv-clang.sh; cd ..; . ~/cmbenv/cmbenv_init.sh; mpirun -np 2 python -c 'import toast.tests; toast.tests.run()' + macos-venv-gcc: + name: MacOS Virtualenv GCC + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Create Install Script + run: ./cmbenv -c macos-venv-gcc -p ~/cmbenv + - name: Install Packages + run: mkdir build; cd build; ../install_macos-venv-gcc.sh; cd ..; . ~/cmbenv/cmbenv_init.sh; mpirun -np 2 python -c 'import toast.tests; toast.tests.run()' diff --git a/README.md b/README.md index 948cf74..c0d10df 100644 --- a/README.md +++ b/README.md @@ -21,18 +21,20 @@ If you are installing on a Linux or OS X workstation you may be able to use one Linux: Is your system python3 fairly recent (>= 3.6.0)? - YES. Do you want to use Anaconda python for some reason? - - YES. Use the linux-conda config. - - NO. Use the linux-venv config. - - NO. You should use the linux-conda config. - OS X: Are you currently using macports or homebrew to get python3? + - YES. Do you want to use MKL for your own compiled python extensions? + - Yes. Use the linux-conda-nomkl config, so that numpy uses OpenBLAS. + - No. Use the linux-conda config. + - NO. Use the linux-venv config. See MKL notes below. + - NO. You should use the linux-conda or linux-conda-nomkl config. + OS X: Are you currently using macports or homebrew to get a newer python3? - YES. Do you want to use Fortran packages (libmadam)? - YES. Install GNU compilers with macports or homebrew. - Use the osx-venv-gcc config. - - NO. Use the osx-venv-clang config. + Use the macos-venv-gcc config. + - NO. Use the macos-venv-clang config. - NO. Do you want to use Fortran packages (libmadam)? - YES. Install GNU compilers with macports or homebrew. - Use the osx-conda-gcc config. - - NO. Use the osx-conda-clang config. + Use the macos-conda-gcc config. + - NO. Use the macos-conda-clang config. ### Special Notes for OS X @@ -40,18 +42,36 @@ Apple's operating system can be challenging to work with when building larger co - Whenever you update your OS, also ensure that X Code and the commandline tools have been updated. - - If using macports or homebrew, wipe and reinstall these when you upgrade your OS to a new major version. + - If using macports or homebrew, wipe and reinstall these when you upgrade your OS to a new version. -If you have trouble with python or gcc on OS X, try testing the "osx-conda-clang" config. This should be the most stand-alone solution since it uses only the system clang compiler. Downsides of this are the lack of fortran support and perhaps other features like OpenMP threading. +If you have trouble with python or gcc on OS X, try testing the "macos-conda-clang" config. This should be the most stand-alone solution since it uses only the system clang compiler. Downsides of this are the lack of fortran support and perhaps other features like OpenMP threading. + +### MKL Warning + +Some versions of numpy use a bundled version of MKL and the Intel threading libraries for linear algebra. Some packages in `cmbenv` have compiled extensions that also link to external BLAS / LAPACK libraries. The linear algebra libraries specified in the `BLAS` and `LAPACK` config variables must either be *different* from those used by numpy or **identical** to those used by numpy. + +Since it is very challenging to control what upstream MKL is used by numpy, we take a different approach: + + - If you want to use the Intel compilers and MKL when building packages with `cmbenv`, please ensure that your numpy is NOT using MKL (for example, but choosing the "conda nomkl" option for the python package in the config files). + + - If you are using OpenBLAS (external or built by `cmbenv`) or the Apple accelerate framework, then you should not have any conflicts regardless of what numpy is using. + +More details: If you have a compiled extension that is linking to MKL and numpy is also +linked to a (different) MKL, then only one MKL version will be dlopen'ed by the dynamic +library loader. So the order of python imports will determine which one gets loaded. +Even if the MKL versions are binary compatible, they may link to different threading +interface libraries. For example, numpy ships with a bundled version of the Intel +threading library. If your extension is built with gcc and linked to MKL, it will link +to the GNU interface library. ### Custom Configurations -Create or edit a file in the "configs" subdirectory that is named whatever you -like. This file will define compilers, flags, etc. Optionally create files -with the same name and the ".module" and ".sh" suffixes. These optional files -should contain any modulefile and shell commands needed to set up the -environment prior to building the tools or loading them later. See existing -files for examples. +Create or edit a file in the "configs" subdirectory that is named whatever you like. +This file will define compilers, flags, etc. Optionally create files with the same name +and the ".module" and ".sh" suffixes. These optional files should contain any +modulefile and shell commands needed to set up the environment prior to building the +tools or loading them later. The ".pkgs" file defines the packages to build for your +system. See existing files for examples. To create a config for a docker image, the config file must be prefixed with "docker-". You should not have any "*.module" or "*.sh" files for @@ -107,9 +127,10 @@ it here. It is recommended to tag the container with the hash of the cmbenv git repository. In the following snippets, I assume that username is the same on -local machine, Github, DockerHub and NERSC. Build it with: +local machine, Github, DockerHub and NERSC. Build it with (for example): - %> docker build . -t $USER/cmbenv:$(git rev-parse --short HEAD) + %> docker build -t $USER/cmbenv:$(git rev-parse --short HEAD) \ + -f Dockerfile_docker-py3.8-debian . ### Push the Docker container to Docker Hub @@ -139,11 +160,12 @@ To use this image in a slurm batch script, just add: #SBATCH --image=docker:YOURUSERNAME/cmbenv:xxxxx -In the SLURM header to set the image. Then prepend `shifter` to all running -commands (after `srun` and all its options). For example, to run a script in the container: +In the SLURM header to set the image. Then prepend `shifter` to all running commands +(after `srun` and all its options). For example, to run a script in the container: srun -n 1 -N 1 shifter myscript.py -If you are running any command in the container, make sure to prepend the shifter command. For example: +If you are running any command in the container, make sure to prepend the shifter +command. For example: shifter which myscript.py diff --git a/configs/cori-gcc b/configs/cori-gcc index ac36e60..d5a546c 100644 --- a/configs/cori-gcc +++ b/configs/cori-gcc @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/cori-gcc-gpu b/configs/cori-gcc-gpu index 88f0f8e..068e792 100644 --- a/configs/cori-gcc-gpu +++ b/configs/cori-gcc-gpu @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/cori-intel b/configs/cori-intel index 5b4ec92..2677e77 100644 --- a/configs/cori-intel +++ b/configs/cori-intel @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/docker-py3.5-alpine3.11 b/configs/docker-py3.5-alpine3.11 index 9b8503f..52e8846 100644 --- a/configs/docker-py3.5-alpine3.11 +++ b/configs/docker-py3.5-alpine3.11 @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/docker-py3.5-debian b/configs/docker-py3.5-debian index f16274f..7b8d0be 100644 --- a/configs/docker-py3.5-debian +++ b/configs/docker-py3.5-debian @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/docker-py3.6-alpine3.11 b/configs/docker-py3.6-alpine3.11 index 8b88437..73aab15 100644 --- a/configs/docker-py3.6-alpine3.11 +++ b/configs/docker-py3.6-alpine3.11 @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/docker-py3.6-alpine3.11.pkgs b/configs/docker-py3.6-alpine3.11.pkgs deleted file mode 120000 index df13829..0000000 --- a/configs/docker-py3.6-alpine3.11.pkgs +++ /dev/null @@ -1 +0,0 @@ -docker-py3.5-alpine3.11.pkgs \ No newline at end of file diff --git a/configs/docker-py3.6-alpine3.11.pkgs b/configs/docker-py3.6-alpine3.11.pkgs new file mode 100644 index 0000000..e364c98 --- /dev/null +++ b/configs/docker-py3.6-alpine3.11.pkgs @@ -0,0 +1,103 @@ +# This is the full set of packages that can be installed. This can be +# used as a starting point for the package list for a particular config. +# Some packages accept additional options which can be added after a colon ":". +# These extra options are documented in the shell snippet for each package +# in the top-level pkgs directory. +# +# Autotools. If you already have recent versions installed with your OS +# package manager, then comment these out. +#m4 +#libtool +#autoconf +#automake +# +# CMake. +#cmake +# +# Install zlib. This is needed on some systems where the OS-provided zlib is +# very ancient. +#zlib +# +# Install OpenBLAS. Comment out if you are using MKL with the Intel compilers +# or some other vendor BLAS / LAPACK solution. +#openblas +# +# Python 3. Uncomment one of the following lines. You should only use the +# "default" option for Docker images. All other configs should use either +# a virtualenv or a conda environment. This will also install a set of +# common base packages. +#python:virtualenv +#python:conda +python:default +# +# Install MPICH. This step is optional and only needed in 2 cases: +# 1. You don't have MPI available through system packages that is +# compatible with the serial compilers you are using. +# 2. You are building a docker container for use at NERSC with shifter +# and need an MPICH compatible with the Cray one. +mpich +# +# Install mpi4py. This will use the MPI compilers specified in your config. +mpi4py +# +# Install CFITSIO. +cfitsio +# +# Install FFTW3. +#fftw +# +# Install libbz2. This is required to enable some features in the boost +# build which are in turn needed by spt3g. +bzip2 +# +# Install Boost. +#boost +# +# Install HDF5 (serial version). +hdf5 +# +# Install h5py (using our HDF5). +h5py +# +# Install healpy +healpy +# +# Install quaternionarray +qarray +# +# Install fitsio +fitsio +# +# Install aatm. Needed for some features of atmosphere simulations. +aatm +# +# Install suitesparse +#suitesparse +# +# Install libconviqt. 4-PI a_lm space beam convolution. +conviqt +# +# Install libsharp. Distributed harmonic transforms. +libsharp +# +# Install libmadam. Destriping map-maker. +madam +# +# Install FLAC, needed by spt3g +#libflac +# +# Install SPT3G. Frame based data format. +#spt3g +# +# Install TIDAS. HDF5-based timestream data format. +tidas +# +# Install PySM. Python Sky Model. +pysm +# +# Install PyMPIT for environment testing. Useful for testing working +# mpi4py stack. +pympit +# +# Install TOAST. +toast diff --git a/configs/docker-py3.6-debian b/configs/docker-py3.6-debian index 3e6fbbd..c84718b 100644 --- a/configs/docker-py3.6-debian +++ b/configs/docker-py3.6-debian @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/docker-py3.7-alpine3.11 b/configs/docker-py3.7-alpine3.11 index 22ec84f..604e20c 100644 --- a/configs/docker-py3.7-alpine3.11 +++ b/configs/docker-py3.7-alpine3.11 @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/docker-py3.7-alpine3.11.pkgs b/configs/docker-py3.7-alpine3.11.pkgs deleted file mode 120000 index df13829..0000000 --- a/configs/docker-py3.7-alpine3.11.pkgs +++ /dev/null @@ -1 +0,0 @@ -docker-py3.5-alpine3.11.pkgs \ No newline at end of file diff --git a/configs/docker-py3.7-alpine3.11.pkgs b/configs/docker-py3.7-alpine3.11.pkgs new file mode 100644 index 0000000..e364c98 --- /dev/null +++ b/configs/docker-py3.7-alpine3.11.pkgs @@ -0,0 +1,103 @@ +# This is the full set of packages that can be installed. This can be +# used as a starting point for the package list for a particular config. +# Some packages accept additional options which can be added after a colon ":". +# These extra options are documented in the shell snippet for each package +# in the top-level pkgs directory. +# +# Autotools. If you already have recent versions installed with your OS +# package manager, then comment these out. +#m4 +#libtool +#autoconf +#automake +# +# CMake. +#cmake +# +# Install zlib. This is needed on some systems where the OS-provided zlib is +# very ancient. +#zlib +# +# Install OpenBLAS. Comment out if you are using MKL with the Intel compilers +# or some other vendor BLAS / LAPACK solution. +#openblas +# +# Python 3. Uncomment one of the following lines. You should only use the +# "default" option for Docker images. All other configs should use either +# a virtualenv or a conda environment. This will also install a set of +# common base packages. +#python:virtualenv +#python:conda +python:default +# +# Install MPICH. This step is optional and only needed in 2 cases: +# 1. You don't have MPI available through system packages that is +# compatible with the serial compilers you are using. +# 2. You are building a docker container for use at NERSC with shifter +# and need an MPICH compatible with the Cray one. +mpich +# +# Install mpi4py. This will use the MPI compilers specified in your config. +mpi4py +# +# Install CFITSIO. +cfitsio +# +# Install FFTW3. +#fftw +# +# Install libbz2. This is required to enable some features in the boost +# build which are in turn needed by spt3g. +bzip2 +# +# Install Boost. +#boost +# +# Install HDF5 (serial version). +hdf5 +# +# Install h5py (using our HDF5). +h5py +# +# Install healpy +healpy +# +# Install quaternionarray +qarray +# +# Install fitsio +fitsio +# +# Install aatm. Needed for some features of atmosphere simulations. +aatm +# +# Install suitesparse +#suitesparse +# +# Install libconviqt. 4-PI a_lm space beam convolution. +conviqt +# +# Install libsharp. Distributed harmonic transforms. +libsharp +# +# Install libmadam. Destriping map-maker. +madam +# +# Install FLAC, needed by spt3g +#libflac +# +# Install SPT3G. Frame based data format. +#spt3g +# +# Install TIDAS. HDF5-based timestream data format. +tidas +# +# Install PySM. Python Sky Model. +pysm +# +# Install PyMPIT for environment testing. Useful for testing working +# mpi4py stack. +pympit +# +# Install TOAST. +toast diff --git a/configs/docker-py3.7-debian b/configs/docker-py3.7-debian index a38da42..8d5934d 100644 --- a/configs/docker-py3.7-debian +++ b/configs/docker-py3.7-debian @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/docker-py3.7-debian.pkgs b/configs/docker-py3.7-debian.pkgs deleted file mode 120000 index 1354c8d..0000000 --- a/configs/docker-py3.7-debian.pkgs +++ /dev/null @@ -1 +0,0 @@ -docker-py3.6-debian.pkgs \ No newline at end of file diff --git a/configs/docker-py3.7-debian.pkgs b/configs/docker-py3.7-debian.pkgs new file mode 100644 index 0000000..c719166 --- /dev/null +++ b/configs/docker-py3.7-debian.pkgs @@ -0,0 +1,103 @@ +# This is the full set of packages that can be installed. This can be +# used as a starting point for the package list for a particular config. +# Some packages accept additional options which can be added after a colon ":". +# These extra options are documented in the shell snippet for each package +# in the top-level pkgs directory. +# +# Autotools. If you already have recent versions installed with your OS +# package manager, then comment these out. +#m4 +#libtool +#autoconf +#automake +# +# CMake. +#cmake +# +# Install zlib. This is needed on some systems where the OS-provided zlib is +# very ancient. +#zlib +# +# Install OpenBLAS. Comment out if you are using MKL with the Intel compilers +# or some other vendor BLAS / LAPACK solution. +#openblas +# +# Python 3. Uncomment one of the following lines. You should only use the +# "default" option for Docker images. All other configs should use either +# a virtualenv or a conda environment. This will also install a set of +# common base packages. +#python:virtualenv +#python:conda +python:default +# +# Install MPICH. This step is optional and only needed in 2 cases: +# 1. You don't have MPI available through system packages that is +# compatible with the serial compilers you are using. +# 2. You are building a docker container for use at NERSC with shifter +# and need an MPICH compatible with the Cray one. +mpich +# +# Install mpi4py. This will use the MPI compilers specified in your config. +mpi4py +# +# Install CFITSIO. +#cfitsio +# +# Install FFTW3. +#fftw +# +# Install libbz2. This is required to enable some features in the boost +# build which are in turn needed by spt3g. +#bzip2 +# +# Install Boost. +#boost +# +# Install HDF5 (serial version). +#hdf5 +# +# Install h5py (using our HDF5). +h5py:pkg-config +# +# Install healpy +healpy +# +# Install quaternionarray +qarray +# +# Install fitsio +fitsio +# +# Install aatm. Needed for some features of atmosphere simulations. +aatm +# +# Install suitesparse +#suitesparse +# +# Install libconviqt. 4-PI a_lm space beam convolution. +conviqt +# +# Install libsharp. Distributed harmonic transforms. +libsharp +# +# Install libmadam. Destriping map-maker. +madam:--with-cfitsio=/usr --with-fftw=/usr +# +# Install FLAC, needed by spt3g +#libflac +# +# Install SPT3G. Frame based data format. +#spt3g:boost=/usr/local flaclib=/usr/lib/x86_64-linux-gnu/libFLAC.so +# +# Install TIDAS. HDF5-based timestream data format. +tidas +# +# Install PySM. Python Sky Model. +pysm +# +# Install PyMPIT for environment testing. Useful for testing working +# mpi4py stack. +pympit +# +# Install TOAST. +toast diff --git a/configs/docker-py3.8-alpine3.11 b/configs/docker-py3.8-alpine3.11 index ca3e401..31046ff 100644 --- a/configs/docker-py3.8-alpine3.11 +++ b/configs/docker-py3.8-alpine3.11 @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/docker-py3.8-alpine3.11.pkgs b/configs/docker-py3.8-alpine3.11.pkgs deleted file mode 120000 index df13829..0000000 --- a/configs/docker-py3.8-alpine3.11.pkgs +++ /dev/null @@ -1 +0,0 @@ -docker-py3.5-alpine3.11.pkgs \ No newline at end of file diff --git a/configs/docker-py3.8-alpine3.11.pkgs b/configs/docker-py3.8-alpine3.11.pkgs new file mode 100644 index 0000000..e364c98 --- /dev/null +++ b/configs/docker-py3.8-alpine3.11.pkgs @@ -0,0 +1,103 @@ +# This is the full set of packages that can be installed. This can be +# used as a starting point for the package list for a particular config. +# Some packages accept additional options which can be added after a colon ":". +# These extra options are documented in the shell snippet for each package +# in the top-level pkgs directory. +# +# Autotools. If you already have recent versions installed with your OS +# package manager, then comment these out. +#m4 +#libtool +#autoconf +#automake +# +# CMake. +#cmake +# +# Install zlib. This is needed on some systems where the OS-provided zlib is +# very ancient. +#zlib +# +# Install OpenBLAS. Comment out if you are using MKL with the Intel compilers +# or some other vendor BLAS / LAPACK solution. +#openblas +# +# Python 3. Uncomment one of the following lines. You should only use the +# "default" option for Docker images. All other configs should use either +# a virtualenv or a conda environment. This will also install a set of +# common base packages. +#python:virtualenv +#python:conda +python:default +# +# Install MPICH. This step is optional and only needed in 2 cases: +# 1. You don't have MPI available through system packages that is +# compatible with the serial compilers you are using. +# 2. You are building a docker container for use at NERSC with shifter +# and need an MPICH compatible with the Cray one. +mpich +# +# Install mpi4py. This will use the MPI compilers specified in your config. +mpi4py +# +# Install CFITSIO. +cfitsio +# +# Install FFTW3. +#fftw +# +# Install libbz2. This is required to enable some features in the boost +# build which are in turn needed by spt3g. +bzip2 +# +# Install Boost. +#boost +# +# Install HDF5 (serial version). +hdf5 +# +# Install h5py (using our HDF5). +h5py +# +# Install healpy +healpy +# +# Install quaternionarray +qarray +# +# Install fitsio +fitsio +# +# Install aatm. Needed for some features of atmosphere simulations. +aatm +# +# Install suitesparse +#suitesparse +# +# Install libconviqt. 4-PI a_lm space beam convolution. +conviqt +# +# Install libsharp. Distributed harmonic transforms. +libsharp +# +# Install libmadam. Destriping map-maker. +madam +# +# Install FLAC, needed by spt3g +#libflac +# +# Install SPT3G. Frame based data format. +#spt3g +# +# Install TIDAS. HDF5-based timestream data format. +tidas +# +# Install PySM. Python Sky Model. +pysm +# +# Install PyMPIT for environment testing. Useful for testing working +# mpi4py stack. +pympit +# +# Install TOAST. +toast diff --git a/configs/docker-py3.8-debian b/configs/docker-py3.8-debian index 7f37def..35fafe1 100644 --- a/configs/docker-py3.8-debian +++ b/configs/docker-py3.8-debian @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/docker-py3.8-debian.pkgs b/configs/docker-py3.8-debian.pkgs deleted file mode 120000 index 1354c8d..0000000 --- a/configs/docker-py3.8-debian.pkgs +++ /dev/null @@ -1 +0,0 @@ -docker-py3.6-debian.pkgs \ No newline at end of file diff --git a/configs/docker-py3.8-debian.pkgs b/configs/docker-py3.8-debian.pkgs new file mode 100644 index 0000000..c719166 --- /dev/null +++ b/configs/docker-py3.8-debian.pkgs @@ -0,0 +1,103 @@ +# This is the full set of packages that can be installed. This can be +# used as a starting point for the package list for a particular config. +# Some packages accept additional options which can be added after a colon ":". +# These extra options are documented in the shell snippet for each package +# in the top-level pkgs directory. +# +# Autotools. If you already have recent versions installed with your OS +# package manager, then comment these out. +#m4 +#libtool +#autoconf +#automake +# +# CMake. +#cmake +# +# Install zlib. This is needed on some systems where the OS-provided zlib is +# very ancient. +#zlib +# +# Install OpenBLAS. Comment out if you are using MKL with the Intel compilers +# or some other vendor BLAS / LAPACK solution. +#openblas +# +# Python 3. Uncomment one of the following lines. You should only use the +# "default" option for Docker images. All other configs should use either +# a virtualenv or a conda environment. This will also install a set of +# common base packages. +#python:virtualenv +#python:conda +python:default +# +# Install MPICH. This step is optional and only needed in 2 cases: +# 1. You don't have MPI available through system packages that is +# compatible with the serial compilers you are using. +# 2. You are building a docker container for use at NERSC with shifter +# and need an MPICH compatible with the Cray one. +mpich +# +# Install mpi4py. This will use the MPI compilers specified in your config. +mpi4py +# +# Install CFITSIO. +#cfitsio +# +# Install FFTW3. +#fftw +# +# Install libbz2. This is required to enable some features in the boost +# build which are in turn needed by spt3g. +#bzip2 +# +# Install Boost. +#boost +# +# Install HDF5 (serial version). +#hdf5 +# +# Install h5py (using our HDF5). +h5py:pkg-config +# +# Install healpy +healpy +# +# Install quaternionarray +qarray +# +# Install fitsio +fitsio +# +# Install aatm. Needed for some features of atmosphere simulations. +aatm +# +# Install suitesparse +#suitesparse +# +# Install libconviqt. 4-PI a_lm space beam convolution. +conviqt +# +# Install libsharp. Distributed harmonic transforms. +libsharp +# +# Install libmadam. Destriping map-maker. +madam:--with-cfitsio=/usr --with-fftw=/usr +# +# Install FLAC, needed by spt3g +#libflac +# +# Install SPT3G. Frame based data format. +#spt3g:boost=/usr/local flaclib=/usr/lib/x86_64-linux-gnu/libFLAC.so +# +# Install TIDAS. HDF5-based timestream data format. +tidas +# +# Install PySM. Python Sky Model. +pysm +# +# Install PyMPIT for environment testing. Useful for testing working +# mpi4py stack. +pympit +# +# Install TOAST. +toast diff --git a/configs/docker-toastdeps-py35 b/configs/docker-toastdeps-py35 deleted file mode 120000 index 1549483..0000000 --- a/configs/docker-toastdeps-py35 +++ /dev/null @@ -1 +0,0 @@ -docker-py3.5-debian \ No newline at end of file diff --git a/configs/docker-toastdeps-py35 b/configs/docker-toastdeps-py35 new file mode 100644 index 0000000..7b8d0be --- /dev/null +++ b/configs/docker-toastdeps-py35 @@ -0,0 +1,80 @@ + +# OS type (linux OR macos) +OSTYPE = linux + +# Specify the template to use +TEMPLATE = docker-debian + +# Python version +PYVERSION = 3.5 + +# Specify the docker base image +DOCKER_BASE = python:3.5-slim-buster + +# Specify additional packages to install for docker builds +DOCKER_SYS_PKGS = m4 libtool autoconf automake llvm libsuitesparse-dev libfftw3-dev libcfitsio-dev libflac-dev zlib1g-dev libbz2-dev libopenblas-dev liblapack-dev libhdf5-dev + +# Packages to install with pip. Note that we must force older versions of packages +# to ones that have wheels available for python3.5. The numpy 1.13 requirement comes +# from healpy and the others are chosen to be from around the same time period. +# +PIP_PKGS = setuptools future six Cython cycler kiwisolver pyparsing python-dateutil toml pkgconfig pytz psutil==5.3.1 numpy==1.13.3 scipy==0.19.1 matplotlib==2.1.0 pandas==0.20.3 memory_profiler==0.47 astropy==1.3.3 ephem==3.7.7.0 ipython==6.2.1 numba==0.36.2 cmake sphinx sphinx-rtd-theme pyfftw + +# Packages to install with conda +CONDA_PKGS = + +# Serial compilers + +CC = gcc +CXX = g++ +FC = gfortran + +# Compiler to use for packages needed on the build machine + +BUILD_CC = gcc +BUILD_CXX = g++ + +# MPI compilers + +MPICC = mpicc +MPICXX = mpicxx +MPIFC = mpifort +MPI_CPPFLAGS = @AUX_PREFIX@/include +MPI_LDFLAGS = @AUX_PREFIX@/lib +MPI_CXXLIB = mpichcxx +MPI_LIB = mpich +MPI_EXTRA_COMP = +MPI_EXTRA_LINK = + +# Compile flags + +CFLAGS = -O2 -g -fPIC -pthread +CXXFLAGS = -O2 -g -fPIC -pthread -std=c++11 +FCFLAGS = -O2 -g -fPIC -pthread + +OPENMP_CFLAGS = -fopenmp +OPENMP_CXXFLAGS = -fopenmp +LDFLAGS = -lpthread -fopenmp + +# Are we doing a cross-compile? +CROSS = + +# Parallel builds +MAKEJ = 1 + +# Define MKL location +MKL = + +# For BLAS/LAPACK, we use openblas + +BLAS = -lopenblas -fopenmp -lm +LAPACK = + +# Boost toolchain name + +BOOSTCHAIN = gcc + +# Group and permissions to set + +CHGRP = +CHMOD = diff --git a/configs/docker-toastdeps-py36 b/configs/docker-toastdeps-py36 deleted file mode 120000 index 8b77647..0000000 --- a/configs/docker-toastdeps-py36 +++ /dev/null @@ -1 +0,0 @@ -docker-py3.6-debian \ No newline at end of file diff --git a/configs/docker-toastdeps-py36 b/configs/docker-toastdeps-py36 new file mode 100644 index 0000000..c84718b --- /dev/null +++ b/configs/docker-toastdeps-py36 @@ -0,0 +1,77 @@ + +# OS type (linux OR macos) +OSTYPE = linux + +# Specify the template to use +TEMPLATE = docker-debian + +# Python version +PYVERSION = 3.6 + +# Specify the docker base image +DOCKER_BASE = python:3.6-slim-buster + +# Specify additional packages to install for docker builds +DOCKER_SYS_PKGS = m4 libtool autoconf automake llvm libsuitesparse-dev libfftw3-dev libcfitsio-dev libflac-dev zlib1g-dev libbz2-dev libopenblas-dev liblapack-dev libhdf5-dev + +# Packages to install with pip +PIP_PKGS = setuptools future six Cython cycler kiwisolver pyparsing python-dateutil toml pkgconfig pytz psutil==5.7.0 numpy==1.18.4 scipy==1.4.1 matplotlib==3.2.1 pandas==1.0.3 memory_profiler==0.57.0 astropy==4.0.1.post1 ephem==3.7.7.1 ipython==7.14.0 numba==0.49.1 tbb cmake sphinx sphinx-rtd-theme pyfftw + +# Packages to install with conda +CONDA_PKGS = + +# Serial compilers + +CC = gcc +CXX = g++ +FC = gfortran + +# Compiler to use for packages needed on the build machine + +BUILD_CC = gcc +BUILD_CXX = g++ + +# MPI compilers + +MPICC = mpicc +MPICXX = mpicxx +MPIFC = mpifort +MPI_CPPFLAGS = @AUX_PREFIX@/include +MPI_LDFLAGS = @AUX_PREFIX@/lib +MPI_CXXLIB = mpichcxx +MPI_LIB = mpich +MPI_EXTRA_COMP = +MPI_EXTRA_LINK = + +# Compile flags + +CFLAGS = -O2 -g -fPIC -pthread +CXXFLAGS = -O2 -g -fPIC -pthread -std=c++11 +FCFLAGS = -O2 -g -fPIC -pthread + +OPENMP_CFLAGS = -fopenmp +OPENMP_CXXFLAGS = -fopenmp +LDFLAGS = -lpthread -fopenmp + +# Are we doing a cross-compile? +CROSS = + +# Parallel builds +MAKEJ = 1 + +# Define MKL location +MKL = + +# For BLAS/LAPACK, we use openblas + +BLAS = -lopenblas -fopenmp -lm +LAPACK = + +# Boost toolchain name + +BOOSTCHAIN = gcc + +# Group and permissions to set + +CHGRP = +CHMOD = diff --git a/configs/docker-toastdeps-py37 b/configs/docker-toastdeps-py37 deleted file mode 120000 index 5791b1b..0000000 --- a/configs/docker-toastdeps-py37 +++ /dev/null @@ -1 +0,0 @@ -docker-py3.7-debian \ No newline at end of file diff --git a/configs/docker-toastdeps-py37 b/configs/docker-toastdeps-py37 new file mode 100644 index 0000000..8d5934d --- /dev/null +++ b/configs/docker-toastdeps-py37 @@ -0,0 +1,77 @@ + +# OS type (linux OR macos) +OSTYPE = linux + +# Specify the template to use +TEMPLATE = docker-debian + +# Python version +PYVERSION = 3.7 + +# Specify the docker base image +DOCKER_BASE = python:3.7-slim-buster + +# Specify additional packages to install for docker builds +DOCKER_SYS_PKGS = m4 libtool autoconf automake llvm libsuitesparse-dev libfftw3-dev libcfitsio-dev libflac-dev zlib1g-dev libbz2-dev libopenblas-dev liblapack-dev libhdf5-dev + +# Packages to install with pip +PIP_PKGS = setuptools future six Cython cycler kiwisolver pyparsing python-dateutil toml pkgconfig pytz psutil==5.7.0 numpy==1.18.4 scipy==1.4.1 matplotlib==3.2.1 pandas==1.0.3 memory_profiler==0.57.0 astropy==4.0.1.post1 ephem==3.7.7.1 ipython==7.14.0 numba==0.49.1 tbb cmake sphinx sphinx-rtd-theme pyfftw + +# Packages to install with conda +CONDA_PKGS = + +# Serial compilers + +CC = gcc +CXX = g++ +FC = gfortran + +# Compiler to use for packages needed on the build machine + +BUILD_CC = gcc +BUILD_CXX = g++ + +# MPI compilers + +MPICC = mpicc +MPICXX = mpicxx +MPIFC = mpifort +MPI_CPPFLAGS = @AUX_PREFIX@/include +MPI_LDFLAGS = @AUX_PREFIX@/lib +MPI_CXXLIB = mpichcxx +MPI_LIB = mpich +MPI_EXTRA_COMP = +MPI_EXTRA_LINK = + +# Compile flags + +CFLAGS = -O2 -g -fPIC -pthread +CXXFLAGS = -O2 -g -fPIC -pthread -std=c++11 +FCFLAGS = -O2 -g -fPIC -pthread + +OPENMP_CFLAGS = -fopenmp +OPENMP_CXXFLAGS = -fopenmp +LDFLAGS = -lpthread -fopenmp + +# Are we doing a cross-compile? +CROSS = + +# Parallel builds +MAKEJ = 1 + +# Define MKL location +MKL = + +# For BLAS/LAPACK, we use openblas + +BLAS = -lopenblas -fopenmp -lm +LAPACK = + +# Boost toolchain name + +BOOSTCHAIN = gcc + +# Group and permissions to set + +CHGRP = +CHMOD = diff --git a/configs/docker-toastdeps-py37.pkgs b/configs/docker-toastdeps-py37.pkgs deleted file mode 120000 index 0a373e7..0000000 --- a/configs/docker-toastdeps-py37.pkgs +++ /dev/null @@ -1 +0,0 @@ -docker-toastdeps-py36.pkgs \ No newline at end of file diff --git a/configs/docker-toastdeps-py37.pkgs b/configs/docker-toastdeps-py37.pkgs new file mode 100644 index 0000000..560687a --- /dev/null +++ b/configs/docker-toastdeps-py37.pkgs @@ -0,0 +1,101 @@ +# This is the full set of packages that can be installed. This can be +# used as a starting point for the package list for a particular config. +# Some packages accept additional options which can be added after a colon ":". +# These extra options are documented in the shell snippet for each package +# in the top-level pkgs directory. +# +# Autotools. If you already have recent versions installed with your OS +# package manager, then comment these out. +#m4 +#libtool +#autoconf +#automake +# +# CMake. +#cmake +# +# Install zlib. This is needed on some systems where the OS-provided zlib is +# very ancient. +#zlib +# +# Install OpenBLAS. Comment out if you are using MKL with the Intel compilers +# or some other vendor BLAS / LAPACK solution. +#openblas +# +# Python 3. Uncomment one of the following lines. You should only use the +# "default" option for Docker images. All other configs should use either +# a virtualenv or a conda environment. This will also install a set of +# common base packages. +#python:virtualenv +#python:conda +python:default +# +# Install MPICH. This step is optional and only needed in 2 cases: +# 1. You don't have MPI available through system packages that is +# compatible with the serial compilers you are using. +# 2. You are building a docker container for use at NERSC with shifter +# and need an MPICH compatible with the Cray one. +mpich +# +# Install mpi4py. This will use the MPI compilers specified in your config. +mpi4py +# +# Install CFITSIO. +#cfitsio +# +# Install FFTW3. +#fftw +# +# Install libbz2. This is required to enable some features in the boost +# build which are in turn needed by spt3g. +#bzip2 +# +# Install Boost. +#boost +# +# Install HDF5 (serial version). +#hdf5 +# +# Install h5py (using our HDF5). +h5py:pkg-config +# +# Install healpy +healpy +# +# Install quaternionarray +qarray +# +# Install fitsio +fitsio +# +# Install aatm. Needed for some features of atmosphere simulations. +aatm +# +# Install suitesparse +#suitesparse +# +# Install libconviqt. 4-PI a_lm space beam convolution. +conviqt +# +# Install libsharp. Distributed harmonic transforms. +libsharp +# +# Install libmadam. Destriping map-maker. +madam:--with-cfitsio=/usr --with-fftw=/usr +# +# Install FLAC, needed by spt3g +#libflac +# +# Install SPT3G. Frame based data format. +#spt3g:boost=/usr/local flaclib=/usr/lib/x86_64-linux-gnu/libFLAC.so +# +# Install TIDAS. HDF5-based timestream data format. +tidas +# +# Install PySM. Python Sky Model. +pysm +# +# Install PyMPIT for environment testing. Useful for testing working +# mpi4py stack. +pympit +# diff --git a/configs/docker-toastdeps-py38 b/configs/docker-toastdeps-py38 deleted file mode 120000 index 13f08c2..0000000 --- a/configs/docker-toastdeps-py38 +++ /dev/null @@ -1 +0,0 @@ -docker-py3.8-debian \ No newline at end of file diff --git a/configs/docker-toastdeps-py38 b/configs/docker-toastdeps-py38 new file mode 100644 index 0000000..35fafe1 --- /dev/null +++ b/configs/docker-toastdeps-py38 @@ -0,0 +1,77 @@ + +# OS type (linux OR macos) +OSTYPE = linux + +# Specify the template to use +TEMPLATE = docker-debian + +# Python version +PYVERSION = 3.8 + +# Specify the docker base image +DOCKER_BASE = python:3.8-slim-buster + +# Specify additional packages to install for docker builds +DOCKER_SYS_PKGS = m4 libtool autoconf automake llvm libsuitesparse-dev libfftw3-dev libcfitsio-dev libflac-dev zlib1g-dev libbz2-dev libopenblas-dev liblapack-dev libhdf5-dev + +# Packages to install with pip +PIP_PKGS = setuptools future six Cython cycler kiwisolver pyparsing python-dateutil toml pkgconfig pytz psutil==5.7.0 numpy==1.18.4 scipy==1.4.1 matplotlib==3.2.1 pandas==1.0.3 memory_profiler==0.57.0 astropy==4.0.1.post1 ephem==3.7.7.1 ipython==7.14.0 numba==0.49.1 tbb cmake sphinx sphinx-rtd-theme pyfftw + +# Packages to install with conda +CONDA_PKGS = + +# Serial compilers + +CC = gcc +CXX = g++ +FC = gfortran + +# Compiler to use for packages needed on the build machine + +BUILD_CC = gcc +BUILD_CXX = g++ + +# MPI compilers + +MPICC = mpicc +MPICXX = mpicxx +MPIFC = mpifort +MPI_CPPFLAGS = @AUX_PREFIX@/include +MPI_LDFLAGS = @AUX_PREFIX@/lib +MPI_CXXLIB = mpichcxx +MPI_LIB = mpich +MPI_EXTRA_COMP = +MPI_EXTRA_LINK = + +# Compile flags + +CFLAGS = -O2 -g -fPIC -pthread +CXXFLAGS = -O2 -g -fPIC -pthread -std=c++11 +FCFLAGS = -O2 -g -fPIC -pthread + +OPENMP_CFLAGS = -fopenmp +OPENMP_CXXFLAGS = -fopenmp +LDFLAGS = -lpthread -fopenmp + +# Are we doing a cross-compile? +CROSS = + +# Parallel builds +MAKEJ = 1 + +# Define MKL location +MKL = + +# For BLAS/LAPACK, we use openblas + +BLAS = -lopenblas -fopenmp -lm +LAPACK = + +# Boost toolchain name + +BOOSTCHAIN = gcc + +# Group and permissions to set + +CHGRP = +CHMOD = diff --git a/configs/docker-toastdeps-py38.pkgs b/configs/docker-toastdeps-py38.pkgs deleted file mode 120000 index 0a373e7..0000000 --- a/configs/docker-toastdeps-py38.pkgs +++ /dev/null @@ -1 +0,0 @@ -docker-toastdeps-py36.pkgs \ No newline at end of file diff --git a/configs/docker-toastdeps-py38.pkgs b/configs/docker-toastdeps-py38.pkgs new file mode 100644 index 0000000..560687a --- /dev/null +++ b/configs/docker-toastdeps-py38.pkgs @@ -0,0 +1,101 @@ +# This is the full set of packages that can be installed. This can be +# used as a starting point for the package list for a particular config. +# Some packages accept additional options which can be added after a colon ":". +# These extra options are documented in the shell snippet for each package +# in the top-level pkgs directory. +# +# Autotools. If you already have recent versions installed with your OS +# package manager, then comment these out. +#m4 +#libtool +#autoconf +#automake +# +# CMake. +#cmake +# +# Install zlib. This is needed on some systems where the OS-provided zlib is +# very ancient. +#zlib +# +# Install OpenBLAS. Comment out if you are using MKL with the Intel compilers +# or some other vendor BLAS / LAPACK solution. +#openblas +# +# Python 3. Uncomment one of the following lines. You should only use the +# "default" option for Docker images. All other configs should use either +# a virtualenv or a conda environment. This will also install a set of +# common base packages. +#python:virtualenv +#python:conda +python:default +# +# Install MPICH. This step is optional and only needed in 2 cases: +# 1. You don't have MPI available through system packages that is +# compatible with the serial compilers you are using. +# 2. You are building a docker container for use at NERSC with shifter +# and need an MPICH compatible with the Cray one. +mpich +# +# Install mpi4py. This will use the MPI compilers specified in your config. +mpi4py +# +# Install CFITSIO. +#cfitsio +# +# Install FFTW3. +#fftw +# +# Install libbz2. This is required to enable some features in the boost +# build which are in turn needed by spt3g. +#bzip2 +# +# Install Boost. +#boost +# +# Install HDF5 (serial version). +#hdf5 +# +# Install h5py (using our HDF5). +h5py:pkg-config +# +# Install healpy +healpy +# +# Install quaternionarray +qarray +# +# Install fitsio +fitsio +# +# Install aatm. Needed for some features of atmosphere simulations. +aatm +# +# Install suitesparse +#suitesparse +# +# Install libconviqt. 4-PI a_lm space beam convolution. +conviqt +# +# Install libsharp. Distributed harmonic transforms. +libsharp +# +# Install libmadam. Destriping map-maker. +madam:--with-cfitsio=/usr --with-fftw=/usr +# +# Install FLAC, needed by spt3g +#libflac +# +# Install SPT3G. Frame based data format. +#spt3g:boost=/usr/local flaclib=/usr/lib/x86_64-linux-gnu/libFLAC.so +# +# Install TIDAS. HDF5-based timestream data format. +tidas +# +# Install PySM. Python Sky Model. +pysm +# +# Install PyMPIT for environment testing. Useful for testing working +# mpi4py stack. +pympit +# diff --git a/configs/docker-ubuntu_20.04_gcc9_py38 b/configs/docker-ubuntu_20.04_gcc9_py38 index 68cb2e4..cd34122 100644 --- a/configs/docker-ubuntu_20.04_gcc9_py38 +++ b/configs/docker-ubuntu_20.04_gcc9_py38 @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/linux-conda b/configs/linux-conda index b3262f0..b4455db 100644 --- a/configs/linux-conda +++ b/configs/linux-conda @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/linux-conda-nomkl b/configs/linux-conda-nomkl index b3262f0..b4455db 100644 --- a/configs/linux-conda-nomkl +++ b/configs/linux-conda-nomkl @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/linux-venv b/configs/linux-venv index 8f63a2e..d86fa03 100644 --- a/configs/linux-venv +++ b/configs/linux-venv @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/osx-homebrew-clang b/configs/macos-conda-clang similarity index 85% rename from configs/osx-homebrew-clang rename to configs/macos-conda-clang index cca07a4..5fd6717 100644 --- a/configs/osx-homebrew-clang +++ b/configs/macos-conda-clang @@ -1,6 +1,9 @@ -# OS type (linux OR osx) -OSTYPE = osx +# OS type (linux OR macos) +OSTYPE = macos + +# Specify the template to use +TEMPLATE = macos # Serial compilers @@ -42,8 +45,11 @@ CROSS = # Parallel builds MAKEJ = 2 +# Define MKL location +MKL = + # Python version to use -PYVERSION = auto +PYVERSION = 3.7 # For BLAS/LAPACK, we use accelerate framework diff --git a/configs/macos-conda-clang.pkgs b/configs/macos-conda-clang.pkgs new file mode 100644 index 0000000..cacba99 --- /dev/null +++ b/configs/macos-conda-clang.pkgs @@ -0,0 +1,103 @@ +# This is the full set of packages that can be installed. This can be +# used as a starting point for the package list for a particular config. +# Some packages accept additional options which can be added after a colon ":". +# These extra options are documented in the shell snippet for each package +# in the top-level pkgs directory. +# +# Autotools. If you already have recent versions installed with your OS +# package manager, then comment these out. +m4 +libtool +autoconf +automake +# +# CMake. +cmake +# +# Install zlib. This is needed on some systems where the OS-provided zlib is +# very ancient. +#zlib +# +# Install OpenBLAS. Comment out if you are using MKL with the Intel compilers +# or some other vendor BLAS / LAPACK solution. +#openblas +# +# Python 3. Uncomment one of the following lines. You should only use the +# "default" option for Docker images. All other configs should use either +# a virtualenv or a conda environment. This will also install a set of +# common base packages. +#python:virtualenv +python:conda +#python:default +# +# Install MPICH. This step is optional and only needed in 2 cases: +# 1. You don't have MPI available through system packages that is +# compatible with the serial compilers you are using. +# 2. You are building a docker container for use at NERSC with shifter +# and need an MPICH compatible with the Cray one. +mpich +# +# Install mpi4py. This will use the MPI compilers specified in your config. +mpi4py +# +# Install CFITSIO. +cfitsio +# +# Install FFTW3. +fftw +# +# Install libbz2. This is required to enable some features in the boost +# build which are in turn needed by spt3g. +bzip2 +# +# Install Boost. +boost +# +# Install HDF5 (serial version). +hdf5 +# +# Install h5py (using our HDF5). +h5py +# +# Install healpy +healpy +# +# Install quaternionarray +qarray +# +# Install fitsio +fitsio +# +# Install aatm. Needed for some features of atmosphere simulations. +aatm +# +# Install suitesparse +suitesparse +# +# Install libconviqt. 4-PI a_lm space beam convolution. +conviqt +# +# Install libsharp. Distributed harmonic transforms. +libsharp +# +# Install libmadam. Destriping map-maker. +#madam +# +# Install FLAC, needed by spt3g +libflac +# +# Install SPT3G. Frame based data format. +#spt3g +# +# Install TIDAS. HDF5-based timestream data format. +tidas +# +# Install PySM. Python Sky Model. +pysm +# +# Install PyMPIT for environment testing. Useful for testing working +# mpi4py stack. +pympit +# +# Install TOAST. +toast diff --git a/configs/osx-macports-gcc b/configs/macos-conda-gcc similarity index 68% rename from configs/osx-macports-gcc rename to configs/macos-conda-gcc index f9e3c94..9c09c38 100644 --- a/configs/osx-macports-gcc +++ b/configs/macos-conda-gcc @@ -1,6 +1,9 @@ -# OS type (linux OR osx) -OSTYPE = osx +# OS type (linux OR macos) +OSTYPE = macos + +# Specify the template to use +TEMPLATE = macos # Serial compilers @@ -17,9 +20,9 @@ BUILD_CXX = g++ MPICC = mpicc MPICXX = mpicxx -MPIFC = mpif90 -MPI_CPPFLAGS = -MPI_LDFLAGS = +MPIFC = +MPI_CPPFLAGS = @AUX_PREFIX@/include +MPI_LDFLAGS = @AUX_PREFIX@/lib MPI_CXXLIB = mpichcxx MPI_LIB = mpich MPI_EXTRA_COMP = @@ -42,12 +45,15 @@ CROSS = # Parallel builds MAKEJ = 2 +# Define MKL location +MKL = + # Python version to use -PYVERSION = auto +PYVERSION = 3.7 -# For BLAS/LAPACK, we use macports openblas +# For BLAS/LAPACK, we use our own openblas -BLAS = -lopenblas +BLAS = -lopenblas -fopenmp -lm LAPACK = # Boost toolchain name diff --git a/configs/macos-conda-gcc.pkgs b/configs/macos-conda-gcc.pkgs new file mode 100644 index 0000000..f4ab573 --- /dev/null +++ b/configs/macos-conda-gcc.pkgs @@ -0,0 +1,103 @@ +# This is the full set of packages that can be installed. This can be +# used as a starting point for the package list for a particular config. +# Some packages accept additional options which can be added after a colon ":". +# These extra options are documented in the shell snippet for each package +# in the top-level pkgs directory. +# +# Autotools. If you already have recent versions installed with your OS +# package manager, then comment these out. +m4 +libtool +autoconf +automake +# +# CMake. +cmake +# +# Install zlib. This is needed on some systems where the OS-provided zlib is +# very ancient. +#zlib +# +# Install OpenBLAS. Comment out if you are using MKL with the Intel compilers +# or some other vendor BLAS / LAPACK solution. +openblas +# +# Python 3. Uncomment one of the following lines. You should only use the +# "default" option for Docker images. All other configs should use either +# a virtualenv or a conda environment. This will also install a set of +# common base packages. +#python:virtualenv +python:conda +#python:default +# +# Install MPICH. This step is optional and only needed in 2 cases: +# 1. You don't have MPI available through system packages that is +# compatible with the serial compilers you are using. +# 2. You are building a docker container for use at NERSC with shifter +# and need an MPICH compatible with the Cray one. +mpich +# +# Install mpi4py. This will use the MPI compilers specified in your config. +mpi4py +# +# Install CFITSIO. +cfitsio +# +# Install FFTW3. +fftw +# +# Install libbz2. This is required to enable some features in the boost +# build which are in turn needed by spt3g. +bzip2 +# +# Install Boost. +boost +# +# Install HDF5 (serial version). +hdf5 +# +# Install h5py (using our HDF5). +h5py +# +# Install healpy +healpy +# +# Install quaternionarray +qarray +# +# Install fitsio +fitsio +# +# Install aatm. Needed for some features of atmosphere simulations. +aatm +# +# Install suitesparse +suitesparse +# +# Install libconviqt. 4-PI a_lm space beam convolution. +conviqt +# +# Install libsharp. Distributed harmonic transforms. +libsharp +# +# Install libmadam. Destriping map-maker. +madam +# +# Install FLAC, needed by spt3g +libflac +# +# Install SPT3G. Frame based data format. +spt3g +# +# Install TIDAS. HDF5-based timestream data format. +tidas +# +# Install PySM. Python Sky Model. +pysm +# +# Install PyMPIT for environment testing. Useful for testing working +# mpi4py stack. +pympit +# +# Install TOAST. +toast diff --git a/configs/macos-venv-clang b/configs/macos-venv-clang new file mode 100644 index 0000000..e4f3993 --- /dev/null +++ b/configs/macos-venv-clang @@ -0,0 +1,75 @@ + +# OS type (linux OR macos) +OSTYPE = macos + +# Specify the template to use +TEMPLATE = macos-homebrew + +# Python version to use +PYVERSION = auto + +# Specify additional packages to install with Homebrew +HOMEBREW_PKGS = python libtool autoconf automake cmake boost + +# Packages to install with pip +PIP_PKGS = future nose Cython numpy scipy matplotlib pyyaml astropy six psutil ephem pandas memory_profiler ipython cycler kiwisolver python-dateutil toml numba tbb nbstripout black wurlitzer ipympl ipykernel jupyterlab pyfftw pillow + +# Packages to install with conda +CONDA_PKGS = + +# Serial compilers + +CC = clang +CXX = clang++ +FC = + +# Compiler to use for packages needed on the build machine + +BUILD_CC = clang +BUILD_CXX = clang++ + +# MPI compilers + +MPICC = mpicc +MPICXX = mpicxx +MPIFC = +MPI_CPPFLAGS = @AUX_PREFIX@/include +MPI_LDFLAGS = @AUX_PREFIX@/lib +MPI_CXXLIB = mpichcxx +MPI_LIB = mpich +MPI_EXTRA_COMP = +MPI_EXTRA_LINK = + +# Compile flags + +CFLAGS = -O3 -fPIC +CXXFLAGS = -O3 -fPIC -std=c++11 -stdlib=libc++ +FCFLAGS = -O3 -fPIC + +OPENMP_CFLAGS = +OPENMP_CXXFLAGS = +LDFLAGS = + +# Are we doing a cross-compile? + +CROSS = + +# Parallel builds +MAKEJ = 2 + +# Define MKL location +MKL = + +# For BLAS/LAPACK, we use accelerate framework + +BLAS = -framework Accelerate +LAPACK = + +# Boost toolchain name + +BOOSTCHAIN = clang + +# Group and permissions to set + +CHGRP = +CHMOD = diff --git a/configs/osx-homebrew-clang.pkgs b/configs/macos-venv-clang.pkgs similarity index 97% rename from configs/osx-homebrew-clang.pkgs rename to configs/macos-venv-clang.pkgs index ca7ab90..eb7aa44 100644 --- a/configs/osx-homebrew-clang.pkgs +++ b/configs/macos-venv-clang.pkgs @@ -35,16 +35,16 @@ python:virtualenv # compatible with the serial compilers you are using. # 2. You are building a docker container for use at NERSC with shifter # and need an MPICH compatible with the Cray one. -#mpich +mpich # # Install mpi4py. This will use the MPI compilers specified in your config. mpi4py # # Install CFITSIO. -#cfitsio +cfitsio # # Install FFTW3. -#fftw +fftw # # Install libbz2. This is required to enable some features in the boost # build which are in turn needed by spt3g. @@ -72,10 +72,10 @@ fitsio aatm # # Install suitesparse -#suitesparse +suitesparse # # Install libconviqt. 4-PI a_lm space beam convolution. -conviqt +#conviqt # # Install libsharp. Distributed harmonic transforms. libsharp @@ -87,7 +87,7 @@ libsharp libflac # # Install SPT3G. Frame based data format. -spt3g +#spt3g # # Install TIDAS. HDF5-based timestream data format. tidas diff --git a/configs/macos-venv-gcc b/configs/macos-venv-gcc new file mode 100644 index 0000000..a5ae8f5 --- /dev/null +++ b/configs/macos-venv-gcc @@ -0,0 +1,75 @@ + +# OS type (linux OR macos) +OSTYPE = macos + +# Specify the template to use +TEMPLATE = macos-homebrew + +# Python version to use +PYVERSION = auto + +# Specify additional packages to install with Homebrew +HOMEBREW_PKGS = python libtool autoconf automake cmake gcc + +# Packages to install with pip +PIP_PKGS = future nose Cython numpy scipy matplotlib pyyaml astropy six psutil ephem pandas memory_profiler ipython cycler kiwisolver python-dateutil toml numba tbb nbstripout black wurlitzer ipympl ipykernel jupyterlab pyfftw pillow + +# Packages to install with conda +CONDA_PKGS = + +# Serial compilers + +CC = gcc-10 +CXX = g++-10 +FC = gfortran-10 + +# Compiler to use for packages needed on the build machine + +BUILD_CC = clang +BUILD_CXX = clang++ + +# MPI compilers + +MPICC = mpicc +MPICXX = mpicxx +MPIFC = +MPI_CPPFLAGS = @AUX_PREFIX@/include +MPI_LDFLAGS = @AUX_PREFIX@/lib +MPI_CXXLIB = mpichcxx +MPI_LIB = mpich +MPI_EXTRA_COMP = +MPI_EXTRA_LINK = + +# Compile flags + +CFLAGS = -O3 -fPIC +CXXFLAGS = -O3 -fPIC -std=c++11 +FCFLAGS = -O3 -fPIC + +OPENMP_CFLAGS = -fopenmp +OPENMP_CXXFLAGS = -fopenmp +LDFLAGS = + +# Are we doing a cross-compile? + +CROSS = + +# Parallel builds +MAKEJ = 2 + +# Define MKL location +MKL = + +# For BLAS/LAPACK, we use self-built openblas + +BLAS = -framework Accelerate +LAPACK = + +# Boost toolchain name + +BOOSTCHAIN = gcc + +# Group and permissions to set + +CHGRP = +CHMOD = diff --git a/configs/osx-macports-gcc.pkgs b/configs/macos-venv-gcc.pkgs similarity index 97% rename from configs/osx-macports-gcc.pkgs rename to configs/macos-venv-gcc.pkgs index c1803c3..9a36df0 100644 --- a/configs/osx-macports-gcc.pkgs +++ b/configs/macos-venv-gcc.pkgs @@ -35,29 +35,29 @@ python:virtualenv # compatible with the serial compilers you are using. # 2. You are building a docker container for use at NERSC with shifter # and need an MPICH compatible with the Cray one. -#mpich +mpich # # Install mpi4py. This will use the MPI compilers specified in your config. mpi4py # # Install CFITSIO. -#cfitsio +cfitsio # # Install FFTW3. -#fftw +fftw # # Install libbz2. This is required to enable some features in the boost # build which are in turn needed by spt3g. -#bzip2 +bzip2 # # Install Boost. -#boost +boost # # Install HDF5 (serial version). -#hdf5 +hdf5 # # Install h5py (using our HDF5). -#h5py +h5py # # Install healpy healpy @@ -72,7 +72,7 @@ fitsio aatm # # Install suitesparse -#suitesparse +suitesparse # # Install libconviqt. 4-PI a_lm space beam convolution. conviqt @@ -87,7 +87,7 @@ madam libflac # # Install SPT3G. Frame based data format. -spt3g +#spt3g # # Install TIDAS. HDF5-based timestream data format. tidas diff --git a/configs/simons-intel b/configs/simons-intel index bcfbbc8..02d26b6 100644 --- a/configs/simons-intel +++ b/configs/simons-intel @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/ubuntu-18.04-venv b/configs/ubuntu-18.04-venv index 446ce22..e29dca1 100644 --- a/configs/ubuntu-18.04-venv +++ b/configs/ubuntu-18.04-venv @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/ubuntu-19.04-venv b/configs/ubuntu-19.04-venv index f26c6eb..71633e4 100644 --- a/configs/ubuntu-19.04-venv +++ b/configs/ubuntu-19.04-venv @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/ubuntu-19.10-venv b/configs/ubuntu-19.10-venv index c44269e..cb7af7e 100644 --- a/configs/ubuntu-19.10-venv +++ b/configs/ubuntu-19.10-venv @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/configs/ubuntu-20.04-venv b/configs/ubuntu-20.04-venv index c44269e..cb7af7e 100644 --- a/configs/ubuntu-20.04-venv +++ b/configs/ubuntu-20.04-venv @@ -1,5 +1,5 @@ -# OS type (linux OR osx) +# OS type (linux OR macos) OSTYPE = linux # Specify the template to use diff --git a/pkgs/aatm.sh b/pkgs/aatm.sh index 8f92bea..9df21cb 100644 --- a/pkgs/aatm.sh +++ b/pkgs/aatm.sh @@ -37,6 +37,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/autoconf.sh b/pkgs/autoconf.sh index 31e311d..f72094c 100644 --- a/pkgs/autoconf.sh +++ b/pkgs/autoconf.sh @@ -28,6 +28,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/automake.sh b/pkgs/automake.sh index d361797..9c77bf2 100644 --- a/pkgs/automake.sh +++ b/pkgs/automake.sh @@ -28,6 +28,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/boost.sh b/pkgs/boost.sh index 1ea7275..10cf575 100644 --- a/pkgs/boost.sh +++ b/pkgs/boost.sh @@ -40,6 +40,7 @@ tar xjf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/bzip2.sh b/pkgs/bzip2.sh index e5e4a44..f645170 100644 --- a/pkgs/bzip2.sh +++ b/pkgs/bzip2.sh @@ -32,6 +32,7 @@ tar xjf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/cfitsio.sh b/pkgs/cfitsio.sh index 81f47e0..3b350cb 100644 --- a/pkgs/cfitsio.sh +++ b/pkgs/cfitsio.sh @@ -30,6 +30,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/cmake.sh b/pkgs/cmake.sh index 9cd6729..44d1002 100644 --- a/pkgs/cmake.sh +++ b/pkgs/cmake.sh @@ -28,6 +28,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/conviqt.sh b/pkgs/conviqt.sh index 3027d95..c218dbc 100644 --- a/pkgs/conviqt.sh +++ b/pkgs/conviqt.sh @@ -36,6 +36,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/fftw.sh b/pkgs/fftw.sh index 1942eb5..5a36b6d 100644 --- a/pkgs/fftw.sh +++ b/pkgs/fftw.sh @@ -30,6 +30,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/fitsio.sh b/pkgs/fitsio.sh index 3560f5f..b175985 100644 --- a/pkgs/fitsio.sh +++ b/pkgs/fitsio.sh @@ -4,9 +4,9 @@ pkg="fitsio" pkgopts=$@ cleanup="" -version=1.0.1 +version=1.1.2 pfile=fitsio-${version}.tar.gz -src=$(eval "@TOP_DIR@/tools/fetch_check.sh" https://github.com/esheldon/fitsio/archive/v${version}.tar.gz ${pfile}) +src=$(eval "@TOP_DIR@/tools/fetch_check.sh" https://files.pythonhosted.org/packages/5e/d7/58ef112ec42a23a866351b09f802e1b1fa6967ac01df0c9f3ea5ee8223ce/${pfile} ${pfile}) if [ "x${src}" = "x" ]; then echo "Failed to fetch ${pkg}" >&2 @@ -26,6 +26,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/h5py.sh b/pkgs/h5py.sh index 113663c..036d056 100644 --- a/pkgs/h5py.sh +++ b/pkgs/h5py.sh @@ -4,7 +4,7 @@ pkg="h5py" pkgopts=$@ cleanup="" -hdf5pref='--hdf5="@AUX_PREFIX@"' +hdf5pref='--hdf5=@AUX_PREFIX@' if [ "x$pkgopts" != "x" ]; then if [ "x$pkgopts" = "xpkg-config" ]; then hdf5pref="" @@ -39,6 +39,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/hdf5.sh b/pkgs/hdf5.sh index d3fd127..6c81590 100644 --- a/pkgs/hdf5.sh +++ b/pkgs/hdf5.sh @@ -51,6 +51,7 @@ tar xjf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/healpy.sh b/pkgs/healpy.sh index 31303ce..6636e81 100644 --- a/pkgs/healpy.sh +++ b/pkgs/healpy.sh @@ -4,9 +4,9 @@ pkg="healpy" pkgopts=$@ cleanup="" -version=1.13.0 +version=1.14.0 pfile=healpy-${version}.tar.gz -src=$(eval "@TOP_DIR@/tools/fetch_check.sh" https://files.pythonhosted.org/packages/26/74/0c8592686027a8196e275cb81999e8aae88d0416c223fa55a7f0cb5bdd26/${pfile} ${pfile}) +src=$(eval "@TOP_DIR@/tools/fetch_check.sh" https://files.pythonhosted.org/packages/52/bb/21e57f6b3a4c2a3bb59fb2a284fccf6ea15241a180e86ace1f9b891e251b/${pfile} ${pfile}) if [ "x${src}" = "x" ]; then echo "Failed to fetch ${pkg}" >&2 @@ -28,6 +28,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/libflac.sh b/pkgs/libflac.sh index 6506412..2e17138 100644 --- a/pkgs/libflac.sh +++ b/pkgs/libflac.sh @@ -31,6 +31,7 @@ tar xJf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/libsharp.sh b/pkgs/libsharp.sh index 7beb192..75f00b6 100644 --- a/pkgs/libsharp.sh +++ b/pkgs/libsharp.sh @@ -35,6 +35,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/libtool.sh b/pkgs/libtool.sh index b598f82..5565d3e 100644 --- a/pkgs/libtool.sh +++ b/pkgs/libtool.sh @@ -28,6 +28,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/m4.sh b/pkgs/m4.sh index ab28654..7c98073 100644 --- a/pkgs/m4.sh +++ b/pkgs/m4.sh @@ -29,6 +29,7 @@ tar xjf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/madam.sh b/pkgs/madam.sh index 3c0a8b1..9cf50a7 100644 --- a/pkgs/madam.sh +++ b/pkgs/madam.sh @@ -44,6 +44,7 @@ tar xjf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/mpi4py.sh b/pkgs/mpi4py.sh index c00a5b6..06d422c 100644 --- a/pkgs/mpi4py.sh +++ b/pkgs/mpi4py.sh @@ -38,6 +38,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/mpich.sh b/pkgs/mpich.sh index 68064cf..f2c32e3 100644 --- a/pkgs/mpich.sh +++ b/pkgs/mpich.sh @@ -21,20 +21,35 @@ echo "Building ${pkg}..." >&2 rm -rf mpich-${version} fcopt="" +fextra="" if [ "x@FC@" = "x" ]; then fcopt="--disable-fortran" +else + # Special handling of gcc-10 fortran flags + verline=$(@FC@ --version | head -n 1) + gnucheck=$(echo ${verline} | awk '{print $1}') + if [ "${gnucheck}" = "GNU" ]; then + gnuversion=$(echo ${verline} | sed -e 's#.*[[:space:]]\([0-9\.]*\)$#\1#') + gnumajor=$(echo ${gnuversion} | sed -e 's#^\([0-9]*\)\..*#\1#') + if [ "${gnumajor}" -ge "10" ]; then + fextra="-fallow-argument-mismatch" + fi + fi fi + tar xzf ${src} \ && cd mpich-${version} \ && cleanup="${cleanup} $(pwd)" \ && CC="@CC@" CXX="@CXX@" FC="@FC@" \ CFLAGS="@CFLAGS@" CXXFLAGS="@CXXFLAGS@" FCFLAGS="@FCFLAGS@" \ + FFLAGS="@FCFLAGS@ ${fextra}" \ ./configure @CROSS@ ${fcopt} --prefix="@AUX_PREFIX@" > ${log} 2>&1 \ && make -j @MAKEJ@ >> ${log} 2>&1 \ && make install >> ${log} 2>&1 if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/openblas.sh b/pkgs/openblas.sh index 5caa882..104a174 100644 --- a/pkgs/openblas.sh +++ b/pkgs/openblas.sh @@ -4,7 +4,7 @@ pkg="openblas" pkgopts=$@ cleanup="" -version=0.3.9 +version=0.3.10 pfile=OpenBLAS-${version}.tar.gz src=$(eval "@TOP_DIR@/tools/fetch_check.sh" https://github.com/xianyi/OpenBLAS/archive/v${version}.tar.gz ${pfile}) @@ -34,6 +34,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/patch_libsharp b/pkgs/patch_libsharp index 5e97fb4..0ec9d4b 100644 --- a/pkgs/patch_libsharp +++ b/pkgs/patch_libsharp @@ -1,10 +1,10 @@ -diff -urN libsharp_orig/configure.ac libsharp/configure.ac ---- libsharp_orig/configure.ac 2018-11-28 11:17:02.833996665 -0800 -+++ libsharp/configure.ac 2018-11-28 11:22:25.019765197 -0800 +diff -urN libsharp-1.0.0_orig/configure.ac libsharp-1.0.0/configure.ac +--- libsharp-1.0.0_orig/configure.ac 2018-10-15 01:33:24.000000000 -0700 ++++ libsharp-1.0.0/configure.ac 2020-09-18 10:12:30.917793669 -0700 @@ -47,28 +47,30 @@ ENABLE_PIC=yes fi]) - + -case $CCTYPE in - gcc) - CCFLAGS="-O3 -fno-tree-vectorize -ffast-math -fomit-frame-pointer -std=c99 -pedantic -Wextra -Wall -Wno-unknown-pragmas -Wshadow -Wmissing-prototypes -Wfatal-errors -march=native" @@ -51,6 +51,48 @@ diff -urN libsharp_orig/configure.ac libsharp/configure.ac +# esac + +CCFLAGS="$CFLAGS" - + case $system in Darwin-*) +diff -urN libsharp-1.0.0_orig/python/setup.py libsharp-1.0.0/python/setup.py +--- libsharp-1.0.0_orig/python/setup.py 2018-10-15 01:33:24.000000000 -0700 ++++ libsharp-1.0.0/python/setup.py 2020-09-18 10:14:56.831182434 -0700 +@@ -34,12 +34,21 @@ + libsharp_include = os.environ.get('LIBSHARP_INCLUDE', libsharp and os.path.join(libsharp, 'include')) + libsharp_lib = os.environ.get('LIBSHARP_LIB', libsharp and os.path.join(libsharp, 'lib')) + ++ompflags = os.environ.get('OPENMP_CXXFLAGS', None) ++ + if libsharp_include is None or libsharp_lib is None: + sys.stderr.write('Please set LIBSHARP environment variable to the install directly of libsharp, ' + 'this script will refer to the lib and include sub-directories. Alternatively ' + 'set LIBSHARP_INCLUDE and LIBSHARP_LIB\n') + sys.exit(1) + ++extra_link = [] ++if ompflags is not None: ++ extra_link.append(ompflags) ++ ++if sys.platform.lower() == 'darwin': ++ extra_link.append("-Wl,-undefined,dynamic_lookup") ++ + if __name__ == "__main__": + setup(install_requires = ['numpy'], + packages = find_packages(), +@@ -70,14 +79,14 @@ + libraries=["sharp", "fftpack", "c_utils"], + include_dirs=[libsharp_include, np.get_include()], + library_dirs=[libsharp_lib], +- extra_link_args=["-fopenmp"], ++ extra_link_args=extra_link, + ), + Extension("libsharp.libsharp_mpi", + ["libsharp/libsharp_mpi.pyx"], + libraries=["sharp", "fftpack", "c_utils"], + include_dirs=[libsharp_include, np.get_include()], + library_dirs=[libsharp_lib], +- extra_link_args=["-fopenmp"], ++ extra_link_args=extra_link, + ), + ]), + ) diff --git a/pkgs/pympit.sh b/pkgs/pympit.sh index 5fac699..c1ff16e 100644 --- a/pkgs/pympit.sh +++ b/pkgs/pympit.sh @@ -30,6 +30,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/pysm.sh b/pkgs/pysm.sh index 46332e7..3d3b796 100644 --- a/pkgs/pysm.sh +++ b/pkgs/pysm.sh @@ -26,6 +26,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/python.sh b/pkgs/python.sh index 07cf82e..97fee29 100644 --- a/pkgs/python.sh +++ b/pkgs/python.sh @@ -16,7 +16,7 @@ if [ "${pytype}" = "conda" ]; then if [ "@OSTYPE@" = "linux" ]; then inst=$(eval "@TOP_DIR@/tools/fetch_check.sh" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh miniconda.sh) else - if [ "@OSTYPE@" = "osx" ]; then + if [ "@OSTYPE@" = "macos" ]; then inst=$(eval "@TOP_DIR@/tools/fetch_check.sh" https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh) else echo "Unsupported value for config option OSTYPE" >&2 @@ -66,7 +66,7 @@ if [ "${pytype}" = "conda" ]; then else if [ "${pytype}" = "virtualenv" ]; then echo "Python using virtualenv" >&2 - virtualenv -p python@PYVERSION@ "@PYTHON_PREFIX@" \ + python3 -m venv "@PYTHON_PREFIX@" \ && eval "@TOP_DIR@/tools/gen_activate.sh" "@VERSION@" "@PREFIX@" "@PYTHON_PREFIX@" "@AUX_PREFIX@" "@PYVERSION@" "${pytype}" "${pextra}" \ && source "@PYTHON_PREFIX@/bin/cmbenv" else @@ -76,7 +76,7 @@ else fi if [ "x@PIP_PKGS@" != "x" ]; then for pip_pkg in @PIP_PKGS@; do - pip3 install ${pip_pkg} >&2 + python3 -m pip install ${pip_pkg} >&2 if [ $? -ne 0 ]; then echo "pip install of ${pip_pkg} failed" >&2 exit 1 diff --git a/pkgs/qarray.sh b/pkgs/qarray.sh index cd6896c..2bc7ce5 100644 --- a/pkgs/qarray.sh +++ b/pkgs/qarray.sh @@ -28,6 +28,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/spt3g.sh b/pkgs/spt3g.sh index 9dec2a6..da3c990 100644 --- a/pkgs/spt3g.sh +++ b/pkgs/spt3g.sh @@ -37,6 +37,11 @@ done # Short version of python to use pyshort=$(echo @PYVERSION@ | sed -e "s/\.//") +ldflags="" +if [ "@OSTYPE@" != "macos" ]; then + ldflags="-Wl,-z,muldefs" +fi + rm -rf spt3g_software-${version} tar xzf ${src} \ && cd spt3g_software-${version} \ @@ -48,7 +53,7 @@ tar xzf ${src} \ && cd "@AUX_PREFIX@/spt3g" \ && mkdir build \ && cd build \ - && LDFLAGS="-Wl,-z,muldefs" \ + && LDFLAGS="${ldflags}" \ cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER="@CC@" \ @@ -71,6 +76,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/suitesparse.sh b/pkgs/suitesparse.sh index dc4e855..e1e1aa9 100644 --- a/pkgs/suitesparse.sh +++ b/pkgs/suitesparse.sh @@ -18,6 +18,11 @@ log="../log_${pkg}" echo "Building ${pkg}..." >&2 +CFOMP="" +if [ "x@OPENMP_CFLAGS@" != "x" ]; then + CFOMP="CFOPENMP=\"@OPENMP_CFLAGS@\"" +fi + rm -rf SuiteSparse-${version} tar xzf ${src} \ && cd SuiteSparse-${version} \ @@ -25,7 +30,7 @@ tar xzf ${src} \ && make library JOBS=@MAKEJ@ \ CC="@CC@" CXX="@CXX@" CFLAGS="@CFLAGS@" AUTOCC=no \ GPU_CONFIG="" \ - CFOPENMP="@OPENMP_CXXFLAGS@" LAPACK="@LAPACK@" BLAS="@BLAS@" \ + ${CFOMP} LAPACK="@LAPACK@" BLAS="@BLAS@" \ > ${log} 2>&1 \ && cp -a ./lib/* "@AUX_PREFIX@/lib/" \ && cp -a ./include/* "@AUX_PREFIX@/include/" \ @@ -33,6 +38,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/tidas.sh b/pkgs/tidas.sh index 0604aad..e9bd739 100644 --- a/pkgs/tidas.sh +++ b/pkgs/tidas.sh @@ -40,6 +40,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/toast.sh b/pkgs/toast.sh index c3b9528..970a75b 100644 --- a/pkgs/toast.sh +++ b/pkgs/toast.sh @@ -4,7 +4,7 @@ pkg="toast" pkgopts=$@ cleanup="" -version=2.3.8 +version=2.3.10 pfile=toast-${version}.tar.gz src=$(eval "@TOP_DIR@/tools/fetch_check.sh" https://github.com/hpc4cmb/toast/archive/${version}.tar.gz ${pfile}) @@ -75,10 +75,8 @@ tar xzf ${src} \ && mkdir -p build \ && cd build \ && cmake \ - -DCMAKE_C_COMPILER="@MPICC@" \ - -DCMAKE_CXX_COMPILER="@MPICXX@" \ - -DMPI_C_COMPILER="@MPICC@" \ - -DMPI_CXX_COMPILER="@MPICXX@" \ + -DCMAKE_C_COMPILER="@CC@" \ + -DCMAKE_CXX_COMPILER="@CXX@" \ -DCMAKE_C_FLAGS="@CFLAGS@" \ -DCMAKE_CXX_FLAGS="@CXXFLAGS@" \ -DPYTHON_EXECUTABLE:FILEPATH=$(which python3) \ @@ -90,6 +88,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/pkgs/zlib.sh b/pkgs/zlib.sh index c8cc6a5..d8451d9 100644 --- a/pkgs/zlib.sh +++ b/pkgs/zlib.sh @@ -29,6 +29,7 @@ tar xzf ${src} \ if [ $? -ne 0 ]; then echo "Failed to build ${pkg}" >&2 + cat "${log}" >&2 exit 1 fi diff --git a/templates/install-macos-homebrew.in b/templates/install-macos-homebrew.in new file mode 100644 index 0000000..2302cfd --- /dev/null +++ b/templates/install-macos-homebrew.in @@ -0,0 +1,83 @@ +#!/bin/bash + +# Initialize environment + +if [ -e "@CONFFILE@.sh" ]; then + source "@CONFFILE@.sh" +fi + +# Install external packages with homebrew + +brew upgrade +brew install @HOMEBREW_PKGS@ + +# Add install prefix to our environment. + +mkdir -p "@PYTHON_PREFIX@/bin" +mkdir -p "@PYTHON_PREFIX@/lib" +mkdir -p "@AUX_PREFIX@/include" +mkdir -p "@AUX_PREFIX@/bin" +mkdir -p "@AUX_PREFIX@/lib/python@PYVERSION@/site-packages" +pushd "@AUX_PREFIX@" > /dev/null +if [ ! -e lib64 ]; then + ln -s lib lib64 +fi +popd > /dev/null + +prepend_env () { + # This function is needed since trailing colons + # on some environment variables can cause major + # problems... + local envname=$1 + local envval=$2 + if [ "x${!envname}" = "x" ]; then + export ${envname}="${envval}" + else + export ${envname}="${envval}":${!envname} + fi +} + +prepend_env "CMBENV_AUX_ROOT" "@AUX_PREFIX@" +prepend_env "CMAKE_PREFIX_PATH" "@AUX_PREFIX@" +prepend_env "PATH" "@PYTHON_PREFIX@/bin" +prepend_env "PATH" "@AUX_PREFIX@/bin" +prepend_env "CPATH" "@AUX_PREFIX@/include" +prepend_env "LIBRARY_PATH" "@AUX_PREFIX@/lib" +prepend_env "LD_LIBRARY_PATH" "@AUX_PREFIX@/lib" +prepend_env "PYTHONPATH" "@AUX_PREFIX@/lib/python@PYVERSION@/site-packages" +prepend_env "PKG_CONFIG_PATH" "@AUX_PREFIX@/lib/pkgconfig" + +# Install packages + +@PACKAGES@ + +# Compile python modules + +echo "Compiling python packages..." +python3 -m compileall -f "@AUX_PREFIX@" > log_pycompile + +# Install environment init file + +cp "$0.init" "@PREFIX@/cmbenv_init.sh" + +# Install modulefile + +if [ "x@MODULE_DIR@" != "x" ]; then + mkdir -p "@MODULE_DIR@" + cp "$0.mod" "@MODULE_DIR@/@VERSION@" + cp "$0.modver" "@MODULE_DIR@/.version_@VERSION@" +fi + +# Install logo + +cp "@TOP_DIR@"/logo-*.png "@PREFIX@/" + +# Set permissions + +if [ "x@CHGRP@" != "x" ]; then + chgrp -R @CHGRP@ "@PREFIX@" +fi + +if [ "x@CHMOD@" != "x" ]; then + chmod -R @CHMOD@ "@PREFIX@" +fi diff --git a/templates/install-macos.in b/templates/install-macos.in new file mode 100644 index 0000000..d658d4d --- /dev/null +++ b/templates/install-macos.in @@ -0,0 +1,78 @@ +#!/bin/bash + +# Initialize environment + +if [ -e "@CONFFILE@.sh" ]; then + source "@CONFFILE@.sh" +fi + +# Add install prefix to our environment. + +mkdir -p "@PYTHON_PREFIX@/bin" +mkdir -p "@PYTHON_PREFIX@/lib" +mkdir -p "@AUX_PREFIX@/include" +mkdir -p "@AUX_PREFIX@/bin" +mkdir -p "@AUX_PREFIX@/lib/python@PYVERSION@/site-packages" +pushd "@AUX_PREFIX@" > /dev/null +if [ ! -e lib64 ]; then + ln -s lib lib64 +fi +popd > /dev/null + +prepend_env () { + # This function is needed since trailing colons + # on some environment variables can cause major + # problems... + local envname=$1 + local envval=$2 + if [ "x${!envname}" = "x" ]; then + export ${envname}="${envval}" + else + export ${envname}="${envval}":${!envname} + fi +} + +prepend_env "CMBENV_AUX_ROOT" "@AUX_PREFIX@" +prepend_env "CMAKE_PREFIX_PATH" "@AUX_PREFIX@" +prepend_env "PATH" "@PYTHON_PREFIX@/bin" +prepend_env "PATH" "@AUX_PREFIX@/bin" +prepend_env "CPATH" "@AUX_PREFIX@/include" +prepend_env "LIBRARY_PATH" "@AUX_PREFIX@/lib" +prepend_env "LD_LIBRARY_PATH" "@AUX_PREFIX@/lib" +prepend_env "PYTHONPATH" "@AUX_PREFIX@/lib/python@PYVERSION@/site-packages" +prepend_env "PKG_CONFIG_PATH" "@AUX_PREFIX@/lib/pkgconfig" + +# Install packages + +@PACKAGES@ + +# Compile python modules + +echo "Compiling python packages..." +python3 -m compileall -f "@AUX_PREFIX@" > log_pycompile + +# Install environment init file + +cp "$0.init" "@PREFIX@/cmbenv_init.sh" + +# Install modulefile + +if [ "x@MODULE_DIR@" != "x" ]; then + mkdir -p "@MODULE_DIR@" + cp "$0.mod" "@MODULE_DIR@/@VERSION@" + cp "$0.modver" "@MODULE_DIR@/.version_@VERSION@" +fi + +# Install logo + +cp "@TOP_DIR@"/logo-*.png "@PREFIX@/" + +# Set permissions + +if [ "x@CHGRP@" != "x" ]; then + chgrp -R @CHGRP@ "@PREFIX@" +fi + +if [ "x@CHMOD@" != "x" ]; then + chmod -R @CHMOD@ "@PREFIX@" +fi