diff --git a/azure-pipelines.yml b/azure-pipelines.yml index af2907dc9..7bc38e685 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,19 +13,17 @@ jobs: PYTHON_VERSION: 3.9 steps: - script: bash ci/build_unix.sh - # We could not get the OSX CIs to pass easily. - # https://github.com/ukoethe/vigra/issues/535 - # - job: OSX - # pool: - # vmImage: macOS-latest - # strategy: - # matrix: - # py37: - # PYTHON_VERSION: 3.7 - # steps: - # - script: | - # sudo xcode-select -s /Applications/Xcode_13.2.1.app - # bash ci/build_unix.sh + - job: OSX + pool: + vmImage: macOS-latest + strategy: + matrix: + py37: + PYTHON_VERSION: 3.7 + steps: + - script: | + sudo xcode-select -s /Applications/Xcode_13.2.1.app + bash ci/build_unix.sh - job: Windows pool: vmImage: windows-2019 diff --git a/ci/build_unix.sh b/ci/build_unix.sh index 7c46618d8..f1ab30173 100644 --- a/ci/build_unix.sh +++ b/ci/build_unix.sh @@ -11,7 +11,15 @@ conda create \ python=${PYTHON_VERSION} c-compiler cxx-compiler \ zlib jpeg libpng libtiff hdf5 fftw \ boost boost-cpp numpy h5py nose sphinx \ - openexr lemon + openexr lemon cmake make + +if [[ `uname` == 'Darwin' ]]; +then + export SHLIB_EXT=".dylib" + export LDFLAGS="-undefined dynamic_lookup ${LDFLAGS}" +else + export SHLIB_EXT=".so" +fi source $CONDA/bin/activate vigra @@ -27,7 +35,15 @@ cmake .. \ -DTEST_VIGRANUMPY=ON \ -DWITH_OPENEXR=ON \ -DWITH_LEMON=ON \ - -DAUTOEXEC_TESTS=OFF + -DAUTOEXEC_TESTS=OFF \ + -DCMAKE_FIND_FRAMEWORK=LAST \ + -DCMAKE_FIND_APPBUNDLE=LAST \ + -DZLIB_INCLUDE_DIR=${CONDA_PREFIX}/include \ + -DZLIB_LIBRARY=${CONDA_PREFIX}/lib/libz${SHLIB_EXT} \ +\ + -DPNG_LIBRARY=${CONDA_PREFIX}/lib/libpng${SHLIB_EXT} \ + -DPNG_PNG_INCLUDE_DIR=${CONDA_PREFIX}/include + make -j2 make check -j2 diff --git a/config/FindVIGRANUMPY_DEPENDENCIES.cmake b/config/FindVIGRANUMPY_DEPENDENCIES.cmake index 1564a18e9..964ae9230 100644 --- a/config/FindVIGRANUMPY_DEPENDENCIES.cmake +++ b/config/FindVIGRANUMPY_DEPENDENCIES.cmake @@ -149,7 +149,13 @@ IF(Python_Interpreter_FOUND) SET(VIGRANUMPY_INCLUDE_DIRS ${VIGRANUMPY_INCLUDE_DIRS} CACHE PATH "include directories needed by VIGRA Python bindings" FORCE) - SET(VIGRANUMPY_LIBRARIES ${Python_LIBRARIES} ${Boost_PYTHON_LIBRARY}) + # due to some static linking in Python on conda-forge, Python cannot be directly linked to + # see also https://github.com/ukoethe/vigra/pull/538 + IF(APPLE AND DEFINED ENV{CONDA_TOOLCHAIN_BUILD}) + SET(VIGRANUMPY_LIBRARIES ${Boost_PYTHON_LIBRARY}) + ELSE() + SET(VIGRANUMPY_LIBRARIES ${Python_LIBRARIES} ${Boost_PYTHON_LIBRARY}) + ENDIF() if(TEST_VIGRANUMPY AND NOT VIGRANUMPY_DEPENDENCIES_FOUND) MESSAGE(FATAL_ERROR " vigranumpy dependencies NOT found while TEST_VIGRANUMPY=1") diff --git a/config/run_test.sh.in b/config/run_test.sh.in index 9e95ef381..5fa61cf54 100644 --- a/config/run_test.sh.in +++ b/config/run_test.sh.in @@ -1 +1,2 @@ +#!/bin/bash PATH=@EXTRA_PATH@$PATH && cd @CMAKE_CURRENT_BINARY_DIR@ && (@VIGRA_TEST_EXECUTABLE@ || { touch testsuccess.cxx; exit 1; } )