ginkgo-project / ginkgo

Numerical linear algebra software package
https://ginkgo-project.github.io/
BSD 3-Clause "New" or "Revised" License
414 stars 89 forks source link

mingw and clang error #1654

Closed 3rav closed 1 week ago

3rav commented 4 months ago

I try to build msys2/mingw packages I have this error only for clang with dynamic library (static are ok):

lib/libginkgo_device.dll.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
  clang++: warning: argument unused during compilation: '-Wa,-mbig-obj' [-Wunused-command-line-argument]
  ld.lld: error: undefined symbol: gko::batch::matrix::Ell<float, int>::Ell(std::__1::shared_ptr<gko::Executor const>, gko::batch_dim<2ull, unsigned long long> const&, int)
yhmtsai commented 2 months ago

Thanks for reporting this. Unfortunately, we did not try clang on windows before. Could you share your configure setup with us?

MarcelKoch commented 3 weeks ago

@3rav any updates from your side? If not we might close this issue soonish.

3rav commented 3 weeks ago

The error still occurs in clang64: https://github.com/3rav/MINGW-packages/actions/runs/11712157728/job/32622223182

  clang++: warning: argument unused during compilation: '-Wa,-mbig-obj' [-Wunused-command-line-argument]
  ld.lld: error: undefined symbol: gko::batch::matrix::Ell<float, int>::Ell(std::__1::shared_ptr<gko::Executor const>, gko::batch_dim<2ull, unsigned long long> const&, int)
  >>> referenced by reference/CMakeFiles/ginkgo_reference.dir/solver/batch_bicgstab_kernels.cpp.obj:(gko::EnablePolymorphicObject<gko::batch::matrix::Ell<float, int>, gko::batch::BatchLinOp>::create_default_impl(std::__1::shared_ptr<gko::Executor const>) const)
  >>> referenced by reference/CMakeFiles/ginkgo_reference.dir/solver/batch_bicgstab_kernels.cpp.obj:(gko::EnablePolymorphicObject<gko::batch::matrix::Ell<float, int>, gko::batch::BatchLinOp>::clear_impl())
  >>> referenced by reference/CMakeFiles/ginkgo_reference.dir/solver/batch_cg_kernels.cpp.obj

  ld.lld: error: undefined symbol: gko::batch::matrix::Dense<float>::Dense(std::__1::shared_ptr<gko::Executor const>, gko::batch_dim<2ull, unsigned long long> const&)
  >>> referenced by reference/CMakeFiles/ginkgo_reference.dir/solver/batch_bicgstab_kernels.cpp.obj:(gko::EnablePolymorphicObject<gko::batch::matrix::Dense<float>, gko::batch::BatchLinOp>::create_default_impl(std::__1::shared_ptr<gko::Executor const>) const)
  >>> referenced by reference/CMakeFiles/ginkgo_reference.dir/solver/batch_bicgstab_kernels.cpp.obj:(gko::EnablePolymorphicObject<gko::batch::matrix::Dense<float>, gko::batch::BatchLinOp>::clear_impl())
  >>> referenced by reference/CMakeFiles/ginkgo_reference.dir/solver/batch_cg_kernels.cpp.obj
yhmtsai commented 2 weeks ago

Hi @3rav, we have a fix in #1724 for this issue. Could you check whether branch batch_dynamic_cast works for you?

3rav commented 2 weeks ago

With this develope version I have this error:

  -- Configuring done (7.9s)
  CMake Error at examples/file-config-solver/CMakeLists.txt:11 (target_link_libraries):
    Target "file-config-solver" links to:

      nlohmann_json::nlohmann_json

    but the target was not found.  Possible reasons include:

      * There is a typo in the target name.
      * A find_package call is missing for an IMPORTED target.
      * An ALIAS target is missing.

  CMake Generate step failed.  Build files cannot be regenerated correctly.
  -- Generating done (0.2s)
  ==> ERROR: A failure occurred in build().
      Aborting...
yhmtsai commented 2 weeks ago

@3rav Thanks for trying it. you can disable the example build by -DGINKGO_BUILD_EXAMPLES=OFF. It is also be tracked in #1727

3rav commented 1 week ago

@3rav Thanks for trying it. you can disable the example build by -DGINKGO_BUILD_EXAMPLES=OFF. It is also be tracked in #1727

Now is OK!:

image

yhmtsai commented 1 week ago

Thank you for confirmation!

yhmtsai commented 1 week ago

close this pr as #1724 merged.