mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Linux (https://www.mersenneforum.org/forumdisplay.php?f=39)
-   -   Seeking help on packaging mprime for Debian (https://www.mersenneforum.org/showthread.php?t=20235)

alexvong1995 2015-05-08 08:05

Seeking help on packaging mprime for Debian
 
1 Attachment(s)
First, I have been a Debian user since New Year. I always want to package some software but was too busy to do so. I think it is the right time now.

Previously, I needed able to build and install libcurl from [URL="http://www.linuxfromscratch.org/blfs/view/svn/basicnet/curl.html"]source[/URL] to compile mprime because mprime won't compile with the Debian libcurl [URL="https://packages.debian.org/jessie/libcurl4-gnutls-dev"]package[/URL] (gcc throws errors about undefined references). Then I need to change the Makefile by a bit, linking against the freshly built dynamic library instead of static library to get mprime compiled.

However, I noticed that mprime was not able to connect primenet. I guess it is because some security code relating issues. Perhaps?
So I decide to compile mprime without primenet support since it makes no sense to link against something not working.

I am able to done it just now! To compile mprime without libcurl. Here is my patch.diff generated by git.

HOW TO COMPILE:
1. extract [URL="http://www.mersenne.org/download/"]p95v285.source.zip[/URL] to p95v285.source/
2. goto p95v285.source/gwnum/ and type [CODE]$ make -f make64[/CODE]3. Download and decompress noprimenet.diff.bz2 and put it inside p95v285.source/
4. goto p95v285.source/ and type [CODE]$ patch -p1 < noprimenet.diff[/CODE]5. goto p95v285.source/linux64/ and type [CODE]$ make -f makenoprimenet[/CODE]Let me know if it works!
(I just find out mersenneforum does not support xz yet)

Xyzzy 2015-05-08 14:43

We looked into it a long time ago.

[url]http://www.mersenneforum.org/showthread.php?t=7181[/url]

alexvong1995 2015-05-09 00:16

1 Attachment(s)
Thanks! Do you mean the restrictive award agreement violates DFSG? Does mprime fit in contrib or non-free? Nevermind, I will also be glad to package Mlucas and Glucas. I was able to compile Mlucas according to [URL="http://hogranch.com/mayer/README.html#download"]instruction[/URL] and Glucas by [CODE]$ ./configure && make[/CODE]Progress report: I have set USE_PRIMENET always equal to 0 to deactivate the use of primenet. Also, I have modified the Makefiles and now we can build mprime with customized optimization flags. See below on how to compile.

HOW TO COMPILE:
1. extract [URL="http://www.mersenne.org/download/"]p95v285.source.zip[/URL] to p95v285.source/
2. Download and decompress noprimenet2.diff.bz2 and put it inside p95v285.source/
3. goto p95v285.source/ and type[CODE]$ patch -p1 < noprimenet2.diff[/CODE]4. goto p95v285.source/gwnum/ and type[CODE]$ make -f make64 'COFLAGS = -march=native -O3 -pipe' 'CXXOFLAGS = $(COFLAGS)'[/CODE]5. goto p95v285.source/linux64/ and type[CODE]$ make -f makenoprimenet 'COFLAGS = -march=native -O3 -pipe -flto' 'CXXOFLAGS = $(COFLAGS)'[/CODE]I don't think the optimization flags will change things because the performance critical part is already written in assembly but it is good to know the optimization doesn't break things (I have tried the non-standard compliant -Ofast which do break things). Now the USE_PRIMENET flag is always 0 so you don't have to worry about accidentally activating it.

Let me know if it builds and runs!
I will not be connected to the Internet for about 2-3 days so I will not be replying until I come back from the rural area.

alexvong1995 2015-05-13 12:49

autotools for Mlucas
 
Currently, Mlucas uses no makefile because it is relatively simple to build. But since I want to package it for Debian, we need some sort of build system. So I decided to use [URL="https://en.wikipedia.org/wiki/GNU_build_system"]autotools[/URL] ([URL="https://www.gnu.org/software/autoconf/autoconf.html"]autoconf[/URL] and [URL="https://www.gnu.org/software/automake/"]automake[/URL]) to build Mlucas.
The tough part is to learn the basics, but thanks to the tutorials ([URL="https://autotools.io/index.html"]Autotools Mythbuster[/URL] and [URL="http://www.dwheeler.com/autotools/index.html"]video tutorial[/URL]), I kind of understand them now. The GNU manuals for autoconf and automake are useful but you need to learn the basics first.

HOW TO BUILD:
OK. So actually I have made 3 files, configure.ac, Makefile.am and m4/sources_list.m4
(configure.ac is actually made by using the template created by autoscan after it scans the source code)
Other files are created by running autoreconf -i

1. Fetch the code from git, [CODE]$ git clone https://gitorious.org/mlucas/mlucas.git[/CODE]2. To build Mlucas type[CODE]$ cd mlucas && mkdir build && cd build && ../configure && make[/CODE]3. To show the help menu, [CODE]$ ./mlucas -h 2>&1 | less[/CODE]4. Currently, make, make clean, make distclean and make dist are tested and worked

FEATURE: (to be added later)

TODO: (to be added later)


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

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