Skip to content

Commit

Permalink
CI: port osx job to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jul 21, 2022
1 parent f9edfd6 commit 601d793
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 45 deletions.
4 changes: 1 addition & 3 deletions ci/travis/osx/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
set -e

conda update -n base -c defaults conda
conda install compilers -y
conda install automake -y
conda install pkgconfig -y
conda install -y compilers automake pkgconfig cmake

conda config --set channel_priority strict
conda install --yes --quiet proj=7.1.1=h45baca5_3 python=3.8 -y
Expand Down
48 changes: 14 additions & 34 deletions ci/travis/osx/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,22 @@ CONDA_PREFIX=/usr/local/miniconda/envs/test
find ${CONDA_PREFIX}/lib -name '*.la' -delete

# build GDAL
./autogen.sh
# --without-tiledb because of https://github.com/OSGeo/gdal/issues/3122
./configure --prefix=$HOME/install-gdal \
--enable-debug \
--with-jpeg12 \
--with-geotiff=internal \
--with-png=internal \
--without-pg \
--without-webp \
--with-expat=${CONDA_PREFIX} \
--with-sqlite3=${CONDA_PREFIX} \
--with-libjson-c=${CONDA_PREFIX} \
--without-tiledb \
--without-python
make USER_DEFS="-Wextra -Werror" -j3
cd apps
make USER_DEFS="-Wextra -Werror" test_ogrsf
mkdir build
cd build
CFLAGS="-Wextra -Werror" CXXFLAGS="-Wextra -Werror" cmake .. \
-DCMAKE_INSTALL_PREFIX=$HOME/install-gdal \
-DCMAKE_PREFIX_PATH=${CONDA_PREFIX} \
-DCMAKE_BUILD_TYPE=Debug \
-DGDAL_USE_GEOTIFF_INTERNAL=ON \
-DGDAL_USE_PNG_INTERNAL=ON \
-DGDAL_USE_POSTGRESQL=OFF \
-DGDAL_USE_WEBP=OFF \
-DBUILD_CSHARP_BINDINGS=OFF
make -j3
echo "Show which shared libs got used:"
otool -L .libs/ogrinfo
cd ..
cd swig/python
python3 setup.py build
cd ../..
otool -L apps/ogrinfo
make install
export PATH=$HOME/install-gdal/bin:$PWD/apps/.libs:$PATH
export DYLD_LIBRARY_PATH=$HOME/install-gdal/lib
export GDAL_DATA=$HOME/install-gdal/share/gdal

cd autotest/cpp
echo $PATH

gdal-config --version
gdal-config --cflags
gdal-config --libs
make -j3
cd ../..
cd ..

# Post-install testing
# ../autotest/postinstall/test_pkg-config.sh $HOME/install-gdal
10 changes: 2 additions & 8 deletions ci/travis/osx/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@

set -e

PYTHONPATH=$(find $PWD/swig/python/build -name "lib.*")
export PYTHONPATH
export PYTEST="python3 -m pytest -vv -p no:sugar --color=no"
export DYLD_LIBRARY_PATH=$HOME/install-gdal/lib
export GDAL_DATA=$HOME/install-gdal/share/gdal
export PROJ_NETWORK=ON

echo 'Running CPP unit tests'
(cd autotest/cpp && make quick_test)
(cd build && make quicktest)

echo 'Running Python unit tests'
# install test dependencies
Expand All @@ -22,8 +17,7 @@ mv autotest/utilities/test_ogr2ogr.py autotest/utilities/test_ogr2ogr.py.disable
mv autotest/pyscripts/test_ogr2ogr_py.py autotest/pyscripts/test_ogr2ogr_py.py.disabled

# Run all the Python autotests
cd autotest
$PYTEST
(cd build && ctest -V -R autotest)

# For some reason, the tests crash at process exit
# (cd autotest; $PYTEST 2>&1 | tee /tmp/log.txt || /bin/true)
Expand Down

0 comments on commit 601d793

Please sign in to comment.