Skip to content

Commit

Permalink
Merge branch 'port/cmake' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
HuguesDelorme committed Feb 29, 2024
2 parents 7445a2e + d598c95 commit 6f63313
Show file tree
Hide file tree
Showing 35 changed files with 1,038 additions and 232 deletions.
39 changes: 11 additions & 28 deletions .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,50 +28,33 @@ jobs:
- name: Install OpenCascade
run: |
sudo apt-get -y install libocct-data-exchange-dev libocct-draw-dev
GH_CASCADE_INC_DIR=`dpkg -L libocct-foundation-dev | grep -i "Standard_Version.hxx" | sed "s/\/Standard_Version.hxx//i"`
GH_CASCADE_LIB_DIR=`dpkg -L libocct-foundation-dev | grep -i "libTKernel.so" | sed "s/\/libTKernel.so//i"`
echo "GH_CASCADE_INC_DIR=$GH_CASCADE_INC_DIR" >> $GITHUB_ENV
echo "GH_CASCADE_LIB_DIR=$GH_CASCADE_LIB_DIR" >> $GITHUB_ENV
sudo apt-get -y install libocct-data-exchange-dev libocct-draw-dev occt-misc
sudo apt-get -y install libtbb2-dev
sudo apt-get -y install libxi-dev
- name: Install Assimp
run: |
sudo apt-get -y install libassimp-dev
GH_ASSIMP_INC_DIR=`dpkg -L libassimp-dev | grep -i "version.h" | sed "s/\/version.h//i"`
GH_ASSIMP_LIB_DIR=`dpkg -L libassimp-dev | grep -i "libassimp.so" | sed "s/\/libassimp.so//i"`
echo "GH_ASSIMP_INC_DIR=$GH_ASSIMP_INC_DIR" >> $GITHUB_ENV
echo "GH_ASSIMP_LIB_DIR=$GH_ASSIMP_LIB_DIR" >> $GITHUB_ENV
- name: Get count of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Build
run: |
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
echo CASCADE_INC_DIR=${{env.GH_CASCADE_INC_DIR}}
echo CASCADE_LIB_DIR=${{env.GH_CASCADE_LIB_DIR}}
echo ASSIMP_INC_DIR=${{env.GH_ASSIMP_INC_DIR}}
echo ASSIMP_LIB_DIR=${{env.GH_ASSIMP_LIB_DIR}}
[ ! -d $CASCADE_INC_DIR ] && echo "ERROR: OpenCascade include dir doesn't exist"
[ ! -d $CASCADE_LIB_DIR ] && echo "ERROR: OpenCascade lib dir doesn't exist"
[ ! -d $ASSIMP_INC_DIR ] && echo "ERROR: assimp include dir doesn't exist"
[ ! -d $ASSIMP_LIB_DIR ] && echo "ERROR: assimp lib dir doesn't exist"
qmake .. CONFIG+=withtests \
CASCADE_INC_DIR=${{env.GH_CASCADE_INC_DIR}} \
CASCADE_LIB_DIR=${{env.GH_CASCADE_LIB_DIR}} \
ASSIMP_INC_DIR=${{env.GH_ASSIMP_INC_DIR}} \
ASSIMP_LIB_DIR=${{env.GH_ASSIMP_LIB_DIR}}
make -j${{steps.cpu-cores.outputs.count}}
cmake --version
cmake .. \
-DMayo_BuildTests=ON \
-DMayo_BuildPluginAssimp=ON
cmake --build . \
--config Release \
--parallel `nproc`
- name: Execute Unit Tests
working-directory: ${{github.workspace}}/build
env:
DISPLAY: :0
run: |
# Install french locale for testing case
echo "fr_FR ISO-8859-1" | sudo tee -a /etc/locale.gen
echo "fr_FR ISO-8859-15" | sudo tee -a /etc/locale.gen
sudo locale-gen
localectl list-locales
# Start X11 display server
Expand Down
107 changes: 70 additions & 37 deletions .github/workflows/ci_linux_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ jobs:
build-linux-arm:
strategy:
matrix:
arch: [armv7, aarch64]
include:
- arch: aarch64
distro: ubuntu_latest
- arch: aarch64
distro: fedora_latest
- arch: armv7
distro: archarm_latest


runs-on: ubuntu-latest

