Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
1b880dfd
Commit
1b880dfd
authored
Jul 26, 2020
by
Henry Schreiner
Committed by
Henry Schreiner
Jul 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci: download EIGEN
parent
9521bc56
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
13 deletions
+41
-13
.github/workflows/ci.yml
+3
-1
tests/CMakeLists.txt
+37
-11
tests/test_embed/CMakeLists.txt
+1
-1
No files found.
.github/workflows/ci.yml
View file @
1b880dfd
...
...
@@ -80,6 +80,7 @@ jobs:
cmake -S . -B build
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=11
-DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
...
...
@@ -101,6 +102,7 @@ jobs:
cmake -S . -B build17
-DPYBIND17_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=17
-DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
...
...
@@ -138,7 +140,7 @@ jobs:
-
uses
:
actions/checkout@v2
-
name
:
Add wget and python3
run
:
apt-get update && apt-get install -y python3-dev python3-numpy python3-pytest
run
:
apt-get update && apt-get install -y python3-dev python3-numpy python3-pytest
libeigen3-dev
-
name
:
Configure
shell
:
bash
...
...
tests/CMakeLists.txt
View file @
1b880dfd
...
...
@@ -97,6 +97,8 @@ set(PYBIND11_CROSS_MODULE_GIL_TESTS
test_gil_scoped.py
)
option
(
DOWNLOAD_EIGEN
"Download EIGEN (requires CMake 3.11+)"
OFF
)
# Check if Eigen is available; if not, remove from PYBIND11_TEST_FILES (but
# keep it in PYBIND11_PYTEST_FILES, so that we get the "eigen is not installed"
# skip message).
...
...
@@ -105,18 +107,42 @@ if(PYBIND11_TEST_FILES_EIGEN_I GREATER -1)
# Try loading via newer Eigen's Eigen3Config first (bypassing tools/FindEigen3.cmake).
# Eigen 3.3.1+ exports a cmake 3.0+ target for handling dependency requirements, but also
# produces a fatal error if loaded from a pre-3.0 cmake.
if
(
NOT CMAKE_VERSION VERSION_LESS 3.0
)
find_package
(
Eigen3 3.2.7 QUIET CONFIG
)
if
(
EIGEN3_FOUND
)
if
(
EIGEN3_VERSION_STRING AND NOT EIGEN3_VERSION_STRING VERSION_LESS 3.3.1
)
set
(
PYBIND11_EIGEN_VIA_TARGET 1
)
if
(
DOWNLOAD_EIGEN
)
if
(
CMAKE_VERSION VERSION_LESS 3.11
)
message
(
FATAL_ERROR
"CMake 3.11+ required when using DOWNLOAD_EIGEN"
)
endif
()
set
(
EIGEN3_VERSION_STRING
"3.3.7"
)
include
(
FetchContent
)
FetchContent_Declare
(
eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG
${
EIGEN3_VERSION_STRING
}
)
FetchContent_GetProperties
(
eigen
)
if
(
NOT eigen_POPULATED
)
message
(
STATUS
"Downloading Eigen"
)
FetchContent_Populate
(
eigen
)
endif
()
set
(
EIGEN3_INCLUDE_DIR
${
eigen_SOURCE_DIR
}
)
set
(
EIGEN3_FOUND TRUE
)
else
()
if
(
NOT CMAKE_VERSION VERSION_LESS 3.0
)
find_package
(
Eigen3 3.2.7 QUIET CONFIG
)
if
(
EIGEN3_FOUND
)
if
(
EIGEN3_VERSION_STRING AND NOT EIGEN3_VERSION_STRING VERSION_LESS 3.3.1
)
set
(
PYBIND11_EIGEN_VIA_TARGET TRUE
)
endif
()
endif
()
endif
()
endif
(
)
if
(
NOT EIGEN3_FOUND
)
# Couldn't load via target, so fall back to allowing module mode finding, which will pick up
# tools/FindEigen3.cmake
find_package
(
Eigen3 3.2.7 QUIET
)
if
(
NOT EIGEN3_FOUND
)
# Couldn't load via target, so fall back to allowing module mode finding, which will pick up
# tools/FindEigen3.cmake
find_package
(
Eigen3 3.2.7 QUIET
)
endif
(
)
endif
()
if
(
EIGEN3_FOUND
)
...
...
@@ -129,7 +155,7 @@ if(PYBIND11_TEST_FILES_EIGEN_I GREATER -1)
message
(
STATUS
"Building tests with Eigen v
${
EIGEN3_VERSION
}
"
)
else
()
list
(
REMOVE_AT PYBIND11_TEST_FILES
${
PYBIND11_TEST_FILES_EIGEN_I
}
)
message
(
STATUS
"Building tests WITHOUT Eigen"
)
message
(
STATUS
"Building tests WITHOUT Eigen
, use -DDOWNLOAD_EIGEN on CMake 3.11+ to download
"
)
endif
()
endif
()
...
...
tests/test_embed/CMakeLists.txt
View file @
1b880dfd
...
...
@@ -9,7 +9,7 @@ if(CATCH_FOUND)
message
(
STATUS
"Building interpreter tests using Catch v
${
CATCH_VERSION
}
"
)
else
()
message
(
STATUS
"Catch not detected. Interpreter tests will be skipped. Install Catch headers"
" manually or use `cmake -DDOWNLOAD_CATCH=
1
` to fetch them automatically."
)
" manually or use `cmake -DDOWNLOAD_CATCH=
ON
` to fetch them automatically."
)
return
()
endif
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment