mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Aliquot Sequences

Reply
 
Thread Tools
Old 2012-09-30, 00:29   #430
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

11×313 Posts
Default

I have run across some trouble trying to compile Aliqueit for a 64-bit installation of Ubuntu. This is in reference to my page on the steps to create an Ubuntu Aliqueit system with ggnfs, msieve, YAFU and associated scripts, etc.

The machine info:
Code:
AMD Athlon(tm) 64 X2 Dual Core Processor 4000+
2G memory
Linux math11 3.2.0-31-generic #50-Ubuntu SMP Fri Sep 7 16:16:45 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
I have successfully compiled and installed gmp (per instructions, I uninstalled all gmp and libgmp repository packages first), gmp-ecm, msieve and YAFU. But, Aliqueit seems to be missing something from the gmp library:
Code:
aliqueit.cc:(.text._ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPSt4pairI10__gmp_exprIA1_12__mpz_structS5_EiESt6vectorIS7_SaIS7_EEEElEvT_SD_T0_[void std::__introsort_loop<__gnu_cxx::__normal_iterator<std::pair<__gmp_expr<__mpz_struct [1], __mpz_struct [1]>, int>*, std::vector<std::pair<__gmp_expr<__mpz_struct [1], __mpz_struct [1]>, int>, std::allocator<std::pair<__gmp_expr<__mpz_struct [1], __mpz_struct [1]>, int> > > >, long>(__gnu_cxx::__normal_iterator<std::pair<__gmp_expr<__mpz_struct [1], __mpz_struct [1]>, int>*, std::vector<std::pair<__gmp_expr<__mpz_struct [1], __mpz_struct [1]>, int>, std::allocator<std::pair<__gmp_expr<__mpz_struct [1], __mpz_struct [1]>, int> > > >, __gnu_cxx::__normal_iterator<std::pair<__gmp_expr<__mpz_struct [1], __mpz_struct [1]>, int>*, std::vector<std::pair<__gmp_expr<__mpz_struct [1], __mpz_struct [1]>, int>, std::allocator<std::pair<__gmp_expr<__mpz_struct [1], __mpz_struct [1]>, int> > > >, long)]+0x13f): undefined reference to `__gmpz_clear'
aliqueit.o: In function `main':
aliqueit.cc:(.text.startup+0x66): undefined reference to `__gmpz_init_set_si'
aliqueit.cc:(.text.startup+0x82): undefined reference to `__gmpz_init_set_si'
aliqueit.cc:(.text.startup+0x9e): undefined reference to `__gmpz_init_set_si'
aliqueit.cc:(.text.startup+0x1c1): undefined reference to `__gmpz_set_str'
aliqueit.cc:(.text.startup+0x2a2): undefined reference to `__gmpz_clear'
aliqueit.cc:(.text.startup+0x2af): undefined reference to `__gmpz_clear'
aliqueit.cc:(.text.startup+0x2bc): undefined reference to `__gmpz_clear'
aliqueit.cc:(.text.startup+0x36f): undefined reference to `__gmpz_init_set'
aliqueit.cc:(.text.startup+0x385): undefined reference to `__gmpz_clear'
aliqueit.cc:(.text.startup+0x706): undefined reference to `__gmpz_set_str'
aliqueit.cc:(.text.startup+0x73e): undefined reference to `__gmpz_set'
aliqueit.cc:(.text.startup+0x78a): undefined reference to `__gmpz_cmp'
aliqueit.cc:(.text.startup+0x95d): undefined reference to `__gmpz_init_set'
aliqueit.cc:(.text.startup+0xa19): undefined reference to `__gmpz_cmp'
aliqueit.cc:(.text.startup+0xd0b): undefined reference to `__gmpz_init_set'
aliqueit.cc:(.text.startup+0xd44): undefined reference to `__gmpz_clear'
aliqueit.cc:(.text.startup+0xfac): undefined reference to `__gmpz_divexact_ui'
aliqueit.cc:(.text.startup+0xfc8): undefined reference to `__gmpz_divisible_ui_p'
aliqueit.cc:(.text.startup+0x116a): undefined reference to `__gmpz_init'
aliqueit.cc:(.text.startup+0x1177): undefined reference to `__gmpz_init'
aliqueit.cc:(.text.startup+0x11a4): undefined reference to `__gmpz_cmp'
aliqueit.cc:(.text.startup+0x11ea): undefined reference to `__gmpz_set'
aliqueit.cc:(.text.startup+0x1202): undefined reference to `__gmpz_sub'
aliqueit.cc:(.text.startup+0x1221): undefined reference to `__gmpz_clear'
aliqueit.cc:(.text.startup+0x122e): undefined reference to `__gmpz_clear'
aliqueit.cc:(.text.startup+0x126f): undefined reference to `__gmpz_clear'
aliqueit.cc:(.text.startup+0x16de): undefined reference to `__gmpz_clear'
aliqueit.cc:(.text.startup+0x1700): undefined reference to `__gmpz_clear'
aliqueit.o:aliqueit.cc:(.text.startup+0x1712): more undefined references to `__gmpz_clear' follow
collect2: ld returned 1 exit status
make: *** [aliqueit] Error 1
math11@math11:~/Math/Aliqueit/src/aliqueit$
I've tried several locations for the gmp directory and libs directory, but nothing changes.

Here's my current Aliqueit Makefile:
Code:
#
# aliqueit Makefile for linux
#

# you'll need to change this if your gmp headers aren't installed globally:
GMP_DIR = /home/math11/Math/gmp

CC = g++
CFLAGS = -O3 -I$(GMP_DIR)

# you'll need to change this if your gmp headers aren't installed globally:
LIBS = -L  /usr/local/lib -lgmp

OBJ = aliqueit.o cfg.o misc.o


aliqueit: $(OBJ)
    $(CC) $(CFLAGS) $(LIBS) $(OBJ) -o aliqueit

%.o: %.cc
    $(CC) $(CFLAGS) -c -o $@ $<
my /usr/local/lib directory holds:
Code:
libecm.a   libgmp.a   libgmp.so     libgmp.so.10.0.5
libecm.la  libgmp.la  libgmp.so.10  python2.7
and, my /home/math11/Math/gmp directory holds:
Code:
acinclude.m4     gen-fac_ui.c       mp_dv_tab.lo    randlc2x.lo
aclocal.m4       gen-fib            mp_dv_tab.o     randlc2x.o
ansi2knr.1       gen-fib.c          mpf             rand.lo
ansi2knr.c       gen-psqr           mp_get_fns.c    randmt.c
assert.c         gen-psqr.c         mp_get_fns.lo   randmt.h
assert.lo        gen-trialdivtab    mp_get_fns.o    randmt.lo
assert.o         gen-trialdivtab.c  mp.h            randmt.o
AUTHORS          gmp.h              mp-h.in         randmts.c
ChangeLog        gmp-h.in           mp_minv_tab.c   randmts.lo
compat.c         gmp-impl.h         mp_minv_tab.lo  randmts.o
compat.lo        gmp-mparam.h       mp_minv_tab.o   randmui.c
compat.o         gmpxx.h            mpn             randmui.lo
configfsf.guess  INSTALL            mpq             randmui.o
configfsf.sub    INSTALL.autoconf   mp_set_fns.c    rand.o
config.guess     install-sh         mp_set_fns.lo   rands.c
config.h         invalid.c          mp_set_fns.o    randsd.c
config.in        invalid.lo         mpz             randsd.lo
config.log       invalid.o          NEWS            randsd.o
config.m4        libgmp.la          nextprime.c     randsdui.c
config.status    libmp.sym          nextprime.lo    randsdui.lo
config.sub       libtool            nextprime.o     randsdui.o
configure        longlong.h         printf          rands.lo
configure.in     ltmain.sh          randbui.c       rands.o
COPYING          Makefile           randbui.lo      README
COPYING.LIB      Makefile.am        randbui.o       scanf
cxx              Makefile.in        rand.c          stamp-h1
demos            memory.c           randclr.c       tal-debug.c
doc              memory.lo          randclr.lo      tal-notreent.c
dumbmp.c         memory.o           randclr.o       tal-reent.c
errno.c          missing            randdef.c       tal-reent.lo
errno.lo         mp_bases.h         randdef.lo      tal-reent.o
errno.o          mp_bpl.c           randdef.o       tests
extract-dbl.c    mp_bpl.lo          randiset.c      trialdivtab.h
extract-dbl.lo   mp_bpl.o           randiset.lo     tune
extract-dbl.o    mpbsd              randiset.o      version.c
fib_table.h      mp_clz_tab.c       randlc2s.c      version.lo
gen-bases        mp_clz_tab.lo      randlc2s.lo     version.o
gen-bases.c      mp_clz_tab.o       randlc2s.o      ylwrap
gen-fac_ui       mp_dv_tab.c        randlc2x.c
Thanks for any assistance.
EdH is online now   Reply With Quote
Old 2012-09-30, 02:55   #431
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

160358 Posts
Default

Try changing "-L /usr/local/lib" to "-L/usr/local/lib". gcc doesn't allow spaces.
Dubslow is offline   Reply With Quote
Old 2012-09-30, 03:56   #432
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

11×313 Posts
Default

Quote:
Originally Posted by Dubslow View Post
Try changing "-L /usr/local/lib" to "-L/usr/local/lib". gcc doesn't allow spaces.
No luck...

My memory must be really short term - a few posts back is the same trouble mentioned by Mr. Odd and solved in my earlier versions by adding libgmp3-dev via the repository. I'm also trying the procedure you put forth in post 424, but that isn't working either.

Thanks for helping sort this out.
EdH is online now   Reply With Quote
Old 2012-09-30, 05:14   #433
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×2,399 Posts
Default

Quote:
Originally Posted by EdH View Post
No luck...

My memory must be really short term - a few posts back is the same trouble mentioned by Mr. Odd and solved in my earlier versions by adding libgmp3-dev via the repository. I'm also trying the procedure you put forth in post 424, but that isn't working either.

Thanks for helping sort this out.
My last general comment would be that I compiled GMP 5.0.4 from source, because IIRC the repositories weren't working either. If you're using an older Ubuntu, it's possible that whatever you have installed doesn't have the necessary functions, and that self-compiling a newer GMP might work.

Edit: Perhaps try adding "-static"? I don't know why it's failing, you've pointed the linker to libgmp, and used "-lgmp", so that should be it... unless the mentioned functions aren't in that particular gmp version, like I hypothesized above.

Last fiddled with by Dubslow on 2012-09-30 at 05:26
Dubslow is offline   Reply With Quote
Old 2012-09-30, 15:00   #434
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

11·313 Posts
Default

Quote:
Originally Posted by Dubslow View Post
My last general comment would be that I compiled GMP 5.0.4 from source, because IIRC the repositories weren't working either. If you're using an older Ubuntu, it's possible that whatever you have installed doesn't have the necessary functions, and that self-compiling a newer GMP might work.

Edit: Perhaps try adding "-static"? I don't know why it's failing, you've pointed the linker to libgmp, and used "-lgmp", so that should be it... unless the mentioned functions aren't in that particular gmp version, like I hypothesized above.
That's the rub. I got the latest everything from the gmp(5.0.5) and ecm(6.4.3b) sites and compiled via their instructions. I gave up on trying to use the repositories and even had to remove some repository versions of packages so that gmp and ecm were "happy." So, if something is missing, they removed it from their latest versions, or it isn't showing up in my system via the methods of compile I used.

Thinking more about it, this might be the trouble. I used their "impatient procedure" to compile, so maybe there is a switch/option I need to engage that isn't invoked by default. However, I expected your procedure from post 424 would have taken care of it.

I do see the defines in gmp.h:
Code:
#define mpz_clear __gmpz_clear
__GMP_DECLSPEC void mpz_clear __GMP_PROTO ((mpz_ptr));
but, not where __gmpz_clear is defined, probably in a library.

Thanks again...
EdH is online now   Reply With Quote
Old 2012-09-30, 15:58   #435
Mr. Odd
 
Mar 2010

5×11 Posts
Default

Yeah, I never figured this out either. If you do, please let us know and/or post a binary!
Mr. Odd is offline   Reply With Quote
Old 2012-09-30, 16:10   #436
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

11×313 Posts
Default

Quote:
Originally Posted by Mr. Odd View Post
Yeah, I never figured this out either. If you do, please let us know and/or post a binary!
I wish I'd known that. Since I saw no further posts, I "assumed" (erroneously) that you were up and running. Sorry!

I do need to track this down to some resolution so I can update my "Steps..." page.

The conclusion will be posted here...
EdH is online now   Reply With Quote
Old 2012-09-30, 17:06   #437
Ralf Recker
 
Ralf Recker's Avatar
 
Oct 2010

191 Posts
Default

Quote:
Originally Posted by EdH View Post
I do see the defines in gmp.h:
Code:
#define mpz_clear __gmpz_clear
__GMP_DECLSPEC void mpz_clear __GMP_PROTO ((mpz_ptr));
but, not where __gmpz_clear is defined, probably in a library.
It's defined in libgmp.so.10.0.5 (dynamic linking)

Code:
ralf@quadriga:~$ objdump -T /usr/lib/x86_64-linux-gnu/libgmp.so.10.0.5 | grep __gmpz_clear
0000000000014900 g    DF .text    0000000000000083  Base        __gmpz_clears
00000000000148e0 g    DF .text    0000000000000018  Base        __gmpz_clear
or in libgmp.a (-static)

Code:
ralf@quadriga:~$ objdump -t /usr/lib/x86_64-linux-gnu/libgmp.a | grep __gmpz_clear
0000000000000000         *UND*    0000000000000000 __gmpz_clear
0000000000000000         *UND*    0000000000000000 __gmpz_clear
0000000000000000         *UND*    0000000000000000 __gmpz_clear
0000000000000000         *UND*    0000000000000000 __gmpz_clear
0000000000000000 g     F .text    0000000000000015 __gmpz_clear
0000000000000000 g     F .text    0000000000000083 __gmpz_clears
0000000000000000         *UND*    0000000000000000 __gmpz_clear
0000000000000000         *UND*    0000000000000000 __gmpz_clear
0000000000000000         *UND*    0000000000000000 __gmpz_clear
This examples are from a Debian 7.0 test setup. Your paths may vary.

By the way: libgmp3-dev is a transitional package for smooth upgrades.
Code:
This is a dummy package that simply pulls in libgmp-dev. It can safely be removed.
You can check if other packets depend on it:

Code:
ralf@quadriga:~$ apt-cache rdepends libgmp3-dev
libgmp3-dev
Reverse Depends:
  swi-prolog-nox
  libppl0.11-dev
  open-cobol
  libmpfr-dev
  libmpfr-dev
  libgmp-ocaml-dev
  libgmp-dev
  libgmp-dev
  genius-dev
  ecl
  ats-lang-anairiats
  libapron-dev
libgmp-dev? Lets look at it:

Code:
ralf@quadriga:~$ apt-cache depends libgmp-dev | grep libgmp3-dev
  Conflicts: libgmp3-dev
  Replaces: libgmp3-dev

Last fiddled with by Ralf Recker on 2012-09-30 at 17:15 Reason: Removed the LANG=C
Ralf Recker is offline   Reply With Quote
Old 2012-09-30, 17:52   #438
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×2,399 Posts
Default

Quote:
Originally Posted by Mr. Odd View Post
or post a binary!
Like I've said more than once before, my binary is available here. That's Aliqueit compiled on Ubuntu 11.04, gcc 4.5.2, GMP 5.0.4.
Dubslow is offline   Reply With Quote
Old 2012-09-30, 18:28   #439
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

D7316 Posts
Default

@Dubslow: Thanks, again. I may have to take that route (even, if just for now), but I am still in question as to why... BTW, I did try -static.

@Ralf Recker: Thanks also. Unfortunately I'm not versed enough to see why my setup differs from yours. Here (with paths adjusted) are my outputs:
Code:
math11@math11:~/Math/gmp$ objdump -T /usr/local/lib/libgmp.so.10.0.5 | grep __gmpz_clear
0000000000015100 g    DF .text    000000000000007f  Base        __gmpz_clears
00000000000150e0 g    DF .text    0000000000000018  Base        __gmpz_clear

math11@math11:~/Math/gmp$ objdump -t /usr/local/lib/libgmp.a | grep __gmpz_clear 
0000000000000000         *UND*    0000000000000000 __gmpz_clear
0000000000000000         *UND*    0000000000000000 __gmpz_clear
0000000000000000         *UND*    0000000000000000 __gmpz_clear
0000000000000000         *UND*    0000000000000000 __gmpz_clear
0000000000000000 g     F .text    0000000000000015 __gmpz_clear
0000000000000000 g     F .text    000000000000007f __gmpz_clears
0000000000000000         *UND*    0000000000000000 __gmpz_clear
0000000000000000         *UND*    0000000000000000 __gmpz_clear
0000000000000000         *UND*    0000000000000000 __gmpz_clear

math11@math11:~/Math/gmp$ apt-cache rdepends libgmp3-dev
libgmp3-dev
Reverse Depends:
  libmpfr-dev:i386
  libmpfr-dev:i386
  libgmp3-dev:i386
  libgmp-dev:i386
  libgmp-dev:i386
  swi-prolog-nox
  open-cobol
  libgmp-ocaml-dev
  libcloog-parma-dev
  libapron-dev
  genius-dev
  ecl
  ats-lang-anairiats
  libppl0.11-dev
  libmpfr-dev
  libmpfr-dev
  libgmp-dev
  libgmp-dev

math11@math11:~/Math/gmp$ apt-cache depends libgmp-dev | grep libgmp3-dev
  Conflicts: libgmp3-dev
  Conflicts: libgmp3-dev:i386
  Replaces: libgmp3-dev
  Replaces: libgmp3-dev:i386
I don't see the significant difference.

Maybe I have found something. This message scrolls off the screen before I can even notice it, when I install gmp:
Code:
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
I'm not familiar with libtool (yet), but maybe this is the issue...
EdH is online now   Reply With Quote
Old 2012-09-30, 18:53   #440
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

11×313 Posts
Default

Quote:
Originally Posted by EdH View Post
...

Maybe I have found something. This message scrolls off the screen before I can even notice it, when I install gmp:
Code:
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
I'm not familiar with libtool (yet), but maybe this is the issue...
Appears to be a dead end. The library paths are already there, as far as I can tell.
EdH is online now   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Resuming aliqueit johnadam74 Aliquot Sequences 4 2016-03-28 12:32
Apparent aliqueit issue with specifying factors pakaran Aliquot Sequences 2 2015-09-12 23:10
Using Several Instances of Aliqueit for a large gnfs job EdH Aliquot Sequences 6 2011-12-13 18:58
Setting up aliqueit science_man_88 Aliquot Sequences 185 2011-11-08 12:18
Tried out aliqueit.exe: ggnfs failing Greebley Aliquot Sequences 35 2010-02-13 15:23

All times are UTC. The time now is 22:17.

Mon Nov 23 22:17:08 UTC 2020 up 74 days, 19:28, 4 users, load averages: 2.92, 2.93, 2.73

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

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.