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

[build] CMake build on RHEL 9 is missing libraries #800

Open
SMillerDev opened this issue Aug 9, 2023 · 3 comments
Open

[build] CMake build on RHEL 9 is missing libraries #800

SMillerDev opened this issue Aug 9, 2023 · 3 comments

Comments

@SMillerDev
Copy link
Contributor

Trying to run drafter after building in from source with CMake on RHEL gives:

/usr/bin/drafter: error while loading shared libraries: libapib-parser.so: cannot open shared object file: No such file or directory
@kylef
Copy link
Member

kylef commented Aug 9, 2023

What arguments are being supplied to Cmake? by default libapib-parser.so and other internals should be statically linked.

$ mkdir build
$ cd build
$ cmake ..
$ make drafter-cli
...
[ 43%] Built target drafter-obj
[ 44%] Linking CXX static library libapib-parser.
...

$ ldd packages/drafter/drafter
	linux-vdso.so.1 (0x00007ffc20fcc000)
	libstdc++.so.6 => /nix/store/yazs3bdl481s2kyffgsa825ihy1adn8f-gcc-12.2.0-lib/lib/libstdc++.so.6 (0x00007fa08ee3e000)
	libm.so.6 => /nix/store/yaz7pyf0ah88g2v505l38n0f3wg2vzdj-glibc-2.37-8/lib/libm.so.6 (0x00007fa08ed5e000)
	libgcc_s.so.1 => /nix/store/yazs3bdl481s2kyffgsa825ihy1adn8f-gcc-12.2.0-lib/lib/libgcc_s.so.1 (0x00007fa08ed3d000)
	libc.so.6 => /nix/store/yaz7pyf0ah88g2v505l38n0f3wg2vzdj-glibc-2.37-8/lib/libc.so.6 (0x00007fa08eb57000)
	/nix/store/yaz7pyf0ah88g2v505l38n0f3wg2vzdj-glibc-2.37-8/lib/ld-linux-x86-64.so.2 => /nix/store/yaz7pyf0ah88g2v505l38n0f3wg2vzdj-glibc-2.37-8/lib64/ld-linux-x86-64.so.2 (0x00007fa08f066000)

@SMillerDev
Copy link
Contributor Author

SMillerDev commented Aug 10, 2023

Using %cmake -DBUILD_TESTING=OFF -DCMAKE_VERBOSE_MAKEFILE=ON spec macro to build an RPM, which expands to the following:

/usr/bin/cmake -S . -B redhat-linux-build -DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_Fortran_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DLIB_SUFFIX=64 -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_TESTING=OFF -DCMAKE_VERBOSE_MAKEFILE=ON

/usr/bin/cmake --build redhat-linux-build -j2 --verbose

/usr/bin/cmake --install redhat-linux-build

@SMillerDev
Copy link
Contributor Author

LDD for the build on RHEL:

sean@phanpy:~$ ldd BUILDROOT/drafter-5.1.0-1.move.el9.x86_64/usr/bin/drafter
        linux-vdso.so.1 (0x00007ffe5cb32000)
        libapib-parser.so => not found
        libapib.so => not found
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f2c42600000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f2c4296c000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f2c42200000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f2c42891000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f2c42a37000)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants