Skip to content

Commit ccc7e5b

Browse files
committed
c++20: Update minimum swig to 4.1.0 for c++20 compatibility
1 parent 7e02522 commit ccc7e5b

7 files changed

Lines changed: 54 additions & 42 deletions

File tree

.github/workflows/CMake.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,17 @@ jobs:
119119
sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev
120120
fi
121121
122-
- name: Install Swig >= 4.0.2
122+
- name: Install Swig >= 4.1.0
123123
run: |
124-
# Install additional apt-based dependencies required to build swig 4.0.2
125-
sudo apt-get install -y bison
124+
# Install additional apt-based dependencies required to build swig 4.1.0.
125+
# swig >= 4.1 requires pcre2-config from libpcre2-dev
126+
sudo apt-get install -y bison automake libpcre2-dev
126127
# Create a local directory to build swig in.
127128
mkdir -p swig-from-source && cd swig-from-source
128129
# Install SWIG building from source dependencies
129-
wget https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz
130-
tar -zxf v4.0.2.tar.gz
131-
cd swig-4.0.2/
130+
wget https://github.com/swig/swig/archive/refs/tags/v4.1.0.tar.gz
131+
tar -zxf v4.1.0.tar.gz
132+
cd swig-4.1.0/
132133
./autogen.sh
133134
./configure
134135
make

.github/workflows/Draft-Release.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,17 @@ jobs:
126126
sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev
127127
fi
128128
129-
- name: Install Swig >= 4.0.2
129+
- name: Install Swig >= 4.1.0
130130
run: |
131-
# Install additional apt-based dependencies required to build swig 4.0.2. 4.0.2 requires pcre-config from pcre3-dev. swig >= 4.1 requires pcre2-config from libpcre2-dev
132-
sudo apt-get install -y bison automake libpcre3-dev libpcre2-dev
131+
# Install additional apt-based dependencies required to build swig 4.1.0.
132+
# swig >= 4.1 requires pcre2-config from libpcre2-dev
133+
sudo apt-get install -y bison automake libpcre2-dev
133134
# Create a local directory to build swig in.
134135
mkdir -p swig-from-source && cd swig-from-source
135136
# Install SWIG building from source dependencies
136-
wget https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz
137-
tar -zxf v4.0.2.tar.gz
138-
cd swig-4.0.2/
137+
wget https://github.com/swig/swig/archive/refs/tags/v4.1.0.tar.gz
138+
tar -zxf v4.1.0.tar.gz
139+
cd swig-4.1.0/
139140
./autogen.sh
140141
./configure
141142
make
@@ -413,6 +414,12 @@ jobs:
413414
make
414415
make install
415416
417+
- name: Install Swig >= 4.1.0 dependencies (EL 8)
418+
run: |
419+
# Install additional apt-based dependencies required to build swig 4.1.0.
420+
# swig >= 4.1 requires pcre2-config, bison and automake
421+
sudo apt-get install -y pcre2-devel bison automake
422+
416423
- name: Install setuptools and wheel
417424
run: |
418425
python${{env.PYTHON}} -m pip install setuptools wheel
@@ -440,8 +447,8 @@ jobs:
440447
-DGLEW_USE_STATIC_LIBS="${{ env.USE_STATIC_GLEW }}"
441448
-DOpenGL_GL_PREFERENCE:STRING=LEGACY
442449
-DFLAMEGPU_BUILD_PYTHON_PATCHELF="ON"
443-
-DFLAMEGPU_SWIG_MINIMUM="4.0.2"
444-
-DFLAMEGPU_SWIG_DOWNLOAD="4.0.2"
450+
-DFLAMEGPU_SWIG_MINIMUM="4.1.0"
451+
-DFLAMEGPU_SWIG_DOWNLOAD="4.1.0"
445452
-DFLAMEGPU_SWIG_EXACT="ON"
446453
447454
- name: Build python wheel
@@ -575,8 +582,8 @@ jobs:
575582
-DPython3_EXECUTABLE="$(which python)"
576583
-DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}"
577584
-DFLAMEGPU_ENABLE_NVTX="ON"
578-
-DFLAMEGPU_SWIG_MINIMUM="4.0.2"
579-
-DFLAMEGPU_SWIG_DOWNLOAD="4.0.2"
585+
-DFLAMEGPU_SWIG_MINIMUM="4.1.0"
586+
-DFLAMEGPU_SWIG_DOWNLOAD="4.1.0"
580587
-DFLAMEGPU_SWIG_EXACT="ON"
581588
582589
- name: Build python wheel

