From 3d3a0958fad475c6b0493ad85459e1c04ba4ba62 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Fri, 6 Dec 2019 17:37:35 +0000 Subject: C lib (#458) C library implemented with optimised axpy fucntions and gradient operator in c --- recipe/bld.bat | 15 ++++++++++++++ recipe/build.sh | 24 ++++++++++++++++++++++ recipe/conda_build_config.yaml | 10 ++++++++++ recipe/meta.yaml | 45 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 recipe/bld.bat create mode 100644 recipe/build.sh create mode 100644 recipe/conda_build_config.yaml create mode 100644 recipe/meta.yaml (limited to 'recipe') diff --git a/recipe/bld.bat b/recipe/bld.bat new file mode 100644 index 0000000..af5ca40 --- /dev/null +++ b/recipe/bld.bat @@ -0,0 +1,15 @@ + +IF NOT DEFINED CIL_VERSION ( +ECHO CIL_VERSION Not Defined. +exit 1 +) + +ROBOCOPY /E "%RECIPE_DIR%\.." "%SRC_DIR%" /XD .git /XD Wrappers\Python\build + +mkdir "%SRC_DIR%\build_framework" + +cd "%SRC_DIR%\build_framework" +cmake -G "NMake Makefiles" %RECIPE_DIR%\..\ -DCONDA_BUILD=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB=%CONDA_PREFIX%\lib -DLIBRARY_INC=%CONDA_PREFIX% -DCMAKE_INSTALL_PREFIX=%PREFIX% + +nmake install +if errorlevel 1 exit 1 diff --git a/recipe/build.sh b/recipe/build.sh new file mode 100644 index 0000000..22cfae8 --- /dev/null +++ b/recipe/build.sh @@ -0,0 +1,24 @@ +if [ -z "$CIL_VERSION" ]; then + echo "Need to set CIL_VERSION" + exit 1 +fi +# mkdir ${SRC_DIR}/ccpi +mkdir -p ${SRC_DIR}/ccpi/Wrappers/Python +cp -r "${RECIPE_DIR}/../Wrappers/Python/test" ${SRC_DIR}/ccpi/Wrappers/Python + +# cd ${SRC_DIR}/ccpi/Wrappers/Python +# $PYTHON setup.py install + + +mkdir ${SRC_DIR}/build_framework +#cp -r "${RECIPE_DIR}/../" ${SRC_DIR}/build_framework + +cd ${SRC_DIR}/build_framework +cmake ${RECIPE_DIR}/../ -DCONDA_BUILD=ON \ + -DCMAKE_BUILD_TYPE="Release"\ + -DLIBRARY_LIB=$CONDA_PREFIX/lib \ + -DLIBRARY_INC=$CONDA_PREFIX \ + -DCMAKE_INSTALL_PREFIX=$PREFIX + +make install +# $PYTHON setup.py install diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml new file mode 100644 index 0000000..e5e168b --- /dev/null +++ b/recipe/conda_build_config.yaml @@ -0,0 +1,10 @@ +python: + - 2.7 # [not win] + - 3.5 + - 3.6 +numpy: + # TODO investigage, as it doesn't currently build with cvxp, requires >1.14 + - 1.11 + - 1.12 + - 1.14 + - 1.15 diff --git a/recipe/meta.yaml b/recipe/meta.yaml new file mode 100644 index 0000000..fee8e87 --- /dev/null +++ b/recipe/meta.yaml @@ -0,0 +1,45 @@ +package: + name: ccpi-framework + version: {{ environ['CIL_VERSION'] }} + +build: + preserve_egg_dir: False + script_env: + - CIL_VERSION + #number: 0 + +test: + requires: + - python-wget + - cvxpy # [ unix and py36 and np115 ] + + source_files: + - ./Wrappers/Python/test # [win] + - ./ccpi/Wrappers/Python/test # [not win] + + commands: + - python -c "import os; print ('TESTING IN THIS DIRECTORY' , os.getcwd())" + - python -m unittest discover Wrappers/Python/test # [win] + - python -m unittest discover -s ccpi/Wrappers/Python/test # [not win] + +requirements: + build: + - {{ pin_compatible('numpy', max_pin='x.x') }} + - python + - setuptools + - cmake + + run: + - {{ pin_compatible('numpy', max_pin='x.x') }} + - python + - numpy + - scipy + - matplotlib + - h5py + - pillow + - libgcc-ng # [not win] + +about: + home: http://www.ccpi.ac.uk + license: Apache 2.0 License + summary: 'CCPi Framework' -- cgit v1.2.3