1# compiler executables --------------------------------------------------------
2
3CC = gcc
4CXX = g++
5FC = gfortran
6
7# language standard -----------------------------------------------------------
8
9# CSTD = -std=c89 -Wno-unused-function
10  CSTD = -std=c99
11  CXXSTD = -std=c++98
12# CXXSTD = -std=c++11
13  FSTD = -std=f2003 -ffree-form -Wno-c-binding-type
14
15# common compiler options -----------------------------------------------------
16
17FLAGS = -O3 -fPIC -Wall -Wextra -pedantic -I../include
18SOFLAGS =
19
20# macOS compiler options (uncomment on macOS) ---------------------------------
21
22# SOFLAGS += -undefined dynamic_lookup
23
24# OpenMP compiler options -----------------------------------------------------
25
26# do not uncomment; use "make ZFP_WITH_OPENMP=0" to disable OpenMP
27OMPFLAGS = -fopenmp
28
29# optional compiler macros ----------------------------------------------------
30
31# use long long for 64-bit types
32# DEFS += -DZFP_INT64='long long' -DZFP_INT64_SUFFIX='ll'
33# DEFS += -DZFP_UINT64='unsigned long long' -DZFP_UINT64_SUFFIX='ull'
34
35# use smaller bit stream word type for finer rate granularity
36# DEFS += -DBIT_STREAM_WORD_TYPE=uint8
37# DEFS += -DBIT_STREAM_WORD_TYPE=uint16
38# DEFS += -DBIT_STREAM_WORD_TYPE=uint32
39# DEFS += -DBIT_STREAM_WORD_TYPE=uint64
40
41# enable strided access for progressive zfp streams
42# DEFS += -DBIT_STREAM_STRIDED
43
44# use aligned memory allocation
45# DEFS += -DZFP_WITH_ALIGNED_ALLOC
46
47# use two-way skew-associative cache
48# DEFS += -DZFP_WITH_CACHE_TWOWAY
49
50# use faster but more collision prone hash function
51# DEFS += -DZFP_WITH_CACHE_FAST_HASH
52
53# count cache misses
54# DEFS += -DZFP_WITH_CACHE_PROFILE
55
56# build targets ---------------------------------------------------------------
57
58# default targets
59BUILD_CFP = 0
60BUILD_ZFORP = 0
61BUILD_UTILITIES = 1
62BUILD_EXAMPLES = 0
63BUILD_TESTING = 1
64BUILD_SHARED_LIBS = 0
65
66# build all targets?
67ifdef BUILD_ALL
68  ifneq ($(BUILD_ALL),0)
69    BUILD_CFP = 1
70    BUILD_ZFORP = 1
71    BUILD_UTILITIES = 1
72    BUILD_EXAMPLES = 1
73    BUILD_TESTING = 1
74  endif
75endif
76
77# build shared libraries?
78ifneq ($(BUILD_SHARED_LIBS),0)
79  LIBRARY = shared
80  LIBZFP = libzfp.so
81  LIBCFP = libcfp.so
82else
83  LIBRARY = static
84  LIBZFP = libzfp.a
85  LIBCFP = libcfp.a
86endif
87
88# conditionals ----------------------------------------------------------------
89
90# enable OpenMP?
91ifdef ZFP_WITH_OPENMP
92  ifneq ($(ZFP_WITH_OPENMP),0)
93    ifneq ($(ZFP_WITH_OPENMP),OFF)
94      FLAGS += $(OMPFLAGS)
95    endif
96  endif
97endif
98
99# compiler options ------------------------------------------------------------
100
101CFLAGS = $(CSTD) $(FLAGS) $(DEFS)
102CXXFLAGS = $(CXXSTD) $(FLAGS) $(DEFS)
103FFLAGS = $(FSTD) $(FLAGS) $(DEFS)
104