mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Factoring

Reply
 
Thread Tools
Old 2004-09-20, 07:58   #1
BotXXX
 
BotXXX's Avatar
 
Aug 2003
Europe

C116 Posts
Default Compiling ECM 5.0.3 for windows

I am trying to compile the ECM 5.0.3 package on a windows system to create a windows binary. I am currently using OpenWatcom but for one reason it won't go with the supplied make file. Besides that it also looks to me that the makefile is desinged for Linux systems instead of Windows systems.

I would like to build some binaries for testing and working. Can anybody give me a help/guide or a push in the right direction. Would it matter to use Cygwin for compiling instead of OpenWatcom? Or does someone have experience in compiling the 5.0.3 as a windows binary.

Source at http://webloria.loria.fr/~zimmerma/r...ecm-5.0.3.html

This is the message i get when compiling:
Quote:
Open Watcom C/C++ NMAKE Clone for 386 Version 1.3
Portions Copyright (c) 1995-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
makefile(62): Error(E23): Extensions reversed in implicit rule
Error(E02): Make execution terminated
The lines of code where it goes wrong:
Quote:
.SUFFIXES: .c .o

ecm: $(ALLOBJS) ecm.h ecm-gmp.h
$(LD) -L$(GMP)/lib $(ALLOBJS) -o $@ $(LDFLAGS)

ecm_with_ntl:
make ecm GMP=$(GMP) NTL=$(NTL) CXX=g++ EXTRAOBJS="ntl.o polyz.o" LDFLAGS="-L$(NTL)/lib -lntl $(LDFLAGS)" CFLAGS="$(CFLAGS) -DPOLYGCD"

tune: mpmod.o ecm.h tune.o auxi.o mul_lo.o ecm-gmp.h
$(CC) $(CFLAGS) -L$(GMP)/lib tune.o mpmod.o auxi.o mul_lo.o -o $@ -lgmp

ntl.o: ntl.c
$(CXX) $(CFLAGS) -c -I$(GMP)/include -I$(NTL)/include $<

.c.o: ecm.h ecm-gmp.h
$(CXX) $(CFLAGS) -I$(GMP)/include -c $<
The 62th line is starting with ".c.o:"
BotXXX is offline   Reply With Quote
Old 2004-09-20, 08:36   #2
xilman
Bamboozled!
 
xilman's Avatar
 
"π’‰Ίπ’ŒŒπ’‡·π’†·π’€­"
May 2003
Down not across

11×919 Posts
Default

Quote:
Originally Posted by BotXXX
I am trying to compile the ECM 5.0.3 package on a windows system to create a windows binary. I am currently using OpenWatcom but for one reason it won't go with the supplied make file. Besides that it also looks to me that the makefile is desinged for Linux systems instead of Windows systems.

I would like to build some binaries for testing and working. Can anybody give me a help/guide or a push in the right direction. Would it matter to use Cygwin for compiling instead of OpenWatcom? Or does someone have experience in compiling the 5.0.3 as a windows binary.

Source at http://webloria.loria.fr/~zimmerma/r...ecm-5.0.3.html

This is the message i get when compiling:
The lines of code where it goes wrong:

The 62th line is starting with ".c.o:"
Here's one I built earlier. It assumes a p6 cpu, i.e., a PPro or later, and will not work on vanilla Pentium or earlier.


Paul

Last fiddled with by xilman on 2008-10-25 at 11:26
xilman is offline   Reply With Quote
Old 2004-09-20, 09:07   #3
BotXXX
 
BotXXX's Avatar
 
Aug 2003
Europe

193 Posts
Default

Paul, thank you. I see that you compiled it with Cygwin. I will have a go with that. In the mean time i will use your compiled version.
BotXXX is offline   Reply With Quote
Old 2004-09-20, 10:14   #4
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

25×7×11 Posts
Default

Paul,

can you give us hints on what it takes to get gmp-ecm to compile under Windows? Neither PaulZ or I can do much in this regards as neither of us has Windows running anywhere. It'd be great if we could include instructions in future gmp-ecm releases.

