forked from OSGeo/gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (160 loc) · 8.51 KB
/
cmake_builds.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# build GDAL library and to run test with CMake
name: Build and test with CMake
on:
push:
paths-ignore:
- 'gdal/doc/**'
pull_request:
paths-ignore:
- 'gdal/doc/**'
env:
CMAKE_UNITY_BUILD: OFF
jobs:
build-linux-ubuntu-focal:
runs-on: ubuntu-20.04
env:
CMAKE_OPTIONS: -DPython_LOOKUP_VERSION=3.8 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
steps:
- name: Checkout GDAL
uses: actions/checkout@v2
- run: |
cmake --version
- name: Install dependency
run: |
sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install -y -q bison libjpeg-dev libgif-dev liblzma-dev libgeos-dev git \
libcurl4-gnutls-dev libproj-dev libxml2-dev libxerces-c-dev libnetcdf-dev netcdf-bin \
libpoppler-dev libpoppler-private-dev gpsbabel libhdf4-alt-dev libhdf5-serial-dev libpodofo-dev poppler-utils \
libfreexl-dev unixodbc-dev libwebp-dev libepsilon-dev liblcms2-2 libcrypto++-dev libdap-dev libkml-dev \
libmysqlclient-dev libarmadillo-dev wget libfyba-dev libjsoncpp-dev libexpat1-dev \
libclc-dev ocl-icd-opencl-dev libsqlite3-dev sqlite3-pcre libpcre3-dev libspatialite-dev libsfcgal-dev fossil libcairo2-dev libjson-c-dev \
python3-dev libpython3-dev libpython3.8-dev python3.8-dev python3-numpy python3-lxml pyflakes python3-setuptools python3-pip python3-venv \
python3-pytest swig doxygen texlive-latex-base make cppcheck ccache g++ \
libpq-dev libpqtypes-dev postgresql-12 postgresql-12-postgis-3 postgresql-client-12 postgresql-12-postgis-3-scripts
python3 -m pip install -U pip wheel setuptools numpy
python3 -m pip install -r $GITHUB_WORKSPACE/autotest/requirements.txt
- name: Configure
run: |
mkdir -p $GITHUB_WORKSPACE/superbuild
cd $GITHUB_WORKSPACE/superbuild
printf "cmake_minimum_required(VERSION 3.10)\nproject(test)\nadd_subdirectory(gdal)" > CMakeLists.txt
ln -s .. gdal
mkdir build
cd build
cmake ${CMAKE_OPTIONS} -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD} -DCMAKE_C_FLAGS=-Werror -DCMAKE_CXX_FLAGS=-Werror ..
- name: Build
run: |
cmake --build $GITHUB_WORKSPACE/superbuild/build -j $(nproc)
- name: test
run: |
cmake --build $GITHUB_WORKSPACE/superbuild/build --target quicktest
build-windows-msys2-mingw:
if: ${{ false }} # FIXME: disable for now
runs-on: windows-latest
env:
generator: MinGW Makefiles
JAVA_HOME: "C:\\Program Files\\Java\\zulu-11-azure-jdk_11.33.15-11.0.4-win_x64"
steps:
- name: Checkout GDAL
uses: actions/checkout@v2
- name: Install MSYS2
run: choco install --yes msys2
- name: Install development packages
run: |
$script = @'
pacman -S --noconfirm base-devel
pacman -S --noconfirm mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-ccache
pacman -S --noconfirm mingw-w64-x86_64-proj mingw-w64-x86_64-geos mingw-w64-x86_64-hdf5 mingw-w64-x86_64-netcdf mingw-w64-x86_64-openjpeg mingw-w64-x86_64-poppler mingw-w64-x86_64-libtiff mingw-w64-x86_64-libpng mingw-w64-x86_64-xerces-c mingw-w64-x86_64-libxml2 mingw-w64-x86_64-libfreexl mingw-w64-x86_64-libgeotiff mingw-w64-x86_64-libspatialite mingw-w64-x86_64-libtiff mingw-w64-x86_64-pcre mingw-w64-x86_64-postgresql mingw-w64-x86_64-zstd mingw-w64-x86_64-crypto++ mingw-w64-x86_64-cgal mingw-w64-x86_64-jasper mingw-w64-x86_64-python-numpy mingw-w64-x86_64-python-pytest
'@
& c:\tools\msys64\usr\bin\bash.exe -lc $script
env:
MSYSTEM: MSYS
- name: Install python dependencies for autotest
run: |
$script = @'
python -m ensurepip --upgrade
python -m pip install -U wheel setuptools numpy
python -m pip install pytest pytest-sugar pytest-env
'@
& c:\tools\msys64\usr\bin\bash.exe -lc $script
env:
MSYSTEM: MINGW64
- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=release -G "${env:generator}" "-DCMAKE_C_COMPILER_LAUNCHER=c:\tools\msys64\mingw64\bin\ccache.exe" "-DCMAKE_CXX_COMPILER_LAUNCHER=c:\tools\msys64\mingw64\bin\ccache.exe" "-DCMAKE_PREFIX_PATH=C:\tools\msys64\mingw64" "-DCMAKE_UNITY_BUILD=${env:CMAKE_UNITY_BUILD}" -S . -B "build"
working-directory: ${{ github.workspace }}
- name: Build
run: cmake --build build
working-directory: ${{ github.workspace }}
- name: test
run: cmake --build build --target quicktest
working-directory: ${{ github.workspace }}
build-windows-conda:
runs-on: windows-latest
env:
architecture: x64
generator: Visual Studio 16 2019
JAVA_HOME: "C:\\Program Files\\Java\\zulu-11-azure-jdk_11.33.15-11.0.4-win_x64"
steps:
- name: Checkout GDAL
uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: gdalenv
python-version: 3.7
channels: conda-forge
- run: |
cmake --version
- name: Install dependency
shell: bash -l {0}
run: |
conda install --yes --quiet --name gdalenv curl libiconv icu git python=3.7 swig numpy pytest zlib clcache
conda install --yes --quiet --name gdalenv -c conda-forge proj geos hdf4 hdf5 \
libnetcdf openjpeg poppler libtiff libpng xerces-c expat libxml2 kealib json-c \
cfitsio freexl geotiff jpeg libpq libspatialite libwebp-base pcre postgresql \
sqlite tiledb zstd charls cryptopp cgal jasper doxygen librttopo libkml openssl xz
- name: Configure
shell: bash -l {0}
# FIXME: Spatialite and Jasper manually disabled because of linking errors: spatialite needs rttopo, and jasper lacks jp2_box_destroy
# Disable MySQL because of ogr\ogrsf_frmts\mysql\ogr_mysql.h(47,10): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
# Disable LIBKML because of issue at linking time with kmlXXXX.lib being debug libraries
run: |
mkdir -p $GITHUB_WORKSPACE/build
cmake -A ${architecture} -G "${generator}" "-DCMAKE_C_COMPILER_LAUNCHER=clcache" "-DCMAKE_CXX_COMPILER_LAUNCHER=clcache" "-DCMAKE_PREFIX_PATH=${CONDA_PREFIX}" -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD} -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build" -DSPATIALITE_LIBRARY:FILEPATH= -DJASPER_LIBRARY_RELEASE:FILEPATH= -DMYSQL_LIBRARY:FILEPATH= -DLIBKML_BASE_LIBRARY:FILEPATH=
- name: Build
shell: bash -l {0}
run: cmake --build $GITHUB_WORKSPACE/build --config Release
- name: test
shell: bash -l {0}
# only test-copy-words for now
run: |
export PATH=${CONDA_PREFIX}/Library/bin:${GITHUB_WORKSPACE}/build/Release:${PATH}
echo $PATH
cmake --build $GITHUB_WORKSPACE/build --config Release --target test-copy-words
build-mac:
if: ${{ false }} # FIXME: disable for now
runs-on: macOS-latest
env:
CMAKE_OPTIONS: -DGDAL_USE_GIFLIB_INTERNAL=YES -DCFITSIO_ROOT=/usr/local/opt/cfitsio -DPoppler_ROOT=/usr/local/opt/poppler -DPROJ_ROOT=/usr/local/opt/proj -DLibXml2_ROOT=/usr/local/opt/libxml2 -DSPATIALITE_ROOT=/usr/local/opt/libspatialite -DPostgreSQL_ROOT=/usr/local/opt/libpq -DEXPAT_ROOT=/usr/local/opt/expat -DXercesC_ROOT=/usr/local/opt/xerces-c -DSQLite3_ROOT=/usr/local/opt/sqlite -DOpenSSL_ROOT=/usr/local/opt/openssl -DPNG_ROOT=/usr/local/opt/libpng -DJPEG_ROOT=/usr/local/opt/jpeg -DOpenJPEG_ROOT=/usr/local/opt/openjpeg
steps:
- name: Checkout GDAL
uses: actions/checkout@v2
- run: |
cmake --version
- name: Install dependency
run: |
brew update
brew outdated
brew install postgresql || brew link --overwrite postgresql
brew install freexl libxml2 libspatialite geos proj openjpeg giflib szip postgis poppler doxygen unixodbc libdap
brew install ccache swig
# gdal is automatically installed as a dependency for postgis
brew uninstall --ignore-dependencies gdal
- name: Configure
run: |
mkdir -p $GITHUB_WORKSPACE/build
cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install-gdal ${CMAKE_OPTIONS} "-DCMAKE_C_COMPILER_LAUNCHER=ccache" "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache" -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD} -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build"
- name: Build
run: cmake --build $GITHUB_WORKSPACE/build
- name: test
run: cmake --build $GITHUB_WORKSPACE/build --target quicktest