Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
121 changes: 52 additions & 69 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,108 +1,91 @@
# GitHub action to build software.
# Linux builds include pre-built dependencies via containers.
# The Linux build uses a pre-built dependency container image.
# The Windows and MacOS builds build dependencies each run.

name: Build
on:
pull_request:

jobs:
ubuntu_20_04_build:
ubuntu_26_04_build:
runs-on: ubuntu-latest
container: ghcr.io/rg2/xreg-deps-ubuntu-20.04:latest
container: ghcr.io/rg2/xreg-deps-ubuntu-26.04:latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: ./.github/workflows/linux_cmake_build
shell: bash
- run: ./dist/ubuntu_dist_pkgs
shell: bash
- run: ./.github/workflows/linux_make_dist ubuntu-20.04
- run: ./.github/workflows/linux_make_dist ubuntu-26.04
shell: bash
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: ubuntu-20.04-build
path: xreg-ubuntu-20.04.tar.gz
name: ubuntu-26.04-build
path: xreg-ubuntu-26.04.tar.gz

ubuntu_18_04_build:
ubuntu_24_04_build:
runs-on: ubuntu-latest
container: ghcr.io/rg2/xreg-deps-ubuntu-18.04:latest
container: ghcr.io/rg2/xreg-deps-ubuntu-24.04:latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: ./.github/workflows/linux_cmake_build
shell: bash
- run: ./dist/ubuntu_dist_pkgs
shell: bash
- run: ./.github/workflows/linux_make_dist ubuntu-18.04
- run: ./.github/workflows/linux_make_dist ubuntu-24.04
shell: bash
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: ubuntu-18.04-build
path: xreg-ubuntu-18.04.tar.gz
name: ubuntu-24.04-build
path: xreg-ubuntu-24.04.tar.gz

ubuntu_16_04_build:
ubuntu_22_04_build:
runs-on: ubuntu-latest
container: ghcr.io/rg2/xreg-deps-ubuntu-16.04:latest
container: ghcr.io/rg2/xreg-deps-ubuntu-22.04:latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: ./.github/workflows/linux_cmake_build
shell: bash
- run: ./dist/ubuntu_dist_pkgs
shell: bash
- run: ./.github/workflows/linux_make_dist ubuntu-16.04
- run: ./.github/workflows/linux_make_dist ubuntu-22.04
shell: bash
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: ubuntu-16.04-build
path: xreg-ubuntu-16.04.tar.gz

centos_7_build:
runs-on: ubuntu-latest
container: ghcr.io/rg2/xreg-deps-centos-7:latest

steps:
- uses: actions/checkout@v2
- run: ./.github/workflows/linux_cmake_build
shell: bash
- run: ./dist/centos_dist_pkgs
shell: bash
- run: ./.github/workflows/linux_make_dist centos-7
shell: bash
- uses: actions/upload-artifact@v2
with:
name: centos-7-build
path: xreg-centos-7.tar.gz

windows_build:
runs-on: windows-2019

steps:
- uses: actions/checkout@v2
- uses: ilammy/msvc-dev-cmd@v1
- run: example_build_script_win.cmd
shell: cmd
- run: .github\workflows\win_make_dist.cmd
shell: cmd
- uses: actions/upload-artifact@v2
with:
name: win-64-build
path: xreg-win64.zip
name: ubuntu-22.04-build
path: xreg-ubuntu-22.04.tar.gz

macos_build:
runs-on: macos-10.15
# windows_build:
# runs-on: windows-2022
#
# steps:
# - uses: actions/checkout@v4
# - uses: ilammy/msvc-dev-cmd@v1
# - run: example_build_script_win.cmd
# shell: cmd
# - run: .github\workflows\win_make_dist.cmd
# shell: cmd
# - uses: actions/upload-artifact@v4
# with:
# name: win-64-build
# path: xreg-win64.zip

