Skip to content

Commit 0bf153c

Browse files
authored
Merge pull request #168 from lrineau/fix-lastools-cmake-4.0
fix builds of LASTools with CMake-4.0
2 parents 6237adb + f099a99 commit 0bf153c

File tree

12 files changed

+184
-304
lines changed

12 files changed

+184
-304
lines changed

ArchLinux/Dockerfile

+5-12
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ ENV DOCKERFILE_URL=$dockerfile_url
77
# ipe: freetype2, lua, poppler, python3, zlib
88
# leda-free: tcsh
99
# and clean up the package cache
10-
RUN pacman --noconfirm -Syu archlinux-keyring
10+
RUN pacman-key --init && pacman --noconfirm -Syu archlinux-keyring
1111
RUN pacman -Syu --noconfirm && pacman -S --needed --noconfirm \
1212
base-devel \
13+
patch \
1314
coreutils \
1415
git \
1516
lsb-release \
@@ -68,17 +69,9 @@ RUN pacman -U --noconfirm *.pkg.tar.zst && \
6869

6970
RUN pacman -Sy --noconfirm unzip wget && pacman -Scc
7071

71-
RUN wget https://github.com/LAStools/LAStools/archive/refs/heads/master.zip \
72-
&& unzip master.zip \
73-
&& cd LAStools-master \
74-
&& mkdir build \
75-
&& cd build \
76-
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
77-
&& make -j "$(nproc)" \
78-
&& make install \
79-
&& cd .. \
80-
&& rm -rf LAStools-master master.zip
81-
72+
# Copy and run the script to install LAStools
73+
COPY --from=root install_lastools.sh LAStools.patch /tmp/
74+
RUN chmod +x /tmp/install_lastools.sh && bash /tmp/install_lastools.sh
8275

8376
# LEDA includes are in a nonstandard location (/usr/include/LEDA/LEDA/...
8477
# instead of just /usr/include/LEDA/...) in Stephan Friedrich's AUR package,

Fedora-rawhide/Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ RUN dnf -y upgrade && \
2828
json-devel \
2929
tar && \
3030
dnf clean all && \
31-
wget https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.8.0.tar.gz && \
32-
tar xf v2021.8.0.tar.gz && \
31+
wget https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2022.0.0.tar.gz && \
32+
tar xf v2022.0.0.tar.gz && \
3333
mkdir build && \
3434
cd build && \
35-
sed -i '1i #include <cstdlib>' /oneTBB-2021.8.0/test/common/utils_assert.h && \
36-
cmake -DCMAKE_BUILD_TYPE=Release -DTBB_STRICT:BOOL=OFF -DTBB_TEST:BOOL=OFF ../oneTBB-2021.8.0 && \
35+
sed -i '1i #include <cstdlib>' /oneTBB-2022.0.0/test/common/utils_assert.h && \
36+
cmake -DCMAKE_BUILD_TYPE=Release -DTBB_STRICT:BOOL=OFF -DTBB_TEST:BOOL=OFF ../oneTBB-2022.0.0 && \
3737
make && \
3838
make install && \
39-
cd .. && rm -rf v2021.8.0.tar.gz oneTBB-2021.8.0 build
39+
cd .. && rm -rf v2022.0.0.tar.gz oneTBB-2022.0.0 build
4040

4141
ENV CGAL_TEST_PLATFORM="Fedora-rawhide"
4242
ENV CGAL_SUMMARY_NAME="Fedora-testing-Debug"

Fedora/Dockerfile

+4-12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ENV DOCKERFILE_URL=$dockerfile_url
55
RUN dnf -y update; dnf clean all
66
RUN dnf -y install \
77
boost-devel.x86_64 \
8+
patch \
89
cmake \
910
eigen3-devel.noarch \
1011
gcc-c++ \
@@ -37,18 +38,9 @@ RUN dnf -y install \
3738
lsb-release \
3839
json-devel
3940

40-
RUN wget https://github.com/LAStools/LAStools/archive/refs/heads/master.zip \
41-
&& unzip master.zip \
42-
&& cd LAStools-master \
43-
&& mkdir build \
44-
&& cd build \
45-
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
46-
&& make -j "$(nproc)" \
47-
&& make install \
48-
&& cd .. \
49-
&& rm -rf LAStools-master master.zip
50-
51-
41+
# Copy and run the script to install LAStools
42+
COPY --from=root install_lastools.sh LAStools.patch /tmp/
43+
RUN chmod +x /tmp/install_lastools.sh && bash /tmp/install_lastools.sh
5244

