summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2017-10-23 10:50:41 +0100
committerEdoardo Pasca <edo.paskino@gmail.com>2017-10-23 10:50:41 +0100
commite3dee52c17c9da457cc4c4e98b7dbb8ce1a644f6 (patch)
tree1971413d892c01d5acfcbf0748ab266027df89b4 /src
parentd5d7d09132f159156fd0ebf586c07e68a10a6bed (diff)
downloadregularization-e3dee52c17c9da457cc4c4e98b7dbb8ce1a644f6.tar.gz
regularization-e3dee52c17c9da457cc4c4e98b7dbb8ce1a644f6.tar.bz2
regularization-e3dee52c17c9da457cc4c4e98b7dbb8ce1a644f6.tar.xz
regularization-e3dee52c17c9da457cc4c4e98b7dbb8ce1a644f6.zip
Add needed environment variables
Adds the environment variables that are needed to compile via conda.
Diffstat (limited to 'src')
-rw-r--r--src/Python/CMakeLists.txt24
-rw-r--r--src/Python/compile.bat.in5
-rw-r--r--src/Python/compile.sh.in7
3 files changed, 30 insertions, 6 deletions
diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt
index 3eb4158..b84f5a3 100644
--- a/src/Python/CMakeLists.txt
+++ b/src/Python/CMakeLists.txt
@@ -14,17 +14,25 @@
message("CIL VERSION " ${CIL_VERSION})
-# variables that are set by conda
+
+# variables that must be set for conda compilation
#PREFIX=C:\Apps\Miniconda2\envs\cil\Library
#LIBRARY_INC=C:\\Apps\\Miniconda2\\envs\\cil\\Library\\include
-
set (NUMPY_VERSION 1.12)
#set (PYTHON_VERSION 3.5)
#https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/R9gWjl09UFs
set (CONDA_ENVIRONMENT "cil")
-set (CONDA_ENVIRONMENT_PATH "C:\\Apps\\Miniconda2\\envs\\${CONDA_ENVIRONMENT}" CACHE PATH "env dir")
+if (WIN32)
+ set (CONDA_ENVIRONMENT_PATH "C:\\Apps\\Miniconda2\\envs\\${CONDA_ENVIRONMENT}" CACHE PATH "Main environment directory")
+ set (CONDA_ENVIRONMENT_PREFIX "${CONDA_ENVIRONMENT_PATH}\\Library" CACHE PATH "env dir")
+ set (CONDA_ENVIRONMENT_LIBRARY_INC "${CONDA_ENVIRONMENT_PREFIX}\\include" CACHE PATH "env dir")
+elseif (UNIX)
+ set (CONDA_ENVIRONMENT_PATH "/apps/anaconda/2.4/envs/${CONDA_ENVIRONMENT}" CACHE PATH "Main environment directory")
+ set (CONDA_ENVIRONMENT_PREFIX "${CONDA_ENVIRONMENT_PATH}" CACHE PATH "env dir")
+ set (CONDA_ENVIRONMENT_LIBRARY_INC "${CONDA_ENVIRONMENT_PREFIX}/include" CACHE PATH "env dir")
+endif()
message("CIL VERSION " ${CIL_VERSION})
@@ -56,4 +64,14 @@ elseif(UNIX)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/compile.sh.in ${CMAKE_CURRENT_BINARY_DIR}/compile.sh)
endif()
+### add tests
+#add_executable(RegularizersTest )
+find_package(tiff)
+if (TIFF_FOUND)
+ message("LibTIFF Found")
+ message("TIFF_INCLUDE_DIR "${TIFF_INCLUDE_DIR})
+ message("TIFF_LIBRARIES"${TIFF_LIBRARIES})
+else()
+ message("LibTIFF not found")
+endif() \ No newline at end of file
diff --git a/src/Python/compile.bat.in b/src/Python/compile.bat.in
index ab23404..e5342ed 100644
--- a/src/Python/compile.bat.in
+++ b/src/Python/compile.bat.in
@@ -1,4 +1,7 @@
set CIL_VERSION=@CIL_VERSION@
-activate @CONDA_ENVIRONMENT@
+set PREFIX=@CONDA_ENVIRONMENT_PREFIX@
+set LIBRARY_INC=@CONDA_ENVIRONMENT_LIBRARY_INC@
+
+REM activate @CONDA_ENVIRONMENT@
conda build conda-recipe --python=@PYTHON_VERSION_MAJOR@.@PYTHON_VERSION_MINOR@ --numpy=@NUMPY_VERSION@ -c ccpi -c conda-forge \ No newline at end of file
diff --git a/src/Python/compile.sh.in b/src/Python/compile.sh.in
index dd29973..ca9f310 100644
--- a/src/Python/compile.sh.in
+++ b/src/Python/compile.sh.in
@@ -1,6 +1,9 @@
#!/bin/sh
+# compile within the right conda environment
+#module load python/anaconda
+#source activate @CONDA_ENVIRONMENT@
export CIL_VERSION=@CIL_VERSION@
-module load python/anaconda
-source activate @CONDA_ENVIRONMENT@
+export LIBRARY_INC=@CONDA_ENVIRONMENT_LIBRARY_INC@
+
conda build conda-recipe --python=@PYTHON_VERSION_MAJOR@.@PYTHON_VERSION_MINOR@ --numpy=@NUMPY_VERSION@ -c ccpi \ No newline at end of file