steps:
- uses: actions/checkout@v2
- run: brew install ninja
- run: XREG_INSTALL_DIR="$HOME/xreg_install" ./example_build_script_2
shell: bash
- run: mkdir xreg-macos-10.15
- run: python3 ./dist/make_macos_dist.py $HOME/xreg_install xreg-macos-10.15 ../xreg_deps_install
- run: cp LICENSE xreg-macos-10.15 && cp ./dist/dist_readme/README.txt xreg-macos-10.15
- run: tar czf xreg-macos-10.15.tar.gz xreg-macos-10.15
- uses: actions/upload-artifact@v2
with:
name: macos-10.15-build
path: xreg-macos-10.15.tar.gz
# macos_build:
# runs-on: macos-15-intel
#
# steps:
# - uses: actions/checkout@v4
# - run: brew install ninja
# - run: XREG_INSTALL_DIR="$HOME/xreg_install" ./example_build_script_2
# shell: bash
# - run: mkdir xreg-macos-15
# - run: python3 ./dist/make_macos_dist.py $HOME/xreg_install xreg-macos-15 ../xreg_deps_install
# - run: cp LICENSE xreg-macos-15 && cp ./dist/dist_readme/README.txt xreg-macos-15
# - run: tar czf xreg-macos-15.tar.gz xreg-macos-15
# - uses: actions/upload-artifact@v4
# with:
# name: macos-15-build
# path: xreg-macos-15.tar.gz
2 changes: 1 addition & 1 deletion .github/workflows/linux_make_dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ XREG_NAME="xreg-${1}"

mkdir $XREG_NAME

LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64:/opt/tbb/lib/intel64/gcc4.7:$LD_LIBRARY_PATH" \
LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH" \
python3 ./dist/make_linux_dist.py /usr/local $XREG_NAME

cp ./dist/dist_readme/README.txt $XREG_NAME
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})

find_package(OpenCV REQUIRED)

Expand Down
14 changes: 4 additions & 10 deletions docker/Dockerfile.ubuntu_dev_base
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
# This Docker file is used to build an ubuntu image with the necessary
# packages installed to complete an xReg build (along with its dependencies)

ARG os_version=16.04
ARG os_version=26.04

FROM ubuntu:${os_version}

