Paramotopy
parallel parameter homotopy through bertini
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Makefile
Go to the documentation of this file.
1 #this file prepared for use with multiple computers.
2 
3 
4 #i understand that including personal machine specifics is a bit selfish, but it's only until we start using a tool like configure
5 #if you add a machine to this file, please add an option to this list.
6 #machine can be: sam - MACBRAKE - cray - macniemerg
7 #MACHINENAME is an environment var set by the user.
8 
9 
10 #User-set options. cannot use some options on the cray.
11 OPT := -Wall -g # -O3 -funroll-loops #-fexpensive-optimizations #-g
12 
13 #use timing info for step 2? YES, or NO (or anything other than YES really)
14 TIMING := YES
15 
16 #print extra stuff to screen in step 2? YES or NO (or anything other than YES really)
17 VERBOSE := NO
18 
19 #turn off bertini and data collection calls?
20 NOSOLVE := NO
21 
22 ##################################
23 # Define machine specific stuff
24 ##################################
25 STATICFLAG:=
26 INSTALLDIR=UNSETLOCATION
27 
28 ifeq (sam,$(MACHINENAME))
29  #sam (hopefully user independent)
30  MCC := mpic++ -std=c++11
31  CC := g++
32  MANDATORYOPT :=
33  BOOSTLOC := /usr/local/boost/lib/
34  INCLUDE := -I../include -I/usr/local/boost/include
35  BOOSTSUFFIX :=#no spaces
36  BERTINILIB := ../lib/libbertinisam.a
37  MPFRLOC :=#already in path
38  STATICFLAG := -static
39 
40 else ifeq (MACBRAKE, $(MACHINENAME))
41  #dan brake's macintosh
42  MCC := mpic++ -cxx=g++ -std=c++11 -arch x86_64
43  CC := g++ -arch x86_64
44  MANDATORYOPT :=
45  BOOSTLOC := /usr/local/Cellar/boost/1.55.0/lib/
46  INCLUDE := -I$(HOME)/bertini_source/include -I../include -I/usr/local/Cellar/boost/1.55.0/include -I/usr/local/gfortran/lib/gcc/x86_64-apple-darwin10/4.6.2/include/
47  BOOSTSUFFIX :=-mt#no spaces
48  BERTINILIB := $(HOME)/lib/libbertini_serial.a #$(HOME)/lib/libbertini_opt_nog.a
49  MPFRLOC :=#in path
50  INSTALLDIR:=~/bin
51 
52 else ifeq (cray,$(MACHINENAME))
53  #cray, as dan brake
54  MCC := CC
55  CC := CC
56  MANDATORYOPT := #do not use the -fopenmp flag on the cray with pgi compilers
57  BOOSTLOC := /home/GRAD511/dbrake/lustrefs/realwork/boost_1_50_0/stage/lib/
58  INCLUDE := -I../include -I/home/GRAD511/dbrake/lustrefs/realwork/boost_1_50_0
59  BOOSTSUFFIX :=#no spaces
60  BERTINILIB := ./libbertinicray.a
61  MPFRLOC := -L/opt/gcc/mpfr/2.4.2/lib
62  STATICFLAG := -static
63 
64 else ifeq (macniemerg,$(MACHINENAME))
65  #matt n's macintosh
66  MCC:= mpic++ #-mpe=mpicheck
67  CC:= g++
68  BOOSTLOC := /usr/local/lib/
69  INCLUDE := -I../include -I$(HOME)/Research/Bertini/bertini1.4/bertini/include #-I/usr/local/include
70  MANDATORYOPT := -fopenmp
71  BOOSTSUFFIX :=#nothing
72  BERTINILIB := ../lib/libbertini_osx.10.6.a
73  MPFRLOC:=#already in path
74  STATICFLAG :=#nothing
75  INSTALLDIR=UNSETLOCATION
76 
77 else
78  #i expect errors here, or down below, because some variables are not set. this is deliberate.
79 
80  #todo: use gnu autoconf to prepare the system for building
81 
82 endif
83 
84 
85 
86 
87 
88 #################################
89 #
90 # end user-set stuff (hopefully)
91 #
92 #################################
93 
94 
95 #Define the file suffixes for C++ source files
96 .SUFFIXES: .cpp $(SUFFIXES)
97 
98 
99 
100 # Define the object files to be used
101 OBJScommon := point.o datagatherer.o failed_paths.o menu_cases.o master.o slave.o step2readandwrite.o runinfo.o mtrand.o random.o step2_funcs.o step1_funcs.o para_aux_funcs.o timing.o tinyxmlerror.o tinyxml.o tinystr.o tinyxmlparser.o xml_preferences.o
102 
103 
104 # Define Libary Locations
105 LIBS := $(BERTINILIB) -lm $(MPFRLOC) -lmpfr -lgmp
106 
107 
108 DEFS := #initialize DEFS
109 
110 
111 
112 ifeq (YES,${TIMING})
113  DEFS := $(DEFS) -Dtimingstep2
114 endif
115 
116 ifeq (YES,${VERBOSE})
117  DEFS := $(DEFS) -Dverbosestep2
118 endif
119 
120 ifeq (YES,${NOSOLVE})
121  DEFS := $(DEFS) -Dnosolve
122 endif
123 
124 
125 
126 
127 
128 
129 
130 OPT := $(OPT) $(MANDATORYOPT)
131 DEFS := $(DEFS)# -DTIXML_USE_STL
132 LIBSboost := $(BOOSTLOC)libboost_system$(BOOSTSUFFIX).a $(BOOSTLOC)libboost_filesystem$(BOOSTSUFFIX).a $(BOOSTLOC)libboost_regex$(BOOSTSUFFIX).a
133 
134 
135 # Describe how to build the executable file
136 all: paramotopy step2
137 
138 paramotopy: paramotopy.o $(OBJScommon)
139  $(MCC) $(INCLUDE) $(DEFS) $(OPT) -o paramotopy paramotopy.cpp $(OBJScommon) $(LIBS) $(LIBSboost) $(STATICFLAG)
140 
141 step2: step2.o $(OBJScommon)
142  $(MCC) $(INCLUDE) $(DEFS) $(OPT) -o step2 step2.cpp $(OBJScommon) $(LIBS) $(LIBSboost) $(STATICFLAG)
143 
144 install: step2 paramotopy
145  cp step2 paramotopy $(INSTALLDIR)
146 
147 
148 
149 xml_preferences.o: tinyxml.o tinystr.o
150 
151 
152 
153 # Describe how to create the object file
154 %.o: %.cpp
155  $(MCC) $(INCLUDE) $(DEFS) $(OPT) -c $< -o $@
156 
157 
158 #.cpp:
159 # $(MCC) $(INCLUDE) $(DEFS) $(OPT) -c $*.cpp
160 #.c:
161 # $(MCC) $(INCLUDE) $(DEFS) $(OPT) -c $*.c
162 
163 
164 # Describe actions necessary to clean the current directory
165 clean:
166  rm -f *.o paramotopy step2 *~
167  rm -rf paramotopy.dSYM step2.dSYM
168 
169 
170