Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresh CMakeLists.txt #2912

Draft
wants to merge 77 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 76 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
d1d265b
WIP
ich123 Feb 4, 2024
8bb207d
correct headers
ich123 Feb 4, 2024
2e294d4
find neon
ich123 Feb 4, 2024
60254ff
SIMD
ich123 Feb 4, 2024
462e182
use static_assert, not the silly macro
ich123 Feb 4, 2024
30cd3df
SIMD
ich123 Feb 4, 2024
8584073
install targets. This is a copy paste from old script. I don't know i…
ich123 Feb 4, 2024
394d91e
- build python in main CMakeLists.txt file
ich123 Feb 5, 2024
95b9210
disable LTO on python module
ich123 Feb 5, 2024
6d73a19
wip
ich123 Feb 6, 2024
ae5380e
- build unit test in normal CMakeLists.txt file
ich123 Feb 6, 2024
6ff13c0
wip
ich123 Feb 6, 2024
8ec8b1c
wip
ich123 Feb 6, 2024
02f35a0
install blas for now while we try fix the version of blas in external
Feb 6, 2024
2d1fad2
use pkg-config
Feb 7, 2024
f59af43
window runner. don't know why ${{ github.workspace }}/dlib doesn't w…
Feb 7, 2024
2bf1bad
missing blas fortran code
Feb 7, 2024
e65ed6b
missing blas
Feb 7, 2024
404b5c4
mssing blas
Feb 7, 2024
4cba233
missing blas
Feb 7, 2024
284fcbc
deprecated
Feb 7, 2024
cb9c9b3
make it use our own blas
Feb 7, 2024
56b9fe8
replace DLIB_CASSERT with normal throw statement. otherwise, the 2nd …
Feb 8, 2024
9909cbd
- check there is a fortran compiler before trying to enable it. Fixes…
Feb 8, 2024
ccf1356
don't strip on windows.
Feb 8, 2024
2031e45
confusingly, gui_widgets/fonts.cpp doesn't depend on X11
Feb 8, 2024
7cfcfee
use DLIB_NO_ABORT_ON_2ND_FATAL_ERROR
Feb 8, 2024
2c22d8e
build examples
Feb 8, 2024
bddb28e
build examples in CI/CD
Feb 8, 2024
d5427e9
imaglab
Feb 8, 2024
6dcaef6
htmlify
Feb 8, 2024
cde3f07
dtoc
Feb 8, 2024
a41836f
build tools
Feb 8, 2024
5f9066f
- build specific architecture. "native" isn't supported until cmake 3.24
Feb 9, 2024
66bd706
increase template depth on old clang and windows. use generator expre…
Feb 9, 2024
3629aeb
- cmake generator expression helpers
Feb 9, 2024
071f6b0
more blas. never ending blas
Feb 9, 2024
a124862
- GLOBAL IMPORTED target
Feb 9, 2024
da25f35
matlab bindings
Feb 11, 2024
aabf289
fix install
Feb 11, 2024
3291d76
didn't need this after all.
Feb 12, 2024
610e187
matlab build fix? I think RPATH is broken on install
Feb 12, 2024
69970c3
WIP
Feb 13, 2024
d50eb8c
WIP
Feb 13, 2024
dac3aae
so, the fix was not to compile all/source.cpp into a static library a…
Feb 13, 2024
1c22cab
deprecated
Feb 13, 2024
323dbba
- split back into seperate CMakeLists.txt files
Feb 14, 2024
e5e8316
oops
Feb 14, 2024
e06f389
oops
Feb 14, 2024
48a48be
come on
Feb 14, 2024
405dfc0
come on, you can do it
Feb 15, 2024
2fbe9d1
- more message statements so you exactly what's enabled, not just wha…
Feb 15, 2024
8187393
more hand holding
Feb 15, 2024
9d05268
deprecated
Feb 15, 2024
2e20ca2
- compiler specific options
Feb 15, 2024
6d1a04f
more hand holding. Gate stripping on MSVC not WIN32
Feb 15, 2024
f3745b5
add test for MKL and FFMPEG
Feb 15, 2024
83e8c65
Update build_cpp.yml
pfeatherstone Feb 15, 2024
09e0fec
- look for tbb. We might need that soon if the tbb symbols in libmkl_…
Feb 16, 2024
161dbcc
need to find a way to fix RPATH
Feb 17, 2024
b94c983
hack to force dlib to link to libtbb and add its path to RPATH.
Feb 17, 2024
e161f9a
don't set avx, sse or neon flags with nvcc. that upsets old nvcc 11.0…
Feb 17, 2024
bfe8b49
added GNU OMP threading layer. Made TBB layer the default.
Feb 17, 2024
b8c8c4f
- release build by default
Feb 18, 2024
ca676a9
warn about BLAS not found and tell people how to install it.
Feb 18, 2024
26640aa
release_build_by_default smells fishy
Feb 18, 2024
4def070
- added linking to ws2_32 winmm on windows with msvc. Is it required …
Feb 18, 2024
b46be21
try this
Feb 18, 2024
fa3e00d
remove find_library ? just force-link and hope for the best?
Feb 18, 2024
00f8016
more messages when can't find packages
Feb 18, 2024
f7a2a83
- QUIET for finding openmp
Feb 20, 2024
92e11fc
- change the order of the SIMD compiler options. e.g. it's -mavx -mav…
Feb 25, 2024
8bf41d5
- compile with Wno-free-nonheap-object when using gcc [11.3.0, 11.4.0]
Feb 25, 2024
9f1cae8
better
Feb 26, 2024
617b9a8
added runner which tests dlib installation
Feb 29, 2024
ad66b68
make installation work
Mar 2, 2024
60a7461
test dlib installation through pkg-config
Mar 3, 2024
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
176 changes: 125 additions & 51 deletions .github/workflows/build_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ defaults:
working-directory: dlib/test