# DEBIAN_FRONTEND=noninteractive is needed to avoid an interactive prompt
# to set the timezone with 20.04 images.
# to set the timezone with images of 20.04 or more recent.

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
ninja-build \
libtbb-dev \
wget \
libssl-dev \
git \
libglew-dev \
libxt-dev && \
rm -rf /var/lib/apt/lists/*

# Build a recent version of cmake
RUN mkdir cmake_build && cd cmake_build && \
wget https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2.tar.gz && \
tar xf cmake-3.18.2.tar.gz && cd cmake-3.18.2 && mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build . && cmake --build . --target install && \
cd / && rm -rf cmake_build

5 changes: 2 additions & 3 deletions docker/Dockerfile.xreg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG os_name=ubuntu

# for ubuntu choose 16.04, 18.04, or 20.04
# for centos choose 7 or 8
ARG os_version=16.04
ARG os_version=26.04

FROM xreg-deps-${os_name}-${os_version}

Expand All @@ -17,9 +17,8 @@ COPY . .
RUN mkdir build && cd build && \
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON \
-DTBB_DIR:PATH="/opt/tbb/cmake" \
-DXREG_USE_LEGACY_FIND_TBB:BOOL=OFF \
.. && \
cmake --build . && cmake --build . --target install && \
cmake --build . --parallel 2 && cmake --build . --target install && \
cd / && rm -rf xreg_build

80 changes: 37 additions & 43 deletions docker/Dockerfile.xreg-deps
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG os_name=ubuntu

# for ubuntu choose 16.04, 18.04, or 20.04
# for centos choose 7 or 8
ARG os_version=16.04
ARG os_version=26.04

# e.g. by running Dockerfile.ubuntu_dev_base or Dockerfile.centos_dev_base
FROM xreg-dev-base-${os_name}-${os_version} as xreg-dev-base-cust-deps
Expand All @@ -21,46 +21,34 @@ RUN mkdir ffmpeg_dl && cd ffmpeg_dl && \
mv ffmpeg-*-amd64-static/ffmpeg /usr/local/bin && \
cd / && rm -rf ffmpeg_dl

# Get a more recent version of TBB than what is probably in the package manager
# At least one that works better w/ CMake
RUN mkdir tbb_dl && cd tbb_dl && \
wget https://github.com/intel/tbb/releases/download/2018_U1/tbb2018_20170919oss_lin.tgz && \
tar xf tbb2018_20170919oss_lin.tgz && \
mv tbb2018_20170919oss /opt && cd /opt && ln -s tbb2018_20170919oss tbb && \
cd / && rm -rf tbb_dl

# building ninja as it is able to build quicker than make
RUN mkdir ninja_build && cd ninja_build && \
wget https://github.com/ninja-build/ninja/archive/v1.10.1.tar.gz && \
tar xf v1.10.1.tar.gz && cd ninja-1.10.1 && mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build . && cmake --build . --target install && \
cd / && rm -rf ninja_build

FROM xreg-dev-base-cust-deps as xreg-deps

WORKDIR /

# bring in boost 1.74 header only
# bring in boost header only
RUN mkdir boost_dl && cd boost_dl && \
wget https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.gz && \
tar xf boost_1_74_0.tar.gz && cd boost_1_74_0 && mv boost /usr/local/include && \
wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.bz2 && \
tar xf boost_1_87_0.tar.bz2 && cd boost_1_87_0 && mv boost /usr/local/include && \
cd / && rm -rf boost_dl

# bring in eigen 3.3.4 header only
# bring in eigen header only, but needs to install cmake files
RUN mkdir eigen_dl && cd eigen_dl && \
wget https://gitlab.com/libeigen/eigen/-/archive/3.3.4/eigen-3.3.4.tar.gz && \
tar xf eigen-3.3.4.tar.gz && cd eigen-3.3.4 && \
mv Eigen /usr/local/include && mv unsupported /usr/local/include && \
mv signature_of_eigen3_matrix_library /usr/local/include && \
wget https://gitlab.com/libeigen/eigen/-/archive/3.4.1/eigen-3.4.1.tar.bz2 && \
tar xf eigen-3.4.1.tar.bz2 && cd eigen-3.4.1 && \
mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX:PATH="/usr/local" \
-DINCLUDE_INSTALL_DIR:PATH="/usr/local/include" \
.. && \
cmake --build . && cmake --build . --target install && \
cd / && rm -rf eigen_dl

# bring in viennacl 1.7.1 header only
# bring in viennacl header only
RUN mkdir viennacl_dl && cd viennacl_dl && \
wget https://github.com/viennacl/viennacl-dev/archive/release-1.7.1.tar.gz && \
tar xf release-1.7.1.tar.gz && cd viennacl-dev-release-1.7.1 && mv viennacl /usr/local/include && \
cd / && rm -rf viennacl_dl

# build format 5.3.0
# build format
RUN mkdir fmt_build && cd fmt_build && \
wget https://github.com/fmtlib/fmt/archive/5.3.0.tar.gz && \
tar xf 5.3.0.tar.gz && cd fmt-5.3.0 && \
Expand All @@ -69,11 +57,12 @@ RUN mkdir fmt_build && cd fmt_build && \
-DCMAKE_CXX_STANDARD:STRING="11" -DFMT_USE_CPP11:BOOL=ON \
-DFMT_TEST:BOOL=OFF -DFMT_INSTALL:BOOL=ON \
-DFMT_DOC:BOOL=OFF \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
.. && \
cmake --build . && cmake --build . --target install && \
cd / && rm -rf fmt_build

# build nlopt 2.5.0
# build nlopt
RUN mkdir nlopt_build && cd nlopt_build && \
wget https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz && \
tar xf v2.5.0.tar.gz && cd nlopt-2.5.0 && \
Expand All @@ -84,55 +73,60 @@ RUN mkdir nlopt_build && cd nlopt_build && \
-DNLOPT_OCTAVE:BOOL=OFF -DNLOPT_MATLAB:BOOL=OFF \
-DNLOPT_GUILE:BOOL=OFF -DNLOPT_SWIG:BOOL=OFF \
-DNLOPT_LINK_PYTHON:BOOL=OFF \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
.. && \
cmake --build . && cmake --build . --target install && \
cd / && rm -rf nlopt_build

# build ITK 5.2.1
# build ITK
RUN mkdir itk_build && cd itk_build && \
wget https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.2.1/InsightToolkit-5.2.1.zip && \
wget https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.2.1/InsightToolkit-5.2.1.tar.gz && \
tar xf InsightToolkit-5.2.1.tar.gz && cd InsightToolkit-5.2.1 && \
mkdir build && cd build && \
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_CXX_STANDARD:STRING="11" \
-DCMAKE_CXX_FLAGS:STRING="-include cstdint" \
-DCMAKE_C_FLAGS:STRING="-std=gnu17" \
-DBUILD_TESTING:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF \
-DITK_USE_GPU:BOOL=OFF -DModule_ITKReview:BOOL=ON \
-DModule_LabelErodeDilate:BOOL=ON \
-DITK_USE_SYSTEM_EIGEN=ON \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
.. && \
cmake --build . && cmake --build . --target install && \
cd / && rm -rf itk_build

# build OpenCV 3.4.12
# build OpenCV
RUN mkdir opencv_build && cd opencv_build && \
wget https://github.com/opencv/opencv/archive/3.4.12.tar.gz && \
tar xf 3.4.12.tar.gz && cd opencv-3.4.12 && \
wget https://github.com/opencv/opencv/archive/refs/tags/4.12.0.tar.gz && \
tar xf 4.12.0.tar.gz && cd opencv-4.12.0 && \
mkdir build && cd build && \
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_CXX_STANDARD:STRING="11" \
-DBUILD_TESTS:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF \
-DBUILD_DOCS:BOOL=OFF -DBUILD_WITH_DEBUG_INFO:BOOL=OFF \
-DWITH_TBB:BOOL=ON -DBUILD_TBB:BOOL=OFF -DTBB_INCLUDE_DIRS:PATH="/opt/tbb/include" \
-DWITH_TBB:BOOL=ON -DBUILD_TBB:BOOL=OFF \
-DWITH_IPP:BOOL=OFF -DWITH_VTK:BOOL=OFF \
-DWITH_CUBLAS:BOOL=OFF -DWITH_CUDA:BOOL=OFF \
-DWITH_CUFFT:BOOL=OFF -DWITH_OPENCL:BOOL=OFF \
-DBUILD_opencv_python2:BOOL=OFF -DBUILD_opencv_python3:BOOL=OFF \
-DWITH_OPENCL:BOOL=OFF \
-DBUILD_opencv_java_bindings_generator:BOOL=OFF \
-DBUILD_opencv_python_tests:BOOL=OFF \
-DBUILD_opencv_python_bindings_generator:BOOL=OFF \
-DBUILD_opencv_highgui:BOOL=OFF -DWITH_GSTREAMER:BOOL=OFF \
.. && \
cmake --build . && cmake --build . --target install && \
cd / && rm -rf opencv_build

# build VTK 8.2.0
# build VTK, note --parallel 2 is used in order to avoid OOM errors
RUN mkdir vtk_build && cd vtk_build && \
wget https://www.vtk.org/files/release/8.2/VTK-8.2.0.tar.gz && \
tar xf VTK-8.2.0.tar.gz && cd VTK-8.2.0 && \
wget https://vtk.org/files/release/9.6/VTK-9.6.2.tar.gz && \
tar xf VTK-9.6.2.tar.gz && cd VTK-9.6.2 && \
mkdir build && cd build && \
TBB_ROOT="/opt/tbb" \
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_CXX_STANDARD:STRING="11" \
-DVTK_Group_Imaging:BOOL=ON -DVTK_Group_Views:BOOL=ON \
-DVTK_GROUP_ENABLE_Imaging=YES -DVTK_GROUP_ENABLE_Views=YES \
-DBUILD_TESTING:BOOL=OFF \
-DVTK_SMP_IMPLEMENTATION_TYPE:STRING="TBB" \
.. && \
cmake --build . && cmake --build . --target install && \
cmake --build . --parallel 2 && cmake --build . --target install && \
cd / && rm -rf vtk_build

Loading
Loading