-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.rules
90 lines (78 loc) · 3.39 KB
/
Makefile.rules
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
# Makefile.rules for parallelGBC 0.9 and later
#
# With this file you can configure the compilation of the tool.
#
######################
#
# This file is part of parallelGBC, a parallel groebner basis computation tool.
#
# parallelGBC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# parallelGBC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with parallelGBC. If not, see <http://www.gnu.org/licenses/>.
#
# Configure PGBC Options
# COEFF_BITS defines the length of the coefficents. If you need large coefficient fields
# you should choose 32. If you want to get the most performance, you can choose 8. But
# for most cases the default value of 16 should do it.
PGBC_COEFF_BITS=16
# PGBC_USE_SSE1 enables sse optimizations in the field arithmetics (currently requires GCC)
PGBC_USE_SSE=1
# PGBC_SORTING defines the sorting for the reduction, the behaviour only changes if this
# value is set to one. Further sortings may follow
PGBC_SORTING=1
# Allow post reduction if simplify is used.
PGBC_POST_REDUCE=0
# Enable MPI (you also should configure CXX to use mpic++)
PGBC_WITH_MPI=0
# Parallel matrix setup
PGBC_PARALLEL_SETUP=1
# Set your Compiler. Attention you need a compiler which supports the C++11 standard
CXX = /usr/bin/g++
AR = /usr/bin/ar
# Enable the following if you want to use google's tcmalloc
TCMALLOC =
#TCMALLOC = -ltcmalloc
# Configure CXXFLAGS.
# the following CXXFLAGS are for the GNU COMPILER:
CXXFLAGS = -fPIC -Wall -fopenmp -O2 -pipe -std=c++0x
# Possible FLAGS:
#CXXFLAGS = -fPIC -Wall -fopenmp -pipe -std=c++0x -march=native -O3
# DEBUG FLAGS:
#CXXFLAGS = -fPIC -Wall -fopenmp -pipe -std=c++0x -pg -g -gdwarf-2
# Where the compiled (static) library will be stored.
LIBRARY = ../lib/libf4.a
###
# You shouldn't need to modify the following
###
ifeq ($(PGBC_WITH_MPI),1)
BOOSTMPI=-lboost_serialization -lboost_mpi
else
BOOSTMPI=
endif
# Combine compile time options with compile time optimizations
DEFINITIONS = -D'PGBC_COEFF_BITS=$(PGBC_COEFF_BITS)' -D'PGBC_USE_SSE=$(PGBC_USE_SSE)' -D'PGBC_SORTING=$(PGBC_SORTING)' -D'PGBC_POST_REDUCE=$(PGBC_POST_REDUCE)' -D'PGBC_WITH_MPI=$(PGBC_WITH_MPI)' -D'PGBC_PARALLEL_SETUP=$(PGBC_PARALLEL_SETUP)'
# Below you find some generic make rules ...
dummy:
echo "Please use the Makefile in the main directory or specify a target"
%.o: %.C ../include/%.H ../Makefile.rules
$(CXX) $(CXXFLAGS) $(DEFINITIONS) -c $<
definitions:
echo "#define PGBC_COEFF_BITS $(PGBC_COEFF_BITS)" > ../include/Definitions.H
echo "#define PGBC_USE_SSE $(PGBC_USE_SSE)" >> ../include/Definitions.H
echo "#define PGBC_SORTING $(PGBC_SORTING)" >> ../include/Definitions.H
echo "#define PGBC_POST_REDUCE $(PGBC_POST_REDUCE)" >> ../include/Definitions.H
echo "#define PGBC_WITH_MPI $(PGBC_WITH_MPI)" >> ../include/Definitions.H
echo "#define PGBC_PARALLEL_SETUP $(PGBC_PARALLEL_SETUP)" >> ../include/Definitions.H
%.bin: %.C $(LIBRARY) definitions
$(CXX) $(CXXFLAGS) -o $(<:%.C=%.bin) $< $(LIBRARY) -lboost_regex -ltbb $(TCMALLOC) $(BOOSTMPI)
objclean:
rm -f $(OBJ)