Skip to content

Commit

Permalink
Merge pull request #2 from feelpp/1-modernize-cmake
Browse files Browse the repository at this point in the history
modernize cmake #1
  • Loading branch information
prudhomm authored Jul 8, 2023
2 parents 1fb632f + 8aef276 commit ce3a8d4
Show file tree
Hide file tree
Showing 11 changed files with 372 additions and 167 deletions.
1 change: 1 addition & 0 deletions .github/workflows/generate_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
with:
working-directory: './doxygen'
- name: gen doc
if: github.repository == 'bab2min/EigenRand'
run: |
export EIGENRAND_VER=${GITHUB_REF##*/}
mkdir -p ../g
Expand Down
161 changes: 73 additions & 88 deletions .github/workflows/pull_request_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,190 +8,175 @@ on:
jobs:
build_linux:
name: Build for linux
if: "!contains(github.event.head_commit.message, '[skip linux]')"
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
max-parallel: 4
fail-fast: false
matrix:
arch: [DEIGEN_DONT_VECTORIZE, msse2, mssse3, mavx, mavx2]
eigenversion: [3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8, 3.3.9, 3.4.0]
os: [ubuntu-18.04]
os: [ubuntu-22.04]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
submodules: true
- name: Install dependencies
run: |
git clone https://gitlab.com/libeigen/eigen
pushd eigen
git checkout tags/${{ matrix.eigenversion }}
popd
mv eigen include
git clone https://github.com/google/googletest
pushd googletest
git checkout v1.8.x
popd
- name: Build
continue-on-error: true
run: |
export EIGEN_PATH=`pwd`/include
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DEIGENRAND_CXX_FLAGS="-${{ matrix.arch }} -I${EIGEN_PATH}" ../
make
- name: Test
cmake --preset default -DEIGENRAND_CXX_FLAGS="-${{ matrix.arch }}"
cmake --build --preset default
ctest --preset default -N
- name: Tests
run: |
./build/test/EigenRand-test
- name: Run Accuracy
run: |
./build/EigenRand-accuracy
ctest --preset default -R test
ctest --preset default -R accuracy
build_linux_avx512:
name: Build for linux AVX512
if: "!contains(github.event.head_commit.message, '[skip avx]')"
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
max-parallel: 4
matrix:
arch: [mavx512dq]
eigenversion: [3.4.0]
os: [ubuntu-18.04]
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
submodules: true
- name: Install dependencies
run: |
git clone https://gitlab.com/libeigen/eigen
pushd eigen
git checkout tags/${{ matrix.eigenversion }}
popd
mv eigen include
git clone https://github.com/google/googletest
pushd googletest
git checkout v1.8.x
popd
- name: Build
continue-on-error: true
run: |
export EIGEN_PATH=`pwd`/include
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DEIGENRAND_CXX_FLAGS="-${{ matrix.arch }} -mavx512f -mfma -I${EIGEN_PATH}" ../
make
- name: Test
run: |
./build/test/EigenRand-test
- name: Run Accuracy
cmake --preset default -DEIGENRAND_CXX_FLAGS="-${{ matrix.arch }}"
cmake --build --preset default
ctest --preset default -N
- name: Tests
run: |
./build/EigenRand-accuracy
ctest --preset default -R test
ctest --preset default -R accuracy
build_macos:
name: Build for macOS
runs-on: macOS-10.15
if: "!contains(github.event.head_commit.message, '[skip macos]')"
runs-on: macOS-latest
continue-on-error: true
strategy:
max-parallel: 4
matrix:
arch: [DEIGEN_DONT_VECTORIZE, msse2, mssse3, mavx]
eigenversion: [3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8, 3.3.9, 3.4.0]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
submodules: true
- name: Install dependencies
run: |
wget https://gitlab.com/libeigen/eigen/-/archive/${{ matrix.eigenversion }}/eigen-${{ matrix.eigenversion }}.tar.gz
tar -zxvf eigen-${{ matrix.eigenversion }}.tar.gz
mv eigen-${{ matrix.eigenversion }} include
git clone https://github.com/google/googletest
pushd googletest
git checkout v1.8.x
popd
- name: Build
continue-on-error: true
run: |
export EIGEN_PATH=`pwd`/include
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DEIGENRAND_CXX_FLAGS="-${{ matrix.arch }} -I${EIGEN_PATH}" ../
make
- name: Test
run: |
./build/test/EigenRand-test
- name: Run Accuracy
cmake --preset default -DEIGENRAND_CXX_FLAGS="-${{ matrix.arch }}"
cmake --build --preset default
ctest --preset default -N
- name: Tests
run: |
./build/EigenRand-accuracy
ctest --preset default -R test
ctest --preset default -R accuracy
build_windows:
name: Build for Windows
runs-on: windows-2019
if: "!contains(github.event.head_commit.message, '[skip windows]')"
runs-on: windows-latest
continue-on-error: true
strategy:
max-parallel: 4
matrix:
arch: ['/D EIGEN_DONT_VECTORIZE', '/arch:SSE2', '/arch:AVX', '/arch:AVX2']
eigenversion: [3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8, 3.3.9, 3.4.0]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
submodules: true
- name: Install dependencies
run: |
Invoke-WebRequest -OutFile eigen.tar.gz https://gitlab.com/libeigen/eigen/-/archive/${{ matrix.eigenversion }}/eigen-${{ matrix.eigenversion }}.tar.gz
tar -zxvf eigen.tar.gz
mv eigen-${{ matrix.eigenversion }} include
echo "EIGEN_PATH=$(Get-Location)\include" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
git clone https://github.com/google/googletest
pushd googletest
git checkout v1.8.x
popd
- name: Build
continue-on-error: true
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeBuildType: Release
buildWithCMake: true
cmakeAppendedArgs: -G"Visual Studio 16 2019" -Ax64 -DEIGENRAND_CXX_FLAGS="${{ matrix.arch }} /I${{ env.EIGEN_PATH }}"
buildWithCMakeArgs: --config Release
buildDirectory: build
- name: Test
run: |
.\build\test\Release\EigenRand-test.exe
- name: Run Accuracy
run: |
.\build\Release\EigenRand-accuracy.exe
run: |
cmake --preset windows -DEIGENRAND_CXX_FLAGS="${{ matrix.arch }}"
cmake --build --preset windows
ctest --preset windows -N
- name: Tests
run: |
ctest --preset windows -R test
ctest --preset windows -R accuracy
build_windows_avx512:
name: Build for Windows
runs-on: windows-2019
if: "!contains(github.event.head_commit.message, '[skip windows-avx]')"
runs-on: windows-latest
continue-on-error: true
strategy:
max-parallel: 4
matrix:
arch: ['/arch:AVX512']
arch: ['/arch:AVX512 /bigobj']
eigenversion: [3.4.0]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
submodules: true
- name: Install dependencies
run: |
Invoke-WebRequest -OutFile eigen.tar.gz https://gitlab.com/libeigen/eigen/-/archive/${{ matrix.eigenversion }}/eigen-${{ matrix.eigenversion }}.tar.gz
tar -zxvf eigen.tar.gz
mv eigen-${{ matrix.eigenversion }} include
echo "EIGEN_PATH=$(Get-Location)\include" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
git clone https://github.com/google/googletest
pushd googletest
git checkout v1.8.x
popd
- name: Build
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeBuildType: Release
buildWithCMake: true
cmakeAppendedArgs: -G"Visual Studio 16 2019" -Ax64 -DEIGENRAND_CXX_FLAGS="${{ matrix.arch }} /I${{ env.EIGEN_PATH }}"
buildWithCMakeArgs: --config Release
buildDirectory: build
- name: Test
run: |
.\build\test\Release\EigenRand-test.exe
- name: Run Accuracy
run: |
.\build\Release\EigenRand-accuracy.exe
continue-on-error: true
run: |
cmake --preset windows -DEIGENRAND_CXX_FLAGS="${{ matrix.arch }}"
cmake --build --preset windows
ctest --preset windows -N
- name: Tests
run: |
ctest --preset windows -R test
ctest --preset windows -R accuracy
reference:
name: Reference
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
os: [ubuntu-18.04, macOS-10.15, windows-2019]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python3
uses: actions/setup-python@v1
with:
Expand Down
25 changes: 11 additions & 14 deletions .github/workflows/pull_request_test_non_x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,22 @@ on:
jobs:
build_macos_aarch64:
name: Build for macOS aarch64
runs-on: macOS-11
if: "!contains(github.event.head_commit.message, '[skip macos-aarch64]')"
runs-on: macOS-latest
strategy:
max-parallel: 4
matrix:
arch: [DEIGEN_DONT_VECTORIZE, DDUMMY]
eigenversion: [3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8, 3.3.9, 3.4.0]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
submodules: true
- name: Install dependencies
run: |
wget https://gitlab.com/libeigen/eigen/-/archive/${{ matrix.eigenversion }}/eigen-${{ matrix.eigenversion }}.tar.gz
tar -zxvf eigen-${{ matrix.eigenversion }}.tar.gz
mv eigen-${{ matrix.eigenversion }} include
git clone https://github.com/google/googletest
pushd googletest
git checkout v1.8.x
popd
- name: Build
run: |
export EIGEN_PATH=`pwd`/include
Expand All @@ -40,15 +39,17 @@ jobs:

build-arm64:
name: Build for Arm64-Centos7
runs-on: ubuntu-18.04
if: "!contains(github.event.head_commit.message, '[skip arm64]')"
runs-on: ubuntu-22.04
continue-on-error: true
strategy:
max-parallel: 4
matrix:
arch: [DEIGEN_DONT_VECTORIZE, march=native]
eigenversion: [3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8, 3.3.9, 3.4.0]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
submodules: true
- uses: bab2min/run-on-arch-action@use-custom-image
Expand All @@ -65,14 +66,10 @@ jobs:
pushd eigen
git checkout tags/${{ matrix.eigenversion }}
popd
git clone https://github.com/google/googletest
pushd googletest
git checkout v1.8.x
popd
mv eigen include
export EIGEN_PATH=`pwd`/include
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DEIGENRAND_CXX_FLAGS="-${{ matrix.arch }} -I${EIGEN_PATH}" ../
make
./test/EigenRand-test
./EigenRand-accuracy 256
ctest -R test
ctest -R accuracy
Loading

0 comments on commit ce3a8d4

Please sign in to comment.