.github/workflows/MPI.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,17 @@ jobs:
184184
sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev
185185
fi
186186
187-
- name: Install Swig >= 4.0.2
187+
- name: Install Swig >= 4.1.0
188188
run: |
189-
# Install additional apt-based dependencies required to build swig 4.0.2
190-
sudo apt-get install -y bison
189+
# Install additional apt-based dependencies required to build swig 4.1.0.
190+
# swig >= 4.1 requires pcre2-config from libpcre2-dev
191+
sudo apt-get install -y bison automake libpcre2-dev
191192
# Create a local directory to build swig in.
192193
mkdir -p swig-from-source && cd swig-from-source
193194
# Install SWIG building from source dependencies
194-
wget https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz
195-
tar -zxf v4.0.2.tar.gz
196-
cd swig-4.0.2/
195+
wget https://github.com/swig/swig/archive/refs/tags/v4.1.0.tar.gz
196+
tar -zxf v4.1.0.tar.gz
197+
cd swig-4.1.0/
197198
./autogen.sh
198199
./configure
199200
make

.github/workflows/Manylinux_2_28.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,19 @@ jobs:
134134
make
135135
make install
136136
137+
- name: Install Swig >= 4.1.0 dependencies (EL 8)
138+
run: |
139+
# Install additional apt-based dependencies required to build swig 4.1.0.
140+
# swig >= 4.1 requires pcre2-config, bison and automake
141+
sudo apt-get install -y pcre2-devel bison automake
142+
137143
- name: Install setuptools and wheel
138144
run: |
139145
python${{env.PYTHON}} -m pip install setuptools wheel
140146
141147
- name: Add custom problem matchers for annotations
142148
run: echo "::add-matcher::.github/problem-matchers.json"
143149

144-
- name: Install setuptools and wheel
145-
if: ${{ env.PYTHON >= 3.12 }}
146-
run: |
147-
python${{env.PYTHON}} -m pip install setuptools wheel
148-
149150
# This patches a bug where ManyLinux doesn't generate buildnumber as git dir is owned by diff user
150151
- name: Enable git safe-directory
151152
run: git config --global --add safe.directory $GITHUB_WORKSPACE
@@ -166,8 +167,8 @@ jobs:
166167
-DGLEW_USE_STATIC_LIBS="${{ env.USE_STATIC_GLEW }}"
167168
-DOpenGL_GL_PREFERENCE:STRING=LEGACY
168169
-DFLAMEGPU_BUILD_PYTHON_PATCHELF="ON"
169-
-DFLAMEGPU_SWIG_MINIMUM="4.0.2"
170-
-DFLAMEGPU_SWIG_DOWNLOAD="4.0.2"
170+
-DFLAMEGPU_SWIG_MINIMUM="4.1.0"
171+
-DFLAMEGPU_SWIG_DOWNLOAD="4.1.0"
171172
-DFLAMEGPU_SWIG_EXACT="ON"
172173
173174
- name: Build python wheel

.github/workflows/Ubuntu.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,17 @@ jobs:
140140
sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev
141141
fi
142142
143-
- name: Install Swig >= 4.0.2
143+
- name: Install Swig >= 4.1.0
144144
run: |
145-
# Install additional apt-based dependencies required to build swig 4.0.2. 4.0.2 requires pcre-config from pcre3-dev. swig >= 4.1 requires pcre2-config from libpcre2-dev
146-
sudo apt-get install -y bison automake libpcre3-dev libpcre2-dev
145+
# Install additional apt-based dependencies required to build swig 4.1.0.
146+
# swig >= 4.1 requires pcre2-config from libpcre2-dev
147+
sudo apt-get install -y bison automake libpcre2-dev
147148
# Create a local directory to build swig in.
148149
mkdir -p swig-from-source && cd swig-from-source
149150
# Install SWIG building from source dependencies
150-
wget https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz
151-
tar -zxf v4.0.2.tar.gz
152-
cd swig-4.0.2/
151+
wget https://github.com/swig/swig/archive/refs/tags/v4.1.0.tar.gz
152+
tar -zxf v4.1.0.tar.gz
153+
cd swig-4.1.0/
153154
./autogen.sh
154155
./configure
155156
make

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ Optionally:
7575
+ [Doxygen](http://www.doxygen.nl/) to build the documentation
7676
+ [Python](https://www.python.org/) `>= 3.8` for python integration
7777
+ With `setuptools`, `wheel`, `build` and optionally `venv` python packages installed
78-
+ [swig](http://www.swig.org/) `>= 4.0.2` for python integration
79-
+ Swig `4.x` will be automatically downloaded by CMake if not provided (if possible).
78+
+ [swig](http://www.swig.org/) `>= 4.1.0` for python integration (with c++20 support)
79+
+ Swig >= `4.1.0` will be automatically downloaded by CMake if not provided (if possible).
80+
+ Swig `4.2.0` is problematic
8081
+ MPI (e.g. [MPICH](https://www.mpich.org/), [OpenMPI](https://www.open-mpi.org/)) for distributed ensemble support
8182
+ MPI 3.0+ tested, older MPIs may work but not tested.
8283
+ [FLAMEGPU2-visualiser](https://github.com/FLAMEGPU/FLAMEGPU2-visualiser) dependencies
@@ -186,8 +187,8 @@ cmake --build . --target all
186187
| `FLAMEGPU_TELEMETRY_SUPPRESS_NOTICE` | `ON`/`OFF` | Suppress notice encouraging telemetry to be enabled, which is emitted once per binary execution if telemetry is disabled. Defaults to `OFF`, or the value of a system environment variable of the same name. |
187188
| `FLAMEGPU_TELEMETRY_TEST_MODE` | `ON`/`OFF` | Submit telemetry values to the test mode of TelemetryDeck. Intended for use during development of FLAMEGPU rather than use. Defaults to `OFF`, or the value of a system environment variable of the same name.|
188189
| `FLAMEGPU_ENABLE_LINT_FLAMEGPU` | `ON`/`OFF` | Enable/Disable creation of the `lint_flamegpu` target. Default `ON` if this repository is the root CMAKE_SOURCE_DIR, otherwise `OFF` |
189-
| `FLAMEGPU_SWIG_MINIMUM` | `4.0.2` | The minimum version of SWIG required. |
190-
| `FLAMEGPU_SWIG_DOWNLOAD` | `4.0.2` | The version of SWIG to download if the required version is not found. |
190+
| `FLAMEGPU_SWIG_MINIMUM` | `4.1.0` | The minimum version of SWIG required. |
191+
| `FLAMEGPU_SWIG_DOWNLOAD` | `4.3.0` | The version of SWIG to download if the required version is not found. |
191192
| `FLAMEGPU_SWIG_EXACT` | `ON`/`OFF` | Require the exact version of SWIG specified in `FLAMEGPU_SWIG_MINIMUM`. This enables downgrading swig. Default `OFF` |
192193

193194
<!-- Additional options which users can find if they need them.

swig/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ unset(PYTHON3_EXACT_VERSION_ARG)
3636
message(STATUS "Python found at " ${Python3_EXECUTABLE})
3737

3838
# Define the minimum and download versions of SWIG which FLAME GPU supports/ requires as cache variables so they may be overridden by users/CI workflows.
39-
# Swig >= 4 is required for C++17
39+
# Swig >= 4.1.0 is required for C++20
4040
# Swig 4.2.0 is very broken for FLAME GPU 2
4141
# Swig 4.2.1 does not allow != / == comparisons against None
4242
# Swig 4.3.0 is potentially required for Python 3.13 support
43-
set(FLAMEGPU_SWIG_MINIMUM 4.0.2 CACHE STRING "Minimum version of SWIG to search for via CMake find_package")
43+
set(FLAMEGPU_SWIG_MINIMUM 4.1.0 CACHE STRING "Minimum version of SWIG to search for via CMake find_package")
4444
mark_as_advanced(FLAMEGPU_SWIG_MINIMUM)
45-
set(FLAMEGPU_SWIG_DOWNLOAD 4.0.2 CACHE STRING "Version of SWIG to download if the minimum required SWIG is not found")
45+
set(FLAMEGPU_SWIG_DOWNLOAD 4.1.0 CACHE STRING "Version of SWIG to download if the minimum required SWIG is not found")
4646
mark_as_advanced(FLAMEGPU_SWIG_DOWNLOAD)
4747
# Use an option to control if minimum or exact swig should be found.
4848
option(FLAMEGPU_SWIG_EXACT "Require the exact version of SWIG specified in FLAMEGPU_SWIG_MINIMUM. This enables downgrading swig." OFF)

0 commit comments

Comments
 (0)