Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
348 stars 233 forks source link

Redhat Enterprise 8 Build problem #3190

Open ustadny opened 7 months ago

ustadny commented 7 months ago

I am building from scratch on a RedhatEnterprise 8, even though there is an RPM available The RPM fails to install as it runs into some issues with libreadline.so.7() not available, when RHEL8 has libreadline.so.8 and just creating a virtual link does not help.

A similar problem happens with a build from scratch. See this ->


checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile gawk: symbol lookup error: /root/M2/M2/usr-host/lib/libreadline.so.8: undefined symbol: UP config.status: error: could not create Makefile make[2]: [../Makefile.library:181: .configured-4.2.1] Error 1 make[2]: Leaving directory '/root/M2/M2/libraries/factory' make[1]: [Makefile:7: all-in-factory] Error 2 make[1]: Leaving directory '/root/M2/M2/libraries' make: *** [GNUmakefile:251: all-in-libraries] Error 2


Searching the web, it seems the symbol UP is defined in libtinfo, and one needs a shared library linking. Any help?

Charanjit Jutla

mahrud commented 7 months ago

Not exactly related to the readline issue, but did you see #3055?

ustadny commented 7 months ago

3055 seems to have tbb issues. I had the same issue but it got resolved after "yum install tbb-devel".

So, I am really stuck with libreadline and libtinfo not getting linked. May have to do with my libreadline.8 being too new...that's a thing if you can believe it.

mahrud commented 7 months ago

Did you also try the cmake build?

ustadny commented 7 months ago

RHEL8 does not have Ninja. so I removed -GNinja, but it still looks for ninja. See here:

cmake -S M2/M2 -B M2/M2/BUILD/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr

CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! See also "/root/M2/M2/BUILD/build/CMakeFiles/CMakeOutput.log".

mahrud commented 7 months ago

You need to delete the CMakeCache.txt file before running cmake again.

ustadny commented 7 months ago

blas-devel and gdbm-devel not found in RHEL repositories. Also, my IBM system does not allow the following command: subscription-manager repos --enable rhel-*-optional-rpms

mahrud commented 7 months ago

Surely there's some linear algebra package with development headers in RHEL that you can install. CMake should recognize any. As for gdbm, you might need to build it from source or install the centos package.

jkyang92 commented 6 months ago

@mikestillman Incidentally, why is factory linking readline? Are we using factory in a way that it would need readline? Can we pass --with-readline=no to the factory build?

ustadny commented 6 months ago

@mahrud RedHat and IBM customer service installed gdbm for me. For BLAS, I installed OpenBLAS(from scratch) : https://github.com/OpenMathLib/OpenBLAS. However, cmake does not recognize this:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find BLAS (missing: BLAS_LIBRARIES) Call Stack (most recent call first): /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake/Modules/FindBLAS.cmake:1045 (find_package_handle_standard_args) /usr/share/cmake/Modules/FindLAPACK.cmake:265 (find_package) /usr/share/cmake/Modules/FindLAPACK.cmake:291 (_lapack_find_dependency) cmake/check-libraries.cmake:44 (find_package) CMakeLists.txt:70 (include)

mahrud commented 6 months ago

OpenBLAS is supported by CMake, but it's possible that the installation path is unusual on RHEL, in which case setting the right environment variable should tell CMake where to find it. See this page.

ustadny commented 6 months ago

Lol. After all that I am back at READLINE !! Hopefully, this is again some misplaced include files:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find Readline (missing: READLINE_INCLUDE_DIR READLINE_LIBRARY)

ustadny commented 6 months ago

after it complained there was no (GMP_ROOT GMP_INCLUDE_DIRS GMP_LIBRARIES GMP_LIBRARY_DIRS GMP_VERSION_OK)

I installed gmp-6.1.0. But it still gives this error:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find GMP (missing: GMP_LIBRARY_DIRS) (Required is at least version "6.0.0")

mahrud commented 6 months ago

Where are most of your libraries installed? e.g. where are gmp.h and libgmp or readline.h and libreadline?

ustadny commented 6 months ago

gmp.h and readline.h are in /usr/local/include libreadline is in /usr/lib64

I can move these .h files to /usr/include ?

ustadny commented 6 months ago

I reinstalled gmp.6.1.0, this time specifying that it be installed in prefix==/usr So now I have it in /usr/lib64 as well as the gmp.h in /usr/include. I also ran libtool --finish /usr/lib64 Still cmake says GMP_LIBRARY_DIRS missing.

mahrud commented 6 months ago

Could you upload CMakeFiles/CMakeError.log and CMakeFiles/CMakeOutput.log from the build directory?

ustadny commented 6 months ago

