coin-or / qpOASES

Open-source C++ implementation of the recently proposed online active set strategy
GNU Lesser General Public License v2.1
365 stars 127 forks source link

Install MA57 to solve sparse QP problems #80

Open svigerske opened 4 years ago

svigerske commented 4 years ago

Issue created by migration from Trac.

Original creator: kribe48

Original creation time: 2018-01-15 10:34:00

Assignee: ferreau

Version: 3.2.0

Hi!

I am trying to install the HSL_MA57 solver with qpOASES according to the descriptions provided in the user manual, Section 2.2. However, I get the following error when I run make:


/home/kribe48/Software/qpOASES/bin/libqpOASES.so: undefined reference to `metis_nodend_'

I have updated the make_linux.mk file according to:

# user configuration

# include directories, relative
IDIR =   ${TOP}/include
SRCDIR = ${TOP}/src
BINDIR = ${TOP}/bin

# Matlab include directory (ADAPT TO YOUR LOCAL SETTINGS!)
#MATLAB_IDIR   = ${HOME}/Programs/matlab/extern/include/
MATLAB_IDIR   = /usr/local/matlab/extern/include/
MATLAB_LIBDIR = /usr/local/matlab/bin/glnxa64/

# system or replacement BLAS/LAPACK
REPLACE_LINALG = 0

ifeq ($(REPLACE_LINALG), 1)
    LIB_BLAS =   ${SRCDIR}/BLASReplacement.o
    LIB_LAPACK = ${SRCDIR}/LAPACKReplacement.o
else
    LIB_BLAS =   /home/kribe48/Software/Ipopt/lib/libcoinblas.so
    LIB_LAPACK = /home/kribe48/Software/Ipopt/lib/libcoinlapack.so
#   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 = MA57
#USE_SOLVER = MA57

ifeq ($(USE_SOLVER), MA57)
    LIB_SOLVER = /usr/local/lib/libhsl_ma57.a
    DEF_SOLVER = SOLVER_MA57
    LINKHSL =  -Wl,-rpath=/usr/local/lib/
else ifeq ($(USE_SOLVER), MA27)
    LIB_SOLVER = /usr/local/lib/libhsl_ma27.a
    DEF_SOLVER = SOLVER_MA27
    LINKHSL =
else
    LIB_SOLVER =
    DEF_SOLVER = SOLVER_NONE
    LINKHSL =
endif

I have used HSL_MA57 5.2.0 and installed libhsl_ma57.a and libfakemetis.a in /usr/local/lib. However, it seems like I got some errors with linking towards the metis package.

Can anyone help me with this issue?

Regards, Kristoffer

svigerske commented 4 years ago

Comment by kribe48 created at 2018-01-18 12:02:55

I managed to solve the problem, by doing the following modifications to make_linux.mk :

################################################################################
# user configuration
..
..
..
USE_SOLVER = MA57
#USE_SOLVER = MA57

ifeq ($(USE_SOLVER), MA57)
    LIB_SOLVER = /usr/local/lib/libhsl_ma57.a
    LIB_METIS = /usr/local/lib/libfakemetis.so
    DEF_SOLVER = SOLVER_MA57
    LINKHSL =  -Wl,-rpath=/usr/local/lib/
else ifeq ($(USE_SOLVER), MA27)
    LIB_SOLVER = /usr/local/lib/libhsl_ma27.a
    DEF_SOLVER = SOLVER_MA27
    LINKHSL =
else
    LIB_SOLVER =
    DEF_SOLVER = SOLVER_NONE
    LINKHSL =
endif
..
..
################################################################################
# do not touch this
..
..
..
# libraries to link against when building qpOASES .so files
LINK_LIBRARIES = ${LIB_LAPACK} ${LIB_BLAS} ${LIB_METIS} -lm ${LIB_SOLVER}

Hence, the solution was to provide the location of the metis-package.

Regards, Kristoffer