diff --git a/CHANGELOG.md b/CHANGELOG.md index cea185a385125526bbfad7c025595b17d1d11f9d..f8c67a30f2fffc6fa733ca5550d28ee7d3ddf9a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 20.03 (unreleased) ++## 20.03 (unreleased) FEATURES * introduced substreams for producer/consumer [[JIRA_102](https://agira.desy.de/browse/HIDRA2-102)] @@ -6,6 +6,7 @@ IMPROVEMENTS * switch to MongoDB 4.2 * receiver use ASAP3 directory structure to save files to * API documentation is available at [asapo-docs.desy.de](asapo-docs.desy.de) +* switch to using cmake 3.7+ BUG FIXES * consumer operation timout - take duration of the operation into account \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index adfc8069e53176f3c4a6f3a253081a6e12dd0aa7..6a19e04e8c3ba1fce6cbb406a14999b59b15d5f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.7) project(ASAPO) set(CMAKE_CXX_STANDARD 11) IF(WIN32) diff --git a/consumer/api/python/CMakeLists_Linux.cmake b/consumer/api/python/CMakeLists_Linux.cmake index d9a50307b1f64a2b953a603dcf0b212cdfb133be..f29e2096677ddab9cc77b62bdfa6ade15db06c47 100644 --- a/consumer/api/python/CMakeLists_Linux.cmake +++ b/consumer/api/python/CMakeLists_Linux.cmake @@ -9,7 +9,8 @@ else() set (EXTRA_LINK_ARGS "[]") ENDIF() -get_property(ASAPO_CONSUMER_LIB TARGET asapo-consumer PROPERTY LOCATION) +configure_files(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} @ONLY) +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py INPUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py) set (ASAPO_CONSUMER_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../cpp/include) diff --git a/consumer/api/python/setup.py.in b/consumer/api/python/setup.py.in index b70319b080b519e0a2dd2a4eafc78764ca3be067..0de6e24cd6f79c81acc3a76cfce082e534f522db 100644 --- a/consumer/api/python/setup.py.in +++ b/consumer/api/python/setup.py.in @@ -6,7 +6,7 @@ from Cython.Build import cythonize import numpy module = Extension("asapo_consumer", ["asapo_consumer.pyx"], - extra_objects=['@ASAPO_CONSUMER_LIB@', + extra_objects=['$<TARGET_FILE:asapo-consumer>', '@CURL_LIBRARIES@'], include_dirs=["@ASAPO_CXX_COMMON_INCLUDE_DIR@","@ASAPO_CONSUMER_INCLUDE_DIR@",numpy.get_include()], extra_compile_args=@EXTRA_COMPILE_ARGS@, diff --git a/deploy/build_env/Ubuntu16.04/Dockerfile b/deploy/build_env/Ubuntu16.04/Dockerfile index 45fe5432d1ac7b1a3ad4a0df0dee6a2010ccbd92..bdbb2bd1e96b197c5388407a73450c6860b2236b 100644 --- a/deploy/build_env/Ubuntu16.04/Dockerfile +++ b/deploy/build_env/Ubuntu16.04/Dockerfile @@ -11,5 +11,9 @@ RUN ./install_curl.sh /curl RUN apt install -y python-pip python3-pip && pip install --upgrade cython && pip3 install --upgrade cython RUN pip3 install sphinx +ADD install_cmake.sh install_cmake.sh +RUN ./install_cmake.sh + + ADD build.sh /bin/build.sh diff --git a/deploy/build_env/Ubuntu16.04/build.sh b/deploy/build_env/Ubuntu16.04/build.sh index cd34659e4cb618d0efe93305f5b399c12ad039e2..4daa3974e7e7b74bddf00b38fdac56b936ff5a75 100755 --- a/deploy/build_env/Ubuntu16.04/build.sh +++ b/deploy/build_env/Ubuntu16.04/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + cd /asapo/build cmake \ -DCMAKE_BUILD_TYPE="Release" \ diff --git a/deploy/build_env/Ubuntu16.04/install_cmake.sh b/deploy/build_env/Ubuntu16.04/install_cmake.sh new file mode 100755 index 0000000000000000000000000000000000000000..55245ffb3a58f94111e147c138a79a488279c6ca --- /dev/null +++ b/deploy/build_env/Ubuntu16.04/install_cmake.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +wget https://cmake.org/files/v3.10/cmake-3.10.0.tar.gz + +tar zxvf cmake-3.* +cd cmake-3.* +./bootstrap --prefix=/usr/local +make -j$(nproc) +make install + +cmake --version + +/usr/local/bin/cmake --version diff --git a/deploy/build_env/manylinux2010/Dockerfile b/deploy/build_env/manylinux2010/Dockerfile index a94863c1dab73c515fe26362bc6877f5214d5347..f9ea1e6244926873f98c0f7ea3e77ed3d47d8af6 100644 --- a/deploy/build_env/manylinux2010/Dockerfile +++ b/deploy/build_env/manylinux2010/Dockerfile @@ -11,4 +11,6 @@ ADD build.sh /bin/build.sh RUN chmod og+rwX -R /opt +ADD install_cmake.sh install_cmake.sh +RUN ./install_cmake.sh diff --git a/deploy/build_env/manylinux2010/build.sh b/deploy/build_env/manylinux2010/build.sh index 8377035aa3a68c6f9bc1e560a5c7f902c2df39fd..afc0ab8d0a5e6116bf06991def4a92e1c1108c39 100755 --- a/deploy/build_env/manylinux2010/build.sh +++ b/deploy/build_env/manylinux2010/build.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash - +set -e for python_path in /opt/python/cp{27,35,36,37}*m; do python=$python_path/bin/python diff --git a/deploy/build_env/manylinux2010/build_image.sh b/deploy/build_env/manylinux2010/build_image.sh index 46679a5bc6a1f4bf81d8424907d2680aab74320a..0228fb276e807f4ce8fdcf35fcfd65d14e2e4463 100755 --- a/deploy/build_env/manylinux2010/build_image.sh +++ b/deploy/build_env/manylinux2010/build_image.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash docker build -t yakser/asapo-env:manylinux2010 . -#docker push yakser/asapo-env:manylinux2010 +docker push yakser/asapo-env:manylinux2010 diff --git a/deploy/build_env/manylinux2010/install_cmake.sh b/deploy/build_env/manylinux2010/install_cmake.sh new file mode 100755 index 0000000000000000000000000000000000000000..55245ffb3a58f94111e147c138a79a488279c6ca --- /dev/null +++ b/deploy/build_env/manylinux2010/install_cmake.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +wget https://cmake.org/files/v3.10/cmake-3.10.0.tar.gz + +tar zxvf cmake-3.* +cd cmake-3.* +./bootstrap --prefix=/usr/local +make -j$(nproc) +make install + +cmake --version + +/usr/local/bin/cmake --version diff --git a/producer/api/python/CMakeLists_Linux.cmake b/producer/api/python/CMakeLists_Linux.cmake index 2f42024abf3591eccfdbd38dad4245b56ad697ff..0a8ca96ac36608c9b266e1ee5903dfe0d75059d1 100644 --- a/producer/api/python/CMakeLists_Linux.cmake +++ b/producer/api/python/CMakeLists_Linux.cmake @@ -9,11 +9,11 @@ else() set (EXTRA_LINK_ARGS "[]") ENDIF() -get_property(ASAPO_PRODUCER_LIB TARGET asapo-producer PROPERTY LOCATION) - set (ASAPO_PRODUCER_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../cpp/include) configure_files(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} @ONLY) +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py INPUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py) + ADD_CUSTOM_TARGET(python-lib-producer ALL COMMAND ${Python_EXECUTABLE} setup.py build_ext --inplace --force) diff --git a/producer/api/python/setup.py.in b/producer/api/python/setup.py.in index 180039026505919394e2739dbb3e070a4e4c97c1..85c5330bdffca059b4b3ee0be1ce0b4e2612bf40 100644 --- a/producer/api/python/setup.py.in +++ b/producer/api/python/setup.py.in @@ -6,7 +6,7 @@ from Cython.Build import cythonize import numpy module = Extension("asapo_producer", ["asapo_producer.pyx"], - extra_objects=['@ASAPO_PRODUCER_LIB@', + extra_objects=[$<TARGET_FILE:asapo-producer>, '@CURL_LIBRARIES@'], include_dirs=["@ASAPO_CXX_COMMON_INCLUDE_DIR@","@ASAPO_PRODUCER_INCLUDE_DIR@",numpy.get_include()], extra_compile_args=@EXTRA_COMPILE_ARGS@,