mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Msieve

Reply
 
Thread Tools
Old 2012-10-13, 10:20   #1
VolMike
 
VolMike's Avatar
 
Jun 2007
Moscow,Russia

7×19 Posts
Default Building msieve under Ubuntu 12.04

I'm trying to build msieve under under Ubuntu 12.04 x86
If "make x86", system returns :

Code:
make: svnversion: Command not found
gcc -D_FILE_OFFSET_BITS=64 -O3 -fomit-frame-pointer -march=k8 -DNDEBUG -D_LARGEFILE64_SOURCE  -Wall -W -DMSIEVE_SVN_VERSION="\"unknown\"" -I. -Iinclude -Ignfs -Ignfs/poly -Ignfs/poly/stage1 -c -o common/filter/clique.o common/filter/clique.c
In file included from include/msieve.h:24:0,
                 from include/common.h:18,
                 from common/filter/filter.h:23,
                 from common/filter/filter_priv.h:23,
                 from common/filter/clique.c:15:
include/util.h:47:19: fatal error: zlib.h: No such file or directory
compilation terminated.
make: *** [common/filter/clique.o] Error 1
Zlib folder is in msieve folder and zlib.h exists in zlib.

I'm newbie in Linux systems, but it seems that msieve needs some other zlib files.How to get rid of this error and build msieve?

Last fiddled with by VolMike on 2012-10-13 at 10:26
VolMike is offline   Reply With Quote
Old 2012-10-13, 10:26   #2
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

9,161 Posts
Default

Add -Izlib to makefile next to -I. -Iinclude -Ignfs
Batalov is offline   Reply With Quote
Old 2012-10-13, 10:36   #3
VolMike
 
VolMike's Avatar
 
Jun 2007
Moscow,Russia

7·19 Posts
Default

Quote:
Originally Posted by Batalov View Post
Add -Izlib to makefile next to -I. -Iinclude -Ignfs
Thanks!
It makes compilation proceed, libmsieve.a was successfully created, but then system retuns another error
Code:
ar: creating libmsieve.a
ranlib libmsieve.a
gcc -D_FILE_OFFSET_BITS=64 -O3 -fomit-frame-pointer -march=k8 -DNDEBUG -D_LARGEFILE64_SOURCE  -Wall -W -DMSIEVE_SVN_VERSION="\"unknown\"" -I. -Iinclude -Ignfs -Izlib -Ignfs/poly -Ignfs/poly/stage1 demo.c -o msieve  \
            libmsieve.a -lz -lgmp -lm -lpthread
demo.c: In function ‘main’:
demo.c:559:9: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
demo.c:581:9: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
demo.c: In function ‘get_random_seeds’:
demo.c:54:8: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
demo.c:55:8: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [x86] Error 1
What's wrong with lz?

Last fiddled with by VolMike on 2012-10-13 at 10:37
VolMike is offline   Reply With Quote
Old 2012-10-13, 12:08   #4
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

3×1,163 Posts
Default

On most other unix systems zlib is a library called libz.a or libz.so; you link it in by adding '-lz' to the compile line. But you've already done that, so you can go into the makefile and remove the part that adds '-lz'.
jasonp is offline   Reply With Quote
Old 2012-10-13, 15:51   #5
debrouxl
 
debrouxl's Avatar
 
Sep 2009

977 Posts
Default

If you want to compile against the zlib on your host system, you'll have to install the zlib1g-dev package.
debrouxl is offline   Reply With Quote
Old 2012-10-13, 17:36   #6
VolMike
 
VolMike's Avatar
 
Jun 2007
Moscow,Russia

7·19 Posts
Default

Quote:
Originally Posted by jasonp View Post
On most other unix systems zlib is a library called libz.a or libz.so; you link it in by adding '-lz' to the compile line. But you've already done that, so you can go into the makefile and remove the part that adds '-lz'.
Thanks, but it seems int this case not only -lz should be removed. The most easiest way is to install zlib1g-dev as debrouxl mentioned.
VolMike is offline   Reply With Quote
Old 2012-10-13, 17:41   #7
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×2,399 Posts
Default

You can also compile it with NO_ZLIB=1 in the make command.
Dubslow is offline   Reply With Quote
Old 2012-10-13, 17:41   #8
VolMike
 
VolMike's Avatar
 
Jun 2007
Moscow,Russia

7·19 Posts
Default

Quote:
Originally Posted by debrouxl View Post
If you want to compile against the zlib on your host system, you'll have to install the zlib1g-dev package.
Thanks! I was successfull in msieve compilation after installing this package.
VolMike is offline   Reply With Quote
Old 2012-10-13, 19:17   #9
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

916110 Posts
Default

Quote:
Originally Posted by VolMike View Post
Thanks!
It makes compilation proceed, libmsieve.a was successfully created, but then system retuns another error
Code:
ar: creating libmsieve.a
ranlib libmsieve.a
gcc -D_FILE_OFFSET_BITS=64 -O3 -fomit-frame-pointer -march=k8 -DNDEBUG -D_LARGEFILE64_SOURCE  -Wall -W -DMSIEVE_SVN_VERSION="\"unknown\"" -I. -Iinclude -Ignfs -Izlib -Ignfs/poly -Ignfs/poly/stage1 demo.c -o msieve  \
            libmsieve.a -lz -lgmp -lm -lpthread
demo.c: In function ‘main’:
demo.c:559:9: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
demo.c:581:9: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
demo.c: In function ‘get_random_seeds’:
demo.c:54:8: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
demo.c:55:8: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [x86] Error 1
What's wrong with lz?
In addition to the above comments, suppose we were on a machine where we have no sudo -or- even if you have the system libz, but it is old (VER<=1.2.3). The zlib folder is included, indeed, for that reason (and for Windows builds). You want to cd zlib; make, then copy libz.a to the msieve folder and replace -lz with ./libz.a in the Makefile and you will have libz built-in. There's no harm in doing -- libz code is tiny. It will not bloat the binary or the memory image.
Batalov is offline   Reply With Quote
Old 2012-10-14, 07:57   #10
VolMike
 
VolMike's Avatar
 
Jun 2007
Moscow,Russia

7·19 Posts
Default

Quote:
Originally Posted by Batalov View Post
In addition to the above comments, suppose we were on a machine where we have no sudo -or- even if you have the system libz, but it is old (VER<=1.2.3). The zlib folder is included, indeed, for that reason (and for Windows builds). You want to cd zlib; make, then copy libz.a to the msieve folder and replace -lz with ./libz.a in the Makefile and you will have libz built-in. There's no harm in doing -- libz code is tiny. It will not bloat the binary or the memory image.
As I'm newbie in Linux systems, it seems too complicated for me to keep in mind all those features. Honestely, I didn't think it would be so difficult to me to make msieve build. The main reason of that is a deficit of Linux knowledges.
VolMike is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
How I Run a Larger Factorization Using Msieve, gnfs and factmsieve.py on Several Ubuntu Machines EdH EdH 7 2019-08-21 02:26
How I Install msieve onto my Ubuntu Machines EdH EdH 0 2018-02-23 14:43
Building sr1sieve for RPi wombatman Software 14 2017-03-04 16:21
Building MSieve without VS? SWSaunders Msieve 3 2013-04-26 11:19
Building gcc 4.4.0 CRGreathouse Software 1 2009-07-07 22:25

All times are UTC. The time now is 03:58.

Sun Nov 29 03:58:17 UTC 2020 up 80 days, 1:09, 3 users, load averages: 0.98, 1.01, 1.07

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.