1 #this file prepared for use with multiple computers.
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.
10 #User-set options. cannot use some options on the cray.
11 OPT := -Wall -g # -O3 -funroll-loops #-fexpensive-optimizations #-g
13 #use timing info for step 2? YES, or NO (or anything other than YES really)
16 #print extra stuff to screen in step 2? YES or NO (or anything other than YES really)
19 #turn off bertini and data collection calls?
22 ##################################
23 # Define machine specific stuff
24 ##################################
26 INSTALLDIR=UNSETLOCATION
28 ifeq (sam,$(MACHINENAME))
29 #sam (hopefully user independent)
30 MCC := mpic++ -std=c++11
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
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
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
52 else ifeq (cray,$(MACHINENAME))
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
64 else ifeq (macniemerg,$(MACHINENAME))
66 MCC:= mpic++ #-mpe=mpicheck
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
75 INSTALLDIR=UNSETLOCATION
78 #i expect errors here, or down below, because some variables are not set. this is deliberate.
80 #todo: use gnu autoconf to prepare the system for building
88 #################################
90 # end user-set stuff (hopefully)
92 #################################
95 #Define the file suffixes for C++ source files
96 .SUFFIXES: .cpp $(SUFFIXES)
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
104 # Define Libary Locations
105 LIBS := $(BERTINILIB) -lm $(MPFRLOC) -lmpfr -lgmp
108 DEFS := #initialize DEFS
113 DEFS := $(DEFS) -Dtimingstep2
116 ifeq (YES,${VERBOSE})
117 DEFS := $(DEFS) -Dverbosestep2
120 ifeq (YES,${NOSOLVE})
121 DEFS := $(DEFS) -Dnosolve
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
135 # Describe how to build the executable file
136 all: paramotopy step2
138 paramotopy: paramotopy.o $(OBJScommon)
139 $(MCC) $(INCLUDE) $(DEFS) $(OPT) -o paramotopy paramotopy.cpp $(OBJScommon) $(LIBS) $(LIBSboost) $(STATICFLAG)
141 step2: step2.o $(OBJScommon)
142 $(MCC) $(INCLUDE) $(DEFS) $(OPT) -o step2 step2.cpp $(OBJScommon) $(LIBS) $(LIBSboost) $(STATICFLAG)
144 install: step2 paramotopy
145 cp step2 paramotopy $(INSTALLDIR)
149 xml_preferences.o: tinyxml.o tinystr.o
153 # Describe how to create the object file
155 $(MCC) $(INCLUDE) $(DEFS) $(OPT) -c $< -o $@
159 # $(MCC) $(INCLUDE) $(DEFS) $(OPT) -c $*.cpp
161 # $(MCC) $(INCLUDE) $(DEFS) $(OPT) -c $*.c
164 # Describe actions necessary to clean the current directory
166 rm -f *.o paramotopy step2 *~
167 rm -rf paramotopy.dSYM step2.dSYM