mpir v gmp and problems building for Qt6
Jack Ostroff
ostroffjh at users.sourceforge.net
Fri Dec 27 17:48:18 GMT 2024
On 12/26/24 2:10 AM, Thomas Baumgart via KMyMoney-devel wrote:
> On Mittwoch, 25. Dezember 2024 23:26:35 CET Jack Ostroff via KMyMoney-devel wrote:
>> Merry Christmas to all.
>>
>> In bits of spare time, I've been trying to compile libalkimia and
>> kmymoney for Qt6. I was having some difficulties getting them to find
>> mpir. While digging into the details of why, as I read the code, I see
>> KMyMoney prefers MPIR to GMP (from CMakeLists.txt) since 6 years ago.
>> Wikipedia (https://en.wikipedia.org/wiki/MPIR_(mathematics_software))
>> mentions that "According to the MPIR-devel mailing list, "MPIR is no
>> longer maintained" with a link to
>> https://groups.google.com/g/mpir-devel/c/qTOaOBuS2E4/m/_8AQjEieAAAJ?pli=1
>> which includes "MPIR is no longer maintained for years now." from a post
>> from 23 Dec 2021. Given this, is there any reason to continue our
>> preference from mpir over mgp?
> Not really, something we should change. Although, the preference is only
> in alkimia. KMyMoney contains two references to gmpxx.h:
>
> kmymoney/mymoney/mymoneymoney.cpp
> 21:#include <gmpxx.h>
>
> kmymoney/mymoney/payeeidentifier/ibanbic/ibanbic.cpp
> 11:#include <gmpxx.h>
>
> and on my distro, mpir is not included so apparently I use gmp for a
> long time already.
>
>> Back to the code, without mpir installed, libalkimia seems to find gmp
>> with no problem, but fails later in cmake (which I'll discuss in a
>> separate thread.) However, running cmake for KMyMoney, I get:
>>
>> CMake Error at
>> /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package):
>> By not providing "FindGMP.cmake" in CMAKE_MODULE_PATH this project has
>> asked CMake to find a package configuration file provided by "GMP", but
>> CMake did not find one.
>>
>> Could not find a package configuration file provided by "GMP" with any of
>> the following names:
>>
>> GMPConfig.cmake
>> gmp-config.cmake
>>
>> Add the installation prefix of "GMP" to CMAKE_PREFIX_PATH or set
>> "GMP_DIR"
>> to a directory containing one of the above files. If "GMP" provides a
>> separate development package or SDK, be sure it has been installed.
>> Call Stack (most recent call first):
>> /home/jack/KDE/KMM/libalkimia/build6/src/LibAlkimia6Config.cmake:31
>> (find_dependency)
>> CMakeLists.txt:216 (find_package)
>>
>> I can find neither GMPConfig.cmake nor gmp-config.cmakeanywhere on my
>> system, but I do have pkgconfig files gmp.pc and gmpxx.pc. So - why can
>> libalkimia find it but not kmymoney? I have cmake 3.31.3 installed. Is
>> my system somehow misconfigured, or have I missed something?
> I don't see any reference to GMP nor MPIR in the KMyMoney build instructions:
>
> thb at sy-346-nb /home/thb/devel/kmymoney (master)$ find -name CMakeLists.txt | xargs grep -i gmp
> thb at sy-346-nb /home/thb/devel/kmymoney (master)$ find -name CMakeLists.txt | xargs grep -i mpir
> thb at sy-346-nb /home/thb/devel/kmymoney (master)$
>
> I'd try the following:
>
> - Start with a complete empty build directory and see if that makes a difference.
> - In case that does not help, try running cmake with option --trace-expand
> (and maybe redirect output of stdout and stderr to a file). Try to see what
> cmake does, when it fails.
I found the cause. When I first tried building KMM with Qt6, it
couldn't find libalkimia (which I was also having problems compiling) so
I added -DLibAlkimia6_DIR pointing (incorrectly) to the alkimia build
dir, so it seems to have picked up alkimia's need for gmp, but not it's
cmake file to actually find it. Once I finally built and installed the
Qt6 alkimia, the KMM cmake (pointed to that same install dir) picked it
up correctly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20241227/98776916/attachment.htm>
More information about the KMyMoney-devel
mailing list