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

BUG: Wrap LBFGSOptimizerBaseHelperv4 before LBFGSOptimizerBasev4 #4361

Merged

Conversation

thewtex
Copy link
Member

@thewtex thewtex commented Dec 4, 2023

LBFGSOptimizerBasev4 uses the LBFGSOptimizerBasev4 in its interface with the GetOptimizer method. Wrap LBFGSOptimizerBaseHelperv4 before LBFGSOptimizerBasev4 so LBFGSOptimizerBaseHelperv4 wrapper definition is available.

LBFGSOptimizerBasev4 uses the LBFGSOptimizerBasev4 in its interface with
the GetOptimizer method. Wrap LBFGSOptimizerBaseHelperv4 before LBFGSOptimizerBasev4
so LBFGSOptimizerBaseHelperv4 wrapper definition is available.
@thewtex thewtex requested a review from dzenanz December 4, 2023 19:39
@github-actions github-actions bot added type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:Python wrapping Python bindings for a class area:Numerics Issues affecting the Numerics module labels Dec 4, 2023
@thewtex
Copy link
Member Author

thewtex commented Dec 4, 2023

This is intended to address:

ITKOptimizersv4Python: LNK2005 “public: class itk::LBFGSOptimizerBaseHelperv4 * __cdecl itk::LBFGSOptimizerBasev4::GetOptimizer(void)” already defined in itkLBFGSOptimizerBasev4Python.obj

reported: https://discourse.itk.org/t/itk-5-3-0-5-4rc-build-errors-shared-libs-python-wrappings-itkvtkglue-vs-2022-win11/6327

but I have not tested the impact on a shared library Windows build. It is possible that more is still needed to prevent implicit instantiation of LBFGSOptimizerBaseHelperv4. Regardless of whether additional steps are needed, this order should be changed.

@sophonet
Copy link

sophonet commented Dec 4, 2023

Unfortunately, with this patch (changed order of itkLBFGSOptimizerBaseHelperv4 and itkLBFGSOptimiyerBasev4 in CMakeLists.txt) the error is still the same.

@hjmjohnson hjmjohnson merged commit 119e8da into InsightSoftwareConsortium:master Dec 7, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Numerics Issues affecting the Numerics module area:Python wrapping Python bindings for a class type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants