-
Notifications
You must be signed in to change notification settings - Fork 134
/
make_linux.mk
133 lines (110 loc) · 3.97 KB
/
make_linux.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
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 qpOASES.
##
## qpOASES -- An Implementation of the Online Active Set Strategy.
## Copyright (C) 2007-2017 by Hans Joachim Ferreau, Andreas Potschka,
## Christian Kirches et al. All rights reserved.
##
## qpOASES is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## qpOASES 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 Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with qpOASES; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##
##
## Filename: make_linux.mk
## Author: Hans Joachim Ferreau, Andreas Potschka, Christian Kirches
## Version: 3.2
## Date: 2007-2017
##
################################################################################
# user configuration
# include directories, relative
IDIR = ${TOP}/include
SRCDIR = ${TOP}/src
BINDIR = ${TOP}/bin
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MKFILE_DIR := $(dir $(MKFILE_PATH))
EXT_IDIR =
# Matlab include directory (ADAPT TO YOUR LOCAL SETTINGS!)
#MATLAB_IDIR = ${HOME}/Programs/matlab/extern/include/
# system or replacement BLAS/LAPACK
REPLACE_LINALG = 1
ifeq ($(REPLACE_LINALG), 1)
LIB_BLAS = ${SRCDIR}/BLASReplacement.o
LIB_LAPACK = ${SRCDIR}/LAPACKReplacement.o
else
# LIB_BLAS = ${MATLAB_LIBDIR}/libmwblas.so
# LIB_LAPACK = ${MATLAB_LIBDIR}/libmwlapack.so
endif
# choice of sparse solver: NONE, MA27, or MA57
# If choice is not 'NONE', BLAS and LAPACK replacements must not be used
USE_SOLVER = NONE
# USE_SOLVER = MUMPS
ifeq ($(USE_SOLVER), MA57)
LIB_SOLVER = ${MATLAB_LIBDIR}/libmwma57.so
DEF_SOLVER = SOLVER_MA57
LINKHSL = -Wl,-rpath=${MATLAB_LIBDIR}
else ifeq ($(USE_SOLVER), MA27)
LIB_SOLVER = /usr/local/lib/libhsl_ma27.a
DEF_SOLVER = SOLVER_MA27
LINKHSL =
else ifeq ($(USE_SOLVER), MUMPS)
LIB_SOLVER = $(MKFILE_DIR)external/mumps_installation/lib/libcoinmumps.so
DEF_SOLVER = SOLVER_MUMPS
LINKHSL =
EXT_IDIR += -I$(MKFILE_DIR)external/mumps_installation/include/coin-or/mumps/
else
LIB_SOLVER =
DEF_SOLVER = SOLVER_NONE
LINKHSL =
endif
################################################################################
# do not touch this
CPP = g++
CC = gcc
AR = ar
RM = rm
F77 = gfortran
ECHO = echo
CD = cd
CP = cp
# file extensions
OBJEXT = o
LIBEXT = a
DLLEXT = so
EXE =
MEXOCTEXT = mex
DEF_TARGET = -o $@
SHARED = -shared
# 32 or 64 depending on target platform
BITS = $(shell getconf LONG_BIT)
# decide on MEX interface extension
ifeq ($(BITS), 32)
MEXEXT = mexglx
else
MEXEXT = mexa64
endif
# CPPFLAGS = -Wall $(EXT_IDIR) -pedantic -Wshadow -Wfloat-equal -O3 -Wconversion -Wsign-conversion -fPIC -DLINUX -D__USE_LONG_INTEGERS__ -D__USE_LONG_FINTS__ -D${DEF_SOLVER} -D__NO_COPYRIGHT__
CPPFLAGS = -Wall $(EXT_IDIR) -pedantic -Wshadow -Wfloat-equal -O3 -Wconversion -Wsign-conversion -fPIC -DLINUX -D${DEF_SOLVER} -D__NO_COPYRIGHT__
# -g -D__DEBUG__ -D__NO_COPYRIGHT__ -D__SUPPRESSANYOUTPUT__ -D__USE_SINGLE_PRECISION__
# libraries to link against when building qpOASES .so files
LINK_LIBRARIES = ${LIB_LAPACK} ${LIB_BLAS} -lm ${LIB_SOLVER} -ldl
LINK_LIBRARIES_WRAPPER = -lm ${LIB_SOLVER} -lstdc++
# how to link against the qpOASES shared library
QPOASES_LINK = -L${BINDIR} -Wl,-rpath=${BINDIR} ${LINKHSL} -lqpOASES
QPOASES_LINK_WRAPPER = -L${BINDIR} -Wl,-rpath=${BINDIR} ${LINKHSL} -lqpOASES_wrapper
# link dependencies when creating executables
LINK_DEPENDS = ${LIB_LAPACK} ${LIB_BLAS} ${BINDIR}/libqpOASES.${LIBEXT} ${BINDIR}/libqpOASES.${DLLEXT}
LINK_DEPENDS_WRAPPER = ${BINDIR}/libqpOASES_wrapper.${LIBEXT} ${BINDIR}/libqpOASES_wrapper.${DLLEXT}
##
## end of file
##