jobs:
ubuntu-latest-gcc-default-cmake-3-8-ffmpeg5:
ubuntu-latest-gcc-default-cmake-3-17-ffmpeg5:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
Expand All @@ -40,18 +40,18 @@ jobs:
sudo apt update
sudo apt install libwebp-dev make yasm

- name: Cache cmake 3.8.0
- name: Cache cmake 3.17.0
uses: actions/cache@v3
id: cache-cmake-download
with:
# cache this folder:
path: ~/cmake-3.8.0-Linux-x86_64
key: cmake-3.8.0_try3
path: ~/cmake-3.17.0-Linux-x86_64
key: cmake-3.17.0_try1

- run: |
# Get the minimum version of cmake dlib supports
wget https://cmake.org/files/v3.8/cmake-3.8.0-Linux-x86_64.tar.gz
tar -xf cmake-3.8.0-Linux-x86_64.tar.gz -C ~
wget https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz
tar -xf cmake-3.17.0-Linux-x86_64.tar.gz -C ~
if: steps.cache-cmake-download.outputs.cache-hit != 'true'

- name: Cache FFmpeg 5
Expand All @@ -72,24 +72,20 @@ jobs:
make install
cd ..

- name: Configure
run: |
mkdir build
cd build
~/cmake-3.8.0-Linux-x86_64/bin/cmake -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n5.1.3_installation ..
- name: Configure tests
run: ~/cmake-3.17.0-Linux-x86_64/bin/cmake ${{ github.workspace }}/dlib/test -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n5.1.3_installation

- name: Build just tests
run: |
cd build
make -j4 dtest
- name: Build tests
run: ~/cmake-3.17.0-Linux-x86_64/bin/cmake --build build --parallel 4

- name: Test
- name: Run tests
run: build/dtest --runall -q

- name: Build examples, etc
run: |
cd build
make -j2

- name: Configure examples
run: ~/cmake-3.17.0-Linux-x86_64/bin/cmake ${{ github.workspace }}/examples -B build2 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n5.1.3_installation

