-
Notifications
You must be signed in to change notification settings - Fork 131
/
Makefile.rule
172 lines (145 loc) · 5.95 KB
/
Makefile.rule
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
###################################################################################################
# #
# This file is part of HPIPM. #
# #
# HPIPM -- High-Performance Interior Point Method. #
# Copyright (C) 2019 by Gianluca Frison. #
# Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. #
# All rights reserved. #
# #
# The 2-Clause BSD License #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, this #
# list of conditions and the following disclaimer. #
# 2. Redistributions in binary form must reproduce the above copyright notice, #
# this list of conditions and the following disclaimer in the documentation #
# and/or other materials provided with the distribution. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR #
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES #
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND #
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT #
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
# Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de #
# #
###################################################################################################
# Do something in this makefile
$(info Parsing Makefile.rule)
# Get path of Makefile.rule as main project directory
#CURRENT_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))
#################################################
### main makefile options
#################################################
# Target architecture
#TARGET = AVX512
TARGET = AVX
#TARGET = GENERIC
# Use C99 extension to math library
#
# USE_C99_MATH = 0
USE_C99_MATH = 1
# Compile auxiliary functions with external dependencies (for memory allocation, printing and timing)
#
# EXT_DEP = 0
EXT_DEP = 1
# BLAS and LAPACK version (only used for LA=BLAS in BLASFEO)
REF_BLAS = 0
#REF_BLAS = OPENBLAS
#REF_BLAS = NETLIB
#REF_BLAS = MKL
#REF_BLAS = BLIS
#REF_BLAS = ATLAS
# Installation directory
TOP = $(CURRENT_DIR)
#TOP = $(shell pwd)
#TOP = C:/cygwin64/home/gianluca/hpipm
# operating system
#UNAME_S := $(shell uname -s)
#ifeq ($(UNAME_S),Linux)
# OS = LINUX
#endif
#ifeq ($(UNAME_S),Darwin)
# OS = MAC
#endif
#OS = LINUX
#OS = MAC
#OS = WINDOWS
# C Compiler
CC = gcc
#CC = clang
#CC = x86_64-w64-mingw32-gcc
# Installation directory
PREFIX = /opt
# BLASFEO installation directory
BLASFEO_PATH = /opt/blasfeo
#BLASFEO_PATH = /home/gianluca/blasfeo
#BLASFEO_PATH = C:/cygwin64/home/gianluca/blasfeo
# enable runtine checks
RUNTIME_CHECKS = 0
#RUNTIME_CHECKS = 1
# compiler flags
CFLAGS =
# optimization flags
CFLAGS += -O2 -fPIC
# debugging flags
CFLAGS += #-g #-Werror=vla -Wall -pedantic -Wfloat-equal #-pg
# search directories
CFLAGS += -I$(BLASFEO_PATH)/include -I$(TOP)/include #-I$(TOP)/../../include
# definirions
#ifeq ($(OS), LINUX)
#CFLAGS += -DOS_LINUX
#endif
#ifeq ($(OS), MAC)
#CFLAGS += -DOS_MAC
#endif
#ifeq ($(OS), WINDOWS)
#CFLAGS += -DOS_WINDOWS
#endif
ifeq ($(USE_C99_MATH), 1)
CFLAGS += -DUSE_C99_MATH
endif
ifeq ($(EXT_DEP), 1)
CFLAGS += -DEXT_DEP
endif
ifeq ($(REF_BLAS), 0)
CFLAGS +=
endif
ifeq ($(REF_BLAS), OPENBLAS)
CFLAGS += -DREF_BLAS_OPENBLAS -I/opt/openblas/include
endif
ifeq ($(REF_BLAS), BLIS)
CFLAGS += -DREF_BLAS_BLIS -std=c99
endif
ifeq ($(REF_BLAS), NETLIB)
CFLAGS += -DREF_BLAS_NETLIB
endif
ifeq ($(REF_BLAS), MKL)
CFLAGS += -DREF_BLAS_MKL -m64 -I/opt/intel/mkl/include
endif
ifeq ($(REF_BLAS), ATLAS)
CFLAGS += -DREF_BLAS_ATLAS
endif
ifeq ($(RUNTIME_CHECKS), 1)
CFLAGS += -DRUNTIME_CHECKS
endif
# architecture-specific flags
ifeq ($(TARGET), AVX512)
CFLAGS += -mavx512f -mavx512vl -mfma -DTARGET_AVX512
endif
ifeq ($(TARGET), AVX)
CFLAGS += -mavx -DTARGET_AVX
endif
ifeq ($(TARGET), GENERIC)
CFLAGS += -DTARGET_GENERIC
endif