View | Details | Raw Unified | Return to bug 233261
Collapse All | Expand All

(-)math/mprime/Makefile (-2 / +4 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	mprime
4
PORTNAME=	mprime
5
PORTVERSION=	28.10
5
PORTVERSION=	29.4b7
6
CATEGORIES=	math benchmarks net
6
CATEGORIES=	math benchmarks net
7
MASTER_SITES=	http://www.mersenne.org/ftp_root/gimps/ \
7
MASTER_SITES=	http://www.mersenne.org/ftp_root/gimps/ \
8
		ftp://mersenne.org/gimps/
8
		ftp://mersenne.org/gimps/
Lines 18-24 Link Here
18
18
19
ONLY_FOR_ARCHS=	amd64 i386
19
ONLY_FOR_ARCHS=	amd64 i386
20
20
21
LIB_DEPENDS=	libcurl.so:ftp/curl
21
LIB_DEPENDS=	libcurl.so:ftp/curl					\
22
		libhwloc.so:devel/hwloc					\
23
		libgmp.so:math/gmp
22
24
23
USES=		zip
25
USES=		zip
24
NO_WRKSUBDIR=	yes
26
NO_WRKSUBDIR=	yes
(-)math/mprime/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1495315765
1
TIMESTAMP = 1542398806
2
SHA256 (p95v2810.source.zip) = fdde4652ea12a66487245fbef7980237b2707c595f613cac013e97a489301060
2
SHA256 (p95v294b7.source.zip) = 15682e9587af2b86647de9786f97dc8c5d7a4a679a0440f7d1d1936a48c5aa45
3
SIZE (p95v2810.source.zip) = 44979437
3
SIZE (p95v294b7.source.zip) = 47931498
(-)math/mprime/files/patch-commonc.c (-1 / +1 lines)
Lines 12-18 Link Here
12
 		if (w->k != 1.0) sprintf (buf+strlen(buf), "%g", fmod (w->k, 1000000.0));
12
 		if (w->k != 1.0) sprintf (buf+strlen(buf), "%g", fmod (w->k, 1000000.0));
13
 		sprintf (buf+strlen(buf), "_%ld", p);
13
 		sprintf (buf+strlen(buf), "_%ld", p);
14
-		if (abs(w->c) != 1) sprintf (buf+strlen(buf), "_%d", abs(w->c) % 1000);
14
-		if (abs(w->c) != 1) sprintf (buf+strlen(buf), "_%d", abs(w->c) % 1000);
15
+		if (labs(w->c) != 1) sprintf (buf+strlen(buf), "_%d", labs(w->c) % 1000);
15
+		if (labs(w->c) != 1) sprintf (buf+strlen(buf), "_%ld", labs(w->c) % 1000);
16
 		rename (v258_filename, buf);
16
 		rename (v258_filename, buf);
17
 		if (buf[0] == 'p') {
17
 		if (buf[0] == 'p') {
18
 			v258_filename[0] = buf[0] = 'q';
18
 			v258_filename[0] = buf[0] = 'q';
(-)math/mprime/files/patch-ecm.c (-9 lines)
Lines 9-20 Link Here
9
 		giant	tmp = allocgiant ((bits >> 5) + 5);
9
 		giant	tmp = allocgiant ((bits >> 5) + 5);
10
 		if (tmp == NULL) return (OutOfMemory (thread_num));
10
 		if (tmp == NULL) return (OutOfMemory (thread_num));
11
 		ultog (w->b, tmp);
11
 		ultog (w->b, tmp);
12
@@ -1156,7 +1156,7 @@ int setN (
13
 /* Open file of known factors.  This code has been obsoleted by the */
14
 /* known factors list in worktodo.ini. */
15
 
16
-	if (w->k != 1.0 || w->b != 2 || abs(w->c) != 1) return (0);
17
+	if (w->k != 1.0 || w->b != 2 || labs(w->c) != 1) return (0);
18
 	fd = fopen (w->c == 1 ? "lowp.txt" : "lowm.txt", "r");
19
 	if (fd == NULL) return (0);
20
 
(-)math/mprime/files/patch-gwnum_gwnum.c (-43 / +16 lines)
Lines 1-15 Link Here
1
--- gwnum/gwnum.c.orig	2016-10-30 14:22:26 UTC
1
--- gwnum/gwnum.c.orig	2016-10-30 14:22:26 UTC
2
+++ gwnum/gwnum.c
2
+++ gwnum/gwnum.c
3
@@ -170,7 +170,7 @@ void *avx_carries_prctab[] = {
3
@@ -865,17 +865,17 @@
4
 /*	b or blank	(b > 2 or not) */
5
 /*	s4 or blank	(SSE4 or not) */
6
 /*	k or blank	(k for XMM_K_HI is zero or not) */
7
-/*	c1 or cm1 or blank (c=1, c=-1, abs(c)!=1) */
8
+/*	c1 or cm1 or blank (c=1, c=-1, labs(c)!=1) */
9
 /* We also define a macro that will pick the correct entry from the array. */
10
 
11
 #define avx_explode(macro)			avx_explode1(macro,yr)			avx_explode1(macro,yi)
12
@@ -767,17 +767,17 @@ int gwinfo (			/* Return zero-padded fft flag or error
13
 	log2k = log2 (k);
4
 	log2k = log2 (k);
14
 	logbk = logb (k);
5
 	logbk = logb (k);
15
 	log2b = log2 (b);
6
 	log2b = log2 (b);
Lines 20-46 Link Here
20
 /* First, see what FFT length we would get if we emulate the k*b^n+c modulo */
11
 /* First, see what FFT length we would get if we emulate the k*b^n+c modulo */
21
-/* with a zero padded FFT.  If k is 1 and abs (c) is 1 then we can skip this */
12
-/* with a zero padded FFT.  If k is 1 and abs (c) is 1 then we can skip this */
22
+/* with a zero padded FFT.  If k is 1 and labs (c) is 1 then we can skip this */
13
+/* with a zero padded FFT.  If k is 1 and labs (c) is 1 then we can skip this */
23
 /* loop as we're sure to find an IBDWT that will do the job. */
14
 /* loop as we're sure to find an IBDWT that will do the job. Also skip if called from */
15
 /* gwmap_fftlen_to_max_exponent (n = 0) or we are QAing IBDWT FFTs (qa_pick_nth_fft >= 1000) */
24
 
16
 
25
 again:	zpad_jmptab = NULL;
17
 again:	zpad_jmptab = NULL;
26
 	generic_jmptab = NULL;
18
 	generic_jmptab = NULL;
27
 	if (! gwdata->force_general_mod &&
19
-	if (! gwdata->force_general_mod && (k > 1.0 || (n > 0 && n < 500) || abs (c) > 1) && gwdata->qa_pick_nth_fft < 1000) {
28
-	    (k > 1.0 || n < 500 || abs (c) > 1) &&
20
+	if (! gwdata->force_general_mod && (k > 1.0 || (n > 0 && n < 500) || labs (c) > 1) && gwdata->qa_pick_nth_fft < 1000) {
29
+	    (k > 1.0 || n < 500 || labs (c) > 1) &&
30
 	    gwdata->qa_pick_nth_fft < 1000) {
31
 
21
 
32
 /* Use the proper 2^N-1 jmptable */
22
 /* Use the proper 2^N-1 jmptable */
33
@@ -984,7 +984,7 @@ next1:			while (zpad_jmptab->flags & 0x80000000) INC_J
34
 /* the bits per word.  An FFT result word cannot be more than 5 times */
35
 /* bits-per-word (bits-per-word are stored in the current word and the */
36
 /* 4 words we propagate carries to).  How many bits are in an FFT result */
37
-/* word?  Well, because of balanced representation the abs(input word) is */
38
+/* word?  Well, because of balanced representation the labs(input word) is */
39
 /* (bits_per_word-1) bits long. An FFT result word contains multiplied data */
40
 /* words, that's (bits_per_word-1)*2 bits.  Adding up many multiplied data */
41
 /* words adds some bits proportional to the size of the FFT.  Experience */
42
@@ -1789,13 +1789,13 @@ int gwsetup (
43
 
23
 
24
@@ -1915,13 +1915,13 @@
25
 
44
 	if (c == 0)
26
 	if (c == 0)
45
 		gcd = 0;
27
 		gcd = 0;
46
-	else if (k == 1.0 || abs (c) == 1)
28
-	else if (k == 1.0 || abs (c) == 1)
Lines 55-61 Link Here
55
 		gcdg (kg, cg);
37
 		gcdg (kg, cg);
56
 		gcd = cg->n[0];
38
 		gcd = cg->n[0];
57
 	}
39
 	}
58
@@ -1809,7 +1809,7 @@ int gwsetup (
40
@@ -1935,7 +1935,7 @@
59
 
41
 
60
 	if (gcd == 1 &&
42
 	if (gcd == 1 &&
61
 	    k * gwdata->maxmulbyconst <= MAX_ZEROPAD_K &&
43
 	    k * gwdata->maxmulbyconst <= MAX_ZEROPAD_K &&
Lines 64-70 Link Here
64
 	    log2(b) * (double) n >= 350.0 &&
46
 	    log2(b) * (double) n >= 350.0 &&
65
 	    (b == 2 || (gwdata->cpu_flags & (CPU_AVX | CPU_SSE2))) &&
47
 	    (b == 2 || (gwdata->cpu_flags & (CPU_AVX | CPU_SSE2))) &&
66
 	    !gwdata->force_general_mod) {
48
 	    !gwdata->force_general_mod) {
67
@@ -2429,12 +2429,12 @@ int internal_gwsetup (
49
@@ -2555,12 +2555,12 @@
68
 	gwdata->NUM_B_PER_SMALL_WORD = (unsigned long) gwdata->avg_num_b_per_word;
50
 	gwdata->NUM_B_PER_SMALL_WORD = (unsigned long) gwdata->avg_num_b_per_word;
69
 
51
 
70
 /* Set a flag if this is a rational FFT.  That is, an FFT where all the */
52
 /* Set a flag if this is a rational FFT.  That is, an FFT where all the */
Lines 79-85 Link Here
79
 
61
 
80
 /* Remember the maximum number of bits per word that this FFT length */
62
 /* Remember the maximum number of bits per word that this FFT length */
81
 /* supports.  We this in gwnear_fft_limit.  Note that zero padded FFTs */
63
 /* supports.  We this in gwnear_fft_limit.  Note that zero padded FFTs */
82
@@ -3688,7 +3688,7 @@ int internal_gwsetup (
64
@@ -3814,7 +3814,7 @@
83
 		if (gwdata->ZERO_PADDED_FFT ||
65
 		if (gwdata->ZERO_PADDED_FFT ||
84
 		    3.0 * gwdata->NUM_B_PER_SMALL_WORD * log2 (b) >
66
 		    3.0 * gwdata->NUM_B_PER_SMALL_WORD * log2 (b) >
85
 				2.0 * ((gwdata->NUM_B_PER_SMALL_WORD + 1) * log2 (b) - 1) +
67
 				2.0 * ((gwdata->NUM_B_PER_SMALL_WORD + 1) * log2 (b) - 1) +
Lines 88-94 Link Here
88
 			asm_data->SPREAD_CARRY_OVER_EXTRA_WORDS = FALSE;
70
 			asm_data->SPREAD_CARRY_OVER_EXTRA_WORDS = FALSE;
89
 		else
71
 		else
90
 			asm_data->SPREAD_CARRY_OVER_EXTRA_WORDS = TRUE;
72
 			asm_data->SPREAD_CARRY_OVER_EXTRA_WORDS = TRUE;
91
@@ -6262,7 +6262,7 @@ void gw_as_string (
73
@@ -6409,7 +6409,7 @@
92
 		sprintf (buf, "%.0f", k + c);
74
 		sprintf (buf, "%.0f", k + c);
93
 	else if (k != 1.0)
75
 	else if (k != 1.0)
94
 		sprintf (buf, "%.0f*%lu^%lu%c%lu", k, b, n,
76
 		sprintf (buf, "%.0f*%lu^%lu%c%lu", k, b, n,
Lines 97-103 Link Here
97
 	else if (b == 2 && c == -1)
79
 	else if (b == 2 && c == -1)
98
 		sprintf (buf, "M%lu", n);
80
 		sprintf (buf, "M%lu", n);
99
 	else {
81
 	else {
100
@@ -6272,7 +6272,7 @@ void gw_as_string (
82
@@ -6419,7 +6419,7 @@
101
 			sprintf (buf, "F%lu", cnt);
83
 			sprintf (buf, "F%lu", cnt);
102
 		else
84
 		else
103
 			sprintf (buf, "%lu^%lu%c%lu", b, n,
85
 			sprintf (buf, "%lu^%lu%c%lu", b, n,
Lines 106-112 Link Here
106
 	}
88
 	}
107
 }
89
 }
108
 
90
 
109
@@ -6357,7 +6357,7 @@ double virtual_bits_per_word (
91
@@ -6504,7 +6504,7 @@
110
 		weighted_bits_per_output_word =
92
 		weighted_bits_per_output_word =
111
 			2.0 * ((b_per_input_word + 1.0) * log2b - 1.0) +
93
 			2.0 * ((b_per_input_word + 1.0) * log2b - 1.0) +
112
 			0.6 * log2 (gwdata->FFTLEN) +
94
 			0.6 * log2 (gwdata->FFTLEN) +
Lines 115-121 Link Here
115
 		if (gwdata->k == 1.0 && gwdata->n % gwdata->FFTLEN == 0)
97
 		if (gwdata->k == 1.0 && gwdata->n % gwdata->FFTLEN == 0)
116
 			weighted_bits_per_output_word -= ((log2b <= 4.0) ? log2b : 1.4 * log2b);
98
 			weighted_bits_per_output_word -= ((log2b <= 4.0) ? log2b : 1.4 * log2b);
117
 		else if (num_big_words == 1 && gwdata->k > 1.0)
99
 		else if (num_big_words == 1 && gwdata->k > 1.0)
118
@@ -6756,7 +6756,7 @@ void gwsetaddin (
100
@@ -6911,7 +6911,7 @@
119
 {
101
 {
120
 	unsigned long word, b_in_word;
102
 	unsigned long word, b_in_word;
121
 
103
 
Lines 124-130 Link Here
124
 
106
 
125
 /* In a zero-padded FFT, the value is added into ZPAD0 */
107
 /* In a zero-padded FFT, the value is added into ZPAD0 */
126
 
108
 
127
@@ -7022,7 +7022,7 @@ void gianttogw (
109
@@ -7177,7 +7177,7 @@
128
 /* Small numbers can also be optimized for many moduli by zeroing all the */
110
 /* Small numbers can also be optimized for many moduli by zeroing all the */
129
 /* FFT data using memset and then setting only the affected FFT elements. */
111
 /* FFT data using memset and then setting only the affected FFT elements. */
130
 
112
 
Lines 133-148 Link Here
133
 		uint32_t low_addin;
115
 		uint32_t low_addin;
134
 		int	i;
116
 		int	i;
135
 
117
 
136
@@ -7639,7 +7639,7 @@ void specialmodg (
118
@@ -7802,7 +7802,7 @@
137
 	}
138
 
139
 /* Do the quick modulus code twice because in the case where */
140
-/* abs(c) > k once won't get us close enough. */
141
+/* labs(c) > k once won't get us close enough. */
142
 
143
 	neg = FALSE;
144
 	for (count = 0; count < 2; count++) {
145
@@ -7647,7 +7647,7 @@ void specialmodg (
146
 /* Handle negative input values */
119
 /* Handle negative input values */
147
 
120
 
148
 	    neg ^= (g->sign < 0);
121
 	    neg ^= (g->sign < 0);
(-)math/mprime/files/patch-gwnum_gwutil.c (-1 / +1 lines)
Lines 5-11 Link Here
5
 #include <memory.h>
5
 #include <memory.h>
6
 #endif
6
 #endif
7
-#ifdef __APPLE__
7
-#ifdef __APPLE__
8
+#ifdef __APPLE__ || __FreeBSD__
8
+#if defined (__APPLE__) || defined (__FreeBSD__)
9
 #include <memory.h>
9
 #include <memory.h>
10
 #endif
10
 #endif
11
 #include "gwcommon.h"
11
 #include "gwcommon.h"
(-)math/mprime/files/patch-gwnum_makemsys (-3 / +3 lines)
Lines 5-18 Link Here
5
 #
5
 #
6
 
6
 
7
-CC = gcc
7
-CC = gcc
8
-CFLAGS = -I.. -O2 -march=i486 -malign-double
8
-CFLAGS = -I.. -I../sqlite-amalgamation-3180000 -O2 -march=i486 -malign-double
9
+CC = cc
9
+CC = cc
10
+CFLAGS = -I.. -O2 -march=i486 
10
+CFLAGS = -I.. -I../sqlite-amalgamation-3180000 -O2 -march=i486
11
 
11
 
12
-CPP = g++
12
-CPP = g++
13
-CPPFLAGS = -I.. -I../qd -O2 -march=i486 -malign-double
13
-CPPFLAGS = -I.. -I../qd -O2 -march=i486 -malign-double
14
+CPP = cc
14
+CPP = cc
15
+CPPFLAGS = -I.. -I../qd -O2 -march=i486 
15
+CPPFLAGS = -I.. -I../qd -O2 -march=i486
16
 
16
 
17
 AR = ar
17
 AR = ar
18
 
18
 
(-)math/mprime/files/patch-linux64_makebsd (-4 / +11 lines)
Lines 1-7 Link Here
1
--- linux64/makebsd.orig	2016-10-30 18:42:16 UTC
1
--- linux64/makebsd.orig	2016-10-30 18:42:16 UTC
2
+++ linux64/makebsd
2
+++ linux64/makebsd
3
@@ -4,13 +4,13 @@
3
@@ -1,19 +1,19 @@
4
 # Makefile for FreeBSD 10.0 64-bit mprime
4
 #
5
 #
6
-# Install the curl package.  This will be installed to /usr/local by default.
7
+# Install the curl package.  This will be installed to %%LOCALBASE%% by default.
8
 #
9
 # Hwloc can be downloaded from https://www.open-mpi.org/projects/hwloc/
10
 # Configure hwloc with --enable-static --disable-shared --disable-pci --disable-cuda --disable-gl
11
 #
5
 
12
 
6
 CC = cc
13
 CC = cc
7
-CFLAGS = -I.. -I../gwnum -I/usr/local/include -DX86_64 -O2
14
-CFLAGS = -I.. -I../gwnum -I/usr/local/include -DX86_64 -O2
Lines 11-19 Link Here
11
 CPPFLAGS = -I.. -I../gwnum -DX86_64 -O2
18
 CPPFLAGS = -I.. -I../gwnum -DX86_64 -O2
12
 
19
 
13
-LFLAGS = -L/usr/local/lib -Wl,-M
20
-LFLAGS = -L/usr/local/lib -Wl,-M
14
-LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -lcurl -lstdc++ -lcompat
21
-LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread /usr/local/lib/libhwloc.a -lcurl -lstdc++ -lcompat -lgmp
15
+LFLAGS = -L%%LOCALBASE%%/lib -Wl,-M
22
+LFLAGS = -L%%LOCALBASE%%/lib
16
+LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -lcurl -lcompat
23
+LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -lhwloc -lcurl -lcompat -lgmp
17
 
24
 
18
 FACTOROBJ = factor64.o
25
 FACTOROBJ = factor64.o
19
 OBJS = prime.o menu.o
26
 OBJS = prime.o menu.o
(-)math/mprime/files/patch-linux_makebsd (-9 / +10 lines)
Lines 1-22 Link Here
1
--- linux/makebsd.orig	2016-10-30 18:42:16 UTC
1
--- linux/makebsd.orig	2016-10-30 18:42:16 UTC
2
+++ linux/makebsd
2
+++ linux/makebsd
3
@@ -1,14 +1,14 @@
3
@@ -4,14 +4,14 @@
4
 # Makefile for FreeBSD 32-bit mprime
4
 # Configure hwloc with --enable-static --disable-shared --disable-pci --disable-cuda --disable-gl
5
 #
5
 #
6
 
6
 
7
-CC = gcc
7
-CC = gcc
8
-CFLAGS = -I.. -I../gwnum -I/usr/local/include -O2 -march=i486 -malign-double
8
-CFLAGS = -I.. -I../gwnum -I/usr/local/include -O2 -march=i486 -malign-double
9
+CC = cc
9
+CC = cc
10
+CFLAGS = -I.. -I../gwnum -I%%LOCALBASE%%/include -O2 -march=i486 
10
+CFLAGS = -I.. -I../gwnum -I%%LOCALBASE%%/include -O2 -march=i486
11
 
11
 
12
 CPP = g++
12
-CPP = g++
13
-CPPFLAGS = -I.. -I../gwnum -I/usr/local/include -O2 -march=i486 -malign-double
13
-CPPFLAGS = -I.. -I../gwnum -I/usr/local/include -O2 -march=i486 -malign-double
14
+CPPFLAGS = -I.. -I../gwnum -I%%LOCALBASE%%/include -O2 -march=i486 
14
+CPP = cc
15
+CPPFLAGS = -I.. -I../gwnum -I%%LOCALBASE%%/include -O2 -march=i486
15
 
16
 
16
-LFLAGS = -Wl,-M
17
-LFLAGS = -Wl,-M -L/usr/local/lib
17
-LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic /usr/local/lib/libcurl.a -lz -lcompat -lstdc++ -Wl,-Bdynamic -lssl
18
-LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic /usr/local/lib/libhwloc.a -Wl,-Bstatic /usr/local/lib/libcurl.a -lz -lcompat -lstdc++ -Wl,-Bdynamic -lssl -lgmp
18
+LFLAGS = -L%%LOCALBASE%%/lib -Wl,-M
19
+LFLAGS = -L%%LOCALBASE%%/lib
19
+LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-lcurl  -lcompat  -Wl,
20
+LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -lcurl -lhwloc -lz -lcompat -lssl -lgmp
20
 
21
 
21
 FACTOROBJ = factor32.o
22
 FACTOROBJ = factor32.o
22
 OBJS = prime.o menu.o
23
 OBJS = prime.o menu.o

Return to bug 233261