5345
ENV CGAL_TEST_PLATFORM="Fedora"
5446
ENV CGAL_SUMMARY_NAME="Fedora-latest-Debug"

LAStools.patch

Whitespace-only changes.

Makefile

+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
.PHONY: all archlinux debian-stable debian-testing fedora fedora-32 fedora-rawhide ubuntu \
2+
dockerbuild dockerbuildandtest \
3+
archlinux-cxx14 archlinux-cxx17-release archlinux-clang archlinux-clang-cxx14 \
4+
archlinux-clang-cxx17-release archlinux-clang-cxx20-release archlinux-clang-release \
5+
debian-stable-release debian-stable-cross-compilation-for-arm \
6+
debian-testing-clang-main \
7+
fedora-with-leda fedora-release fedora-strict-ansi \
8+
fedora-32-release \
9+
fedora-rawhide-release \
10+
ubuntu-cxx11 ubuntu-no-deprecated-code ubuntu-no-gmp-no-leda ubuntu-gcc6 \
11+
ubuntu-gcc6-cxx1z ubuntu-gcc6-release ubuntu-gcc_master_cxx20-release
12+
13+
all: archlinux archlinux-cxx14 archlinux-cxx17-release archlinux-clang archlinux-clang-cxx14 \
14+
archlinux-clang-cxx17-release archlinux-clang-cxx20-release archlinux-clang-release \
15+
debian-stable debian-stable-release debian-stable-cross-compilation-for-arm \
16+
debian-testing debian-testing-clang-main \
17+
fedora fedora-with-leda fedora-release fedora-strict-ansi \
18+
fedora-32 fedora-32-release \
19+
fedora-rawhide fedora-rawhide-release \
20+
ubuntu ubuntu-cxx11 ubuntu-no-deprecated-code ubuntu-no-gmp-no-leda ubuntu-gcc6 \
21+
ubuntu-gcc6-cxx1z ubuntu-gcc6-release ubuntu-gcc_master_cxx20-release
22+
23+
archlinux:
24+
$(MAKE) dockerbuildandtest TARGET=archlinux DIR=ArchLinux
25+
26+
archlinux-cxx14: archlinux
27+
$(MAKE) dockerbuildandtest TARGET=archlinux-cxx14 DIR=ArchLinux-CXX14
28+
29+
archlinux-cxx17-release: archlinux
30+
$(MAKE) dockerbuildandtest TARGET=archlinux-cxx17-release DIR=ArchLinux-CXX17-Release
31+
32+
archlinux-clang: archlinux
33+
$(MAKE) dockerbuildandtest TARGET=archlinux-clang DIR=ArchLinux-clang
34+
35+
archlinux-clang-cxx14: archlinux-clang
36+
$(MAKE) dockerbuildandtest TARGET=archlinux-clang-cxx14 DIR=ArchLinux-clang-CXX14
37+
38+
archlinux-clang-cxx17-release: archlinux-clang
39+
$(MAKE) dockerbuildandtest TARGET=archlinux-clang-cxx17-release DIR=ArchLinux-clang-CXX17-Release
40+
41+
archlinux-clang-cxx20-release: archlinux-clang
42+
$(MAKE) dockerbuildandtest TARGET=archlinux-clang-cxx20-release DIR=ArchLinux-clang-CXX20-Release
43+
44+
archlinux-clang-release: archlinux-clang
45+
$(MAKE) dockerbuildandtest TARGET=archlinux-clang-release DIR=ArchLinux-clang-Release
46+
47+
debian-stable:
48+
$(MAKE) dockerbuildandtest TARGET=debian-stable DIR=Debian-stable
49+
50+
debian-stable-release: debian-stable
51+
$(MAKE) dockerbuildandtest TARGET=debian-stable-release DIR=Debian-stable-Release
52+
53+
debian-stable-cross-compilation-for-arm: debian-stable
54+
$(MAKE) dockerbuildandtest TARGET=debian-stable-cross-compilation-for-arm DIR=Debian-stable-cross-compilation-for-arm
55+
56+
debian-testing:
57+
$(MAKE) dockerbuildandtest TARGET=debian-testing DIR=Debian-testing
58+
59+
debian-testing-clang-main: debian-testing
60+
$(MAKE) dockerbuildandtest TARGET=debian-testing-clang-main DIR=Debian-testing-clang-main
61+
62+
fedora:
63+
$(MAKE) dockerbuildandtest TARGET=fedora DIR=Fedora
64+
65+
fedora-with-leda: fedora
66+
$(MAKE) dockerbuildandtest TARGET=fedora-with-leda DIR=Fedora-with-LEDA
67+
68+
fedora-release: fedora
69+
$(MAKE) dockerbuildandtest TARGET=fedora-release DIR=Fedora-Release
70+
71+
fedora-strict-ansi: fedora
72+
$(MAKE) dockerbuildandtest TARGET=fedora-strict-ansi DIR=Fedora-strict-ansi
73+
74+
fedora-32:
75+
$(MAKE) dockerbuildandtest TARGET=fedora-32 DIR=Fedora-32
76+
77+
fedora-32-release: fedora-32
78+
$(MAKE) dockerbuildandtest TARGET=fedora-32-release DIR=Fedora-32-Release
79+
80+
fedora-rawhide:
81+
$(MAKE) dockerbuildandtest TARGET=fedora-rawhide DIR=Fedora-rawhide
82+
83+
fedora-rawhide-release: fedora-rawhide
84+
$(MAKE) dockerbuildandtest TARGET=fedora-rawhide-release DIR=Fedora-rawhide-Release
85+
86+
ubuntu:
87+
$(MAKE) dockerbuildandtest TARGET=ubuntu DIR=Ubuntu
88+
89+
ubuntu-cxx11: ubuntu
90+
$(MAKE) dockerbuildandtest TARGET=ubuntu-cxx11 DIR=Ubuntu-CXX11
91+
92+
ubuntu-no-deprecated-code: ubuntu
93+
$(MAKE) dockerbuildandtest TARGET=ubuntu-no-deprecated-code DIR=Ubuntu-NO_DEPRECATED_CODE
94+
95+
ubuntu-no-gmp-no-leda: ubuntu
96+
$(MAKE) dockerbuildandtest TARGET=ubuntu-no-gmp-no-leda DIR=Ubuntu-no-gmp-no-leda
97+
98+
ubuntu-gcc6: ubuntu
99+
$(MAKE) dockerbuildandtest TARGET=ubuntu-gcc6 DIR=Ubuntu-GCC6
100+
101+
ubuntu-gcc6-cxx1z: ubuntu-gcc6
102+
$(MAKE) dockerbuildandtest TARGET=ubuntu-gcc6-cxx1z DIR=Ubuntu-GCC6-CXX1Z
103+
104+
ubuntu-gcc6-release: ubuntu-gcc6
105+
$(MAKE) dockerbuildandtest TARGET=ubuntu-gcc6-release DIR=Ubuntu-GCC6-Release
106+
107+
ubuntu-gcc_master_cxx20-release: ubuntu-gcc6
108+
$(MAKE) dockerbuildandtest TARGET=ubuntu-gcc_master_cxx20-release DIR=Ubuntu-GCC_master_cpp20-Release
109+
110+
download_cgal:
111+
@CGAL_TARBALL=$$(curl -s https://api.github.com/repos/CGAL/cgal/releases/latest | jq -r .tarball_url); \
112+
echo "::group::Download and extract CGAL tarball from $$CGAL_TARBALL"; \
113+
curl -o cgal.tar.gz -L "$$CGAL_TARBALL";
114+
mkdir -p cgal;
115+
tar -xzf cgal.tar.gz -C cgal --strip-components=1;
116+
if command -v selinuxenabled >/dev/null && selinuxenabled; then \
117+
chcon -Rt container_file_t cgal; \
118+
fi;
119+
@echo '::endgroup::'
120+
121+
dockerbuild:
122+
if [ -n "$$GITHUB_SHA" ]; then \
123+
COMMIT_URL=https://github.com/$${GITHUB_REPOSITORY}/blob/$${GITHUB_SHA}; \
124+
fi; \
125+
if [ -z "$$COMMIT_URL" ]; then \
126+
docker build --build-context root=. -t cgal/testsuite-docker:$(TARGET) ./$(DIR); \
127+
else \
128+
docker build --build-context root=. --build-arg dockerfile_url=$${COMMIT_URL}/$(DIR)/Dockerfile -t cgal/testsuite-docker:$(TARGET) ./$(DIR); \
129+
fi
130+
131+
dockerbuildandtest: dockerbuild download_cgal
132+
@echo "::group::Build image $(TARGET) from $(DIR)/Dockerfile";
133+
$(MAKE) dockerbuild TARGET=$(TARGET) DIR=$(DIR);
134+
@echo '::endgroup::';
135+
@echo "::group::Display third-party libraries of $(TARGET)";
136+
docker run --rm -v $$(pwd)/cgal:/cgal cgal/testsuite-docker:$(TARGET) cmake -S /cgal -B /build -DCGAL_TEST_SUITE=ON
137+
@echo "::endgroup::"
138+
@echo "::group::Test image $(TARGET)";
139+
docker run --rm -v $$(pwd)/cgal:/cgal cgal/testsuite-docker:$(TARGET) bash -c 'cmake -DWITH_examples=ON -S /cgal -B /build && cmake --build /build -t terrain -v';
140+
@echo '::endgroup::'

Ubuntu-clang-latest/Dockerfile

+4-14
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ ENV DOCKERFILE_URL=$dockerfile_url
55

66
#install the necessary packages
77
RUN apt-get update \
8-
&& apt-get install -y python \
9-
&& apt-get install -y subversion \
10-
&& apt-get install unzip \
11-
&& apt-get install wget \
8+
&& apt-get install -y python subversion patch unzip wget \
129
&& apt-get clean -y \
1310
&& cd /tmp \
1411
&& svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm \
@@ -21,16 +18,9 @@ RUN apt-get update \
2118
&& make -j"$(nproc)" install \
2219
&& cd /tmp && rm -rf build llvm
2320

24-
RUN wget https://github.com/LAStools/LAStools/archive/refs/heads/master.zip \
25-
&& unzip master.zip \
26-
&& cd LAStools-master \
27-
&& mkdir build \
28-
&& cd build \
29-
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
30-
&& make -j "$(nproc)" \
31-
&& make install \
32-
&& cd .. \
33-
&& rm -rf LAStools-master master.zip
21+
# Copy and run the script to install LAStools
22+
COPY --from=root install_lastools.sh LAStools.patch /tmp/
23+
RUN chmod +x /tmp/install_lastools.sh && bash /tmp/install_lastools.sh
3424

3525
ENV CGAL_TEST_PLATFORM="Ubuntu-clang-latest"
3626
ENV CXX=/usr/local/bin/clang++

install_lastools.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Download and install LAStools
6+
wget https://github.com/LAStools/LAStools/archive/refs/heads/master.zip
7+
unzip master.zip
8+
cd LAStools-master
9+
10+
dir=$(dirname $0)
11+
patch -p1 < "${dir}/LAStools.patch"
12+
13+
mkdir build
14+
cd build
15+
cmake -DCMAKE_BUILD_TYPE=Release ..
16+
make -j "$(nproc)" VERBOSE=1
17+
make install
18+
cd ../..
19+
rm -rf LAStools-master master.zip

test.sh

+7-66
Original file line numberDiff line numberDiff line change
@@ -4,89 +4,30 @@ set -e
44

55
[ -n "$ACTIONS_RUNNER_DEBUG" ] && set -x
66

7-
CGAL_TARBALL=$(curl -s https://api.github.com/repos/CGAL/cgal/releases/latest | jq -r .tarball_url)
8-
echo "::group::Download and extract CGAL tarball from $CGAL_TARBALL"
9-
curl -o cgal.tar.gz -L "$CGAL_TARBALL"
10-
mkdir -p cgal
11-
tar -xzf cgal.tar.gz -C cgal --strip-components=1
12-
if command -v selinuxenabled >/dev/null && selinuxenabled; then
13-
chcon -Rt container_file_t cgal
14-
fi
15-
echo '::endgroup::'
16-
17-
echo "::group::Install docker-py"
18-
if command -v python3 >/dev/null; then
19-
python3 -m pip install docker
20-
fi
21-
echo '::endgroup::'
22-
237
if [ -n "$GITHUB_SHA" ]; then
248
COMMIT_URL=https://github.com/${GITHUB_REPOSITORY}/blob/${GITHUB_SHA}
259
fi
2610

27-
function dockerbuild() {
28-
if [ -z "$COMMIT_URL" ]; then
29-
docker build -t cgal/testsuite-docker:$1 ./$2
30-
else
31-
docker build --build-arg dockerfile_url=${COMMIT_URL}/$2/Dockerfile -t cgal/testsuite-docker:$1 ./$2
32-
fi
33-
}
34-
35-
function dockerbuildandtest() {
36-
echo "::group::Build image $1 from $2/Dockerfile"
37-
dockerbuild $1 $2
38-
echo '::endgroup::'
39-
40-
echo "::group::Test image $1"
41-
docker run --rm -v $PWD/cgal:/cgal cgal/testsuite-docker:$1 bash -c 'cmake -DWITH_examples=ON -S /cgal -B /build && cmake --build /build -t terrain -v'
42-
if command -v python3 >/dev/null; then
43-
python3 ./test_container/test_container.py --image cgal/testsuite-docker:$1 --cgal-dir $PWD/cgal ${DOCKER_HOST:+--docker-url "${DOCKER_HOST}"}
44-
fi
45-
echo '::endgroup::'
46-
}
47-
4811
if [ "$1" = ArchLinux ]
4912
then
50-
dockerbuildandtest archlinux ArchLinux
51-
dockerbuildandtest archlinux-cxx14 ArchLinux-CXX14
52-
dockerbuildandtest archlinux-cxx17-release ArchLinux-CXX17-Release
53-
dockerbuildandtest archlinux-clang ArchLinux-clang
54-
dockerbuildandtest archlinux-clang-cxx14 ArchLinux-clang-CXX14
55-
dockerbuildandtest archlinux-clang-cxx17-release ArchLinux-clang-CXX17-Release
56-
dockerbuildandtest archlinux-clang-cxx20-release ArchLinux-clang-CXX20-Release
57-
dockerbuildandtest archlinux-clang-release ArchLinux-clang-Release
13+
make -j "$(nproc)" --output-sync=target archlinux archlinux-cxx14 archlinux-cxx17-release archlinux-clang archlinux-clang-cxx14 archlinux-clang-cxx17-release archlinux-clang-cxx20-release archlinux-clang-release
5814
elif [ "$1" = Debian-stable ]
5915
then
60-
dockerbuildandtest debian-stable Debian-stable
61-
dockerbuildandtest debian-stable-release Debian-stable-Release
62-
dockerbuildandtest debian-stable-cross-compilation-for-arm Debian-stable-cross-compilation-for-arm
16+
make -j "$(nproc)" --output-sync=target debian-stable debian-stable-release debian-stable-cross-compilation-for-arm
6317
elif [ "$1" = Debian-testing ]
6418
then
65-
dockerbuildandtest debian-testing Debian-testing
66-
dockerbuildandtest debian-testing-clang-main Debian-testing-clang-main
19+
make -j "$(nproc)" --output-sync=target debian-testing debian-testing-clang-main
6720
elif [ "$1" = Fedora ]
6821
then
69-
dockerbuildandtest fedora Fedora
70-
dockerbuildandtest fedora-with-leda Fedora-with-LEDA
71-
dockerbuildandtest fedora-release Fedora-Release
72-
dockerbuildandtest fedora-strict-ansi Fedora-strict-ansi
22+
make -j "$(nproc)" --output-sync=target fedora fedora-with-leda fedora-release fedora-strict-ansi
7323
elif [ "$1" = Fedora-32 ]
7424
then
75-
dockerbuildandtest fedora-32 Fedora-32
76-
dockerbuildandtest fedora-32-release Fedora-32-Release
25+
make -j "$(nproc)" --output-sync=target fedora-32 fedora-32-release
7726
elif [ "$1" = Fedora-rawhide ]
7827
then
79-
dockerbuildandtest fedora-rawhide Fedora-rawhide
80-
dockerbuildandtest fedora-rawhide-release Fedora-rawhide-Release
28+
make -j "$(nproc)" --output-sync=target fedora-rawhide fedora-rawhide-release
8129
elif [ "$1" = Ubuntu ]
8230
then
83-
dockerbuildandtest ubuntu Ubuntu
84-
dockerbuildandtest ubuntu-cxx11 Ubuntu-CXX11
85-
dockerbuildandtest ubuntu-no-deprecated-code Ubuntu-NO_DEPRECATED_CODE
86-
dockerbuildandtest ubuntu-no-gmp-no-leda Ubuntu-no-gmp-no-leda
87-
dockerbuildandtest ubuntu-gcc6 Ubuntu-GCC6
88-
dockerbuildandtest ubuntu-gcc6-cxx1z Ubuntu-GCC6-CXX1Z
89-
dockerbuildandtest ubuntu-gcc6-release Ubuntu-GCC6-Release
90-
dockerbuildandtest ubuntu-gcc_master_cxx20-release Ubuntu-GCC_master_cpp20-Release
31+
make -j "$(nproc)" --output-sync=target ubuntu ubuntu-cxx11 ubuntu-no-deprecated-code ubuntu-no-gmp-no-leda ubuntu-gcc6 ubuntu-gcc6-cxx1z ubuntu-gcc6-release ubuntu-gcc_master_cxx20-release
9132
fi
9233
docker images

0 commit comments

Comments
 (0)