Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Add CMake build #3621

Draft
wants to merge 182 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 158 commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
43daba2
parent 464ffca1e1fbb98107593ee60c43a8449e567eed
rkanavath Jun 11, 2017
f9c5cf0
revert C related INFINITY/NAN changes (this is taken care of in #2681)
neteler Dec 5, 2022
f9b1ba7
Sync to PR Cmake build2 #348 (replaces #348)
neteler Dec 5, 2022
4889de7
CI fix for pylint in gui/wxpython called with wildcard
neteler Dec 5, 2022
9eed8bc
cmake/find_scripts/FindPROJ.cmake: update to PROJ > 4
neteler Dec 5, 2022
67cdeee
cmake/find_scripts/FindPostgreSQL.cmake: update to https://github.com…
neteler Dec 5, 2022
faea30b
various path updates (sync to main)
neteler Dec 5, 2022
7f39bb3
grass7 -> grass8; msg cosmetics
neteler Dec 5, 2022
96862bd
CI: cmake compile script
neteler Dec 6, 2022
d9f674e
fix syntax
neteler Dec 10, 2022
49c5d5b
fix Build step
neteler Dec 10, 2022
b2669e5
Build step debugging
neteler Dec 11, 2022
18bf7f0
Simplify cmake command call
neteler Jan 2, 2023
f76f68f
Remove debugging leftover.
neteler Jan 2, 2023
ba6c07d
make -> cmake
neteler Jan 2, 2023
76576db
update year
neteler Jan 2, 2023
2be2b75
python_bandref -> python_semantic_label
neteler Jan 2, 2023
e8126e7
remove outdated bandref
neteler Jan 2, 2023
52123fe
bandref -> semantic_label
neteler Jan 2, 2023
91461d5
added python/CMakeLists.txt (from https://github.com/OSGeo/grass/pull…
neteler Jan 2, 2023
87ef0aa
add_subdirectory(python)
neteler Jan 2, 2023
aecd006
fix path to grass/script/setup.py
neteler Jan 2, 2023
4b23a6c
remove files deleted in PR #1400
neteler Jan 2, 2023
0a43a1c
Fix missing EOL
neteler Jan 2, 2023
e5becb7
just peek in the folder (by @echoix)
neteler Jan 3, 2023
fd5500d
sync clang-format changes from main
neteler Jan 4, 2023
9565839
apply clang-format
nilason Jan 4, 2023
0afe71f
cmake_minimum_required version 3.11
neteler Jan 4, 2023
617f58d
update to CMake 3.11.4
neteler Jan 4, 2023
a9c23d7
add VERBATIM
neteler Jan 4, 2023
3f1f5a1
pylint: ignore cmakelists.txt
nilason Jan 5, 2023
6301f3e
homogenize ubuntu image name
neteler Jan 4, 2023
d88134e
use of INFINITY and NAN
lbartoletti Jun 5, 2023
8c06b79
Simplify and use PROJ_H_
lbartoletti Jun 3, 2023
6b54a06
CMakeLists.txt: add include_irectories to grass
lbartoletti Jun 3, 2023
1852e08
raster/CMakeLists.txt: fix GDAL_VERSION
lbartoletti Jun 3, 2023
dccaac0
add aprintf.c
lbartoletti Jun 4, 2023
c02053f
v.neighbors requires grass_stats
lbartoletti Jun 4, 2023
b222913
ctypesgen.py: main module is not ctypesgen.py but run.py. fix it.
lbartoletti Jun 4, 2023
062b852
lib/rst: fix build. Remove DEFS POINT2D_C
lbartoletti Jun 5, 2023
075e42e
python: copy grassdb
lbartoletti Jun 5, 2023
555cdb2
propose ccache to speedup build
lbartoletti Jun 5, 2023
754872d
mkhtml.py depends on a sibling python script
aaronsms Jun 5, 2023
9ef6a2b
make libraster libvector link with lapack when it is available
aaronsms Jun 5, 2023
161f1f9
add the 3 missing raster modules
aaronsms Jun 5, 2023
ce13ea1
display: add d.rgb, d.rhumbline, d.text, d.title, d.vect.*
lbartoletti Jun 5, 2023
1541875
raster: enable r3.mapcalc
lbartoletti Jun 5, 2023
2af6d2e
raster: enable r.object.geometry
lbartoletti Jun 6, 2023
1c2b3dd
ps: enable ps.map
lbartoletti Jun 6, 2023
028a323
python/grass: add utils (will be used by g.download.location scripts)
lbartoletti Jun 6, 2023
1edfee8
scripts: add d.background, g.download.location, i.band.library, r.sem…
lbartoletti Jun 6, 2023
6a12d3a
temporal: add t.copy and t.upgrade
lbartoletti Jun 6, 2023
0f90e77
add an optional cmake to use alternate linker
lbartoletti Jun 6, 2023
ce74248
gui/wxpython: copy main_window dir
lbartoletti Jun 6, 2023
31b53b5
init: copy lock, echo, run, clean_temp and winlocale
lbartoletti Jun 6, 2023
a357bc7
minor fixes just to move forward
nilason Aug 14, 2023
aec2b7e
apply cmake-format
nilason Aug 14, 2023
453739a
Very WIP commit, various changes
nilason Mar 3, 2024
91515e0
Define global PYTHON_EXECUTABLE
HuidaeCho Apr 18, 2024
c5de062
Shared library versioning and symlinks
HuidaeCho Apr 18, 2024
c6f17af
Rename grass.sh to grass and set 755 permissions
HuidaeCho Apr 18, 2024
df254d1
Rename project to GRASS
HuidaeCho Apr 18, 2024
c50fe07
Define PYTHON_EXECUTABLE from CheckDependentLibraries.cmake
HuidaeCho Apr 18, 2024
2904d24
Add dependency properties
HuidaeCho Apr 18, 2024
af2fe5c
libjpeg not required anymore?
HuidaeCho Apr 18, 2024
999c71e
cmake-format
HuidaeCho Apr 19, 2024
1527625
Honor WITH_LIBLAS
HuidaeCho Apr 19, 2024
4d5e2b9
Indentation
HuidaeCho Apr 19, 2024
009d06e
Fix Python_EXECUTABLE to PYTHON_EXECUTABLE
HuidaeCho Apr 19, 2024
e98b60b
Do not overwrite BINARY_DIR cmake property
HuidaeCho Apr 19, 2024
12c5192
Move directory settings
HuidaeCho Apr 19, 2024
d27a929
Build directly into GISBASE
HuidaeCho Apr 20, 2024
306e24e
Rename tools directory to utils to be consistent
HuidaeCho Apr 20, 2024
e8fc34c
No need to copy G_NAME to itself now
HuidaeCho Apr 20, 2024
b63b210
Rename G_SRCDIR to G_SRC_DIR for consistency; Do not create tmp.html …
HuidaeCho Apr 20, 2024
e05bfb3
Do not touch empty files; Do not run html-description if G_RUNTIME_OU…
HuidaeCho Apr 20, 2024
3720a85
Don't chdir unnecessarily
HuidaeCho Apr 20, 2024
c870bbf
Set GRASS_HEADERS_(VERSION|DATE) for g.version
HuidaeCho Apr 20, 2024
f8a71d7
Remove JPEG
HuidaeCho Apr 20, 2024
2056b40
Add MySQL support
HuidaeCho Apr 20, 2024
f61e9b4
Support MySQL
HuidaeCho Apr 20, 2024
906ecfb
Move mysql_SRCS to top
HuidaeCho Apr 20, 2024
3e0f6b4
Mixed-case PostgreSQL_* variables
HuidaeCho Apr 20, 2024
322436c
Mixed-case MySQL_* variables
HuidaeCho Apr 20, 2024
60e0737
Mixed-case LibLAS_FOUND
HuidaeCho Apr 20, 2024
ee619ad
Use original mixed-case *_FOUND
HuidaeCho Apr 20, 2024
bf3abef
Support readline
HuidaeCho Apr 20, 2024
9a24f75
Consistent help messages
HuidaeCho Apr 20, 2024
57eceb1
Require WITH-libraries
HuidaeCho Apr 20, 2024
4a040d7
Support zstd
HuidaeCho Apr 21, 2024
e61ca6f
Support regex
HuidaeCho Apr 21, 2024
38fc983
Support OpenMP
HuidaeCho Apr 21, 2024
277ba5d
cmake-format
HuidaeCho Apr 21, 2024
ee3ef6f
Add -fopenmp only if OpenMP is requested and found
HuidaeCho Apr 21, 2024
d46d202
Reorder options by group; Clean up dependencies for libraries and mod…
HuidaeCho Apr 21, 2024
23fbabb
Merge branch 'main' into cmake_build_work
HuidaeCho Apr 21, 2024
9d5a1bf
Add missing dependencies to lidar
HuidaeCho Apr 21, 2024
cf06b01
Update lib/external/ccmath/ccmath.h
HuidaeCho Apr 21, 2024
ff0d592
Update lib/external/ccmath/ccmath.h
HuidaeCho Apr 21, 2024
fe3ba55
Update lib/gis/user_config.c
HuidaeCho Apr 21, 2024
0bd4720
Update raster/r.terraflow/filldepr.cpp
HuidaeCho Apr 21, 2024
46ebe25
Update raster/r.terraflow/main.cpp
HuidaeCho Apr 21, 2024
6d6f38c
Compile parson
HuidaeCho Apr 21, 2024
e1bac2a
Add parson dependency
HuidaeCho Apr 21, 2024
1d6e1dd
Remove duplicate regex check
HuidaeCho Apr 21, 2024
afe6fba
Add GUI history
HuidaeCho Apr 21, 2024
1639f8c
Copy install to GISBASE; Fix ctypesgen
HuidaeCho Apr 21, 2024
23621b5
Copy include to GISBASE
HuidaeCho Apr 21, 2024
6c1b216
Copy render_cmd.py to GISBASE/etc/d.mon
HuidaeCho Apr 21, 2024
4ad7eb2
Extend copy_python_files_in_subdir to copy on build event
HuidaeCho Apr 21, 2024
bc460e6
Copy lib/symbol/symbol to GISBASE/etc/symbol
HuidaeCho Apr 21, 2024
023fb24
Copy symbol images to GISBASE/gui/images/symbols
HuidaeCho Apr 21, 2024
cc7fb73
Copy fonts and create fontcap
HuidaeCho Apr 22, 2024
9606c20
Resolve a dependency loop
HuidaeCho Apr 22, 2024
ded2773
Update .github/workflows/cmake.yml
HuidaeCho Apr 22, 2024
63c048c
Update .github/workflows/cmake.yml
HuidaeCho Apr 22, 2024
a1f54d3
Update .github/workflows/cmake.yml
HuidaeCho Apr 22, 2024
7c072f8
Update .github/workflows/cmake.yml
HuidaeCho Apr 22, 2024
76f6bbf
Update .github/workflows/cmake.yml
HuidaeCho Apr 22, 2024
7534f7d
Update .github/workflows/cmake.yml
HuidaeCho Apr 22, 2024
3fcc02a
Update .github/workflows/cmake.yml
HuidaeCho Apr 22, 2024
9d4d22c
Define (read|write)_png only if HAVE_PNG_H
HuidaeCho Apr 22, 2024
e5732bc
Add postgres versions 14-16
HuidaeCho Apr 22, 2024
4c61830
Add Findzstd.cmake
HuidaeCho Apr 22, 2024
f084cc0
Add grass_gis dependency to symbol (G_malloc)
HuidaeCho Apr 22, 2024
ebfc26e
Address an issue with excluding PNG files
HuidaeCho Apr 22, 2024
3dceff3
Revert pngdriver.h; if we need it, should be done in a new PR
HuidaeCho Apr 22, 2024
c364893
Require CMake 3.16.0; format to yamllint *manually* (do we have a for…
HuidaeCho Apr 22, 2024
3f47bbe
CHMOD (cmake 3.19) workaround for 3.16
HuidaeCho Apr 22, 2024
7193663
Use full path to /bin/chmod for security
HuidaeCho Apr 22, 2024
e2d1198
chmod 755 instead of chmod a+x
HuidaeCho Apr 22, 2024
f772e0f
Update .github/workflows/cmake.yml
HuidaeCho Apr 22, 2024
e0e3003
Update gui/images/CMakeLists.txt
HuidaeCho Apr 22, 2024
ce96fca
Use CMAKE_VERSION VERSION_* instead of comments for CHMOD
HuidaeCho Apr 22, 2024
ad18fc7
Update .github/workflows/cmake.yml
HuidaeCho Apr 22, 2024
5c334f5
Let's try g.mkfontcap -s
HuidaeCho Apr 23, 2024
b6ce1d0
Tell me where please...
HuidaeCho Apr 23, 2024
8ecd3cc
Add more print lines to g.mkfontcap
HuidaeCho Apr 23, 2024
bdb5836
Is it G_asprintf?
HuidaeCho Apr 23, 2024
b8a0718
Memory address seems too high
HuidaeCho Apr 23, 2024
4dbb27e
Try allocating memory to fontcap.path
HuidaeCho Apr 23, 2024
2db8c1f
Do you HAVE_ASPRINTF?
HuidaeCho Apr 23, 2024
69b9091
We hit the bug in G_asprintf; ap is undefined as the first call
HuidaeCho Apr 23, 2024
021fd25
OK, G_vasprintf without HAVE_ASPRINTF is buggy
HuidaeCho Apr 23, 2024
727f31b
Let's try this fix for G_vasprintf
HuidaeCho Apr 23, 2024
f1aec67
Update .github/workflows/cmake.yml
HuidaeCho Apr 23, 2024
5fefb87
Fix check for HAVE_ASPRINTF
HuidaeCho Apr 23, 2024
1bbd7c6
Fix diglib compile
HuidaeCho Apr 23, 2024
3bdec35
Update CMakeLists.txt
HuidaeCho Apr 23, 2024
050f940
Update CMakeLists.txt
HuidaeCho Apr 23, 2024
9f10471
Update CMakeLists.txt
HuidaeCho Apr 23, 2024
dfe4295
Merge branch 'main' into cmake_build_work
echoix Apr 23, 2024
dcfa492
CI(cmake): Use ninja generator
echoix May 2, 2024
4debbaa
Merge branch 'main' into cmake_build_work
echoix May 15, 2024
77aac55
Merge branch 'main' into cmake_build_work_huidae
nilason May 24, 2024
04ec6f1
source changes (address separately)
nilason May 24, 2024
f6ac367
cmake: major update, FHS, dependencies, tests added
nilason May 24, 2024
7da00eb
CI: restore original state
nilason May 24, 2024
45dad8f
Merge branch 'main' into cmake_build_work
echoix Jul 2, 2024
4b2aa27
Added parson to r.info, r.profile, v.info
Mahesh1998 Jul 15, 2024
e446882
Merge pull request #2 from Mahesh1998/cmake_build_work
HuidaeCho Jul 15, 2024
8291252
Fixed Building grass with Ubuntu System Libraries and cmake
Mahesh1998 Jul 17, 2024
0c87922
Merge branch 'main' into cmake_build_work
echoix Jul 18, 2024
d3f25c5
Merge pull request #3 from Mahesh1998/ubuntu_sys_lib_cmake
HuidaeCho Jul 22, 2024
7e349f5
Added parson to r.univar, r3.univar, v.univar
Mahesh1998 Jul 29, 2024
b53059b
Merge pull request #4 from Mahesh1998/ubuntu_conda_lib_cmake
HuidaeCho Jul 30, 2024
7da418b
Merge pull request #2 from HuidaeCho/cmake_build_work
Mahesh1998 Aug 12, 2024
3bcc984
Fixed LIBM target issue and added the missing file gettimeoftheday c …
Mahesh1998 Sep 6, 2024
6d29c6e
Merge pull request #3 from Mahesh1998/windows_conda_lib_cmake
Mahesh1998 Sep 6, 2024
ec0fc42
Merge branch 'main' into cmake_build_work
echoix Sep 10, 2024
8125579
Fixed Windows Environment Path Issue and Relocated all msvc files fro…
Mahesh1998 Sep 12, 2024
3ebded4
Merge pull request #6 from Mahesh1998/cmake_build_work
HuidaeCho Sep 15, 2024
7fa9bd0
msvc/gettimeofday.c: clang-formatted
HuidaeCho Sep 15, 2024
b585f5f
Merge branch 'main' into cmake_build_work
HuidaeCho Sep 15, 2024
0510aa6
Include all C files for lib/gis
HuidaeCho Sep 15, 2024
9adfddb
Use bracket arguments for REGEX
HuidaeCho Sep 15, 2024
e1987d9
Add more parson dependency
HuidaeCho Sep 15, 2024
8ec272e
ctypegen: Do not link against versioned libs because lib names are no…
HuidaeCho Sep 15, 2024
286c5d6
libgrass_interface_generator depends on grass_ogsf; build libs first
HuidaeCho Sep 15, 2024
1bb932d
msvc/gettimeofday.c: Add the original URL
HuidaeCho Sep 15, 2024
3a7d9f7
Use the SDRangel version of gettimeofday.c because c.h is postgres-only
HuidaeCho Sep 18, 2024
d790ac0
gettimeofday.c: comment
HuidaeCho Sep 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# inspired by "build GDAL library and to run test with CMake"
# from https://github.com/OSGeo/gdal/blob/master/.github/workflows/cmake_builds.yml

---
name: CMake

on:
push:
paths-ignore:
- 'doc/**'
branches:
- main
- releasebranch_*
pull_request:
paths-ignore:
- 'doc/**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

env:
CMAKE_UNITY_BUILD: OFF

permissions:
contents: read # to fetch code (actions/checkout)

jobs:

build-cmake:
runs-on: ubuntu-20.04
env:
CMAKE_OPTIONS: -DPython_LOOKUP_VERSION=3.8 -DUSE_CCACHE=ON
cache-name: cmake-ubuntu-20.04
steps:
- name: Checkout GRASS
uses: actions/checkout@v4.1.1
- name: Setup cache
uses: actions/cache@v4.0.2
id: cache
with:
path: ${{ github.workspace }}/.ccache
key: "${{ env.cache-name }}-${{ runner.os }}-${{ github.base_ref }}\
${{ github.ref_name }}-${{ github.run_id }}"
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-${{ github.base_ref }}
${{ env.cache-name }}-${{ runner.os }}
- name: Install CMake 3.16.0
run: |
cd ${GITHUB_WORKSPACE}
wget https://github.com/Kitware/CMake/releases/download/v3.16.0/cmake-3.16.0-Linux-x86_64.tar.gz
tar xzf cmake-3.16.0-Linux-x86_64.tar.gz
echo "CMAKE_DIR=$GITHUB_WORKSPACE/cmake-3.16.0-Linux-x86_64/bin" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/cmake-3.16.0-Linux-x86_64/bin" >> $GITHUB_PATH
- run: |
cmake --version
- name: Install dependencies
run: |
sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install -y -q build-essential \
flex make bison gcc libgcc1 g++ ccache \
python3 python3-dev \
python3-opengl python3-wxgtk4.0 \
python3-dateutil libgsl-dev python3-numpy \
wx3.0-headers wx-common libwxgtk3.0-gtk3-dev \
libwxbase3.0-dev libbz2-dev zlib1g-dev gettext \
libtiff5-dev libpnglite-dev libcairo2 libcairo2-dev \
sqlite3 libsqlite3-dev \
libpq-dev libreadline6-dev libfreetype6-dev \
libfftw3-3 libfftw3-dev \
libboost-thread-dev libboost-program-options-dev libpdal-dev\
subversion libzstd-dev checkinstall \
libglu1-mesa-dev libxmu-dev \
ghostscript wget -y make ccache g++
- run: python -m pip install ninja
- name: Configure ccache
HuidaeCho marked this conversation as resolved.
Show resolved Hide resolved
run: |
echo CCACHE_BASEDIR=$PWD >> ${GITHUB_ENV}
echo CCACHE_DIR=$PWD/.ccache >> ${GITHUB_ENV}
echo CCACHE_MAXSIZE=250M >> ${GITHUB_ENV}
ccache -z
working-directory: ${{ github.workspace }}
- name: Print build environment variables
shell: bash -el {0}
run: |
printenv | sort
gcc --version
ldd --version
- name: Create installation directory
run: |
mkdir $HOME/install
- name: Configure
run: |
cmake ${CMAKE_OPTIONS} -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -G Ninja \
-DCMAKE_INSTALL_PREFIX=$HOME/install -DWITH_NLS=OFF \
-DCMAKE_C_FLAGS="-I/usr/include -I/usr/include/gdal" \
-DCMAKE_CXX_FLAGS="-I/usr/include -I/usr/include/gdal"
- name: Print CMakeCache.txt
shell: bash -el {0}
run: |
cat ${GITHUB_WORKSPACE}/build/CMakeCache.txt
- name: Build
run: |
cmake --build build --verbose -j$(nproc)
- name: Install
run: |
cmake --install $GITHUB_WORKSPACE/build --verbose
- name: Add the bin directory to PATH
run: |
echo "$HOME/install/bin" >> $GITHUB_PATH
- name: Print installed versions
if: always()
run: .github/workflows/print_versions.sh
- name: Test executing of the grass command
run: .github/workflows/test_simple.sh
- name: Run tests
run: .github/workflows/test_thorough.sh --config .gunittest.cfg
- name: ccache statistics
run: ccache -s
2 changes: 1 addition & 1 deletion .github/workflows/python-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
run: |
mkdir $HOME/install

- name: Set number of cores for compilation

Check warning on line 116 in .github/workflows/python-code-quality.yml

View workflow job for this annotation

GitHub Actions / Python Code Quality Checks (ubuntu-22.04, 3.10, 3.8, 24.4.0, 3.9.2, 2.12.2, 1.7.8)

Temporarily downgraded pytest-pylint and pytest to allow merging other PRs. The errors reported with a newer version seem legitimite and should be fixed (2023-10-18, see https://github.com/OSGeo/grass/pull/3205) (2024-01-28, see https://github.com/OSGeo/grass/issues/3380)
run: |
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV

Expand All @@ -137,7 +137,7 @@
export PYTHONPATH=`grass --config python_path`:$PYTHONPATH
export LD_LIBRARY_PATH=$HOME/install/grass84/lib:$LD_LIBRARY_PATH
cd gui/wxpython
pylint --persistent=no --py-version=${{ matrix.min-python-version }} --jobs=$(nproc) *
pylint --persistent=no --py-version=${{ matrix.min-python-version }} --jobs=$(nproc) --ignore=CMakeLists.txt *

- name: Run Pylint on other files using pytest
run: |
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ OBJ.*
locale/scriptstrings/*
bin.*/*
dist.*/*
.vs/*
CMakeSettings.json
config.log
config.status*
error.log
Expand Down Expand Up @@ -50,6 +52,7 @@ test_keyvalue_result.txt

# ignore paths generated by helper tools
node_modules

include/VERSION_GIT

# ignore autogenerated documentation
Expand All @@ -58,3 +61,6 @@ html/
latex/
lib/*/html/
lib/*/latex/

# ignore cmake build directory
build
Loading
Loading