Alex
akruppa is offline   Reply With Quote
Old 2004-09-20, 12:04   #5
JHansen
 
JHansen's Avatar
 
Apr 2004
Copenhagen, Denmark

22×29 Posts
Default

Quote:
Originally Posted by akruppa
Paul,

can you give us hints on what it takes to get gmp-ecm to compile under Windows? Neither PaulZ or I can do much in this regards as neither of us has Windows running anywhere. It'd be great if we could include instructions in future gmp-ecm releases.

Alex
Well, if you just install Cygwin (and remembers to include the gcc tools and make), and then install GMP, GMP-ECM installs without any trouble at all.

The only thing you have to make sure, is that you manually select the gcc tools and the make tool during installation of cygwin.


Jes
JHansen is offline   Reply With Quote
Old 2004-09-20, 13:28   #6
dleclair
 
dleclair's Avatar
 
Mar 2003

3×52 Posts
Default

Both GMP and GMP-ECM 5.0.3 compile easily using Mingw which gives you a Windows binary without the dependency on the Cygwin DLL.

Don Leclair
dleclair is offline   Reply With Quote
Old 2004-09-20, 14:58   #7
xilman
Bamboozled!
 
xilman's Avatar
 
"π’‰Ίπ’ŒŒπ’‡·π’†·π’€­"
May 2003
Down not across

235758 Posts
Default

Quote:
Originally Posted by akruppa
Paul,

can you give us hints on what it takes to get gmp-ecm to compile under Windows? Neither PaulZ or I can do much in this regards as neither of us has Windows running anywhere. It'd be great if we could include instructions in future gmp-ecm releases.

Alex
There are two main ways.

The first is to install some sort of Unix emulator. By far the best, IMAO, is SFU (Services for Unix) which is a free download from microsoft.com. As well as lots of Unix goodies, it comes with a gcc and associated tool set. The site http://www.interopsystems.com/tools/warehouse.htm has lots and lots of add-ons for SFU and some replacements for the utilities shipped. I no longer run a Windows system without SFU installed.

Related is to use Cygwin and/or MIngw. Either of these work, after a fashion, but are clunky (again, IMAO). The free (as in beer) version of Cygwin has a seriously restrictive license condition attached. Any binary distributed that uses the cygwin1.dll must also distribute the corresponding source under the GPL. In the case of gmp-ecm that's not a problem so I pushed out the binary. I could not redistribute a binary built from a BSD, Artistic, Public Domain, etc, source in this way.

