diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2018-08-29 13:04:12 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2018-08-29 13:04:12 -0400 |
commit | e1e50116a7151574f7ddfc05528bdf398e6f1566 (patch) | |
tree | 162a53ad2420651afe3e30ecdf7e57ee0f7cfbd5 | |
download | docker-buildsys-openblas-e1e50116a7151574f7ddfc05528bdf398e6f1566.tar.gz |
Initial commit
-rw-r--r-- | Dockerfile | 22 | ||||
-rwxr-xr-x | build_cython.sh | 45 | ||||
-rwxr-xr-x | build_numpy.sh | 46 | ||||
-rwxr-xr-x | build_openblas.sh | 37 | ||||
-rwxr-xr-x | build_scipy.sh | 45 |
5 files changed, 195 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e926cf3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM astroconda/buildsys-vanilla +WORKDIR /build + +COPY build_openblas.sh . +RUN ./build_openblas.sh + +COPY build_cython.sh . +RUN ./build_cython.sh 3.5 \ + && ./build_cython.sh 3.6 \ + && ./build_cython.sh 3.7 + +COPY build_numpy.sh . +RUN ./build_numpy.sh 3.5 \ + && ./build_numpy.sh 3.6 \ + && ./build_numpy.sh 3.7 + +COPY build_scipy.sh . +RUN ./build_scipy.sh 3.5 \ + && ./build_scipy.sh 3.6 \ + && ./build_scipy.sh 3.7 + +WORKDIR /work diff --git a/build_cython.sh b/build_cython.sh new file mode 100755 index 0000000..995f556 --- /dev/null +++ b/build_cython.sh @@ -0,0 +1,45 @@ +#!/bin/bash +set -e +set -x + +version="0.28.5" +tarball="${version}.tar.gz" +dest="cython-${version}" # Ugh. +url="http://github.com/cython/cython/archive/${tarball}" +export PATH_OLD="${PATH}" + +if [[ ! $1 ]]; then + echo No argument passed. Need a version. + exit 1 +fi +export pylon="/opt/$1/bin" + +function pre() +{ + export PATH="${pylon}:${PATH_OLD}" + export OPENBLAS_ROOT="/opt/OpenBLAS" + export PKG_CONFIG_PATH="${OPENBLAS_ROOT}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export LDFLAGS="-Wl,-rpath=${OPENBLAS_ROOT}/lib" + + curl -LO "${url}" + tar xf "${tarball}" +} + +function build() +{ + pre + pushd "${dest}" + python setup.py install + popd + post +} + +function post() +{ + rm -rf "${dest}" + rm -rf "${tarball}" + echo "All done." +} + +# Main +build diff --git a/build_numpy.sh b/build_numpy.sh new file mode 100755 index 0000000..5836ed5 --- /dev/null +++ b/build_numpy.sh @@ -0,0 +1,46 @@ +#!/bin/bash +set -e +set -x + +name="numpy" +version="1.15.0" +tarball="v${version}.tar.gz" +dest="${name}-${version}" # Ugh. +url="http://github.com/numpy/${name}/archive/${tarball}" +export PATH_OLD="${PATH}" + +if [[ ! $1 ]]; then + echo No argument passed. Need a version. + exit 1 +fi +export py_dest="/opt/$1/bin" + +function pre() +{ + export PATH="${py_dest}:${PATH_OLD}" + export OPENBLAS="/opt/OpenBLAS" + export PKG_CONFIG_PATH="${OPENBLAS}/lib/pkgconfig:${PKG_CONFIG_PATH}" + export LDFLAGS="-Wl,-rpath=${OPENBLAS}/lib" + + curl -LO "${url}" + tar xf "${tarball}" +} + +function build() +{ + pre + pushd "${dest}" + python setup.py install + popd + post +} + +function post() +{ + rm -rf "${dest}" + rm -rf "${tarball}" + echo "All done." +} + +# Main +build diff --git a/build_openblas.sh b/build_openblas.sh new file mode 100755 index 0000000..94a0735 --- /dev/null +++ b/build_openblas.sh @@ -0,0 +1,37 @@ +#!/bin/bash +set -e +set -x + +name="OpenBLAS" +version="0.3.2" +tarball="v${version}.tar.gz" +dest="${name}-${version}" # Ugh. +url="http://github.com/xianyi/${name}/archive/${tarball}" +prefix="/opt/OpenBLAS" + +function pre() +{ + curl -LO "${url}" + tar xf "${tarball}" +} + +function build() +{ + pre + pushd "${dest}" + export LDFLAGS="-Wl,-rpath=$prefix/lib" + make USE_OPENMP=1 + make install PREFIX="${prefix}" NO_STATIC=1 + popd + post +} + +function post() +{ + rm -rf "${dest}" + rm -rf "${tarball}" + echo "All done." +} + +# Main +build diff --git a/build_scipy.sh b/build_scipy.sh new file mode 100755 index 0000000..2f941f0 --- /dev/null +++ b/build_scipy.sh @@ -0,0 +1,45 @@ +#!/bin/bash +set -e +set -x + +name="scipy" +version="1.1.0" +tarball="v${version}.tar.gz" +dest="${name}-${version}" # Ugh. +url="http://github.com/scipy/scipy/archive/${tarball}" +export PATH_OLD="${PATH}" + +if [[ ! $1 ]]; then + echo No argument passed. Need a version. + exit 1 +fi +export py_dest="/opt/$1/bin" + +function pre() +{ + export PATH="${py_dest}:${PATH_OLD}" + export OPENBLAS="/opt/OpenBLAS" + export PKG_CONFIG_PATH="${OPENBLAS}/lib/pkgconfig:${PKG_CONFIG_PATH}" + + curl -LO "${url}" + tar xf "${tarball}" +} + +function build() +{ + pre + pushd "${dest}" + python setup.py install + popd + post +} + +function post() +{ + rm -rf "${dest}" + rm -rf "${tarball}" + echo "All done." +} + +# Main +build |