mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Linux (https://www.mersenneforum.org/forumdisplay.php?f=39)
-   -   building mprime issue on FedoraCore22 (https://www.mersenneforum.org/showthread.php?t=20918)

EmbeddedSteve 2016-01-27 21:28

building mprime issue on FedoraCore22
 
Greetings,
I got a copy of the P95v287 release (source code) to build mprime to be used in a diagnostics manner (i.e. stressing the CPU).
Host system is FedoraCore 22 running in Virtual Box on a 2014 vintage MacBook Pro. The hose CPU is i7 Quad-Core. The Host GCC is 5.3.1.
Initial issues were the lack of curl - which I added, including the curl-devel.
The build of the gwnum.a library was successful, I have the ~ 34.5MB output.
Then, in the Linux64 directory, I run the "make" and get the following error:

/bin/ld: cannot find -lcurl
collect2: error: ld returned 1 exit status
makefile:31: recipe for target 'mprime' failed
make: *** [mprime] Error 1

The prime.o and menu.o get build, but the loader/linker can't find the libcurl, which is here:

[sbeckwith@sdb-mbp-vm lib64]$ ls -l libcurl*
lrwxrwxrwx. 1 root root 18 Jan 26 2015 libcurlpp.so -> libcurlpp.so.0.0.2
lrwxrwxrwx. 1 root root 18 Jan 26 2015 libcurlpp.so.0 -> libcurlpp.so.0.0.2
-rwxr-xr-x. 1 root root 123360 Jan 26 2015 libcurlpp.so.0.0.2
lrwxrwxrwx. 1 root root 16 Sep 18 12:45 libcurl.so -> libcurl.so.4.3.0
lrwxrwxrwx. 1 root root 16 Sep 18 12:45 libcurl.so.4 -> libcurl.so.4.3.0
-rwxr-xr-x. 1 root root 489200 Sep 18 12:45 libcurl.so.4.3.0

this is in /usr/lib64. Doing an export on LD_LIBRARY_PATH to point to /usr/lib64 doesn't help, same error.
Any suggestions as to why this doesn't work "out of the box"?
Thanks!

Prime95 2016-01-27 22:06

[QUOTE=EmbeddedSteve;424335]
Any suggestions as to why this doesn't work "out of the box"?
Thanks![/QUOTE]

It doesn't work because I know very little about Linux and makefiles.

Try this suggestion (from the 32-bit linux makefile):

# NOTES: libcurl built by downloading latest sources and:
# ./configure --without-ssl --without-libssh2 --without-libidn --disable-ldap --disable-ldaps --without-gssapi --enable-ipv6 --without-krb4
# make
# make install

Linux gurus here might give you more helpful advice

Batalov 2016-01-28 02:28

[QUOTE=EmbeddedSteve;424335]Greetings,
I got a copy of the P95v287 release (source code) to build mprime to be used in a diagnostics manner (i.e. stressing the CPU).
Host system is FedoraCore 22 running in Virtual Box on a 2014 vintage MacBook Pro. The hose CPU is i7 Quad-Core. The Host GCC is 5.3.1.
Initial issues were the lack of curl - which I added, including the curl-devel.
The build of the gwnum.a library was successful, I have the ~ 34.5MB output.
Then, in the Linux64 directory, I run the "make" and get the following error:

/bin/ld: cannot find -lcurl
collect2: error: ld returned 1 exit status
makefile:31: recipe for target 'mprime' failed
make: *** [mprime] Error 1

The prime.o and menu.o get build, but the loader/linker can't find the libcurl, which is here:

[sbeckwith@sdb-mbp-vm lib64]$ ls -l libcurl*
lrwxrwxrwx. 1 root root 18 Jan 26 2015 libcurlpp.so -> libcurlpp.so.0.0.2
lrwxrwxrwx. 1 root root 18 Jan 26 2015 libcurlpp.so.0 -> libcurlpp.so.0.0.2
-rwxr-xr-x. 1 root root 123360 Jan 26 2015 libcurlpp.so.0.0.2
lrwxrwxrwx. 1 root root 16 Sep 18 12:45[B] libcurl.so[/B] -> libcurl.so.4.3.0
lrwxrwxrwx. 1 root root 16 Sep 18 12:45 libcurl.so.4 -> libcurl.so.4.3.0
-rwxr-xr-x. 1 root root 489200 Sep 18 12:45 libcurl.so.4.3.0

this is in /usr/lib64. Doing an export on LD_LIBRARY_PATH to point to /usr/lib64 doesn't help, same error.
Any suggestions as to why this doesn't work "out of the box"?
Thanks![/QUOTE]
Ok, [B]libcurl.a[/B] is needed (as written in the Makefile). I've seen this issue before (as I've built, modified, rebuilt, ... mprime).
Two ways to solve it:
1. Either remove mentions of static from makefile (and get a dynamic dep on libcurl.so which is not a problem if you are just going to use it on one comp)
[CODE]LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread [STRIKE]-Wl,-Bstatic[/STRIKE] -lcurl [STRIKE]-Wl,-Bdynamic[/STRIKE] -lrt -lstdc++ -ldl[/CODE]2. Or get curl source and build the static lib, then go back to building mprime statically linked binary. (It might be faster, and will be more portable from a comp to a comp)

EmbeddedSteve 2016-01-28 14:24

@Batalov @Prime95:
Thanks for the suggestions. Removing the -Wl options worked, but this ended up with an mprime with "many" libraries, which won't be on the target system (it's an embedded box). So, following both your suggestions to build curl from scratch, I built the same version as in the FC22 release (7.40) and that worked OK (got the libcurl.a). Back to the original linux64/makefile setup with the -Wl options and it threw an error missing zlib in curl. Adding the "-lz" to the LIBS worked (I have zlib on the host) and we're good to go! Cuts down from 36 libraries to 10, which is ~ what the 1.32 version we currently use has. Thanks for the Assist! ! ! !


All times are UTC. The time now is 08:28.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.