-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile.am
152 lines (129 loc) · 5.54 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS = -I m4
# to not install libecm.la, we could write noinst_LTLIBRARIES instead of
# lib_LTLIBRARIES below, however then libecm.a is not installed either
# (see http://www.gnu.org/software/automake/manual/html_node/Libtool-Convenience-Libraries.html)
lib_LTLIBRARIES = libecm.la
EXTRA_PROGRAMS = rho
# If we want assembly mulredc code, recurse into the right subdirectory
# and set up variables to include the mulredc library from that subdir
if ENABLE_ASM_REDC
SUBDIRS = $(ASMPATH)
MULREDCINCPATH = -I$(srcdir)/$(ASMPATH)
MULREDCLIBRARY = $(builddir)/$(ASMPATH)/libmulredc.la
# Add a tuning and testing program for the mulredc code
EXTRA_PROGRAMS += bench_mulredc test_mulredc
CLEANFILES = bench_mulredc test_mulredc
bench_mulredc_CPPFLAGS = $(MULREDCINCPATH)
bench_mulredc_LDADD = $(MULREDCLIBRARY) $(GMPLIB)
test_mulredc_CPPFLAGS = $(MULREDCINCPATH)
test_mulredc_LDADD = $(MULREDCLIBRARY) $(GMPLIB)
else
# Add a tuning program for the mulredc code
EXTRA_PROGRAMS += bench_mulredc
CLEANFILES = bench_mulredc
bench_mulredc_LDADD = $(GMPLIB)
endif
libecm_la_SOURCES = ecm.c ecm2.c pm1.c pp1.c getprime.c listz.c lucas.c \
stage2.c toomcook.c mpmod.c mul_lo.c polyeval.c median.c \
schoen_strass.c ks-multiply.c rho.c bestd.c auxlib.c \
random.c factor.c sp.c spv.c spm.c mpzspm.c mpzspv.c \
ntt_gfp.c ecm_ntt.c pm1fs2.c mul_fft.c sets_long.c \
auxarith.c batch.c parametrizations.c cudawrapper.c
# Link the asm redc code (if we use it) into libecm.la
libecm_la_CPPFLAGS = $(MULREDCINCPATH)
libecm_la_CFLAGS = $(OPENMP_CFLAGS)
libecm_la_LDFLAGS = '-version-info 0:0:0'
libecm_la_LIBADD = $(MULREDCLIBRARY)
if WANT_CUDA
libecm_la_SOURCES += cudakernel.cu
libecm_la_LIBADD += $(CUDA_LIB_FLAGS)
libecm_la_CFLAGS += $(CUDA_INC_FLAGS) $(CC_ADD_FLAGS_FOR_GPU)
endif
bin_PROGRAMS = ecm
noinst_PROGRAMS = tune ecmfactor bench_mulredc
# Most binaries want to link libecm.la, and the ones which don't will
# have their own _LDADD which overrides the default LDADD here
LDADD = libecm.la $(GMPLIB)
ecm_CPPFLAGS = -DOUTSIDE_LIBECM
ecm_CFLAGS = $(OPENMP_CFLAGS)
if WANT_CUDA
ecm_CFLAGS += $(CC_ADD_FLAGS_FOR_GPU)
endif
ecm_SOURCES = auxi.c b1_ainc.c candi.c eval.c random.c main.c \
resume.c getprime.c champions.h
tune_SOURCES = mpmod.c tune.c mul_lo.c listz.c auxlib.c ks-multiply.c \
toomcook.c schoen_strass.c polyeval.c median.c ecm_ntt.c \
ntt_gfp.c mpzspv.c mpzspm.c sp.c spv.c spm.c random.c \
mul_fft.c auxarith.c
tune_CPPFLAGS = -DTUNE $(MULREDCINCPATH)
tune_LDADD = $(MULREDCLIBRARY) $(GMPLIB)
ecmfactor_CFLAGS = $(OPENMP_CFLAGS)
rho_SOURCES = rho.c
rho_CPPFLAGS = -DTESTDRIVE
rho_LDADD = -lprimegen $(GMPLIB) $(GSL_LD_FLAGS)
if WITH_GWNUM
gwdata.ld :
echo "SECTIONS { .data : { . = ALIGN(0x20); *(_GWDATA) } }" >gwdata.ld
libecm_la_SOURCES += Fgw.c
# Use ecm_DEPENDENCIES += gwdata.ld instead? Is that possible?
ecm_DEPENDENCIES = gwdata.ld
ecm_LDFLAGS = $(AM_LDFLAGS) -Wl,gwdata.ld
Fgwtest : Fgw.c gwdata.ld
$(CC) $(CFLAGS) $(CPPFLAGS) -g -DTESTDRIVE -Wl,gwdata.ld -o Fgwtest Fgw.c libecm.a $(LIBS)
endif
include_HEADERS = ecm.h
noinst_HEADERS = ecm-impl.h ecm-gmp.h ecm-ecm.h sp.h longlong.h ecm-params.h \
mpmod.h ecm-gpu.h cudakernel.h
EXTRA_DIST = test.pm1 test.pp1 test.ecm README.lib INSTALL-ecm ecm.xml \
pentium4/params.h x86_64/core2/params.h x86_64/k8/params.h \
athlon/params.h x86/params.h ia64/params.h arm/params.h \
powerpc64/params.h powerpc32/params.h sparc64/params.h \
hppa/params.h mips/params.h x86_64/corei7/params.h \
generic/params.h
DIST_SUBDIRS = athlon pentium4 x86_64 powerpc64 build.vc10
DISTCLEANFILES = config.m4
if WANT_CUDA
.cu.lo: cudakernel.h
$(LIBTOOL) --tag=CC --mode=compile $(NVCC) --compile $(CUDA_INC_FLAGS) $(NVCC_FLAGS) -o $@ $^ -static
endif
ecm-params: tune$(EXEEXT)
@echo Optimising parameters for your system, please be patient.
test -z "ecm-params.h" || rm -f ecm-params.h
./tune > ecm-params.h
check: ecm$(EXEEXT)
$(srcdir)/test.pp1 ./ecm$(EXEEXT)
echo ""
$(srcdir)/test.pm1 ./ecm$(EXEEXT)
echo ""
$(srcdir)/test.ecm ./ecm$(EXEEXT)
if WANT_CUDA
echo ""
$(srcdir)/test.gpuecm ./ecm$(EXEEXT)
endif
longcheck: ecm$(EXEEXT)
$(srcdir)/test.pp1 "$(VALGRIND) ./ecm$(EXEEXT)"
$(srcdir)/test.pp1 "$(VALGRIND) ./ecm$(EXEEXT) -no-ntt"
$(srcdir)/test.pp1 "$(VALGRIND) ./ecm$(EXEEXT) -modmuln"
$(srcdir)/test.pp1 "$(VALGRIND) ./ecm$(EXEEXT) -redc"
$(srcdir)/test.pp1 "$(VALGRIND) ./ecm$(EXEEXT) -mpzmod"
$(srcdir)/test.pm1 "$(VALGRIND) ./ecm$(EXEEXT)"
$(srcdir)/test.pm1 "$(VALGRIND) ./ecm$(EXEEXT) -no-ntt"
$(srcdir)/test.pm1 "$(VALGRIND) ./ecm$(EXEEXT) -modmuln"
$(srcdir)/test.pm1 "$(VALGRIND) ./ecm$(EXEEXT) -redc"
$(srcdir)/test.pm1 "$(VALGRIND) ./ecm$(EXEEXT) -mpzmod"
$(srcdir)/test.ecm "$(VALGRIND) ./ecm$(EXEEXT)"
$(srcdir)/test.ecm "$(VALGRIND) ./ecm$(EXEEXT) -no-ntt"
$(srcdir)/test.ecm "$(VALGRIND) ./ecm$(EXEEXT) -modmuln"
$(srcdir)/test.ecm "$(VALGRIND) ./ecm$(EXEEXT) -redc"
$(srcdir)/test.ecm "$(VALGRIND) ./ecm$(EXEEXT) -mpzmod"
## to be sure ecm.1 is considered as source
## (cf section "Man pages" in the automake manual)
dist_man_MANS = ecm.1
## If ./configure found xsltproc and docbook.xsl, add a rule for building
## the manpage. If they were not found, this rule is omitted and make will
## never try to rebuild the man page, which would result in an error anyway.
if MAKE_MANPAGE
ecm.1: ecm.xml
xsltproc -o ecm.1 $(XSLDIR)/manpages/docbook.xsl ecm.xml
endif