-- Checking for existing libraries and programs -- Found Threads: TRUE -- Found OpenMP_C: -fopenmp (found version "4.5") -- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenMP: TRUE (found version "4.5") CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find GMP (missing: GMP_LIBRARY_DIRS) (Required is at least version "6.0.0") Call Stack (most recent call first): /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) cmake/FindGMP.cmake:122 (find_package_handle_standard_args) cmake/check-libraries.cmake:113 (find_package) CMakeLists.txt:70 (include)

-- Configuring incomplete, errors occurred! See also "/root/M2/M2/BUILD/build/CMakeFiles/CMakeOutput.log". See also "/root/M2/M2/BUILD/build/CMakeFiles/CMakeError.log".

ustadny commented 6 months ago

Here is the MakeOutput.log (next message)

ustadny commented 6 months ago

CMakeOutput.log

ustadny commented 6 months ago

CMakeError.log

mahrud commented 4 months ago

Could you run cmake . --debug-find --debug-trycompile and provide the output as well?

ustadny commented 4 months ago

Ok, after I ran in debug mode, it showed that libgmpxx was missing. So I installed gmp-devel. This fixed the problem, and I was ready to build libraries. On running "make build-libraries", it however gave this error:

[ 0%] Performing build step for 'build-bdwgc' [ 2%] Building C object CMakeFiles/gc.dir/extra/gc.c.o In file included from /root/M2/M2/submodules/bdwgc/extra/gc.c:72: /root/M2/M2/submodules/bdwgc/extra/../pthread_support.c: In function ‘set_marker_thread_name’: /root/M2/M2/submodules/bdwgc/extra/../pthread_support.c:365:13: error: too few arguments to function ‘pthread_setname_np’ 365 | (void)pthread_setname_np(name_buf); | ^~~~~~ In file included from /root/M2/M2/submodules/bdwgc/include/private/../gc_pthread_redirects.h:38, from /root/M2/M2/submodules/bdwgc/include/private/../gc.h:1763, from /root/M2/M2/submodules/bdwgc/include/private/gc_priv.h:57, from /root/M2/M2/submodules/bdwgc/include/private/dbg_mlc.h:28, from /root/M2/M2/submodules/bdwgc/extra/../backgraph.c:15, from /root/M2/M2/submodules/bdwgc/extra/gc.c:40: /usr/include/pthread.h:463:12: note: declared here 463 | extern int pthread_setname_np (pthread_t __target_thread, const char *__name) | ^~~~~~ make[6]: [CMakeFiles/gc.dir/build.make:76: CMakeFiles/gc.dir/extra/gc.c.o] Error 1 make[5]: [CMakeFiles/Makefile2:879: CMakeFiles/gc.dir/all] Error 2 make[4]: [Makefile:146: all] Error 2 make[3]: [CMakeFiles/build-bdwgc-install.dir/build.make:80: libraries/bdwgc/src/build-bdwgc-stamp/build-bdwgc-build] Error 2 make[2]: [CMakeFiles/Makefile2:2879: CMakeFiles/build-bdwgc-install.dir/all] Error 2 make[1]: [CMakeFiles/Makefile2:2645: CMakeFiles/build-libraries.dir/rule] Error 2 make: *** [Makefile:563: build-libraries] Error 2

mahrud commented 4 months ago

Have you installing all the prereq libraries for Redhat?

ustadny commented 4 months ago

sudo yum install openblas-devel gmp-devel libxml2-devel readline-devel gdbm-devel boost-devel libomp-devel tbb-devel libffi-devel Updating Subscription Management repositories. Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs) 516 B/s | 4.1 kB 00:08 Red Hat Enterprise Linux 9 for x86_64 - AppStream (RP 573 B/s | 4.5 kB 00:08 No match for argument: openblas-devel Package gmp-devel-1:6.2.0-13.el9.x86_64 is already installed. Package libxml2-devel-2.9.13-6.el9_4.x86_64 is already installed. No match for argument: gdbm-devel Package boost-devel-1.75.0-8.el9.x86_64 is already installed. Package tbb-devel-2020.3-8.el9.x86_64 is already installed. Error: Unable to find a match: openblas-devel gdbm-devel

libffi was installed. However, make build-libraries keeps giving the above error (not sure how to install the above two missing libraries).

mahrud commented 4 months ago

I think you need to add some extra package repositories to your system: https://docs.fedoraproject.org/en-US/epel/

openblas and gdbm are both included in CentOS packages, and so is gc-devel: https://rpmfind.net/linux/rpm2html/search.php?query=gc-devel

This should probably be added to the wiki.

mahrud commented 1 week ago

Could you try the new rpm packages for RedHat here? Various build issues have also been fixed, so it would be worth trying again.

cc: @d-torrance