Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
waves
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
Aerospace and Mechanical Engineering
waves
Commits
e8343fea
Commit
e8343fea
authored
5 years ago
by
acrovato
Browse files
Options
Downloads
Patches
Plain Diff
Add Eigen version check to Cmake
parent
7ad50d31
No related branches found
No related tags found
1 merge request
!52
Feature eigen
Pipeline
#1105
passed
5 years ago
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMake/FindEIGEN.cmake
+46
-3
46 additions, 3 deletions
CMake/FindEIGEN.cmake
CMake/msys2.cmake
+0
-1
0 additions, 1 deletion
CMake/msys2.cmake
tbox/src/CMakeLists.txt
+1
-1
1 addition, 1 deletion
tbox/src/CMakeLists.txt
with
47 additions
and
5 deletions
CMake/FindEIGEN.cmake
+
46
−
3
View file @
e8343fea
...
...
@@ -12,11 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# FindEIGEN.cmake - try to find Eigen headers
# FindEIGEN.cmake - try to find Eigen 3 headers
# The logic that checks the version comes from FindEigen3.cmake (source dir)
# ----------------------------------------------------------------------------
# output:
# EIGEN_FOUND : TRUE/FALSE
# EIGEN_INCLUDE_DIRS : where the Eigen/*.h are [cached]
# EIGEN_VERSION : version number of Eigen
# ----------------------------------------------------------------------------
# autodetection:
# utiliser "CMAKE_PREFIX_PATH=c:\local"
...
...
@@ -24,12 +26,53 @@
# ou "INCLUDE=c:\local\include"
# ----------------------------------------------------------------------------
# Check version (only for Eigen 3)
macro
(
_eigen3_check_version
)
file
(
READ
"
${
EIGEN_INCLUDE_DIRS
}
/Eigen/src/Core/util/Macros.h"
_eigen3_version_header
)
string
(
REGEX MATCH
"define[
\t
]+EIGEN_WORLD_VERSION[
\t
]+([0-9]+)"
_eigen3_world_version_match
"
${
_eigen3_version_header
}
"
)
set
(
EIGEN_WORLD_VERSION
"
${
CMAKE_MATCH_1
}
"
)
string
(
REGEX MATCH
"define[
\t
]+EIGEN_MAJOR_VERSION[
\t
]+([0-9]+)"
_eigen3_major_version_match
"
${
_eigen3_version_header
}
"
)
set
(
EIGEN_MAJOR_VERSION
"
${
CMAKE_MATCH_1
}
"
)
string
(
REGEX MATCH
"define[
\t
]+EIGEN_MINOR_VERSION[
\t
]+([0-9]+)"
_eigen3_minor_version_match
"
${
_eigen3_version_header
}
"
)
set
(
EIGEN_MINOR_VERSION
"
${
CMAKE_MATCH_1
}
"
)
set
(
EIGEN_VERSION
${
EIGEN_WORLD_VERSION
}
.
${
EIGEN_MAJOR_VERSION
}
.
${
EIGEN_MINOR_VERSION
}
)
if
(
${
EIGEN_VERSION
}
VERSION_LESS
${
EIGEN_FIND_VERSION
}
)
message
(
FATAL_ERROR
"Eigen version
${
EIGEN_VERSION
}
found in
${
EIGEN_INCLUDE_DIRS
}
, but at least version
${
EIGEN_FIND_VERSION
}
is required!"
)
endif
()
endmacro
()
# Set a dummy version if not provided
if
(
NOT EIGEN_FIND_VERSION
)
if
(
NOT EIGEN_FIND_VERSION_MAJOR
)
set
(
EIGEN_FIND_VERSION_MAJOR 3
)
endif
()
if
(
NOT EIGEN_FIND_VERSION_MINOR
)
set
(
EIGEN_FIND_VERSION_MINOR 3
)
endif
()
if
(
NOT EIGEN_FIND_VERSION_PATCH
)
set
(
EIGEN_FIND_VERSION_PATCH 4
)
endif
()
set
(
EIGEN_FIND_VERSION
"
${
EIGEN_FIND_VERSION_MAJOR
}
.
${
EIGEN_FIND_VERSION_MINOR
}
.
${
EIGEN_FIND_VERSION_PATCH
}
"
)
endif
()
# Find the header and check the version
find_path
(
EIGEN_INCLUDE_DIRS
"Eigen/Dense"
PATHS
"/usr/include/eigen3"
)
if
(
EIGEN_INCLUDE_DIRS
)
_eigen3_check_version
()
else
()
message
(
FATAL_ERROR
"Eigen3 headers not found! Define the path in the INCLUDE environment variable."
)
endif
()
# handle the QUIETLY and REQUIRED arguments and set EIGEN_FOUND to TRUE
# if all listed variables are TRUE
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
EIGEN DEFAULT_MSG
EIGEN_INCLUDE_DIRS
)
find_package_handle_standard_args
(
EIGEN
FOUND_VAR EIGEN_FOUND
REQUIRED_VARS EIGEN_INCLUDE_DIRS
VERSION_VAR EIGEN_VERSION
)
#MESSAGE(STATUS "EIGEN_FOUND = ${EIGEN_FOUND}")
This diff is collapsed.
Click to expand it.
CMake/msys2.cmake
+
0
−
1
View file @
e8343fea
...
...
@@ -17,4 +17,3 @@
SET
(
CMAKE_GENERATOR
"MSYS Makefiles"
CACHE INTERNAL
""
FORCE
)
SET
(
WAVES_USE_MKL OFF CACHE BOOL
""
FORCE
)
SET
(
WAVES_USE_MUMPS OFF CACHE BOOL
""
FORCE
)
INCLUDE
(
disable-trilinos
)
This diff is collapsed.
Click to expand it.
tbox/src/CMakeLists.txt
+
1
−
1
View file @
e8343fea
...
...
@@ -69,7 +69,7 @@ ELSE()
ENDIF
()
# -- Eigen --
FIND_PACKAGE
(
EIGEN REQUIRED
)
FIND_PACKAGE
(
EIGEN
3.3.4
REQUIRED
)
TARGET_INCLUDE_DIRECTORIES
(
tbox PUBLIC
${
EIGEN_INCLUDE_DIRS
}
${
LAPACK_INCLUDE_DIRS
}
)
TARGET_COMPILE_DEFINITIONS
(
tbox PUBLIC EIGEN_DONT_PARALLELIZE
)
IF
(
FOUND_MKL
)
...
...
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