Created attachment 687651 [details] build.log > -- GMP version was not detected > CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:165 (message): > Could NOT find GMP (missing: GMP_VERSION_OK) (Required is at least version > "5.1.0") > Call Stack (most recent call first): > /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE) > CMake/FindGMP.cmake:74 (find_package_handle_standard_args) > CMakeLists.txt:31 (find_package) > > > -- Configuring incomplete, errors occurred! > See also "/var/tmp/portage/sci-mathematics/flint-2.6.3/work/flint-2.6.3_build/CMakeFiles/CMakeOutput.log". > * ERROR: sci-mathematics/flint-2.6.3::gentoo failed (configure phase): > * cmake failed Portage 3.0.13 (python 3.8.7-final-0, default/linux/x86/17.0, gcc-9.3.0, glibc-2.32-r6, 5.4.97-gentoo-x86 i686) ================================================================= System uname: Linux-5.4.97-gentoo-x86-i686-with-glibc2.1.3 KiB Mem: 3106076 total, 1997316 free KiB Swap: 8387560 total, 8357436 free Timestamp of repository gentoo: Fri, 19 Feb 2021 14:37:40 +0000 Head commit of repository gentoo: fc67b33c6e61f1f439ffc270260e06cce6ee7dde sh bash 5.0_p18 ld GNU ld (Gentoo 2.35.1 p2) 2.35.1 ccache version 4.1 [enabled] app-shells/bash: 5.0_p18::gentoo dev-lang/perl: 5.30.3::gentoo dev-lang/python: 3.8.7-r1::gentoo, 3.9.1-r1::gentoo dev-util/ccache: 4.1::gentoo dev-util/cmake: 3.18.5::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.7::gentoo sys-apps/openrc: 0.42.1-r1::gentoo sys-apps/sandbox: 2.20::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r5::gentoo sys-devel/automake: 1.16.2-r1::gentoo sys-devel/binutils: 2.35.1-r1::gentoo sys-devel/gcc: 9.3.0-r2::gentoo sys-devel/gcc-config: 2.3.2-r1::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers) sys-libs/glibc: 2.32-r6::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: git sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git priority: -1000 ABI="x86" ABI_X86="32" ACCEPT_KEYWORDS="x86" ACCEPT_LICENSE="*" ACCEPT_PROPERTIES="*" ACCEPT_RESTRICT="*" ADA_TARGET="gnat_2018" ARCH="x86" BINPKG_COMPRESS="bzip2" BROOT="" CBUILD="i686-pc-linux-gnu" CCACHE_DIR="/var/cache/ccache" CFLAGS="-O2 -pipe -march=pentium4m -mtune=pentium4m -Wno-error=jump-misses-init -Wno-error=sign-compare" CHOST="i686-pc-linux-gnu" CHOST_x86="i686-pc-linux-gnu" COLLISION_IGNORE="/lib/modules/*" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CPU_FLAGS_X86="mmx mmxext sse sse2" CXXFLAGS="-O2 -pipe -march=pentium4m -mtune=pentium4m -Wno-error=jump-misses-init -Wno-error=sign-compare" DCC_EMAILLOG_WHOM_TO_BLAME="" DEFAULT_ABI="x86" DISTCC_ENABLE_DISCREPANCY_EMAIL="" DISTCC_FALLBACK="1" DISTCC_SAVE_TEMPS="0" DISTCC_SSH="" DISTCC_TCP_CORK="" DISTCC_VERBOSE="0" EDITOR="/usr/bin/mcedit" ELIBC="glibc" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR" EPREFIX="" EROOT="/" ESYSROOT="/" FCFLAGS="-O2 -march=i686 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg ccache cgroup config-protect-if-modified distlocks downgrade-backup ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -march=i686 -pipe" GCC_SPECS="" GRUB_PLATFORMS="efi-32 pc" GSETTINGS_BACKEND="dconf" HOME="/root" INFOPATH="/usr/share/gcc-data/i686-pc-linux-gnu/9.3.0/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.35.1/info:/usr/share/info" INPUT_DEVICES="libinput" IUSE_IMPLICIT="abi_x86_32 prefix prefix-guest prefix-stack" KERNEL="linux" L10N="en en-US de de-DE" LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" LC_MESSAGES="C" LC_PAPER="de_DE.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LIBDIR_x86="lib" LINGUAS="en de" LOGNAME="root" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" MAIL="/var/mail/root" MAKEOPTS="--jobs 5 --load-average 7.95" MANPAGER="manpager" MOTD_SHOWN="pam" MULTILIB_ABIS="x86" NOCOLOR="true" OFFICE_IMPLEMENTATION="libreoffice" OPENCL_PROFILE="ocl-icd" OPENGL_PROFILE="xorg-x11" PAGER="/usr/bin/less" PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/11/bin" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PWD="/root" PYTHONDONTWRITEBYTECODE="1" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" QT_GRAPHICSSYSTEM="raster" ROOT="/" ROOTPATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/11/bin" RUBY_TARGETS="ruby25 ruby26" SHELL="/bin/bash" SHLVL="2" SSH_TTY="/dev/pts/0" SYSROOT="/" TERM="tmux-256color" TMUX="/tmp//tmux-0/default,3324,0" TMUX_PANE="%2" TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE="1" UNCACHED_ERR_FD="" USER="root" USERLAND="GNU" VIDEO_CARDS="vmware" XDG_RUNTIME_DIR="/run/user/0" XDG_SESSION_CLASS="user" XDG_SESSION_ID="2" XDG_SESSION_TYPE="tty"
GMP is installed, right? What does `equery f dev-libs/gmp` output?
@whissi halp
> # equery f dev-libs/gmp > * Searching for gmp in dev-libs ... > * Contents of dev-libs/gmp-6.2.1: > /usr > /usr/include > /usr/include/gmp.h > /usr/include/gmpxx.h > /usr/include/i686-pc-linux-gnu > /usr/include/i686-pc-linux-gnu/gmp.h > /usr/lib > /usr/lib/libgmp.so -> libgmp.so.10.4.1 > /usr/lib/libgmp.so.10 -> libgmp.so.10.4.1 > /usr/lib/libgmp.so.10.4.1 > /usr/lib/libgmpxx.so -> libgmpxx.so.4.6.1 > /usr/lib/libgmpxx.so.4 -> libgmpxx.so.4.6.1 > /usr/lib/libgmpxx.so.4.6.1 > /usr/lib/pkgconfig > /usr/lib/pkgconfig/gmp.pc > /usr/lib/pkgconfig/gmpxx.pc > /usr/share > /usr/share/doc > /usr/share/doc/gmp-6.2.1 > /usr/share/doc/gmp-6.2.1/AUTHORS.bz2 > /usr/share/doc/gmp-6.2.1/ChangeLog.bz2 > /usr/share/doc/gmp-6.2.1/NEWS.bz2 > /usr/share/doc/gmp-6.2.1/README.bz2 > /usr/share/doc/gmp-6.2.1/configuration.bz2 > /usr/share/doc/gmp-6.2.1/html > /usr/share/doc/gmp-6.2.1/html/doc > /usr/share/doc/gmp-6.2.1/html/doc/Makefile.am > /usr/share/doc/gmp-6.2.1/html/doc/Makefile.in > /usr/share/doc/gmp-6.2.1/html/doc/configuration > /usr/share/doc/gmp-6.2.1/html/doc/fdl-1.3.texi > /usr/share/doc/gmp-6.2.1/html/doc/gmp.info > /usr/share/doc/gmp-6.2.1/html/doc/gmp.info-1 > /usr/share/doc/gmp-6.2.1/html/doc/gmp.info-2 > /usr/share/doc/gmp-6.2.1/html/doc/gmp.texi > /usr/share/doc/gmp-6.2.1/html/doc/isa_abi_headache > /usr/share/doc/gmp-6.2.1/html/doc/mdate-sh > /usr/share/doc/gmp-6.2.1/html/doc/projects.html > /usr/share/doc/gmp-6.2.1/html/doc/stamp-vti > /usr/share/doc/gmp-6.2.1/html/doc/tasks.html > /usr/share/doc/gmp-6.2.1/html/doc/texinfo.tex > /usr/share/doc/gmp-6.2.1/html/doc/version.texi > /usr/share/doc/gmp-6.2.1/isa_abi_headache.bz2 > /usr/share/info > /usr/share/info/gmp.info-1.bz2 > /usr/share/info/gmp.info-2.bz2 > /usr/share/info/gmp.info.bz2
dev-libs/gmp-6.2.1::gentoo was built with the following: USE="asm cxx -doc -pic -static-libs"
@Thomas would you be able and ready to do some manual experiments for me? Alternatively can you attach the folder flint-2.6.3_build (in tar.bz2) which may have cache and log info from cmake. Dealing with config.log in autotools is way easier :(
Could you attach CMakeOutput.log (and possibly Error, although it's never really helped me)?
I see the problem... the file at /usr/include/gmp.h is just a wrapper that includes the real file at /usr/include/<arch>/gmp.h. And the check in FindGMP.cmake is too naive. Instead of building a test program, it's grepping the header to find what it needs. The problem is thus that it's grepping the wrapper at /usr/include/gmp.h instead of the actual header (that would be included transitively) at /usr/include/<arch>/gmp.h. This just happens to work on amd64 because Dima added a patch that checks for /usr/include/x86*/gmp.h, and that matches the location /usr/include/x86_64-pc-linux-gnu/gmp.h. For a quick hack we could add i686*/gmp.h to the list of paths, but now is probably the best time to replace the hacks with something reliable.
I tried to fix this by compiling a test program: try_run(GMP_VERSION_OK, GMP_VERSION_COMPILE_OK, ${PROJECT_BINARY_DIR}, ${PROJECT_BINARY_DIR}/gmp-version-check.c, CMAKE_FLAGS -DGMP_FIND_VERSION_MAJOR=${GMP_FIND_VERSION_MAJOR}, -DGMP_FIND_VERSION_MINOR=${GMP_FIND_VERSION_MINOR}, -DGMP_FIND_VERSION_PATCH=${GMP_FIND_VERSION_PATCH}) However, CMake is being stupid today: CMake Error at CMake/FindGMP.cmake:55 (try_run): Unknown extension ".c," for file /home/mjo/src/flint2/gmp-version-check.c, try_compile() works only for enabled languages. Currently these are: C CXX See project() command to enable other languages. If anyone knows why CMake thinks that ".c" is not a C extension, I'd love to know myself.
I think the comma "," at the end is the issue. It thinks the extension is ".c,". Note how the comma is part of what is quoted. This probably need some quotes.
The documentation is actually showing no commas at all anywhere. https://cmake.org/cmake/help/latest/command/try_run.html
(In reply to François Bissey from comment #10) > The documentation is actually showing no commas at all anywhere. > https://cmake.org/cmake/help/latest/command/try_run.html Right, the fact that I don't know what I'm doing in CMake turns out to be the problem once again!
Created attachment 700935 [details, diff] 0001-CMake-FindGMP.cmake-compile-a-test-program-to-check-.patch Here's what I came up with. After fixing the commas and a few more issues, it looks like it's doing what I think it does.
Looks alright to me.
Created attachment 700938 [details, diff] 0001-CMake-FindGMP.cmake-compile-a-test-program-to-check-.patch Here's an improved version that moves up the call to find_library(), and then uses the found header/library during compilation/linking of the test program.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=491b50cf718ca492e2d3329545b6709783264a5e commit 491b50cf718ca492e2d3329545b6709783264a5e Author: Michael Orlitzky <mjo@gentoo.org> AuthorDate: 2021-04-22 01:10:11 +0000 Commit: Michael Orlitzky <mjo@gentoo.org> CommitDate: 2021-04-22 01:10:11 +0000 sci-mathematics/flint: new revision to fix x86 gmp detection. The FindGMP routine in upstream's CMake is using voodoo to determine the version of gmp that's installed. The sorcery succeeds quite accidentally on amd64, but fails on x86. We patch their cmake to do something more reliable. Bug: https://bugs.gentoo.org/771663 Package-Manager: Portage-3.0.17, Repoman-3.0.2 Signed-off-by: Michael Orlitzky <mjo@gentoo.org> .../files/flint-2.7.1-fix-cmake-findgmp.patch | 152 +++++++++++++++++++++ .../{flint-2.7.1.ebuild => flint-2.7.1-r1.ebuild} | 2 + 2 files changed, 154 insertions(+)
Whissi, can you please try flint-2.7.1-r1 to make sure it works? If it does, we can switch the stablereq to that version and make Andreas happy as well.
@whissi: ping... I'd like to know if this works before I send it upstream =)
Patch fixed the issue here at least. Could you backport to the previous version too?
(In reply to Sam James from comment #18) > Patch fixed the issue here at least. Could you backport to the previous > version too? Thanks! Do we need the previous version for anything? This bug killed its stablereq, and if it's all the same to everyone else, I'd rather just move forward stabilizing 2.7.1 with the patch.
I thought there was some changes in sage needed for supporting flint 2.7 but it looks like I was mistaken or that they have been merged in some other ticket. If we can build sage 9.3 in the sage-on-gentoo overlay with it then I am OK to drop 2.6.3.
(In reply to Michael Orlitzky from comment #19) > (In reply to Sam James from comment #18) > > Patch fixed the issue here at least. Could you backport to the previous > > version too? > > Thanks! Do we need the previous version for anything? This bug killed its > stablereq, and if it's all the same to everyone else, I'd rather just move > forward stabilizing 2.7.1 with the patch. I only hit it because of the pending stabilisation of the fixed version, so no objections from me to your plan!
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23c86f8f7da0613fef04521842168147f21bfc62 commit 23c86f8f7da0613fef04521842168147f21bfc62 Author: Michael Orlitzky <mjo@gentoo.org> AuthorDate: 2021-05-28 19:09:42 +0000 Commit: Michael Orlitzky <mjo@gentoo.org> CommitDate: 2021-05-28 19:27:46 +0000 sci-mathematics/flint: update GMP detection patch. The new patch to fix detection of GMP was unnecessarily hostile to cross-compiling, but someone was nice enough to point it out on the upstream pull request. Here's the patch that was accepted upstream. Closes: https://bugs.gentoo.org/771663 Package-Manager: Portage-3.0.18, Repoman-3.0.2 Signed-off-by: Michael Orlitzky <mjo@gentoo.org> .../files/flint-2.7.1-fix-cmake-findgmp.patch | 72 ++++++++++------------ 1 file changed, 33 insertions(+), 39 deletions(-)