microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.2k stars 6.16k forks source link

GTKMM3 related error while installing Cadabra on Windows #35627

Closed Fajeux closed 6 months ago

Fajeux commented 6 months ago

Operating system

Windows

Compiler

No response

Steps to reproduce the behavior

I'm trying to install Cadabra on Windows. Following the instructions (written below), I inevitably get stuck near the very end, after cloning the repository and whilst using cmake.

git clone https://github.com/Microsoft/vcpkg

cd vcpkg
bootstrap-vcpkg.bat

vcpkg install mpir:x64-windows glibmm:x64-windows sqlite3:x64-windows
vcpkg install boost-system:x64-windows boost-asio:x64-windows boost-uuid:x64-windows boost-program-options:x64-windows boost-signals2:x64-windows boost-property-tree:x64-windowsboost-date-time:x64-windows boost-filesystem:x64-windows boost-ublas:x64-windows

vcpkg install gtkmm:x64-windows
vcpkg integrate install

cd ..
git clone https://github.com/kpeeters/cadabra2
cd cadabra2
mkdir build
cd build

cmake -DCMAKE_TOOLCHAIN_FILE=[the path obtained in the last step] -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_INSTALL_PREFIX=C:\Cadabra -G "Visual Studio 17 2022" -A x64 ..

which results in an error - namely, the library called 'gdkmm' missing.

Failure logs

CMake Error at cmake/windows.cmake:197 (message): Could NOT find library gdkmm required for GTKMM3_LIBRARIES Call Stack (most recent call first): cmake/modules/FindGTKMM3.cmake:3 (windows_find_library) C:/codestuf/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package) frontend/CMakeLists.txt:24 (find_package)

Additional context

Previously, I've had the exact same error pop up for two other libraries, 'atkmm' and 'gdk', but solved these two by typing the following into the terminal:

vcpkg install atkmm:x64-windows vcpkg install gtk3:x64-windows

respectively. (The first one might be redundant, I am not sure.) This caveman-mentality approach to solving the issue was inspired by the directions themselves, as one of the previous steps utilizes vcpkg install gtkmm:x64-windows, which should (I guess?) install everything necessary, but it doesn't seem to do so.

My question, then, is how can I download/install/build gdkmm on my Windows OS? I have tried using similar commands like:

vcpkg install gdkmm:x64-windows

but what I'm met with is another error, stating that this does not exist. My guess is that all of the above were somehow and somewhere located in my vcpkg folder locally, whereas the one from above is missing.

jimwang118 commented 6 months ago

You install gtk3 in vcpkg and then try to compile cadabra2. ./vcpkg install gtk3

Fajeux commented 6 months ago

I have done that as well, but I am still met with the same error. 'gdkmm' seems to be missing

dg0yt commented 6 months ago

Port gtkmm is for gtk which is version 4. For gtk3, you would probably need (to add) gtkmm3. (gtk3 isn't a first class citizen. It was added back a while after upgrading gtk because some ports really need that version, e.g. wxwidgets.)

Fajeux commented 6 months ago

Forgive me for not understanding as I am quite new to this whole shebang, but I've installed everything that you've mentioned. What I am missing (or what the error states that I am missing) is gDkmm.

When I open up cadabra's 'FindGTKMM3' CMake Source File, these are the libraries it searches for:

windows_find_library(GTKMM3_LIBRARIES
    gtk gdk gdk_pixbuf pangocairo pango atk gio gobject
    gmodule glib cairo-gobject cairo intl atkmm cairomm
    **gdkmm** giomm glibmm gtkmm pangomm
  )

The rest have been both installed and found successfully.

dg0yt commented 6 months ago

Let me summarize it differently:

Fajeux commented 6 months ago

I think I understand now, thanks. Is it then possible to maybe rollback somehow to the previous version of gtkmm or am I out of options?

dg0yt commented 6 months ago

The easiest way to start might be to write a vcpkg.json manifest to define the dependencies, including version requirements. See documentation on vcpkg manifest mode. But this will be using build recipes from April 2021 at least for some ports. I don't know if this configuration will work well today. That's why I didn't add a recommendation to my other post.

I also added a note to https://github.com/kpeeters/cadabra2/issues/233, to give upstream a chance to look at the issue again (or at least remove the instructions when it is verified that they are no longer working).

Fajeux commented 6 months ago

I'll try dabbling with that for a bit, but I'm a little doubtful because I've never done anything like it before. Thank you for your input!

jimwang118 commented 6 months ago

@Fajeux Did the compilation go normally after you added gtkmm version 3 using manifest mode?

jimwang118 commented 6 months ago

Thanks for posting this issue. Please reopen this issue if this is still a problem for you.