The other approach is to acquire (possibly by building from source) a VS-compatible gmp library and then build gmp-ecm from source. If you have such a library it is then very easy to build the executable. Unfortunately, the GMP people seem to go out of their way to make it hard for people to build GMP under Visual Studio. For instance, on the gmp-developers' mailing list this offer appeared two weeks ago:
Quote:
2) Are GMP authors interested in win32 makefiles ?
I created some bakefiles (XML-like project files for
bakefile: http://bakefile.sourceforge.net) which are
able to generate makefiles for various win32 compilers:
borland, msvc, mingw, watcom....

The build system I've created does not require any change
in the code: it's a small win32 directory to add to the
main GMP folder which contains the bakefiles
(from which the makefiles can be re-generated) and
the generated makefiles ready to be run...

I think that adding these files to the official distribution
could be very interesting since it would allow a wider range of
users to take advantage of GMP.
It met with this response:

Quote:
I don't want to maintain another set of makefiles,
and for a platform which I don't use. Sorry.
from Torbjorn Granlund. Here we have someone who has put in a lot of work to do something a number of people have been asking for and many people could use. He gets a peremptory dismissal in return. I was distinctly underimpressed.

Technically GMP is a superb library. I wish I could say the same about other aspects of it.

Perhaps sometime when I'm feeling less thoroughly disillusioned I may build some native Windows 5.0.3 binaries for various machine architectures.

Paul
xilman is offline   Reply With Quote
Old 2004-09-28, 09:50   #8
BotXXX
 
BotXXX's Avatar
 
Aug 2003
Europe

193 Posts
Default

I had a go with MinGW but encountered some problems. Maybe one can help me in solving the problem.


- Installed MinGW + MSYS.
- Copied GMP414 dir to home dir in MSYS.
- Copied ECM503 dir to home dir in MSYS.
- started MSYS and browsed to GMP414 dir.
- Typed ./configure
- Typed make
- Typed make install
- Typed make check
- Found no erros in the check.
- Browsed to ECM503 dir.
- Typed make GMP=/local

- Got the following error:

$ make GMP=/local
gcc -O2 -g -W -Wall -Wmissing-prototypes -I/local/include -c auxi.c
auxi.c:94:26: sys/resource.h: No such file or directory
auxi.c: In function `cputime':
auxi.c:99: error: storage size of `rus' isn't known
auxi.c:101: warning: implicit declaration of function `getrusage'
auxi.c:101: error: `RUSAGE_SELF' undeclared (first use in this function)
auxi.c:101: error: (Each undeclared identifier is reported only once
auxi.c:101: error: for each function it appears in.)
auxi.c:99: warning: unused variable `rus'
auxi.c: In function `get_random_ui':
auxi.c:129: warning: implicit declaration of function `gettimeofday'
make: *** [auxi.o] Error 1


Appears that resource.h is not in MinGW. How can i include this file? Which package is it connected to?
BotXXX is offline   Reply With Quote
Old 2004-09-28, 11:46   #9
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

1001101000002 Posts
Default

On my SuSE system, sys/resource.h is in glibc-devel. A quick google revealed that this header apparantly is not available under Mingw. There are a bunch of other systems where getrusage() is not available and we fall back to clock() in that case, see auxi.c, lines 84ff. I guess all we need to do is add a test for Mingw to the #if. Please try the attached replacement auxi.c. I also #ifdef'd out gettimeofday if no sys/time.h was included.

Let me know if that works.

Alex
Attached Files
File Type: zip auxi.zip (1.5 KB, 158 views)

Last fiddled with by akruppa on 2004-09-28 at 11:48
akruppa is offline   Reply With Quote
Old 2004-09-28, 12:22   #10
BotXXX
 
BotXXX's Avatar
 
Aug 2003
Europe

C116 Posts
Default

I Changed the defined to the following:

#if defined (ANSIONLY) || defined (USG) || defined (__SVR4) || defined (_UNICOS) || defined(__hpux) || defined(__MINGW32__)

Since it is in the windows version of MinGW called __MINGW32__

But now there is an other error.


$ make GMP=/local
gcc -O2 -g -W -Wall -Wmissing-prototypes -I/local/include -c auxi.c
auxi.c: In function `get_random_ui':
auxi.c:111: error: storage size of `tv' isn't known
auxi.c:111: warning: unused variable `tv'
make: *** [auxi.o] Error 1
BotXXX is offline   Reply With Quote
Old 2004-09-28, 12:27   #11
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

25×7×11 Posts
Default

Oops, the

struct timeval tv;

needs to be #ifdef'd, too.

#ifdef _SYS_TIME_H
struct timeval tv;
#endif

Alex
akruppa is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling YAFU for Windows using mingw bsquared YAFU 59 2020-08-21 16:31
compiling svn 427 for Windows 64 bit. skan NFSNET Discussion 7 2012-04-18 10:30
Windows 7 Windows Update & Prime95 issue!!! Unregistered Information & Answers 14 2010-04-10 21:47
Compiling Msieve 1.39 on Windows Jeff Gilchrist Msieve 20 2009-02-21 22:43
Compiling GMP-ECM in Windows using MSVC jbristow GMP-ECM 4 2008-04-17 14:42

All times are UTC. The time now is 07:06.

Tue Oct 20 07:06:11 UTC 2020 up 40 days, 4:17, 0 users, load averages: 1.71, 1.69, 1.61

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.