-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile240.inc
50 lines (38 loc) · 963 Bytes
/
Makefile240.inc
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
#
# Makefile for stepps2 STAN simulations.
#
#COMP: INTEL, GNU
#COMP = INTEL
COMP = GNU
STAN ?= $(STEPPS2)/opt/stan240
STANC ?= $(STAN)/bin/stanc
MAIN ?= $(STAN)/src/cmdstan/main.cpp
ifeq ($(COMP), GNU)
CXX = g++
# CXXFLAGS = -O3 -fopenmp
LDFLAGS ?= -L$(STAN)/bin -lstan -lrt
endif
ifeq ($(COMP), INTEL)
CXX = icpc
CXXFLAGS = -O3 -openmp #-ipo -no-prec-div -openmp
LDFLAGS ?= -L$(STAN)/bin -lstan -lrt
endif
# include local config
include $(wildcard *.defs)
CXXFLAGS += -I$(STAN)/stan/src
CXXFLAGS += -I$(STAN)/stan/lib/eigen_3.2.0
CXXFLAGS += -I$(STAN)/stan/lib/boost_1.54.0
CXXFLAGS += -I$(STAN)/stan/lib/gtest_1.7.0
#CXXFLAGS += -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -lpthread
#
# rules
#
all:
%.cpp: %.stan
$(STANC) --o=$*.cpp $*.stan
%.exe: %.cpp
$(CXX) -o $*.exe $(CXXFLAGS) $(MAIN) -include $*.cpp $(LDFLAGS)
clean:
rm -rf build *.exe
.PHONY: clean
.PRECIOUS: %.cpp