/usr/bin/ld: cannot find -lmpfr
As mentioned in another thread, I am trying to compile gappa 1.4 . ./configure LDFLAGS=-L/usr/lib64 complains
From config.log configure:4678: checking for mpfr_snprintf in -lmpfr configure:4703: g++ -o conftest -g -O2 -L/usr/lib64/ conftest.cpp -lmpfr -lgmp
&5
/usr/bin/ld: cannot find -lmpfr collect2: error: ld returned 1 exit status
[hennebry@fedora ~]$ ls /usr/lib64/libmpfr* /usr/lib64/libmpfr.so.6 /usr/lib64/libmpfr.so.6.1.0 [hennebry@fedora ~]$
What is going on? How do I deal?
configure is written in the obfuscated shell generated by autotools. Editing that seems unlikely to be successful.
On Thu, 7 Apr 2022 at 19:42, Michael Hennebry < hennebry@web.cs.ndsu.nodak.edu> wrote:
/usr/bin/ld: cannot find -lmpfr
As mentioned in another thread, I am trying to compile gappa 1.4 . ./configure LDFLAGS=-L/usr/lib64 complains
From config.log configure:4678: checking for mpfr_snprintf in -lmpfr configure:4703: g++ -o conftest -g -O2 -L/usr/lib64/ conftest.cpp -lmpfr -lgmp
&5
/usr/bin/ld: cannot find -lmpfr collect2: error: ld returned 1 exit status
[hennebry@fedora ~]$ ls /usr/lib64/libmpfr* /usr/lib64/libmpfr.so.6 /usr/lib64/libmpfr.so.6.1.0 [hennebry@fedora ~]$
What is going on? How do I deal?
When trying to install a newer version of some program than dnf provides, it is often helpful to "borrow" from the source RPM. As already mentioned, you certainly need the mpfr-devel package.
I use mpfr, gmp, and boost in Fedora 35 (so already have the -devel libraries). Running configure with no options as suggested in the documentation "works for me":
% ./configure checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for gcc... gcc checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for flex... flex checking lex output file root... lex.yy checking lex library... none needed checking whether yytext is a pointer... no checking for bison... bison -y checking how to run the C preprocessor... gcc -E checking for gcc... gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... (cached) none needed checking how to run the C preprocessor... gcc -E checking how to run the C++ preprocessor... g++ -E checking for g++... g++ checking whether we are using the GNU C++ compiler... (cached) yes checking whether g++ accepts -g... yes checking how to run the C++ preprocessor... g++ -E checking for __gmpz_init in -lgmp... yes checking for mpfr_snprintf in -lmpfr... yes checking for Boost (>=1.32)... yes checking for tr1/unordered_map... yes configure: building remake... /usr/bin/ld: /tmp/cc8F3rMK.o: in function `main': remake.cpp:(.text.startup+0xb2d): warning: the use of `tempnam' is dangerous, better use `mkstemp' configure: creating ./config.status config.status: creating stamp-config_h config.status: creating Remakefile config.status: creating config.h
Then "./remake" and "./remake check" alss "works for me". I just upgraded my Fedora 34 box to 35, so can't test on F34, but I would be surprised if F34 doesn't work.
configure is written in the obfuscated shell generated by autotools. Editing that seems unlikely to be successful.
Edit configure.in.
On Thu, 7 Apr 2022, George N. White III wrote:
On Thu, 7 Apr 2022 at 19:42, Michael Hennebry < hennebry@web.cs.ndsu.nodak.edu> wrote:
/usr/bin/ld: cannot find -lmpfr
As mentioned in another thread, I am trying to compile gappa 1.4 . ./configure LDFLAGS=-L/usr/lib64 complains
From config.log configure:4678: checking for mpfr_snprintf in -lmpfr configure:4703: g++ -o conftest -g -O2 -L/usr/lib64/ conftest.cpp -lmpfr -lgmp
&5
/usr/bin/ld: cannot find -lmpfr collect2: error: ld returned 1 exit status
[hennebry@fedora ~]$ ls /usr/lib64/libmpfr* /usr/lib64/libmpfr.so.6 /usr/lib64/libmpfr.so.6.1.0 [hennebry@fedora ~]$
What is going on? How do I deal?
When trying to install a newer version of some program than dnf provides, it is often helpful to "borrow" from the source RPM. As already mentioned, you certainly need the mpfr-devel package.
Why? I am not trying to build or edit mpfr. The error message in config.log says that it was looking for the symbol mpfr_snprintf in -lmpfr . It did not even find -lmpfr . Why not?
Even if I am persuaded to get the mpfr-devel package and suddenly the build worked, that would still leave me wondering why ld could not find a library in a place it was told to look. Is there an ld flag that will cause it to say where it looks for libraries? I've been looking, but might have missed it.
I use mpfr, gmp, and boost in Fedora 35 (so already have the -devel libraries). Running configure with no options as suggested in the documentation "works for me":
I tried that first.
Edit configure.in.
A sensible suggestion if I can figure out what to do to it.
On Thu, Apr 7, 2022 at 8:50 PM Michael Hennebry hennebry@web.cs.ndsu.nodak.edu wrote:
Why? I am not trying to build or edit mpfr. The error message in config.log says that it was looking for the symbol mpfr_snprintf in -lmpfr . It did not even find -lmpfr . Why not?
Because /usr/lib64/libmpfr.so is in the mpfr-devel package, not the mpfr package. This is not unique to mpfr. All library packages in Fedora do this. See:
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_devel_packages
On Thu, 7 Apr 2022, Jerry James wrote:
On Thu, Apr 7, 2022 at 8:50 PM Michael Hennebry hennebry@web.cs.ndsu.nodak.edu wrote:
Why? I am not trying to build or edit mpfr. The error message in config.log says that it was looking for the symbol mpfr_snprintf in -lmpfr . It did not even find -lmpfr . Why not?
Because /usr/lib64/libmpfr.so is in the mpfr-devel package, not the mpfr package. This is not unique to mpfr. All library packages in Fedora do this. See:
As noted previously, /usr/lib64/libmpfr.so.6 is in whatever I've got: [hennebry@fedora gappa-1.4.0]$ ls /usr/lib64/libmpfr* /usr/lib64/libmpfr.so.6 /usr/lib64/libmpfr.so.6.1.0 [hennebry@fedora gappa-1.4.0]$
An experiment showed me that the .6 suffix prevented ld from finding -lmfpr . mpfr-devel appears to have gotten me a soft link ending in .so and a header file.
gappa 1.4.0 is built.