@@ -9,14 +9,12 @@ python -m pip install mpi4py setuptools # pyprecice is installed by the tutorial
99sudo apt-get -y install swig
1010
1111# Get SU2 7.5.1 from GitHub
12- wget --quiet https://github.com/su2code/SU2/archive/refs/tags/v7.5.1.tar.gz
13- tar -xzf v7.5.1.tar.gz
14- rm -fv v7.5.1.tar.gz
12+ git clone --depth=1 --branch=v7.5.1 --recurse-submodules https://github.com/su2code/SU2.git
1513
1614# Add SU2 and the SU2 adapter to PATH and apply.
1715# We first export to a separate script, so that we can load it here (non-interactive shell).
1816{
19- echo " export SU2_HOME=\"\$ {HOME}/SU2-7.5.1 \" "
17+ echo " export SU2_HOME=\"\$ {HOME}/SU2\" "
2018 echo " export SU2_RUN=\"\$ {SU2_HOME}/SU2_CFD\" "
2119 echo " export PATH=\"\$ {SU2_RUN}/bin/:\$ {HOME}/su2-adapter/run/:\$ {PATH}\" "
2220 echo " export PYTHONPATH=\"\$ {SU2_RUN}/bin/:\$ {PYTHONPATH}\" "
4240
4341 # Add a previously implied header (compatibility with Ubuntu 24.04)
4442 sed -i ' 1s/^/#include <cstdint>\n/' SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp
43+ sed -i ' 1s/^/#include <cstdint>\n/' SU2_CFD/src/SU2_CFD.cpp
4544
46- ./meson.py build -Denable-pywrapper=true --prefix=" ${SU2_RUN} " && \
45+ # Replace pipes with shlex in Ninja configure (compatibility with Ubuntu 26.04 and Python >= 3.13)
46+ # See https://github.com/ninja-build/ninja/commit/9cf13cd1ecb7ae649394f4133d121a01e191560b
47+ sed -i ' s/pipes/shlex/g' externals/ninja/configure.py
48+
49+ # Disable CGNS with -Denable-cgns=false. Workaround for:
50+ # default: FAILED: externals/cgns/libcgns.a.p/adf_ADF_internals.c.o
51+ # default: cc -Iexternals/cgns/libcgns.a.p -Iexternals/cgns -I../externals/cgns -Iexternals/cgns/hdf5 -I../externals/cgns/hdf5 -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -std=c99 -O3 -fPIC -Wno-unused-result -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable -Wno-sign-compare -Wno-error=unused-function -Wno-pedantic -Wno-error=stringop-truncation -Wno-stringop-truncation -Wno-error=absolute-value -Wno-error=class-memaccess -MD -MQ externals/cgns/libcgns.a.p/adf_ADF_internals.c.o -MF externals/cgns/libcgns.a.p/adf_ADF_internals.c.o.d -o externals/cgns/libcgns.a.p/adf_ADF_internals.c.o -c ../externals/cgns/adf/ADF_internals.c
52+ # default: ../externals/cgns/adf/ADF_internals.c: In function ‘ADFI_open_file’:
53+ # default: ../externals/cgns/adf/ADF_internals.c:194:17: error: implicit declaration of function ‘fileno’ [-Wimplicit-function-declaration]
54+ # default: 194 | # define FILENO fileno
55+ # default: | ^~~~~~
56+ # default: ../externals/cgns/adf/ADF_internals.c:5531:32: note: in expansion of macro ‘FILENO’
57+ # default: 5531 | f_ret = ftmp == NULL ? -1 : FILENO(ftmp);
58+ # default: | ^~~~~~
59+ #
60+ # Also set -Denable-tecio=false, as it is not needed, to save space.
61+ ./meson.py build -Denable-pywrapper=true -Denable-cgns=false -Denable-tecio=false --prefix=" ${SU2_RUN} " && \
4762 ./ninja -C build install
4863)
4964
5065# Remove the libSU2Core.a library to save space (approx. 500MB)
51- rm -fv ~ /SU2-7.5.1 /SU2_CFD/obj/libSU2Core.a
66+ rm -fv ~ /SU2/SU2_CFD/obj/libSU2Core.a
5267
5368deactivate
0 commit comments