Skip to content

Commit

Permalink
Merge pull request #538 from k-dominik/fix-osx-ci
Browse files Browse the repository at this point in the history
fix osx ci :)
  • Loading branch information
hmaarrfk authored Mar 27, 2023
2 parents c331366 + cee42d9 commit 63cd2b2
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 16 deletions.
24 changes: 11 additions & 13 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 18 additions & 2 deletions ci/build_unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
8 changes: 7 additions & 1 deletion config/FindVIGRANUMPY_DEPENDENCIES.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions config/run_test.sh.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#!/bin/bash
PATH=@EXTRA_PATH@$PATH && cd @CMAKE_CURRENT_BINARY_DIR@ && (@VIGRA_TEST_EXECUTABLE@ || { touch testsuccess.cxx; exit 1; } )

0 comments on commit 63cd2b2

Please sign in to comment.