Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redhat Enterprise 8 Build problem #3190

Open
ustadny opened this issue Apr 26, 2024 · 25 comments
Open

Redhat Enterprise 8 Build problem #3190

ustadny opened this issue Apr 26, 2024 · 25 comments
Labels
build issue platform specific issues involving compiling M2, generating examples, or running tests high-performance computing

Comments

@ustadny
Copy link

ustadny commented Apr 26, 2024

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
Copy link
Member

mahrud commented Apr 27, 2024

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

@mahrud mahrud added the build issue platform specific issues involving compiling M2, generating examples, or running tests label Apr 27, 2024
@ustadny
Copy link
Author

ustadny commented Apr 27, 2024

#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
Copy link
Member

mahrud commented Apr 28, 2024

Did you also try the cmake build?

@ustadny
Copy link
Author

ustadny commented Apr 29, 2024

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
Copy link
Member

mahrud commented Apr 29, 2024

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

@ustadny
Copy link
Author

ustadny commented Apr 29, 2024

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
Copy link
Member

mahrud commented Apr 29, 2024

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
Copy link
Contributor

@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
Copy link
Author

ustadny commented May 1, 2024

@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
Copy link
Member

mahrud commented May 1, 2024

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
Copy link
Author

ustadny commented May 1, 2024

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
Copy link
Author

ustadny commented May 1, 2024

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
Copy link
Member

mahrud commented May 2, 2024

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

@ustadny
Copy link
Author

ustadny commented May 2, 2024

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
Copy link
Author

ustadny commented May 2, 2024

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
Copy link
Member

mahrud commented May 2, 2024

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

@ustadny
Copy link
Author

ustadny commented May 3, 2024

-- 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
Copy link
Author

ustadny commented May 3, 2024

Here is the MakeOutput.log (next message)

@ustadny
Copy link
Author

ustadny commented May 3, 2024

CMakeOutput.log

@ustadny
Copy link
Author

ustadny commented May 3, 2024

CMakeError.log

@mahrud
Copy link
Member

mahrud commented Jul 21, 2024

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

@ustadny
Copy link
Author

ustadny commented Jul 23, 2024

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
Copy link
Member

mahrud commented Jul 23, 2024

Have you installing all the prereq libraries for Redhat?

@ustadny
Copy link
Author

ustadny commented Jul 23, 2024

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
Copy link
Member

mahrud commented Jul 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build issue platform specific issues involving compiling M2, generating examples, or running tests high-performance computing
Projects
None yet
Development

No branches or pull requests

3 participants