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

System eigen #357

Closed
dzenanz opened this issue Jan 1, 2019 · 4 comments
Closed

System eigen #357

dzenanz opened this issue Jan 1, 2019 · 4 comments
Assignees

Comments

@dzenanz
Copy link
Member

dzenanz commented Jan 1, 2019

A project which builds against ITK with system Eigen fails with c:\misc\bluequartz\sdk-rwdi\itk-src\modules\core\common\include\itkSymmetricEigenAnalysis.h(22): fatal error C1083: Cannot open include file: 'itk_eigen.h': No such file or directory (compiling source file C:\Misc\BlueQuartz\DREAM3D_Plugins\ITKImageProcessing\ITKImageProcessingFilters\ITKImageReader.cpp). The ITK is also built without default modules.

@phcerdan
Copy link
Contributor

phcerdan commented Jan 2, 2019

Thanks @dzenanz. Is that a clean build after eigen3 was introduced? The folder with itk_eigen.h should be included using system eigen3. If still failing I will have a look first thing in a couple of days.

@skn123
Copy link

skn123 commented Jan 26, 2019

Please reopen this
CMake Error at CMake/ITKModuleMacros.cmake:468 (add_library):
Target "ITKCommon" links to target "Eigen3::Eigen" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
Call Stack (most recent call first):
Modules/Core/Common/src/CMakeLists.txt:179 (itk_module_add_library)

@skn123
Copy link

skn123 commented Jan 26, 2019

[100%] Linking CXX executable ../../../../bin/itkTestDriver
/usr/bin/ld: cannot find -lEigen3::Eigen
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Modules/Core/TestKernel/src/CMakeFiles/itkTestDriver.dir/build.make:153: recipe for target 'bin/itkTestDriver' failed
make[2]: *** [bin/itkTestDriver] Error 1
CMakeFiles/Makefile2:15640: recipe for target 'Modules/Core/TestKernel/src/CMakeFiles/itkTestDriver.dir/all' failed
make[1]: *** [Modules/Core/TestKernel/src/CMakeFiles/itkTestDriver.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

Setting this line solved the issue:

if(ITK_USE_SYSTEM_EIGEN)
set(_eigen_itk_target) <-------
else()
set(_eigen_itk_target ITKInternalEigen3::Eigen)
endif()

Remove that Eigen3::Eigen

@thewtex thewtex reopened this Jan 26, 2019
@phcerdan
Copy link
Contributor

There is a find_package(Eigen3) in that file in the case of ITK_USE_SYSTEM_EIGEN. Not sure why is not called by other internal modules...

Your problem can be solved adding an extra file: itk-module-init.cmake in the module:

if(ITK_USE_SYSTEM_EIGEN)
  find_package(Eigen3 REQUIRED CONFIG)
endif()

I am going to update Eigen to the latest release (3.7) and check if they have solved the annoying gcc shadowed warnings. If that's the case, we could re-think on changing ITKCommon to only depends on ITKEigen3 at compile time, instead of publicly.

phcerdan added a commit to phcerdan/ITK that referenced this issue Jan 27, 2019
To handle missing call of find_package by other modules

Fix InsightSoftwareConsortium#357
phcerdan added a commit to phcerdan/ITK that referenced this issue Jan 27, 2019
To handle missing call of find_package by other modules
in the case of ITK_USE_SYSTEM_EIGEN

Fix InsightSoftwareConsortium#357
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants