From 4e949951428b5ae1363991077da725a072c59e5d Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Fri, 15 Mar 2019 14:23:51 +0100 Subject: [PATCH] conda build --- {recipe => conda-recepie}/build.sh | 0 {recipe => conda-recepie}/copy_gui.sh | 0 {recipe => conda-recepie}/copy_lib.sh | 0 {recipe => conda-recepie}/meta.yaml | 9 +++++ python/CMakeLists.txt | 36 +++++++++++++++++++ .../{conda-recipe => conda-recepie}/bld.bat | 0 .../{conda-recipe => conda-recepie}/build.sh | 0 .../conda_build_config.yaml | 0 .../conda_env.txt | 0 .../{conda-recipe => conda-recepie}/meta.yaml | 10 +++--- python/setup.py | 26 +------------- 11 files changed, 51 insertions(+), 30 deletions(-) rename {recipe => conda-recepie}/build.sh (100%) rename {recipe => conda-recepie}/copy_gui.sh (100%) rename {recipe => conda-recepie}/copy_lib.sh (100%) rename {recipe => conda-recepie}/meta.yaml (91%) create mode 100644 python/CMakeLists.txt rename python/{conda-recipe => conda-recepie}/bld.bat (100%) rename python/{conda-recipe => conda-recepie}/build.sh (100%) rename python/{conda-recipe => conda-recepie}/conda_build_config.yaml (100%) rename python/{conda-recipe => conda-recepie}/conda_env.txt (100%) rename python/{conda-recipe => conda-recepie}/meta.yaml (78%) diff --git a/recipe/build.sh b/conda-recepie/build.sh similarity index 100% rename from recipe/build.sh rename to conda-recepie/build.sh diff --git a/recipe/copy_gui.sh b/conda-recepie/copy_gui.sh similarity index 100% rename from recipe/copy_gui.sh rename to conda-recepie/copy_gui.sh diff --git a/recipe/copy_lib.sh b/conda-recepie/copy_lib.sh similarity index 100% rename from recipe/copy_lib.sh rename to conda-recepie/copy_lib.sh diff --git a/recipe/meta.yaml b/conda-recepie/meta.yaml similarity index 91% rename from recipe/meta.yaml rename to conda-recepie/meta.yaml index 5b117e216..87c8015dc 100644 --- a/recipe/meta.yaml +++ b/conda-recepie/meta.yaml @@ -58,6 +58,15 @@ outputs: build: - {{ compiler('c') }} - {{compiler('cxx')}} + + # - name: sls_detector + # version: "refactor" + # script: copy_lib.sh + # requirements: + # build: + # - {{ compiler('c') }} + # - {{compiler('cxx')}} + # - name: sls_detector_gui # version: "refactor" # script: copy_gui.sh diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt new file mode 100644 index 000000000..9f9a3b7ee --- /dev/null +++ b/python/CMakeLists.txt @@ -0,0 +1,36 @@ +add_subdirectory(pybind11) +pybind11_add_module(_sls_detector src/main.cpp) + +target_link_libraries(_sls_detector PUBLIC + slsDetectorShared + slsReceiverShared + slsSupportLib ) + +set_target_properties(_sls_detector PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + ) + +#Copy Python code +set( PYTHON_FILES + __init__.py + adcs.py + dacs.py + decorators.py + detector_property.py + detector.py + eiger.py + errors.py + jungfrau_ctb.py + jungfrau.py + registers.py + utils.py + +) + +foreach(FILE ${PYTHON_FILES}) + configure_file( sls_detector/${FILE} + ${CMAKE_BINARY_DIR}/bin/sls_detector/${FILE} ) + +endforeach(FILE ${PYTHON_FILES}) + + diff --git a/python/conda-recipe/bld.bat b/python/conda-recepie/bld.bat similarity index 100% rename from python/conda-recipe/bld.bat rename to python/conda-recepie/bld.bat diff --git a/python/conda-recipe/build.sh b/python/conda-recepie/build.sh similarity index 100% rename from python/conda-recipe/build.sh rename to python/conda-recepie/build.sh diff --git a/python/conda-recipe/conda_build_config.yaml b/python/conda-recepie/conda_build_config.yaml similarity index 100% rename from python/conda-recipe/conda_build_config.yaml rename to python/conda-recepie/conda_build_config.yaml diff --git a/python/conda-recipe/conda_env.txt b/python/conda-recepie/conda_env.txt similarity index 100% rename from python/conda-recipe/conda_env.txt rename to python/conda-recepie/conda_env.txt diff --git a/python/conda-recipe/meta.yaml b/python/conda-recepie/meta.yaml similarity index 78% rename from python/conda-recipe/meta.yaml rename to python/conda-recepie/meta.yaml index b8a1020a8..f6d7ef6a1 100644 --- a/python/conda-recipe/meta.yaml +++ b/python/conda-recepie/meta.yaml @@ -1,6 +1,6 @@ package: name: sls_detector - version: 4.0.1 + version: refactor build: number: 0 @@ -16,18 +16,18 @@ requirements: - python {{ python }} - libpng >=1.6.32,<1.6.35 - setuptools - - sls_detector_lib 4.0.1 + - sls_detector_lib refactor - pyzmq - - pybind11 + - pybind11 2.2 host: - python - - pybind11 + - pybind11 2.2 run: - python - numpy - - sls_detector_lib 4.0.1 + - sls_detector_lib refactor - pyzmq - libstdcxx-ng - libgcc-ng diff --git a/python/setup.py b/python/setup.py index b306185e3..0ccbf9f04 100644 --- a/python/setup.py +++ b/python/setup.py @@ -8,7 +8,7 @@ import sys import setuptools import os -__version__ = '4.0.0' +__version__ = 'refactor' def get_conda_path(): @@ -33,30 +33,6 @@ class get_pybind_include(object): return pybind11.get_include(self.user) -# ext_modules = [ -# Extension( -# '_sls_detector', -# ['src/main.cpp'], -# include_dirs=[ -# # Path to pybind11 headers -# get_pybind_include(), -# get_pybind_include(user=True), -# os.path.join(get_sls_path(), 'slsDetectorSoftware/multiSlsDetector'), -# os.path.join(get_sls_path(), 'slsReceiverSoftware/include/'), -# os.path.join(get_sls_path(),'slsDetectorSoftware/commonFiles/'), -# os.path.join(get_sls_path(), 'slsDetectorSoftware/slsDetector'), -# os.path.join(get_sls_path(), 'slsDetectorSoftware/slsDetectorAnalysis'), -# os.path.join(get_sls_path(), 'slsDetectorSoftware/slsReceiverInterface/'), -# -# ], -# libraries = ['SlsDetector', 'zmq'], -# library_dirs = [os.path.join(get_sls_path(),'build/bin'), -# os.path.join(get_sls_path(),'slsReceiverSoftware/include')], -# -# language='c++' -# ), -# ] - ext_modules = [ Extension( '_sls_detector',