- name: Build examples
run: ~/cmake-3.17.0-Linux-x86_64/bin/cmake --build build2 --parallel 4

ubuntu-latest-gcc-11-blas:
runs-on: 'ubuntu-latest'
Expand All @@ -104,22 +100,51 @@ jobs:
run: |
sudo apt install gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
- name: Configure
run: cmake ${{ github.workspace }}/dlib/test -B build
- name: Build just tests
run: cmake --build build --config Release --target dtest --parallel 4

- name: Configure tests
run: cmake ${{ github.workspace }}/dlib/test -B build -DCMAKE_BUILD_TYPE=Release

- name: Build tests (including BLAS tests)
run: cmake --build build --parallel 4

- name: Test
run: build/dtest --runall -q
- name: Build examples, etc
run: cmake --build build --config Release --parallel 2

# Test the BLAS bindings
- name: Configure BLAS binding tests
run: cmake ${{ github.workspace }}/dlib/test/blas_bindings -B build_blas_bindings
- name: Build blas binding tests
run: cmake --build build_blas_bindings --config Debug --parallel 4
- name: Test BLAS bindings
run: build_blas_bindings/dtest --runall -q
- name: Configure examples
run: cmake ${{ github.workspace }}/examples -B build2 -DCMAKE_BUILD_TYPE=Release

- name: Build examples
run: cmake --build build2 --parallel 4

ubuntu-latest-ffmpeg-mkl:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt update
sudo apt install libwebp-dev libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev libswresample-dev libswscale-dev libavutil-dev
sudo apt install intel-oneapi-mkl-devel

- name: Configure tests with MKL sequential
run: cmake . -B build -DCMAKE_BUILD_TYPE=Release -DDLIB_USE_MKL_SEQUENTIAL=ON -DDLIB_USE_MKL_WITH_TBB=OFF

- name: Build tests with MKL sequential
run: cmake --build build --target dtest --parallel 4

- name: Test with MKL sequential
run: build/dtest --runall -q

- name: Configure tests with MKL tbb
run: cmake . -B build2 -DCMAKE_BUILD_TYPE=Release -DDLIB_USE_MKL_SEQUENTIAL=OFF -DDLIB_USE_MKL_WITH_TBB=ON

- name: Build tests with MKL tbb
run: cmake --build build2 --target dtest --parallel 4

- name: Test with MKL tbb
run: build2/dtest --runall -q

ubuntu-20_04-gcc-7:
runs-on: 'ubuntu-20.04'
Expand All @@ -129,7 +154,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install libwebp-dev make yasm
sudo apt install libwebp-dev make yasm

- name: Install gcc 7
run: |
Expand All @@ -153,24 +178,27 @@ jobs:
make install
cd ..

- name: Configure
- name: Configure tests
run: |
export CC=/usr/bin/gcc-7
export CXX=/usr/bin/g++-7
cmake ${{ github.workspace }}/dlib/test -B build -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n3.2.18_installation
cmake ${{ github.workspace }}/dlib/test -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n3.2.18_installation

- name: Build just tests
run: cmake --build build --config Release --target dtest --parallel 4
- name: Build tests
run: cmake --build build --parallel 4

- name: Test
run: build/dtest --runall -q

- name: Configure examples
run: cmake ${{ github.workspace }}/examples -B build2 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n3.2.18_installation

- name: Build examples, etc
run: cmake --build build --config Release --parallel 2
- name: Build examples
run: cmake --build build2 --parallel 4

# Test cmake scrips can build standalone dlib as a shared library
- name: Configure dlib as shared library
run: cmake ${{ github.workspace }}/dlib -B build_dlib_shared -DBUILD_SHARED_LIBS=1 -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n3.2.18_installation
run: cmake ${{ github.workspace }}/dlib -B build_dlib_shared -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n3.2.18_installation

