Macaulay2 / M2

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

Redhat Enterprise 8 Build problem #3190

Open ustadny opened 2 months ago

ustadny commented 2 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 2 months ago

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

ustadny commented 2 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 2 months ago

Did you also try the cmake build?

ustadny commented 2 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 2 months ago

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

ustadny commented 2 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 2 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 2 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 2 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 2 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 2 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 2 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 2 months ago

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

ustadny commented 1 month 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 1 month 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 1 month ago

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

ustadny commented 1 month 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 1 month ago

Here is the MakeOutput.log (next message)

ustadny commented 1 month ago

CMakeOutput.log

ustadny commented 1 month ago

CMakeError.log