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

Does this project support building on Windows with msys2/gcc? #159

Open
asmwarrior opened this issue Oct 19, 2023 · 11 comments
Open

Does this project support building on Windows with msys2/gcc? #159

asmwarrior opened this issue Oct 19, 2023 · 11 comments

Comments

@asmwarrior
Copy link

Hi, I comes from this wxWidgets forum discussion: Showing a VTK view as a wxPanel - wxWidgets Discussion Forum

Basically, I see in msys2, the vtk library is supplied: Package: mingw-w64-x86_64-vtk - MSYS2 Packages

Also, the wxWidgets library is also supplied: Base Package: mingw-w64-wxwidgets3.2 - MSYS2 Packages

Thanks.

@timhutton
Copy link
Member

timhutton commented Oct 19, 2023 via email

@asmwarrior
Copy link
Author

Hi, Tim, thanks for the reply. I haven't tried it. In-fact, I'm not a cmake expert, it maybe hard for me to build this project. It looks like msys2 also supplied the opencl related library.

@danwills
Copy link
Contributor

danwills commented Oct 20, 2023 via email

@asmwarrior asmwarrior changed the title Is this project supporing the msys2/gcc? Does this project support building on Windows with msys2/gcc? Oct 21, 2023
@asmwarrior
Copy link
Author

Here is my steps: I have clone the repo in my folder: E:\code\ready, and I have mkdir build, and cd build.

In the msys2's mingw64.exe shell, I just type:

# cmake ../
-- Building for: Ninja
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: F:/msys2/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: F:/msys2/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Found WrapVulkanHeaders: F:/msys2/mingw64/include
CMake Error at F:/msys2/mingw64/lib/cmake/vtk/VTK-vtk-module-find-packages.cmake:209 (find_package):
  By not providing "FindCLI11.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "CLI11", but
  CMake did not find one.

  Could not find a package configuration file provided by "CLI11" with any of
  the following names:

    CLI11Config.cmake
    cli11-config.cmake

  Add the installation prefix of "CLI11" to CMAKE_PREFIX_PATH or set
  "CLI11_DIR" to a directory containing one of the above files.  If "CLI11"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  F:/msys2/mingw64/lib/cmake/vtk/vtk-config.cmake:152 (include)
  CMakeLists.txt:333 (find_package)


-- Configuring incomplete, errors occurred!

In-fact, I have vtk installed, see below:

# pacman -Ss vtk
...
    Parallel Data Analysis and Visualization Application based on VTK. (mingw-w64)
mingw64/mingw-w64-x86_64-vtk 9.2.6-12 [installed]
...

@asmwarrior
Copy link
Author

It looks like some library is not found, so I try to install some libraries.

Here is the command I used, once I found a missing library, I just install it, luckily, msys2 supplies most of the libraries.

pacman -S mingw-w64-x86_64-cli11

pacman -S mingw-w64-x86_64-postgresql

pacman -S mingw-w64-x86_64-pdal

pacman -S mingw-w64-x86_64-openvdb

pacman -S mingw-w64-x86_64-liblas

pacman -S mingw-w64-x86_64-gl2ps

pacman -S mingw-w64-x86_64-cgns

pacman -S mingw-w64-x86_64-adios2

After that, I got the result below:

# cmake ../
-- Found Boost: F:/msys2/mingw64/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found suitable exact version "1.83.0")
COMPONENT = openvdb
-- OpenVDB ABI Version: 10
-- Found Boost: F:/msys2/mingw64/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0") found components: iostreams
-- Could not find the VTK package due to a missing dependency: ODBC
-- Reading F:/msys2/mingw64/lib/cmake/libLAS/liblas-config.cmake
-- libLAS configuration, version 1.8.1
-- Found Boost: F:/msys2/mingw64/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found suitable exact version "1.83.0") found components: program_options thread system iostreams filesystem
CMake Deprecation Warning at F:/msys2/mingw64/lib/cmake/adios2/adios2-config.cmake:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
  F:/msys2/mingw64/lib/cmake/vtk/VTK-vtk-module-find-packages.cmake:1355 (find_package)
  F:/msys2/mingw64/lib/cmake/vtk/vtk-config.cmake:152 (include)
  CMakeLists.txt:333 (find_package)


-- Found ADIOS2: F:/msys2/mingw64/lib/cmake/adios2/adios2-config.cmake (found suitable version "2.9.1", minimum required is "2.4") found components: C CXX
-- Found Boost: F:/msys2/mingw64/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found suitable exact version "1.83.0")
-- Found Boost: F:/msys2/mingw64/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found suitable exact version "1.83.0") found components: serialization
-- Could NOT find Qt6Quick (missing: Qt6Quick_DIR)
CMake Error at F:/msys2/mingw64/lib/cmake/vtk/VTK-vtk-module-find-packages.cmake:1543 (find_package):
  Found package configuration file:

    F:/msys2/mingw64/lib/cmake/Qt6/Qt6Config.cmake

  but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
  FOUND.  Reason given by package:

  Failed to find required Qt component "Quick".

  Expected Config file at
  "F:/msys2/mingw64/lib/cmake/Qt6Quick/Qt6QuickConfig.cmake" does NOT exist



  Configuring with --debug-find-pkg=Qt6Quick might reveal details why the
  package was not found.

  Configuring with -DQT_DEBUG_FIND_PACKAGE=ON will print the values of some
  of the path variables that find_package uses to try and find the package.

Call Stack (most recent call first):
  F:/msys2/mingw64/lib/cmake/vtk/vtk-config.cmake:152 (include)
  CMakeLists.txt:333 (find_package)


-- Configuring incomplete, errors occurred!

Do I need to install QT? It looks like I need wxWidgets. So, I need to disable QT?

@asmwarrior
Copy link
Author

I looked at the source file F:/msys2/mingw64/lib/cmake/vtk/VTK-vtk-module-find-packages.cmake:1543 (find_package):

if (_vtk_module_find_package_enabled)
  set(_vtk_module_find_package_required)
  if (_vtk_module_find_package_is_required)
    set(_vtk_module_find_package_required REQUIRED)
  endif ()

  find_package(Qt6
    6.6
    
    
    ${_vtk_module_find_package_quiet}
    ${_vtk_module_find_package_required}
    COMPONENTS          Gui;OpenGL;Quick;Qml
    OPTIONAL_COMPONENTS )
  if (NOT Qt6_FOUND AND _vtk_module_find_package_fail_if_not_found)
    if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
      message(STATUS
        "Could not find the ${CMAKE_FIND_PACKAGE_NAME} package due to a "
        "missing dependency: Qt6")
    endif ()
    set("${CMAKE_FIND_PACKAGE_NAME}_GUISupportQtQuick_FOUND" 0)
    list(APPEND "${CMAKE_FIND_PACKAGE_NAME}_GUISupportQtQuick_NOT_FOUND_MESSAGE"
      "Failed to find the Qt6 package.")
  endif ()
endif ()

I'm not sure that some libraries are needed or not.

@asmwarrior
Copy link
Author

When I looked at this page: Package: mingw-w64-x86_64-vtk - MSYS2 Packages

It mentioned that QT is only an optional library, but it looks like when the F:\msys2\mingw64\lib\cmake\vtk\VTK-vtk-module-find-packages.cmake is called from the file F:\msys2\mingw64\lib\cmake\vtk\vtk-config.cmake, there is a line:

include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}-vtk-module-find-packages.cmake")

with this line, many packages will be searched by cmake, if it can't find on in VTK-vtk-module-find-packages.cmake, it just failed.

I'm not sure how to "disable" or "skip" the "QT" check in this file.

@asmwarrior
Copy link
Author

I just comment out the line 152 in the file F:\msys2\mingw64\lib\cmake\vtk\vtk-config.cmake

# include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}-vtk-module-find-packages.cmake")

So, I don't see such error report, since vtk does not try to find every component.

But I still got errors:

# cmake ../
CMake Error at F:/msys2/mingw64/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find OpenCL (missing: OPENCL_LIBRARIES)
Call Stack (most recent call first):
  F:/msys2/mingw64/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  src/FindOpenCL.cmake:67 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:466 (find_package)


-- Configuring incomplete, errors occurred!

When I looked at the ready's own cmakefile.txt, I see that it has its own FindOpenCL.cmake.

For me, I'm using the latest msys2's gcc(mingw64), and it does have a FindOpenCL.cmake. Also, I has such libraries installed in msys2

pacman -S mingw-w64-x86_64-opencl-headers
pacman -S mingw-w64-x86_64-opencl-icd

So, maybe some of the devs can help to try it, I just stalled here. Thanks.

@asmwarrior
Copy link
Author

To tweak the opencl related issue, I just comment out the line 462 of the E:\code\ready\CMakeLists.txt, this means that I don't need to use ready's own FindOpenCL script.

Now, let me continue:

# cmake ../
-- Looking for CL_VERSION_3_0
-- Looking for CL_VERSION_3_0 - found
-- Found OpenCL: F:/msys2/mingw64/lib/libOpenCL.dll.a (found version "3.0")
-- Found Doxygen: F:/msys2/mingw64/bin/doxygen.exe (found version "1.9.8") found components: doxygen missing components: dot
-- Configuring done (11.2s)
CMake Error at F:/msys2/mingw64/lib/cmake/vtk/VTK-targets.cmake:120 (set_target_properties):
  The link interface of target "VTK::CommonCore" contains:

    Threads::Threads

  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.

Call Stack (most recent call first):
  F:/msys2/mingw64/lib/cmake/vtk/vtk-config.cmake:138 (include)
  CMakeLists.txt:333 (find_package)


CMake Error at F:/msys2/mingw64/lib/cmake/vtk/VTK-targets.cmake:334 (set_target_properties):
  The link interface of target "VTK::glew" contains:

    GLEW::GLEW

  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.

Call Stack (most recent call first):
  F:/msys2/mingw64/lib/cmake/vtk/vtk-config.cmake:138 (include)
  CMakeLists.txt:333 (find_package)


CMake Error at F:/msys2/mingw64/lib/cmake/vtk/VTK-targets.cmake:362 (set_target_properties):
  The link interface of target "VTK::freetype" contains:

    Freetype::Freetype

  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.

Call Stack (most recent call first):
  F:/msys2/mingw64/lib/cmake/vtk/vtk-config.cmake:138 (include)
  CMakeLists.txt:333 (find_package)


CMake Error at F:/msys2/mingw64/lib/cmake/vtk/VTK-targets.cmake:1224 (set_target_properties):
  The link interface of target "VTK::nlohmannjson" contains:

    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.

Call Stack (most recent call first):
  F:/msys2/mingw64/lib/cmake/vtk/vtk-config.cmake:138 (include)
  CMakeLists.txt:333 (find_package)


-- Generating done (0.1s)
CMake Generate step failed.  Build files cannot be regenerated correctly.

Those message means that some components needed by vtk was not found, that's true, because I have commented out the line 152 of the file: F:\msys2\mingw64\lib\cmake\vtk\vtk-config.cmake

# include("${CMAKE_CURRENT_LIST_DIR}/${CMAKE_FIND_PACKAGE_NAME}-vtk-module-find-packages.cmake")

When I enable this line, I just need to install QT or QTQuick, which I think I don't need to build this project, otherwise I got cmake error.

Any ideas?

@danwills
Copy link
Contributor

danwills commented Oct 21, 2023 via email

@asmwarrior
Copy link
Author

I think my goal to try the project Ready is very simple. I'm a wxWidgets fan, and I would like to try a 3D library such as VTK to running in the wxWidgets' framework. I'm not a QT fan.

So, I come from the wx forum, and I see some one is discussing the combination of wxWidgets and VTK.

Also, I'm a msys2 user, and install software and packages are very easy by using the pacman command under msys2.

There are a lot of users who using msys2/gcc, so it is great if we can build Ready under msys2/gcc.

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

3 participants