- name: Build dlib as shared library
run: cmake --build build_dlib_shared --parallel 4
Expand All @@ -183,17 +211,46 @@ jobs:
run: |
sudo apt update
sudo apt install libwebp-dev libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev libswresample-dev libswscale-dev libavutil-dev
- name: Configure
- name: Configure test
run: |
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
cmake ${{ github.workspace }}/dlib/test -B build -DUSE_AVX_INSTRUCTIONS=1
- name: Build just tests
run: cmake --build build --config Release --target dtest --parallel 4
cmake ${{ github.workspace }}/dlib/test -B build -DCMAKE_BUILD_TYPE=Release -DDLIB_USE_AVX=ON

- name: Build tests
run: cmake --build build --parallel 4

- name: Configure examples
run: cmake ${{ github.workspace }}/examples -B build2 -DCMAKE_BUILD_TYPE=Release -DDLIB_USE_AVX=ON

- name: Build examples
run: cmake --build build2 --parallel 4

- name: Test
run: build/dtest --runall -q
- name: Build examples, etc
run: cmake --build build --config Release --parallel 2

ubuntu-latest-intalled_dlib:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2

- name: Configure library
run: cmake ${{ github.workspace }}/dlib -B build

- name: Build library
run: cmake --build build --parallel 4

- name: Install library
run: cmake --install build --prefix /home/runner/dlib_installation

- name: Configure example
run: cmake ${{ github.workspace }}/tools/test -B build2 -DCMAKE_PREFIX_PATH=/home/runner/dlib_installation

- name: Build example
run: cmake --build build2

- name: Run example
run: build2/assignment_learning_ex

windows-latest:
runs-on: 'windows-latest'
Expand All @@ -204,12 +261,21 @@ jobs:
# don't use CMake 3.25.0 https://gitlab.kitware.com/cmake/cmake/-/issues/23975
pip3 install cmake==3.24.0
cmake . -B build

- name: Build just tests
run: cmake --build build --config Release --target dtest --parallel 4

- name: Test
run: build/Release/dtest.exe --runall -q

- name: Build ancillary tools
run: cmake --build build --config Release --target imglab htmlify dtoc --parallel 4
run: |
cmake ../../tools/imglab -B build_imglab
cmake --build build_imglab --config Release --parallel 4
cmake ../../tools/htmlify -B build_htmlify
cmake --build build_htmlify --config Release --parallel 4
cmake ../../tools/convert_dlib_nets_to_caffe -B build_dtoc
cmake --build build_dtoc --config Release --parallel 4

windows-2019:
runs-on: 'windows-2019'
Expand All @@ -220,10 +286,18 @@ jobs:
# don't use CMake 3.25.0 https://gitlab.kitware.com/cmake/cmake/-/issues/23975
pip3 install cmake==3.24.0
cmake . -B build

- name: Build just tests
run: cmake --build build --config Debug --target dtest --parallel 4
run: cmake --build build --config Debug --parallel 4

- name: Build ancillary tools
run: cmake --build build --config Release --target imglab htmlify dtoc --parallel 4
run: |
cmake ../../tools/imglab -B build_imglab
cmake --build build_imglab --config Release --parallel 4
cmake ../../tools/htmlify -B build_htmlify
cmake --build build_htmlify --config Release --parallel 4
cmake ../../tools/convert_dlib_nets_to_caffe -B build_dtoc
cmake --build build_dtoc --config Release --parallel 4

# Disable this because macos targets aren't working on github actions right now.
#macos-latest:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/build_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ jobs:
uses: matlab-actions/setup-matlab@v1
- name: Compile mex wrappers
run: |
pwd
mkdir build
cd build
cmake ..
cmake --build . --config Release --target install --parallel 4
cmake . -B build
cmake --build build --config Release --parallel 4
cmake --install build --component Matlab --prefix ${{ github.workspace }}/dlib/matlab
- name: Run example script
uses: matlab-actions/run-command@v1
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ docs/docs/python/functions.txt
docs/docs/python/constants.txt
**/.vscode
**/venv
**/.env
Loading
Loading