Expand All @@ -21,61 +28,87 @@ jobs:
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{matrix.arch}}
distro: ubuntu22.04
distro: ${{matrix.distro}}
githubToken: ${{github.token}} # Not required, but speeds up builds
install: |
apt-get -y update
apt-get -y install xvfb # Needed to run unit tests
apt-get -y install git
apt-get -y install g++
apt-get -y install qtbase5-dev libqt5svg5-dev
apt-get -y install libxcb-cursor0 # Dependencies for "xcb" Qt plugin(actually needed for Qt6)
apt-get -y install libocct-data-exchange-dev libocct-draw-dev
apt-get -y install libassimp-dev
case "${{ matrix.distro }}" in
ubuntu*)
apt-get -y update
apt-get -y install xvfb # Needed to run unit tests
apt-get -y install cmake
apt-get -y install git
apt-get -y install g++
apt-get -y install qtbase5-dev libqt5svg5-dev
apt-get -y install libxcb-cursor0 # Dependencies for "xcb" Qt plugin(actually needed for Qt6)
apt-get -y install libocct-data-exchange-dev libocct-draw-dev occt-misc
apt-get -y install libtbb2-dev libxi-dev # Dependencies for OpenCascade v7.5
apt-get -y install libassimp-dev
;;
fedora*)
dnf -y update
dnf -y install xorg-x11-server-Xvfb
dnf -y install make cmake
dnf -y install git
dnf -y install gcc-c++
dnf -y install qt5-qtbase qt5-qtsvg
dnf -y install xcb-util-cursor
dnf -y install opencascade-devel
dnf -y install assimp assimp-devel
;;
archarm*)
# See https://github.com/moby/buildkit/issues/1267#issuecomment-769880570
sed -i -e 's~#IgnorePkg.*~IgnorePkg = filesystem~g' '/etc/pacman.conf'
pacman -Syu --noconfirm
pacman -Sy --noconfirm xorg-server-xvfb
pacman -Sy --noconfirm make cmake
pacman -Sy --noconfirm git
pacman -Sy --noconfirm gcc
pacman -Sy --noconfirm qt5-base qt5-svg
pacman -Sy --noconfirm xcb-util-cursor
pacman -Sy --noconfirm opencascade
pacman -Sy --noconfirm libxi
pacman -Sy --noconfirm assimp
;;
esac
env: |
DISPLAY: :0
GIT_BRANCH_NAME: ${{env.BRANCH_NAME}}
RUN_ARCH_NAME: ${{matrix.arch}}
run: |
GH_CASCADE_INC_DIR=`dpkg -L libocct-foundation-dev | grep -i "Standard_Version.hxx" | sed "s/\/Standard_Version.hxx//i"`
GH_CASCADE_LIB_DIR=`dpkg -L libocct-foundation-dev | grep -i "libTKernel.so" | sed "s/\/libTKernel.so//i"`
GH_ASSIMP_INC_DIR=`dpkg -L libassimp-dev | grep -i "version.h" | sed "s/\/version.h//i"`
GH_ASSIMP_LIB_DIR=`dpkg -L libassimp-dev | grep -i "libassimp.so" | sed "s/\/libassimp.so//i"`
git clone https://github.com/fougue/mayo.git
git clone --quiet https://github.com/fougue/mayo.git
cd mayo
# Fixes "fatal: detected dubious ownership in repository at '/home/runner/work/mayo/mayo'"
git config --global --add safe.directory `realpath $PWD/..`
echo GIT_BRANCH_NAME=$GIT_BRANCH_NAME
git checkout $GIT_BRANCH_NAME
cd ..
mkdir build-mayo
cd build-mayo
echo GH_CASCADE_INC_DIR=$GH_CASCADE_INC_DIR
echo GH_CASCADE_LIB_DIR=$GH_CASCADE_LIB_DIR
echo GH_ASSIMP_INC_DIR=$GH_ASSIMP_INC_DIR
echo GH_ASSIMP_LIB_DIR=$GH_ASSIMP_LIB_DIR
[ ! -d $GH_CASCADE_INC_DIR ] && echo "ERROR: OpenCascade include dir doesn't exist"
[ ! -d $GH_CASCADE_LIB_DIR ] && echo "ERROR: OpenCascade lib dir doesn't exist"
[ ! -d $GH_ASSIMP_INC_DIR ] && echo "ERROR: assimp include dir doesn't exist"
[ ! -d $GH_ASSIMP_LIB_DIR ] && echo "ERROR: assimp lib dir doesn't exist"
qmake ../mayo \
CONFIG+=debug \
CONFIG+=withtests \
CASCADE_INC_DIR=$GH_CASCADE_INC_DIR \
CASCADE_LIB_DIR=$GH_CASCADE_LIB_DIR \
ASSIMP_INC_DIR=$GH_ASSIMP_INC_DIR \
ASSIMP_LIB_DIR=$GH_ASSIMP_LIB_DIR
make -j`nproc`
mkdir build
cd build
cmake --version
cmake .. \
-DMayo_BuildTests=ON \
-DMayo_BuildPluginAssimp=ON
cmake --build . \
--config Release \
--parallel `nproc`
#
# Execute Unit Tests
# Note: for some unknown reason unit tests are crashing for armv7(on very first test)
# so just execute them for aarch64
#
if [ $RUN_ARCH_NAME = 'aarch64' ]; then
# Start X11 display server
Xvfb $DISPLAY -screen 0 1280x1024x24 &
sleep 5s
./mayo --runtests
# Start X11 display server
Xvfb $DISPLAY -screen 0 1280x1024x24 &
sleep 5s
./mayo --runtests
else
echo "NOTE: unit tests skipped, they need to be fixed for this architecture"
fi
27 changes: 7 additions & 20 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@ jobs:
- name: Install OpenCascade
run: |
brew install opencascade
GH_CASCADE_BASE_DIR=`brew info opencascade | grep -E -i --only-matching --max-count=1 "^(/[a-z\.\-_0-9]+)+"`
echo "GH_CASCADE_INC_DIR=$GH_CASCADE_BASE_DIR/include/opencascade" >> $GITHUB_ENV
echo "GH_CASCADE_LIB_DIR=$GH_CASCADE_BASE_DIR/lib" >> $GITHUB_ENV
- name: Install Assimp
run: |
brew install assimp
GH_ASSIMP_BASE_DIR=`brew info assimp | grep -E -i --only-matching --max-count=1 "^(/[a-z\.\-_0-9]+)+"`
echo "GH_ASSIMP_INC_DIR=$GH_ASSIMP_BASE_DIR/include/assimp" >> $GITHUB_ENV
echo "GH_ASSIMP_LIB_DIR=$GH_ASSIMP_BASE_DIR/lib" >> $GITHUB_ENV
- name: Get count of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
Expand All @@ -38,20 +32,13 @@ jobs:
run: |
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
echo CASCADE_INC_DIR=${{env.GH_CASCADE_INC_DIR}}
echo CASCADE_LIB_DIR=${{env.GH_CASCADE_LIB_DIR}}
echo ASSIMP_INC_DIR=${{env.GH_ASSIMP_INC_DIR}}
echo ASSIMP_LIB_DIR=${{env.GH_ASSIMP_LIB_DIR}}
[ ! -d $CASCADE_INC_DIR ] && echo "ERROR: OpenCascade include dir doesn't exist"
[ ! -d $CASCADE_LIB_DIR ] && echo "ERROR: OpenCascade lib dir doesn't exist"
[ ! -d $ASSIMP_INC_DIR ] && echo "ERROR: assimp include dir doesn't exist"
[ ! -d $ASSIMP_LIB_DIR ] && echo "ERROR: assimp lib dir doesn't exist"
qmake .. CONFIG+=withtests \
CASCADE_INC_DIR=${{env.GH_CASCADE_INC_DIR}} \
CASCADE_LIB_DIR=${{env.GH_CASCADE_LIB_DIR}} \
ASSIMP_INC_DIR=${{env.GH_ASSIMP_INC_DIR}} \
ASSIMP_LIB_DIR=${{env.GH_ASSIMP_LIB_DIR}}
make -j${{steps.cpu-cores.outputs.count}}
cmake --version
cmake .. \
-DMayo_BuildTests=ON \
-DMayo_BuildPluginAssimp=ON
cmake --build . \
--config Release \
--parallel ${{steps.cpu-cores.outputs.count}}
- name: Execute Unit Tests
working-directory: ${{github.workspace}}/build
Expand Down
36 changes: 13 additions & 23 deletions .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
occ_zip_sha256: 'beb30920efe5e5384d500d43dcb8ba1f476a76bb65b268b1af32d807b697bdee'

