-
Notifications
You must be signed in to change notification settings - Fork 799
/
Makefile.config
74 lines (64 loc) · 1.83 KB
/
Makefile.config
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
#
# Global configuration for SNAP makefiles
#
GLIB = glib-core
SNAP = snap-core
GLIBADV = glib-adv
SNAPADV = snap-adv
SNAPEXP = snap-exp
CGLIB = ../$(GLIB)
CSNAP = ../$(SNAP)
EXGLIB = ../../$(GLIB)
EXSNAP = ../../$(SNAP)
EXGLIBADV = ../../$(GLIBADV)
EXSNAPADV = ../../$(SNAPADV)
EXSNAPEXP = ../../$(SNAPEXP)
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
# Linux flags
CC = g++
CXXFLAGS += -std=c++98 -Wall
CXXFLAGS += -O3 -DNDEBUG -fopenmp
# turn on for crash debugging, get symbols with <prog> 2>&1 | c++filt
#CXXFLAGS += -g -rdynamic
#CXXFLAGS += -ggdb
# turn on for OpenMP
CXXOPENMP =
LDFLAGS +=
LIBS += -lrt
else ifeq ($(UNAME), Darwin)
# OS X flags
CC = g++
CXXFLAGS += -std=c++98 -Wall -Wno-unknown-pragmas
CXXFLAGS += -O3 -DNDEBUG
CLANG := $(shell g++ -v 2>&1 | grep clang | cut -d " " -f 2)
ifeq ($(CLANG), LLVM)
CXXFLAGS += -DNOMP
CXXOPENMP =
else ifeq ($(CLANG), clang)
CXXFLAGS += -DNOMP
CXXOPENMP =
else
CXXFLAGS += -fopenmp
#CXXOPENMP += -fopenmp
endif
LDFLAGS +=
LIBS +=
# If a dynamic library, i.e. gtest, is installed in some local directory,
# for example by Anaconda, the program might fail with 'image not found'.
# Use one of the solutions below.
# 1. set the path to the lib directory in the executable at linking time
#LDFLAGS += -Wl,-rpath,$(HOME)/miniconda3/lib
# 2. set one of the following environment variables from your shell at run time
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/miniconda3/lib
#export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$HOME/miniconda3/lib
#export DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:$HOME/miniconda3/lib
else ifeq ($(shell uname -o), Cygwin)
# Cygwin flags
CC = g++
CXXFLAGS += -Wall -D__STDC_LIMIT_MACROS
CXXFLAGS += -O3 -DNDEBUG
CXXOPENMP = -fopenmp
LDFLAGS += -fopenmp
LIBS +=
endif