Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-common
Commits
7b9e8cf0
Commit
7b9e8cf0
authored
3 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[python][cmake] Require Python version 3.6 for the bindings (only) and improve user messages
parent
792d611e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1096
Fix/python bindings python requirements
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/modules/DunePythonCommonMacros.cmake
+34
-5
34 additions, 5 deletions
cmake/modules/DunePythonCommonMacros.cmake
with
34 additions
and
5 deletions
cmake/modules/DunePythonCommonMacros.cmake
+
34
−
5
View file @
7b9e8cf0
...
...
@@ -89,18 +89,47 @@ if(Python3_Interpreter_FOUND)
add_custom_target
(
test_python COMMAND ctest CMD_ARGS -L python
)
add_custom_target
(
install_python
)
# this option enables the build of Python bindings for DUNE modules
##### Python bindings specific part begin ################
# this option enables the build of Python bindings for DUNE modules per default
option
(
DUNE_ENABLE_PYTHONBINDINGS
"Enable Python bindings for DUNE"
ON
)
if
(
DUNE_ENABLE_PYTHONBINDINGS
)
# first we test if all requirements are satisfied, if not, Python bindings are
# disabled and the user gets an informative message explaining why
set
(
DUNE_PB_USER_NOTICE
"If you do not plan to use the Dune Python bindings you can ignore this information"
)
if
(
NOT Python3_Interpreter_FOUND
)
message
(
WARNING
"Python bindings require a Python 3 interpreter"
)
message
(
STATUS
"Python bindings disabled"
)
message
(
NOTICE
" ----------------------------------------------------------------------------------------
\n
"
" Python bindings require a Python 3 interpreter and none was found.
\n
"
"
${
DUNE_PB_USER_NOTICE
}
.
\n
"
" ----------------------------------------------------------------------------------------
\n
"
)
set
(
DUNE_ENABLE_PYTHONBINDINGS OFF
)
return
()
endif
()
if
(
NOT Python3_INCLUDE_DIRS
)
message
(
WARNING
"Found a Python interpreter but the Python bindings also requires the Python "
"libraries (a package named like python-dev package or python3-devel)"
)
message
(
STATUS
"Python bindings disabled"
)
message
(
NOTICE
" ----------------------------------------------------------------------------------------
\n
"
" Found a Python interpreter but the Python bindings also requires the Python libraries (a package named like python-dev package or python3-devel).
\n
"
"
${
DUNE_PB_USER_NOTICE
}
.
\n
"
" ----------------------------------------------------------------------------------------
\n
"
)
set
(
DUNE_ENABLE_PYTHONBINDINGS OFF
)
return
()
endif
()
# the Python bindings currently require the following minimum Python version
set
(
DUNE_PYTHON_BINDINGS_MIN_PYTHON_VERSION 3.6
)
if
(
Python3_VERSION VERSION_LESS
${
DUNE_PYTHON_BINDINGS_MIN_PYTHON_VERSION
}
)
message
(
STATUS
"Python bindings disabled"
)
message
(
NOTICE
" ----------------------------------------------------------------------------------------
\n
"
" Python bindings require at least Python version
${
DUNE_PYTHON_BINDINGS_MIN_PYTHON_VERSION
}
but only version
${
Python3_VERSION
}
was found.
\n
"
"
${
DUNE_PB_USER_NOTICE
}
.
\n
"
" ----------------------------------------------------------------------------------------
\n
"
)
set
(
DUNE_ENABLE_PYTHONBINDINGS OFF
)
return
()
endif
()
...
...
@@ -120,7 +149,7 @@ if(Python3_Interpreter_FOUND)
include
(
DuneAddPybind11Module
)
endif
()
##### Python bindings end ################
# Set up the Dune-internal virtualenv
include
(
DunePythonVirtualenv
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment