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

GPUDenseFiniteDifferenceImageFilter does not compile as shared library #1381

Open
dzenanz opened this issue Oct 31, 2019 · 4 comments

Comments

@dzenanz
Copy link
Member

@dzenanz dzenanz commented Oct 31, 2019

A compile error occurs with both GPU and SHARED enabled. Example error message:

itkGPUGradientAnisotropicDiffusionImageFilterTest.obj : error LNK2019: unresolved external symbol "public: static char const * __cdecl itk::GPUDenseFiniteDifferenceImageFilterKernel::GetOpenCLSource(void)" (?GetOpenCLSource@GPUDenseFiniteDifferenceImageFilterKernel@itk@@SAPEBDXZ) referenced in function "public: static char const * __cdecl itk::GPUDenseFiniteDifferenceImageFilter<class itk::GPUImage<float,2>,class itk::GPUImage<float,2>,class itk::GradientAnisotropicDiffusionImageFilter<class itk::GPUImage<float,2>,class itk::GPUImage<float,2> > >::GetOpenCLSource(void)" (?GetOpenCLSource@?$GPUDenseFiniteDifferenceImageFilter@V?$GPUImage@M$01@itk@@V12@V?$GradientAnisotropicDiffusionImageFilter@V?$GPUImage@M$01@itk@@V12@@2@@itk@@SAPEBDXZ)

This problem was introduced by 4fe3b5d.

Steps to Reproduce

Turn on BUILD_SHARED_LIBS and ITK_USE_GPU during configure step.

Reproducibility

100%

Environment

Windows 10 x64, VS2019 & VS2017 (probably VS2015 too), multiple recent CMake versions.

@dzenanz dzenanz added the type:Bug label Oct 31, 2019
@dzenanz

This comment has been minimized.

Copy link
Member Author

@dzenanz dzenanz commented Oct 31, 2019

I tried solving this myself. Removing ENABLE_SHARED from here causes problems for the ostream& operator<<, and is probably the reason for adding ENABLE_SHARED there. Adding ENABLE_SHARED here doesn't help either.

Adding ITKGPUFiniteDifference_EXPORT here causes mis-matching DLL linkage error.

@thewtex

This comment has been minimized.

Copy link
Member

@thewtex thewtex commented Nov 1, 2019

@hjmjohnson

This comment has been minimized.

Copy link
Member

@hjmjohnson hjmjohnson commented Nov 1, 2019

I just ordered a dual boot computer that will have both windows and GPU. It should arrive in a few weeks. I have no way of replicating the issue at the moment.

Hans

@dzenanz

This comment has been minimized.

Copy link
Member Author

@dzenanz dzenanz commented Nov 1, 2019

I don't know whether a GPU is needed. You need to point to an OpenCL SDK (I use this one) when configuring ITK, and the error occurs during build step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.