Re: [Prime] More static linking problems
George Woltman wrote: > 1) Download ftp://mersenne.org/source2511.zip > [pie...@freescruz ~]$ wget ftp://mersenne.org/source2511.zip --20:06:42-- ftp://mersenne.org/source2511.zip => `source2511.zip' Resolving mersenne.org... 71.6.220.162 Connecting to mersenne.org|71.6.220.162|:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done.==> PWD ... done. ==> TYPE I ... done. ==> CWD not needed. ==> SIZE source2511.zip ... done. ==> PASV ... done.==> RETR source2511.zip ... No such file `source2511.zip'. thats as far as _I_ got. ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
On Mon, 2009-07-13 at 20:07 -0700, John R Pierce wrote: > George Woltman wrote: > > 1) Download ftp://mersenne.org/source2511.zip > > Try ftp://mersenne.org/gimps/source2511.zip I am going to try rebuild on Ubuntu Jaunty first. I have several Linux distros to try. Good luck, Ralph ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
George Woltman wrote: > I went to build the 25.11 executables with libcurl staticly linked in using > -Wl,-Bstatic -lcurl. > Debian linux 64-bit - no problems. FreeBSD - no problems. Debian linux > 32-bit - no luck. > > I can dynamic link just fine. 64-bit Linux uses libcurl 7.15 package. > 32-bit linux uses libcurl 7.18. > I tried downloading the latest libcurl sources (7.19) and things got even > worse. I tried configuring > without ssl, ssh2, etc. No luck - I'm not much of a linux expert. > > Ideas anyone? > > I'm willing to wipe Debian off the disk if some other distro can do a static > link. Anyone want > to try a build on their distro? To try it, do this: > > centos 4.latest failed too. long error dump similar to that on centos 5.latest fails on CentOS 3.9 x86 too. [pier...@svxeon1 mprime]$ cd gwnum/ [pier...@svxeon1 gwnum]$ make gcc -I.. -O2 -march=i486 -malign-double -c cpuid.c gcc -I.. -O2 -march=i486 -malign-double -c gwnum.c gcc -I.. -O2 -march=i486 -malign-double -c gwthread.c gcc -I.. -O2 -march=i486 -malign-double -c gwutil.c g++ -I.. -I../qd -O2 -march=i486 -malign-double -c gwdbldbl.cpp gcc -I.. -O2 -march=i486 -malign-double -c giants.c gcc -I.. -O2 -march=i486 -malign-double -c ecmstag1.c cp linux/gwnum.a . ar -rs gwnum.a cpuid.o gwnum.o gwthread.o gwutil.o gwdbldbl.o giants.o ecmstag1.o [pier...@svxeon1 gwnum]$ cd ../linux [pier...@svxeon1 linux]$ make [ ! -e ../security.h ] && touch ../security.h || true [ ! -e ../security.c ] && touch ../security.c || true [ ! -e ../secure5.c ] && touch ../secure5.c || true gcc -I.. -I../gwnum -O2 -march=i486 -malign-double -c prime.c In file included from prime.c:111: ../primenet.c: In function `curl_trace': ../primenet.c:620: `CURLINFO_SSL_DATA_IN' undeclared (first use in this function) ../primenet.c:620: (Each undeclared identifier is reported only once ../primenet.c:620: for each function it appears in.) ../primenet.c:623: `CURLINFO_SSL_DATA_OUT' undeclared (first use in this function) ../primenet.c: In function `pnHttpServerCURL': ../primenet.c:699: `CURLOPT_PROXYAUTH' undeclared (first use in this function) make: *** [prime.o] Error 1 gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-59) curl-devel-7.10.6-9.rhel3 do you know if this requires some specific version of curl? I could try cobbling up that environment an ancient RHEL 2.1 legacy test server I keep online at work also failed with errors similar to centos 3. ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
George Woltman wrote: > I went to build the 25.11 executables with libcurl staticly linked in > using -Wl,-Bstatic -lcurl. > Debian linux 64-bit - no problems. FreeBSD - no problems. Debian > linux 32-bit - no luck. > > I can dynamic link just fine. 64-bit Linux uses libcurl 7.15 package. > 32-bit linux uses libcurl 7.18. > I tried downloading the latest libcurl sources (7.19) and things got > even worse. I tried configuring > without ssl, ssh2, etc. No luck - I'm not much of a linux expert. I tried building on an openSUSE 11.0 32bit system - compiled fine, but failed to link. AFAICT, it's missing libcurl.a which doesn't appear to be part of the regular libcurl4 package(s). I'll try with the curl 7.19 source and see how far I get. /Per Jessen, Zürich ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
Per Jessen wrote: > George Woltman wrote: > >> I went to build the 25.11 executables with libcurl staticly linked in >> using -Wl,-Bstatic -lcurl. >> Debian linux 64-bit - no problems. FreeBSD - no problems. Debian >> linux 32-bit - no luck. >> >> I can dynamic link just fine. 64-bit Linux uses libcurl 7.15 >> package. 32-bit linux uses libcurl 7.18. >> I tried downloading the latest libcurl sources (7.19) and things got >> even worse. I tried configuring >> without ssl, ssh2, etc. No luck - I'm not much of a linux expert. > > I tried building on an openSUSE 11.0 32bit system - compiled fine, but > failed to link. AFAICT, it's missing libcurl.a which doesn't appear > to be part of the regular libcurl4 package(s). > > I'll try with the curl 7.19 source and see how far I get. > I got a libcurl.a built, but linking with it appears to drag all sorts of other stuff along - ldap, ssl etc. I then configured libcurl with this: ./configure --disable-ldap --without-libssh2 --without-ssl --without-krb4 --enable-static --disable-shared --without-zlib and when I try to link mprime again, I get this: OUTPUT(mprime elf32-i386) /usr/lib/gcc/i586-suse-linux/4.3/../../../libcurl.a(timeval.o): In function `curlx_tvnow': timeval.c:(.text+0x89): undefined reference to `clock_gettime' collect2: ld returned 1 exit status /Per Jessen, Zürich ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
> I went to build the 25.11 executables with libcurl staticly linked in using > -Wl,-Bstatic -lcurl. > Debian linux 64-bit - no problems. FreeBSD - no problems. Debian linux > 32-bit - no luck. > > I can dynamic link just fine. 64-bit Linux uses libcurl 7.15 package. > 32-bit linux uses libcurl 7.18. > I tried downloading the latest libcurl sources (7.19) and things got even > worse. I tried configuring > without ssl, ssh2, etc. No luck - I'm not much of a linux expert. > > Ideas anyone? Hi George, I'm not sure your problem is the one I sometimes see with Linux. Let say a program requires a lib named ALib.720 and that only ALib.715 is present on the machine, though my program does not need what's new in ALib.720 and though ALib.720 contains everything that ALib.715 provides. Dynamically linking my program fails since a file named ALib.720 is missing. Then it is enough to copy ALib.715 in a file named ALib.720 : my program dynamically links perfectly. I think I did this for mprime. But probably for a RedHat version. Hope it helps, Regards, Tony Créez votre adresse électronique prenom@laposte.net 1 Go d'espace de stockage, anti-spam et anti-virus intégrés. ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
On Mon, Jul 13, 2009 at 10:34:01PM -0400, George Woltman wrote: > I went to build the 25.11 executables with libcurl staticly linked in using > -Wl,-Bstatic -lcurl. > Debian linux 64-bit - no problems. FreeBSD - no problems. Debian linux > 32-bit - no luck. I'm a bit surprised it works fine with 64-bit, really, given that libcurl needs lots of static dependencies to work fine in static linking. Basically, on Linux static libraries don't have dependency information, you'll need to get that from an external source: fugl:~> curl-config --static-libs /usr/lib/libcurl.a -lidn -llber -lldap -lrt -lgssapi_krb5 -lgssapi_krb5 -lz -lgnutls -lgcrypt Normally pkg-config could also be used for this, but for some reason libcurl's pkg-config file appears to be broken. Also, for good measure, something(TM) caused libgssapi_krb5 to no longer be available as a static library at some point, which is causing a headache. > I can dynamic link just fine. 64-bit Linux uses libcurl 7.15 package. > 32-bit linux uses libcurl 7.18. This is also weird. Debian's version numbers are almost always in sync between 32- and 64-bit, so it sounds like your 64-bit install is an older version of Debian; probably etch (4.0, IIRC). If you're only after a quick temporary solution, and it works for you on 64-bit, you could try reinstalling etch on the 32-bit partition as well. > I tried downloading the latest libcurl sources (7.19) and things got even > worse. I tried configuring > without ssl, ssh2, etc. No luck - I'm not much of a linux expert. This is probably the best anyway, if you don't want to get stuck in license problems with SSL libraries. I tried it, and it was relatively painless for me. What error messages did you get? (If you have problems with missing libraries etc., the simplest thing is probably to ask apt to replicate the build dependencies of the Debian package with “apt-get build-dep curl”.) You can get the binary I built at http://home.samfundet.no/~sesse/sprime2511.gz, but I assume you'd rather want to build your own to get in the security code stuff :-) /* Steinar */ -- Homepage: http://www.sesse.net/ ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
On Tue, Jul 14, 2009 at 11:11:12AM +0200, Steinar H. Gunderson wrote: > Normally pkg-config could also be used for this, but for some reason > libcurl's pkg-config file appears to be broken. Sorry, this was just my incompetence: fugl:~> pkg-config --static --libs libcurl -lcurl -lidn -llber -lldap -lrt -lgssapi_krb5 -lz -lgnutls -lgcrypt /* Steinar */ -- Homepage: http://www.sesse.net/ ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
George Woltman wrote: > I went to build the 25.11 executables with libcurl staticly linked in using > -Wl,-Bstatic -lcurl. > Debian linux 64-bit - no problems. FreeBSD - no problems. Debian linux > 32-bit - no luck. > > I can dynamic link just fine. 64-bit Linux uses libcurl 7.15 package. > 32-bit linux uses libcurl 7.18. > I tried downloading the latest libcurl sources (7.19) and things got even > worse. I tried configuring > without ssl, ssh2, etc. No luck - I'm not much of a linux expert. > > Ideas anyone? > > I'm willing to wipe Debian off the disk if some other distro can do a static > link. Anyone want > to try a build on their distro? To try it, do this: > > 1) Download ftp://mersenne.org/source2511.zip > 2) cd gwnum > 3) make > 4) cd ../linux > 5) make > It builds under Slackware-current 32-bit, which is effectively the pre-release of Slackware 13. It would probably work under Slackware 12.2 as well. I just had to add "-ldl -lrt -lidn -lldap -lz" to the library list. This could probably be reduced by building libcurl from source and deselecting some options. Slackware may not be the friendliest of distros, but, where possible, the component packages are unchanged from the original source, so you get minimal conflicts when you build something yourself. ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
On Mon, Jul 13, 2009 at 11:07 PM, John R Pierce wrote: > > > 1) Download ftp://mersenne.org/source2511.zip > > Oops. Make that ftp://mersenne.org/gimps/source2511.zip ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
Andrew Farr wrote: > It builds under Slackware-current 32-bit, which is effectively the > pre-release of Slackware 13. It would probably work under Slackware 12.2 > as well. > > I just had to add "-ldl -lrt -lidn -lldap -lz" to the library list. > This could probably be reduced by building libcurl from source and > deselecting some options. > adding that to the LDFLAGS worked for CentOS 5.3 also. ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
John R Pierce wrote: > Andrew Farr wrote: > >> It builds under Slackware-current 32-bit, which is effectively the >> pre-release of Slackware 13. It would probably work under Slackware 12.2 >> as well. >> >> I just had to add "-ldl -lrt -lidn -lldap -lz" to the library list. >> This could probably be reduced by building libcurl from source and >> deselecting some options. >> >> > > adding that to the LDFLAGS worked for CentOS 5.3 also. > > I dropped the binary that I built on CentOS 5.3 at http://freescruz.com/mprime if you want to examine it. it still has a _LOT_ of dynamic libraries linked.. $ ldd mprime linux-gate.so.1 => (0x004aa000) libdl.so.2 => /lib/libdl.so.2 (0x006b8000) librt.so.1 => /lib/librt.so.1 (0x00777000) libidn.so.11 => /usr/lib/libidn.so.11 (0x00a34000) libldap-2.3.so.0 => /usr/lib/libldap-2.3.so.0 (0x00b39000) libz.so.1 => /usr/lib/libz.so.1 (0x0070) libm.so.6 => /lib/libm.so.6 (0x006be000) libpthread.so.0 => /lib/libpthread.so.0 (0x006e7000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x007e4000) libc.so.6 => /lib/libc.so.6 (0x00111000) /lib/ld-linux.so.2 (0x0054f000) libssl.so.6 => /lib/libssl.so.6 (0x00af) libcrypto.so.6 => /lib/libcrypto.so.6 (0x00255000) libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00934000) liblber-2.3.so.0 => /usr/lib/liblber-2.3.so.0 (0x00abc000) libresolv.so.2 => /lib/libresolv.so.2 (0x007cf000) libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0x00a6a000) libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x0096f000) libcom_err.so.2 => /lib/libcom_err.so.2 (0x0056d000) libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00a07000) libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00964000) libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x00a2f000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x0079b000) libselinux.so.1 => /lib/libselinux.so.1 (0x00715000) libsepol.so.1 => /lib/libsepol.so.1 (0x0072f000) ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
On Tue, Jul 14, 2009 at 12:02:15PM +0100, Andrew Farr wrote: > I just had to add "-ldl -lrt -lidn -lldap -lz" to the library list. > This could probably be reduced by building libcurl from source and > deselecting some options. FWIW, the standard Makefile idiom you want is to replace -lcurl with $(shell pkg-config --static --libs libcurl) which will expand to the output of that command, run once. /* Steinar */ -- Homepage: http://www.sesse.net/ ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
On Tue, Jul 14, 2009 at 10:16 AM, Steinar H. Gunderson wrote: >> I just had to add "-ldl -lrt -lidn -lldap -lz" to the library list. >> This could probably be reduced by building libcurl from source and >> deselecting some options. > > FWIW, the standard Makefile idiom you want is to replace -lcurl with > > $(shell pkg-config --static --libs libcurl) > > which will expand to the output of that command, run once. Thanks, Steinar, I was able to build a linux version using the makefile below, which was created prior to your last mail. I'd appreciate any feedback, especially: 1) Should I configure libcurl without more stuff? I stay as far away from networking internals as possible. 2) I left the libraries that libcurl needs dynamicly linked. Would you recommend that some of these be static instead? # Makefile for Linux 32-bit mprime # # NOTES: libcurl built by downloading latest sources and: # ./configure --without-ssl --without-libssh2 # make # make install # Libraries to include were calculated using: # curl-config --static-libs CC = gcc CFLAGS = -I.. -I../gwnum -O2 -march=i486 -malign-double CPP = g++ CPPFLAGS = -I.. -I../gwnum -O2 -march=i486 -malign-double LFLAGS = -Wl,-M LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic -lcurl -lstdc++ -Wl,-Bdynamic -ldl -lidn -lldap -lrt -lz FACTOROBJ = factor32.o LINUXOBJS = prime.o menu.o EXE = mprime # $(EXE): security $(LINUXOBJS) $(FACTOROBJ) $(CC) $(LFLAGS) -o $(EXE) $(LINUXOBJS) $(FACTOROBJ) $(LIBS) security: [ ! -e ../security.h ] && touch ../security.h || true [ ! -e ../security.c ] && touch ../security.c || true [ ! -e ../secure5.c ] && touch ../secure5.c || true clean: rm -f $(EXE) $(EXE2) $(LINUXOBJS) .c.o: $(CC) $(CFLAGS) -c $< .cpp.o: $(CPP) $(CPPFLAGS) -c $< ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
On Tue, Jul 14, 2009 at 07:06:11AM -0700, John R Pierce wrote: > I dropped the binary that I built on CentOS 5.3 at > http://freescruz.com/mprime if you want to examine it. it still has a > _LOT_ of dynamic libraries linked.. Did you perchance put your libraries outside the static/dynamic linker options pair? Mine has fugl:~/dev/mersenne/linux> ldd sprime2511 linux-gate.so.1 => (0xe000) libm.so.6 => /lib/libm.so.6 (0xb7eca000) libpthread.so.0 => /lib/libpthread.so.0 (0xb7eb2000) libdl.so.2 => /lib/libdl.so.2 (0xb7ead000) libc.so.6 => /lib/libc.so.6 (0xb7d6d000) /lib/ld-linux.so.2 (0xb7f06000) which is probably the list you want. /* Steinar */ -- Homepage: http://www.sesse.net/ ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
On Tue, Jul 14, 2009 at 10:33:34AM -0400, George Woltman wrote: > 1) Should I configure libcurl without more stuff? I stay as far away from > networking internals as possible. You probably should configure it with as few external dependencies as possible. In particular, SSL libraries are historically difficult license-wise. You do not need LDAP. You do not need Kerberos or GSS support. You do not need IDN support. Personally I'd be happy if mprime could talk IPv6 (even though the servers do not support IPv6 at the moment, I take it); keeping --enable-ipv6 shouldn't cost much or need external libraries. > 2) I left the libraries that libcurl needs dynamicly linked. Would you > recommend that some of these be static instead? Everything not part of glibc (libc, libm, librt, libdl, libpthread) should be linked statically, as far as the license permits. If you look at the finished binary with ldd you will also see ld-linux.so.2 (the dynamic loader) and linux-gate.so.1 (a page the kernel links in dynamically for the syscall interface); do not worry about those. > LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic > -lcurl -lstdc++ -Wl,-Bdynamic -ldl -lidn -lldap -lrt -lz It will probably be a bit more robust if you use the $(shell idiom instead. /* Steinar */ -- Homepage: http://www.sesse.net/ ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
George Woltman wrote: > 2) I left the libraries that libcurl needs dynamicly linked. Would you > recommend that some of these be static instead? > that depennds on the goal of static linking. if its to create a binary that will run on as many distributions as possible, then you want as many statics and few external dependencies as you can get, otherwise the binary only works if the specific shared library versions referenced are available. ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime
Re: [Prime] More static linking problems
Ta da! Thanks everyone. Here is the final makefile: # Makefile for Linux 32-bit mprime # # 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 # After linking, check to see if too many dynamic libraries are required by doing: # ldd mprime CC = gcc CFLAGS = -I.. -I../gwnum -O2 -march=i486 -malign-double CPP = g++ CPPFLAGS = -I.. -I../gwnum -O2 -march=i486 -malign-double LFLAGS = -Wl,-M LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic $(shell pkg-config --static --libs libcurl) -lstdc++ -Wl,-Bdynamic -ldl FACTOROBJ = factor32.o LINUXOBJS = prime.o menu.o EXE = mprime # $(EXE): security $(LINUXOBJS) $(FACTOROBJ) $(CC) $(LFLAGS) -o $(EXE) $(LINUXOBJS) $(FACTOROBJ) $(LIBS) security: [ ! -e ../security.h ] && touch ../security.h || true [ ! -e ../security.c ] && touch ../security.c || true [ ! -e ../secure5.c ] && touch ../secure5.c || true clean: rm -f $(EXE) $(EXE2) $(LINUXOBJS) .c.o: $(CC) $(CFLAGS) -c $< .cpp.o: $(CPP) $(CPPFLAGS) -c $< ___ Prime mailing list Prime@hogranch.com http://hogranch.com/mailman/listinfo/prime