forked from giaf/hpipm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.rule
134 lines (115 loc) · 4.52 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
###################################################################################################
# #
# This file is part of HPIPM. #
# #
# HPIPM -- High-Performance Interior Point Method. #
# Copyright (C) 2017-2018 by Gianluca Frison. #
# Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. #
# All rights reserved. #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version #.
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
# #
# The authors designate this particular file as subject to the "Classpath" exception #
# as provided by the authors in the LICENSE file that accompained this code. #
# #
# Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de #
# #
###################################################################################################
# Target architecture
TARGET = AVX
#TARGET = GENERIC
# Use C99 extension to math library
#
# USE_C99_MATH = 0
USE_C99_MATH = 1
# BLAS and LAPACK version (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 = $(shell pwd)
# 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
# enable runtine checks
RUNTIME_CHECKS = 0
#RUNTIME_CHECKS = 1
# compiler flags
CFLAGS =
# optimization flags
CFLAGS += -O2 -fPIC
# debugging flags
CFLAGS += #-g #-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 ($(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), AVX)
CFLAGS += -mavx -DTARGET_AVX
endif
ifeq ($(TARGET), GENERIC)
CFLAGS += -DTARGET_GENERIC
endif