-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.mk
46 lines (38 loc) · 1.27 KB
/
config.mk
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
# OSX install:
# brew install --c++11 --cc=gcc-4.9 --build-from-source boost eigen
# Ubuntu install:
# sudo apt-get install libboost-all-dev libeigen3-dev nvidia-cuda-toolkit
EIGEN := $(shell pkg-config eigen3 --cflags)
BOOST :=
LINKER ?= $(CXX)
ARCHIVER ?= ar -rus
NVCC ?= nvcc -arch=sm_21 # -Xptxas="-v"
CFLAGS ?= -std=c99 -Wall
CXXFLAGS ?= -std=c++11 -Wall $(EIGEN)
LIBS := -lboost_program_options # -static-libgcc -static-libstdc++
ifdef ncuda
CFLAGS := $(CFLAGS) -DNOCUDA
CXXFLAGS := $(CXXFLAGS) -DNOCUDA
NVCC := true
else
# for Ubuntu
# CFLAGS := $(CFLAGS) $(shell pkg-config cudart-6.5 --cflags)
# LDFLAGS := $(LDFLAGS) $(shell pkg-config cudart-6.5 --libs)
# LINKER := nvcc
# for OSX
LDFLAGS := $(LDFLAGS) -L/Developer/NVIDIA/CUDA-6.0/lib -lcudart
endif
ifndef ndebug
CFLAGS := $(CFLAGS) -g -gdwarf-2
CXXFLAGS := $(CXXFLAGS) -g -gdwarf-2
LDFLAGS := $(LDFLAGS) -g -gdwarf-2
NVFLAGS := $(NVFLAGS) -g -G
NVLDFLAGS := $(NVLDFLAGS) -g -G
endif
ifdef opt
CFLAGS := $(CFLAGS) -ffast-math -O3 -mtune=native -DNDEBUG
CXXFLAGS := $(CXXFLAGS) -ffast-math -O3 -mtune=native -DNDEBUG
LDFLAGS := $(LDFLAGS) -ffast-math -O3 -mtune=native
NVFLAGS := $(NVFLAGS) -O3 -DNDEBUG
NVLDFLAGS := $(NVLDFLAGS) -O3
endif