Skip to content

Commit

Permalink
Use git to download Eigen library
Browse files Browse the repository at this point in the history
Also, upgrade Eigen library to 3.3.*
  • Loading branch information
onurulgen committed Feb 22, 2024
1 parent 1c99a7a commit a560060
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
REPORT_PR_CHANGES_ONLY: false
run: |
analysis_file="analysis.txt"
cppcheck_params="--enable=warning --check-level=exhaustive --inline-suppr --suppress=internalError --suppress=internalAstError --suppress=*:*third-party/eigen3/*"
cppcheck_params="--enable=warning --check-level=exhaustive --inline-suppr --suppress=internalError --suppress=internalAstError --suppress=*:*third-party/eigen/*"
cppcheck -j4 $cppcheck_params --project=$(pwd)/build/compile_commands.json --output-file=$analysis_file
# Since cppcheck does not support OpenCL and CUDA, we need to check these files separately
find $(pwd)/reg-lib/cl/. -name "*.cl" -print0 | while IFS= read -r -d '' file; do cppcheck "$file" $cppcheck_params --language=c++ 2>> $analysis_file; done
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ include_directories(${CMAKE_SOURCE_DIR}/reg-lib/cpu)
include_directories(${CMAKE_SOURCE_DIR}/reg-io)
include_directories(${CMAKE_SOURCE_DIR}/third-party)
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_BINARY_DIR}/third-party/eigen3)
include_directories(${CMAKE_BINARY_DIR}/third-party/eigen)
#-----------------------------------------------------------------------------
if(USE_OPENCL)
# Find the OpenCL package
Expand Down
2 changes: 1 addition & 1 deletion niftyreg_build_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
415
416
27 changes: 10 additions & 17 deletions third-party/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
#-----------------------------------------------------------------------------
# Eigen version 3.3.3 - 67e894c6cd8f
if(NOT EXISTS ${CMAKE_BINARY_DIR}/third-party/eigen3)
# Eigen version 3.3.*
if(NOT EXISTS ${CMAKE_BINARY_DIR}/third-party/eigen)
message(STATUS "Cloning Eigen...")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar x ${CMAKE_SOURCE_DIR}/third-party/eigen_3.3.3.tar.gz
COMMAND git clone -q -b 3.3 https://gitlab.com/libeigen/eigen.git
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/third-party
RESULT_VARIABLE result
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E rename
${CMAKE_BINARY_DIR}/third-party/eigen-eigen-67e894c6cd8f
${CMAKE_BINARY_DIR}/third-party/eigen3
)
message(STATUS "Eigen3 files are copied in ${CMAKE_BINARY_DIR}/third-party/eigen3")
endif(NOT EXISTS ${CMAKE_BINARY_DIR}/third-party/eigen3)
#-----------------------------------------------------------------------------
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj" )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /wd4127 /wd4505 /wd4714")
string(REGEX REPLACE "/W[0-9]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()
if(result)
message(FATAL_ERROR "Failed to clone Eigen!")
endif(result)
message(STATUS "Eigen is cloned into ${CMAKE_BINARY_DIR}/third-party/eigen")
endif(NOT EXISTS ${CMAKE_BINARY_DIR}/third-party/eigen)
#-----------------------------------------------------------------------------
if(OPENMP_FOUND)
if(USE_OPENMP)
Expand Down
Binary file removed third-party/eigen_3.3.3.tar.gz
Binary file not shown.

0 comments on commit a560060

Please sign in to comment.