runs-on: windows-latest
name: build-win-msvc-occt${{matrix.occ_version}}

steps:
- name: Checkout
Expand Down Expand Up @@ -66,38 +67,27 @@ jobs:
- name: Extract Assimp
run: 7z x assimp-5.3.1.zip

- name: Download jom.exe
uses: carlosperate/download-file-action@v2
with:
file-url: 'https://www.fougue.pro/share/bin/jom.exe'
sha256: '700943516856c15675212bbcecc4e3d7580514456f8b6f09d634e98e25296ad4'

- name: Get count of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores

- name: Create Build folder
run: mkdir ${{github.workspace}}/build

- name: Configure Compiler
uses: ilammy/msvc-dev-cmd@v1

- name: QMake
working-directory: ${{github.workspace}}/build
- name: Build
shell: cmd
run: |
call ..\OpenCASCADE-${{matrix.occ_version}}-vc14-64\opencascade-${{matrix.occ_version}}\env.bat
echo CSF_OCCTIncludePath=%CSF_OCCTIncludePath%
echo CSF_OCCTLibPath=%CSF_OCCTLibPath%
qmake --version
qmake ..\mayo.pro CONFIG+=release CONFIG+=withtests ^
ASSIMP_INC_DIR=${{github.workspace}}/assimp-5.3.1/include/assimp ^
ASSIMP_LIB_DIR=${{github.workspace}}/assimp-5.3.1/lib ^
ASSIMP_LIBNAME_SUFFIX=-vc143-mt
- name: Build
working-directory: ${{github.workspace}}/build
run: ..\jom.exe -j${{steps.cpu-cores.outputs.count}}
mkdir ${{github.workspace}}\build
cd ${{github.workspace}}\build
cmake --version
cmake .. ^
-DMayo_BuildTests=ON ^
-DMayo_BuildPluginAssimp=ON ^
-DOpenCASCADE_DIR=../OpenCASCADE-${{matrix.occ_version}}-vc14-64/opencascade-${{matrix.occ_version}} ^
-Dassimp_DIR=${{github.workspace}}/assimp-5.3.1/lib/cmake/assimp-5.3
cmake --build . ^
--config Release ^
--parallel ${{steps.cpu-cores.outputs.count}}
- name: Execute Unit Tests
working-directory: ${{github.workspace}}/build
Expand Down
Loading

0 comments on commit 6f63313

Please sign in to comment.