diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-09-15 16:38:08 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-09-15 16:38:08 +0200 |
commit | aa31a06235496c0d808e57c8ce914cb4b640bc6e (patch) | |
tree | 33385e828ddca0b2857bac9e3dac4dd3723a3eee /python/conda | |
parent | f6aa2db83dfea89f9d2cfc6fcbd3da141ee77e02 (diff) | |
parent | 00a1c6118b2d64b867c8e640c295462bcccfc7c9 (diff) | |
download | astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.tar.gz astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.tar.bz2 astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.tar.xz astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.zip |
Merge branch 'master' into parallel_vec
Diffstat (limited to 'python/conda')
-rw-r--r-- | python/conda/astra-toolbox/bld.bat | 33 | ||||
-rw-r--r-- | python/conda/astra-toolbox/build.sh | 4 | ||||
-rw-r--r-- | python/conda/astra-toolbox/meta.yaml (renamed from python/conda/meta.yaml) | 18 | ||||
-rw-r--r-- | python/conda/build.sh | 8 | ||||
-rw-r--r-- | python/conda/libastra/bld.bat | 33 | ||||
-rw-r--r-- | python/conda/libastra/build.sh | 44 | ||||
-rw-r--r-- | python/conda/libastra/meta.yaml | 20 | ||||
-rw-r--r-- | python/conda/linux_release/README.txt | 2 | ||||
-rw-r--r-- | python/conda/linux_release/buildenv/Dockerfile | 15 | ||||
-rw-r--r-- | python/conda/linux_release/builder/Dockerfile | 17 | ||||
-rw-r--r-- | python/conda/linux_release/release.sh | 20 |
11 files changed, 181 insertions, 33 deletions
diff --git a/python/conda/astra-toolbox/bld.bat b/python/conda/astra-toolbox/bld.bat new file mode 100644 index 0000000..15777ce --- /dev/null +++ b/python/conda/astra-toolbox/bld.bat @@ -0,0 +1,33 @@ +@echo off + +set R=%SRC_DIR% + +set B_VC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64 +call "%B_VC%\vcvars64.bat" + +set B_BV=1_62 +set B_BOOST=D:\wjp\boost_%B_BV%_0 + +cd /D "%B_BOOST%\lib64-msvc-14.0" + +mkdir "%R%\lib\x64" +mkdir "%R%\bin\x64\Release_CUDA" + +copy boost_unit_test_framework-vc140-mt-%B_BV%.lib %R%\lib\x64 +copy libboost_chrono-vc140-mt-%B_BV%.lib %R%\lib\x64 +copy libboost_date_time-vc140-mt-%B_BV%.lib %R%\lib\x64 +copy libboost_system-vc140-mt-%B_BV%.lib %R%\lib\x64 +copy libboost_thread-vc140-mt-%B_BV%.lib %R%\lib\x64 + +cd %B_BOOST% + +xcopy /i /e /q boost "%R%\lib\include\boost" + +cd /D %R% + +cd python + +set VS90COMNTOOLS=%VS140COMNTOOLS% +set CL=/DASTRA_CUDA /DASTRA_PYTHON "/I%R%\include" "/I%R%\lib\include" "/I%CUDA_PATH%\include" +copy "%CONDA_PREFIX%\Library\lib\AstraCuda64.lib" astra.lib +python builder.py build_ext --compiler=msvc install diff --git a/python/conda/astra-toolbox/build.sh b/python/conda/astra-toolbox/build.sh new file mode 100644 index 0000000..951fd88 --- /dev/null +++ b/python/conda/astra-toolbox/build.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +cd $SRC_DIR/python/ +CPPFLAGS="-DASTRA_CUDA -DASTRA_PYTHON $CPPFLAGS -I$SRC_DIR/ -I$SRC_DIR/include -I$CUDA_ROOT/include" CC=$CC python ./builder.py build install diff --git a/python/conda/meta.yaml b/python/conda/astra-toolbox/meta.yaml index e6a7f52..942397e 100644 --- a/python/conda/meta.yaml +++ b/python/conda/astra-toolbox/meta.yaml @@ -1,35 +1,41 @@ package: name: astra-toolbox - version: '1.8b' + version: '1.8' source: git_url: https://github.com/astra-toolbox/astra-toolbox.git - #git_tag: v1.7.1 # Change to 1.8 after release + git_tag: v1.8 build: number: 0 script_env: - - CUDA_ROOT - - MAKEOPTS + - CC # [not win] + - CUDA_ROOT # [not win] test: imports: - astra + requires: + # To avoid large downloads just for testing after build phase + - nomkl # [not win] + requirements: build: - python - cython >=0.13 + - nomkl # [not win] - numpy - scipy - six + - libastra ==1.8 run: - python - - numpy + - numpy x.x - scipy - six - - libastra ==1.8b + - libastra ==1.8 about: diff --git a/python/conda/build.sh b/python/conda/build.sh deleted file mode 100644 index 13ae3f8..0000000 --- a/python/conda/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -cd build/linux -./autogen.sh -./configure --with-python --with-cuda=$CUDA_ROOT --prefix=$PREFIX -if [ $MAKEOPTS == '<UNDEFINED>' ] - then - MAKEOPTS="" -fi -make $MAKEOPTS python-root-install
\ No newline at end of file diff --git a/python/conda/libastra/bld.bat b/python/conda/libastra/bld.bat new file mode 100644 index 0000000..29b894a --- /dev/null +++ b/python/conda/libastra/bld.bat @@ -0,0 +1,33 @@ +@echo off + +set R=%SRC_DIR% + +set B_VC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64 +call "%B_VC%\vcvars64.bat" + +set B_BV=1_62 +set B_BOOST=D:\wjp\boost_%B_BV%_0 + +cd /D "%B_BOOST%\lib64-msvc-14.0" + +mkdir "%R%\lib\x64" +mkdir "%R%\bin\x64\Release_CUDA" + +copy boost_unit_test_framework-vc140-mt-%B_BV%.lib %R%\lib\x64 +copy libboost_chrono-vc140-mt-%B_BV%.lib %R%\lib\x64 +copy libboost_date_time-vc140-mt-%B_BV%.lib %R%\lib\x64 +copy libboost_system-vc140-mt-%B_BV%.lib %R%\lib\x64 +copy libboost_thread-vc140-mt-%B_BV%.lib %R%\lib\x64 + +cd %B_BOOST% + +xcopy /i /e /q boost "%R%\lib\include\boost" + +cd /D %R% + +msbuild astra_vc14.sln /p:Configuration=Release_CUDA /p:Platform=x64 /t:astra_vc14 + +copy bin\x64\Release_CUDA\AstraCuda64.dll "%CONDA_PREFIX%\Library\bin" +copy bin\x64\Release_CUDA\AstraCuda64.lib "%CONDA_PREFIX%\Library\lib" +copy "%CUDA_PATH%\bin\cudart64_80.dll" "%CONDA_PREFIX%\Library\bin" +copy "%CUDA_PATH%\bin\cufft64_80.dll" "%CONDA_PREFIX%\Library\bin" diff --git a/python/conda/libastra/build.sh b/python/conda/libastra/build.sh index e1d9700..304c053 100644 --- a/python/conda/libastra/build.sh +++ b/python/conda/libastra/build.sh @@ -1,15 +1,29 @@ -cd build/linux -./autogen.sh -./configure --with-cuda=$CUDA_ROOT --prefix=$PREFIX -if [ $MAKEOPTS == '<UNDEFINED>' ] - then - MAKEOPTS="" -fi -make $MAKEOPTS install-libraries -LIBPATH=lib -if [ $ARCH == 64 ] - then - LIBPATH+=64 -fi -cp -P $CUDA_ROOT/$LIBPATH/libcudart.so.* $PREFIX/lib -cp -P $CUDA_ROOT/$LIBPATH/libcufft.so.* $PREFIX/lib +#!/bin/sh + +cd $SRC_DIR/build/linux + +$SRC_DIR/build/linux/autogen.sh + +# Add C++11 to compiler flags if nvcc supports it, mostly to work around a boost bug +NVCC=$CUDA_ROOT/bin/nvcc +echo "int main(){return 0;}" > $CONDA_PREFIX/test.cu +$NVCC $CONDA_PREFIX/test.cu -ccbin $CC --std=c++11 -o $CONDA_PREFIX/test.out > /dev/null 2>&1 && EXTRA_NVCCFLAGS="--std=c++11" || true +rm -f $CONDA_PREFIX/test.out + +$SRC_DIR/build/linux/configure --with-install-type=prefix --with-cuda=$CUDA_ROOT --prefix=$CONDA_PREFIX NVCCFLAGS="-ccbin $CC -I$CONDA_PREFIX/include $EXTRA_NVCCFLAGS" CC=$CC CXX=$CXX CPPFLAGS="-I$CONDA_PREFIX/include" + +make install-libraries + + +test -d $CUDA_ROOT/lib64 && LIBPATH="$CUDA_ROOT/lib64" || LIBPATH="$CUDA_ROOT/lib" + +case `uname` in + Darwin*) + cp -P $LIBPATH/libcudart.*.dylib $CONDA_PREFIX/lib + cp -P $LIBPATH/libcufft.*.dylib $CONDA_PREFIX/lib + ;; + *) + cp -P $LIBPATH/libcudart.so.* $CONDA_PREFIX/lib + cp -P $LIBPATH/libcufft.so.* $CONDA_PREFIX/lib + ;; +esac diff --git a/python/conda/libastra/meta.yaml b/python/conda/libastra/meta.yaml index 73fa0d7..68cf47a 100644 --- a/python/conda/libastra/meta.yaml +++ b/python/conda/libastra/meta.yaml @@ -1,16 +1,28 @@ package: name: libastra - version: '1.8b' + version: '1.8' source: git_url: https://github.com/astra-toolbox/astra-toolbox.git - #git_tag: v1.7.1 # Change to 1.8 after release + git_tag: v1.8 build: number: 0 script_env: - - CUDA_ROOT - - MAKEOPTS + - CC # [not win] + - CXX # [not win] + - CUDA_ROOT # [not win] + +requirements: + build: + - vs2015_runtime # [win] + - boost # [osx] + - automake # [osx] + - autoconf # [osx] + - libtool # [osx] + + run: + - vs2015_runtime # [win] about: home: http://www.astra-toolbox.com diff --git a/python/conda/linux_release/README.txt b/python/conda/linux_release/README.txt new file mode 100644 index 0000000..12cfcbb --- /dev/null +++ b/python/conda/linux_release/README.txt @@ -0,0 +1,2 @@ +This directory contains a Docker container based environment for building linux release packages for conda. + diff --git a/python/conda/linux_release/buildenv/Dockerfile b/python/conda/linux_release/buildenv/Dockerfile new file mode 100644 index 0000000..c73e4b9 --- /dev/null +++ b/python/conda/linux_release/buildenv/Dockerfile @@ -0,0 +1,15 @@ +FROM debian:7 +ENV PATH /root/miniconda3/bin:$PATH +ENV DEBIAN_FRONTEND noninteractive +# http://developer.download.nvidia.com/compute/cuda/5_5/rel/installers/cuda_5.5.22_linux_64.run +ADD cuda_5.5.22_linux_64.run /root/ +# https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh +ADD Miniconda3-4.2.12-Linux-x86_64.sh /root/ +RUN apt-get update +RUN apt-get install -y perl-modules build-essential autoconf libtool automake libboost-dev git +RUN /bin/bash /root/Miniconda3-4.2.12-Linux-x86_64.sh -b +RUN /bin/bash /root/cuda_5.5.22_linux_64.run -toolkit -silent +RUN conda install -y conda-build +ENV CUDA_ROOT /usr/local/cuda +ENV CC gcc +ENV CXX g++ diff --git a/python/conda/linux_release/builder/Dockerfile b/python/conda/linux_release/builder/Dockerfile new file mode 100644 index 0000000..2404609 --- /dev/null +++ b/python/conda/linux_release/builder/Dockerfile @@ -0,0 +1,17 @@ +FROM astra-build-env +ARG BUILD_NUMBER= +WORKDIR /root +RUN git clone --depth 1 https://github.com/astra-toolbox/astra-toolbox +RUN [ -z $BUILD_NUMBER ] || perl -pi -e "s/^(\s*number:\s*)[0-9]+$/\${1}$BUILD_NUMBER/" astra-toolbox/python/conda/libastra/meta.yaml astra-toolbox/python/conda/astra-toolbox/meta.yaml +RUN conda-build --python=3.5 astra-toolbox/python/conda/libastra +RUN conda-build --python 2.7 --numpy 1.8 astra-toolbox/python/conda/astra-toolbox +RUN conda-build --python 2.7 --numpy 1.9 astra-toolbox/python/conda/astra-toolbox +RUN conda-build --python 2.7 --numpy 1.10 astra-toolbox/python/conda/astra-toolbox +RUN conda-build --python 2.7 --numpy 1.11 astra-toolbox/python/conda/astra-toolbox +RUN conda-build --python 2.7 --numpy 1.12 astra-toolbox/python/conda/astra-toolbox +RUN conda-build --python 3.5 --numpy 1.9 astra-toolbox/python/conda/astra-toolbox +RUN conda-build --python 3.5 --numpy 1.10 astra-toolbox/python/conda/astra-toolbox +RUN conda-build --python 3.5 --numpy 1.11 astra-toolbox/python/conda/astra-toolbox +RUN conda-build --python 3.5 --numpy 1.12 astra-toolbox/python/conda/astra-toolbox +RUN conda-build --python 3.6 --numpy 1.11 astra-toolbox/python/conda/astra-toolbox +RUN conda-build --python 3.6 --numpy 1.12 astra-toolbox/python/conda/astra-toolbox diff --git a/python/conda/linux_release/release.sh b/python/conda/linux_release/release.sh new file mode 100644 index 0000000..cf62bd5 --- /dev/null +++ b/python/conda/linux_release/release.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +D=`mktemp -d` + +[ -f buildenv/cuda_5.5.22_linux_64.run ] || (cd buildenv; wget http://developer.download.nvidia.com/compute/cuda/5_5/rel/installers/cuda_5.5.22_linux_64.run ) +[ -f buildenv/Miniconda3-4.2.12-Linux-x86_64.sh ] || (cd buildenv; wget https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh ) + +docker build -t astra-build-env buildenv +#docker build --no-cache --build-arg=BUILD_NUMBER=0 -t astra-builder builder +docker build --no-cache -t astra-builder builder + +docker run --name astra-build-cnt -v $D:/out:z astra-builder /bin/bash -c "cp /root/miniconda3/conda-bld/linux-64/*astra* /out" + +mkdir -p pkgs +mv $D/* pkgs +rmdir $D + +docker rm astra-build-cnt +docker rmi astra-builder + |