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

Compiling on dSpace plattform #61

Open svigerske opened 4 years ago

svigerske commented 4 years ago

Issue created by migration from Trac.

Original creator: christoph.froehlich

Original creation time: 2017-03-09 13:33:07

Assignee: ferreau

Version: 3.2.0

Keywords: dSpace

I tried to follow the instructions of section 6.7 Running qpOASES on dSPACE in the manual of qpOASES v3.2.

I successfully compiled qpOases and the Simlink-Interface with the compiler Flag __DSPACE__ from Matlab 2015b and the Microsoft Software Development Kit (SDK) 7.1.

Then I tried to build the example_QProblem from the Simulink-Interface with adding USER_BUILD_CPP_APPL USER_SRCS USER_SRCS_DIR and USER_INCLUDES_PATH to example_QProblem_usr.mk. After building the project for the target (DS1202) it tells me MAKE PROCESS SUCCEEDED, but RTI cannot load the application with the follwing errors:

LINKING APPLICATION ... 
LINKING FINISHED 

MAKE PROCESS SUCCEEDED
LOADING APPLICATION "example_QProblem.sdf" ...
  PLATFORM:      ds1202
*** ERROR: RTI: Simulation state: STOP (1/702)[3626.851]
Application stopped (0xb78aa5).[3627.092]
Application unloaded (0xb78aa5).[3627.147]
System information: Hardware initialization succeeded. (5/8001)[3627.477]
Application loaded by host '' ().[3627.999]
Application process crashed. Check message log for error reports. dSPACE Support information: Application ID: 0xb78aa6.[3628.574]
Application loaded (0xb78aa6).[3628.574]
Internal error. dSPACE Support information: Create application object with ID 0xb78aa6 failed. Create shared memory failed.[3628.259]
Memory allocation failed. Probably not enough memory available for requested operation.[3628.259]
Application terminated (0xb78aa6).[3628.577]
Attempt to load application process failed. Check message log for error reports. dSPACE Support information: Invalid application process state detected or timeout occurred. Application ID: 0xb78aa6. Current state: 0x3340000. Expected state: 0x300000.[3628.580]
Cannot load real-time application.[0.000]
Cannot load application process. See message log for further information. dSPACE Support information: Affected application process: 1. Total number of application processes in application group: 1.[0.000]
Could not download application.
Could not download real-time application: example_qproblem.rta.

I am using dSPACE Release 2016-A, the mentioned dSPACE Release 5.3 is ten years old. I cannot find any informations about the dSPACE C++ Integration Kit. Is this still an active product or may the C++ support be included with the Real-Time Interface to Simulink? Is qpOases compatible to the latest dSpace Releases? Is this any issue due to a missing compiler/product?

svigerske commented 4 years ago

Comment by christoph.froehlich created at 2017-03-24 21:07:24

According to the support of dSpace, the current releases of dSpace already contain a C++ compiler without any additional software. Therefore, this has to be any issue of qpoases.

svigerske commented 4 years ago

Comment by ferreau created at 2017-03-28 08:32:51

Changing status from new to assigned.

svigerske commented 4 years ago

Comment by ferreau created at 2017-03-29 07:36:19

Thanks for reporting this issue. You are right that dSPACE version 5.3 is an somewhat old one that used to need an additional C++ compiler. The description in the user's manual seems to need an update.

Regarding your error: I do not have a dSPACE hardware at hand, so I cannot reproduce your problem. However, I am happy to help you fixing it. For doing so, could you please also provide a more detailed error log? If there is a "verbose" option for the build process, it might help to turn that one on, too.

svigerske commented 4 years ago

Attachment example_QProblem_usr.mk by christoph.froehlich created at 2017-03-30 07:25:16

usr makefile

svigerske commented 4 years ago

Comment by christoph.froehlich created at 2017-03-30 07:28:49

Hi, I compiled the simulink-interface with make.m according to section 6.2, with the change of __DSPACE__ in Types.hpp. There weren't any error messages, the simulink file itself works fine.

The verbose option for code genereation in Simulink is already on Simulink Options - Code Generation - Debug - Verbose build. Running slbuild from the command line gives the same error messages and the error-log from dSpace's Control Desk has the same as well.

How can I provide more information? I added the usr-makefile as attachment.

svigerske commented 4 years ago

Comment by ferreau created at 2017-03-30 14:22:57

I thought the problem could be in the linking step; however I just realized that both compilation and linking works fine and the problem only occurs once the application is loaded. The output above mentions

Check message log for error reports.

several times. Can you check these log files and share information that may help narrowing down the issue.

svigerske commented 4 years ago

Comment by rafardasilva created at 2017-04-04 21:19:34

Hi,

I am trying to compile the make.m after uncomment type.hpp line 45 (dspace flag) and I've got the following error:

qpOASES_QProblemB.cpp ../../src\QProblem.cpp(6229) : error C2084: function 'double abs(double)' already has a body

Some suggestion?

Thanks in advance

svigerske commented 4 years ago

Comment by ferreau created at 2017-04-10 09:24:23

This line declaring/defining the function abs should not be there and you can savely delete it. I have done so in revision 253 of the trunk as well. Thanks for reporting this issue.

svigerske commented 4 years ago

Comment by christoph.froehlich created at 2017-04-12 08:15:39

Update: Today I tried to compile and load the example onto a DS1103-dSpace Box. There, the example works as expected. The main difference is the processor architecture: the DS1103 has a PPC, the DS1202 uses a more modern Freescale-processor.

I found a document from dSpace (FAQ239) for debugging errors on the hardware platform, but the workflow does not work neither. I contacted the dSpace support and will provide more information if available.

svigerske commented 4 years ago

Comment by ferreau created at 2017-04-12 09:06:58

This might be a very helpful information for other users as well, thanks a lot already! In case you figure out any tweak required to make qpOASES work on this more modern dSPACE platform, please let us know.

svigerske commented 4 years ago

Comment by rafardasilva created at 2017-04-12 19:37:31

UPDATE: The solution about the function abs worked.

Following the item 6.6 after step 7 (where I insert and modify the MK file) I got several errors related to MessageHandling. Thank you for the help.

My dSPACE platform is DS1401.

Error example:

COMPILING  "example_QProblem_2015.c"
(E) C0020; "example_QProblem_2015.h", line 1052 pos 1; identifier "class" is undefined 
  class MessageHandling 
  ^ 
(E) C0065; "example_QProblem_2015.h", line 1053 pos 1; expected a ";" 
  { 
  ^ 
(W) C0012-D; "example_QProblem_2015.h", line 1077 pos 21; parsing restarts here after previous syntax error 
    MessageHandling( ); 

COMPILING FAILED (1) 
svigerske commented 4 years ago

Comment by ferreau created at 2017-04-13 11:10:29

If you get identifier "class" is undefined, are you sure you have an C++ compiler installed?

svigerske commented 4 years ago

Comment by cherrmann created at 2017-07-04 12:18:39

Hi guys,

I am not quite sure, what exactly is causing the problem. However, during the build process, the subsequent error occurs and the process is aborted:

LINKING APPLICATION ... 
< lnkppc > 
(E) #A0368-D Unresolved external: 
    dpotrf_ (first referenced in module: QProblem.cppm03) 
    __vtbl__18Q2_7qpOASES6Matrix__Q2_7qpOASES11DenseMatrix (first referenced in module: SQProblem.cppm03) 
    qpOASES::DenseMatrix::_vtbl (first referenced in module: SQProblem.cppm03) 
    qpOASES::Indexlist::getIndex(int) const (first referenced in module: QProblem.cppm03) 
    qpOASES::Bounds::swapFree(int, int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Options::print() const (first referenced in module: QProblemB.cppm03) 
    qpOASES::Flipper::get(qpOASES::Bounds *, double *, qpOASES::Constraints *, double *, double *) const (first referenced in module: QProblem.cppm03) 
    qpOASES::Flipper::set(const qpOASES::Bounds *, const double *, const qpOASES::Constraints *, const double *, const double *) (first referenced in module: QProblem.cppm03) 
    qpOASES::readFromFile(double *, int, int, const char *) (first referenced in module: SQProblem.cppm03) 
    qpOASES::SparseMatrix::_ct(int, int, int *, int *, double *) (first referenced in module: QProblemB.cppm03) 
    qpOASES::SparseMatrix::createDiagInfo() (first referenced in module: QProblemB.cppm03) 
    __T_Q2_7qpOASES6Matrix (first referenced in module: SQProblem.cppm03) 
    qpOASES::Matrix::_vtbl (first referenced in module: SQProblem.cppm03) 
    qpOASES::Bounds::_as(const qpOASES::Bounds &) (first referenced in module: QProblemB.cppm03) 
    qpOASES::Bounds::_ct(const qpOASES::Bounds &) (first referenced in module: SQProblem.cppm03) 
    qpOASES::getSimpleStatus(qpOASES::returnValue, qpOASES::BooleanType) (first referenced in module: qpOASES_SQProblem.cppm03) 
    qpOASES::Matrix::getSparseSubmatrix(const qpOASES::Indexlist *, const qpOASES::Indexlist *, int, int, int &, int *, int *, double *, qpOASES::BooleanType) const (first referenced in module: SQProblem.cppm03) 
    qpOASES::Matrix::getSparseSubmatrix(const qpOASES::Indexlist *, int, int, int, int &, int *, int *, double *, qpOASES::BooleanType) const (first referenced in module: SQProblem.cppm03) 
    qpOASES::Matrix::getSparseSubmatrix(int, const qpOASES::Indexlist *, int, int, int &, int *, int *, double *, qpOASES::BooleanType) const (first referenced in module: SQProblem.cppm03) 
    __vtbl__18Q2_7qpOASES6Matrix__Q2_7qpOASES11SymDenseMat (first referenced in module: SQProblem.cppm03) 
    __vtbl__28Q2_7qpOASES15SymmetricMatrix__Q2_7qpOASES11SymDenseMat (first referenced in module: SQProblem.cppm03) 
    qpOASES::SymDenseMat::_vtbl (first referenced in module: SQProblem.cppm03) 
    qpOASES::Bounds::moveFreeToFixed(int, qpOASES::SubjectToStatus) (first referenced in module: QProblem.cppm03) 
    qpOASES::Constraints::moveInactiveToActive(int, qpOASES::SubjectToStatus) (first referenced in module: QProblem.cppm03) 
    qpOASES::Bounds::setupBound(int, qpOASES::SubjectToStatus) (first referenced in module: QProblemB.cppm03) 
    qpOASES::Constraints::setupConstraint(int, qpOASES::SubjectToStatus) (first referenced in module: QProblem.cppm03) 
    qpOASES::writeIntoMatFile(_iobuf *, const double *, int, int, const char *) (first referenced in module: QProblem.cppm03) 
    qpOASES::myPrintf(const char *) (first referenced in module: QProblem.cppm03) 
    qpOASES::Indexlist::getNumberArray(int **) const (first referenced in module: QProblem.cppm03) 
    qpOASES::Options::_ct() (first referenced in module: QProblemB.cppm03) 
    qpOASES::Options::_dt() (first referenced in module: QProblemB.cppm03) 
    qpOASES::Options::ensureConsistency() (first referenced in module: qpOASES_SQProblem.cppm03) 
    qpOASES::Options::setToMPC() (first referenced in module: qpOASES_SQProblem.cppm03) 
    qpOASES::readFromFile(double *, int, const char *) (first referenced in module: QProblem.cppm03) 
    qpOASES::MessageHandling::reset() (first referenced in module: QProblemB.cppm03) 
    qpOASES::Constraints::_ct(int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Constraints::flipFixed(int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Constraints::init(int) (first referenced in module: SQProblem.cppm03) 
    qpOASES::Constraints::moveActiveToInactive(int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Constraints::_ct() (first referenced in module: QProblem.cppm03) 
    qpOASES::Constraints::_dt() (first referenced in module: SQProblem.cppm03) 
    qpOASES::Constraints::setupAllInactive() (first referenced in module: SQProblem.cppm03) 
    qpOASES::Constraints::_as(const qpOASES::Constraints &) (first referenced in module: QProblem.cppm03) 
    qpOASES::Constraints::_ct(const qpOASES::Constraints &) (first referenced in module: SQProblem.cppm03) 
    qpOASES::Flipper::init(unsigned int, unsigned int) (first referenced in module: QProblem.cppm03) 
    qpOASES::getNorm(const double *, int, int) (first referenced in module: QProblemB.cppm03) 
    qpOASES::Flipper::_ct() (first referenced in module: QProblemB.cppm03) 
    qpOASES::Flipper::_dt() (first referenced in module: QProblemB.cppm03) 
    qpOASES::writeIntoMatFile(_iobuf *, const int *, int, int, const char *) (first referenced in module: QProblem.cppm03) 
    qpOASES::Bounds::_ct(int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Bounds::flipFixed(int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Bounds::init(int) (first referenced in module: SQProblem.cppm03) 
    qpOASES::Bounds::moveFixedToFree(int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Bounds::_ct() (first referenced in module: QProblemB.cppm03) 
    qpOASES::Bounds::_dt() (first referenced in module: SQProblem.cppm03) 
    qpOASES::Bounds::setupAllFree() (first referenced in module: SQProblem.cppm03) 
    qpOASES::MessageHandling::throwError(qpOASES::returnValue, const char *, const char *, const char *, unsigned long, qpOASES::VisibilityStatus) (first referenced in module: SQProblem.cppm03) 
    qpOASES::MessageHandling::throwInfo(qpOASES::returnValue, const char *, const char *, const char *, unsigned long, qpOASES::VisibilityStatus) (first referenced in module: QProblem.cppm03) 
    qpOASES::MessageHandling::throwWarning(qpOASES::returnValue, const char *, const char *, const char *, unsigned long, qpOASES::VisibilityStatus) (first referenced in module: QProblem.cppm03) 
    qpOASES::getCPUtime() (first referenced in module: SQProblem.cppm03) 
    qpOASES::getGlobalMessageHandler() (first referenced in module: SQProblem.cppm03) 
    qpOASES::printCopyrightNotice() (first referenced in module: QProblemB.cppm03) 
    qpOASES::Options::_as(const qpOASES::Options &) (first referenced in module: QProblemB.cppm03) 
    __vtbl__18Q2_7qpOASES6Matrix__Q2_7qpOASES12SymSparseMat (first referenced in module: QProblemB.cppm03) 
    __vtbl__25Q2_7qpOASES12SparseMatrix__Q2_7qpOASES12SymSparseMat (first referenced in module: QProblemB.cppm03) 
    qpOASES::SymSparseMat::_vtbl (first referenced in module: QProblemB.cppm03) 
    qpOASES::Flipper::_as(const qpOASES::Flipper &) (first referenced in module: QProblemB.cppm03) 
 Errors: 1, Warnings: 0 
-- call "C:\dSPACE RCPHIL 7.2\Compiler\PPCTools37\BIN\lnkppc.exe"  -K0 -QmsA0314 -QmsA0407 -QmeA0307 -QmeA0329 -m..\MyModel.map -o ..\MyModel.ppc -c _tmp_MyModel.lk  
LINKING FAILED (1) 

MAKE PROCESS ABORTED 

I am not able to detect the fault and therefore, I am asking you, if you have any idea? I followed all given instructions so far

svigerske commented 4 years ago

Comment by cherrmann created at 2017-07-05 10:41:32

Solved it. I had some linebreaks in the user make file for the additional source files.

svigerske commented 4 years ago

Comment by richard.hutter created at 2018-03-29 08:44:53

I ran into exactly the same problem. The download to the DS1202 failed. I am using Matlab 2017a with Microsoft Windows SDK 7.1. With the help of dSPACE support, I was able to localize the problem in the dummy function for "snprintf". Finally, the download works fine if the following lines are deleted in qpOASES 3.2.1:

1) Function declaration in include/Types.hpp (line 128 to 130) 2) Dummy function in scr/Utils.cpp (line 56 to 67)

I think the real problem is that setting the flag "DSPACE" results in setting the "NO_SNPRINTF" (line 122 in Types.hpp).

svigerske commented 4 years ago

Comment by hrichter created at 2018-10-16 01:56:11

Hi Christoph,

I tried to compile example_Qproblem for the dSPACE 1202 platform with Windows 10, MATLAB 2017b, the MinGW compiler and dSPACE release 2018a. I followed the steps shown in the qpOASES manual. When I build the model, the process starts, but stops with the error below. I'm also showing my user make file. If possible, please share the user make file you used to get compilation to succeed. Thanks!

Starting build procedure with RTI 7.10 (RTI1202, 02-May-2018) Model: "example_QProblem" (C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\interfaces\simulink\example_QProblem.mdl)

Using configuration set : "Configuration" Working directory : "C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\interfaces\simulink" *** Initializing code generation

Starting Simulink Coder build procedure for model: example_QProblem

Generating code and artifacts to 'Model specific' folder structure

Code Generation 1 Elapsed: 10 sec

Generating code into build folder: C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\interfaces\simulink\example_QProblem_rti1202

*** Optional User System Description File example_qproblem_usr.sdf not available

Invoking Target Language Compiler on example_QProblem.rtw

Using System Target File: C:\Program Files\dSPACE RCPHIL 2018-A\MATLAB\RTI\RTI1202\TLC\rti1202.tlc

Loading TLC function libraries

Initial pass through model to cache user defined code

Postprocessing RTI blocks Starting I/O block checking *** Passed I/O block checking .

Caching model source code

Writing header file example_QProblem_types.h

Writing header file example_QProblem.h

Writing source file example_QProblem.c

Writing header file rtwtypes.h

Writing header file multiword_types.h

Writing header file example_QProblem_private.h

Writing header file rtmodel.h

.

Writing source file example_QProblem_data.c

Writing header file rt_nonfinite.h

Writing source file rt_nonfinite.c

Writing header file rtGetInf.h

Writing source file rtGetInf.c

Writing header file rtGetNaN.h

Writing source file rtGetNaN.c

TLC code generation complete.

Generating TLC interface API.

Generating file example_QProblem_rti.c Generating file example_QProblem_rti.mk *** Generating Variable Description File example_QProblem.trc

NOTE: The following option in the Configuration Parameters dialog has been used:

  Optimization:
  "Conditional input branch execution" On

  This leads to code optimization in which blocks are not computed if their
  outputs are not required in the simulation step, for example, if their
  output values are used as input for a Switch block and the Switch
  currently routes another signal. When the corresponding output signals
  are displayed in ControlDesk, their values are static.

  To ensure that the blocks are computed, turn off the 
  "Conditional input branch execution" option and rebuild the model.


NOTE: The following options in the Configuration Parameters dialog have been used:

  Optimization:
  "Signal storage reuse"  on
  "Reuse block outputs"   on

  As a consequence, in general no block output variables are written to the
  -> example_QProblem.trc
  file and are therefore not accessible from within ControlDesk.

  You can ensure that a specific block output is accessible by declaring
  its Simulink signal as a test point. To do so, select the signal line and
  choose "Signal properties..." from the Edit menu. In the Signal Properties
  dialog, select the "Test point" option.

Found User-Code File example_QProblem_usr.c from 06-Oct-2018 15:23:53 Found User Makefile example_QProblem_usr.mk from 15-Oct-2018 21:42:20 *** Optional User Variable Description File example_QProblem_usr.trc not available .

Processing Template Makefile: C:\Program Files\dSPACE RCPHIL 2018-A\MATLAB\RTI\RTI1202\RTI\rti1202.tmf

example_QProblem.mk which is generated from C:\Program Files\dSPACE RCPHIL 2018-A\MATLAB\RTI\RTI1202\RTI\rti1202.tmf is up to date

Building example_QProblem: .\example_QProblem.bat

C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\interfaces\simulink\example_QProblem_rti1202>set MATLAB=C:\Program Files\MATLAB\R2017b

C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\interfaces\simulink\example_QProblem_rti1202>"C:\Program Files\dSPACE RCPHIL 2018-A\Exe\dsmake.exe" -f example_QProblem.mk ISPROTECTINGMODEL=NOTPROTECTING EXTMODE_STATIC_ALLOC=0 TMW_EXTMODE_TESTING=0 EXTMODE_STATIC_ALLOC_SIZE=1000000 EXTMODE_TRANSPORT=0 MAT_FILE=0

BUILDING APPLICATION "example_QProblem" (Multiple Timer Task Mode)

WORK DIRECTORY "C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\interfaces\simulink" BUILD DIRECTORY "C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\interfaces\simulink\example_QProblem_rti1202" TARGET COMPILER "C:\ProgramData\dSPACE\071346EA-BFFA-4465-9551-2E48EDF35320\Compiler\QNX650_520" (GCC Vs 5.2.0)

DEFINITIONS FROM USER MAKEFILE "example_QProblem_usr.mk" ... USER_SRCS = qpOASES_SQProblem.cpp qpOASES_QProblem.cpp qpOASES_QProblemB.cpp SQProblem.cpp QProblem.cpp QProblemB.cpp Bounds.cpp Constraints.cpp SubjectTo.cpp Indexlist.cpp Flipper.cpp Utils.cpp Options.cpp Matrices.cpp BLASReplacement.cpp LAPACKReplacement.cpp \ USER_SRCS_DIR = "C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\interfaces\simulink" USER_INCLUDES_PATH = "C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\include\qpOASES" "C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\src" "C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\include"

COMPILING "example_QProblem.c"
COMPILING "example_QProblem_data.c" COMPILING "example_QProblem_trc_ptr.c" COMPILING "rtGetInf.c" COMPILING "rtGetNaN.c" COMPILING "rt_nonfinite.c" COMPILING "C:\Program Files\dSPACE RCPHIL 2018-A\MATLAB\RTI\RTI\C\rti_sim_engine.c" OPUS MAKE: Don't know how to make 'qpOASES_QProblem.cppm07'. Stop.

Errors occurred during make process. Inspect MATLAB Command Window for details. *** Aborting RTI build procedure for model example_QProblem.

*** Stopped RTI build procedure for model: example_QProblem.

Errors occurred during make process. Inspect MATLAB Command Window for details. *** Aborting RTI build procedure for model example_QProblem.

Makefile:

=============================================================================

Make include file example_QProblem_usr.mk:

#

RTI1202 7.10 (02-May-2018)

Sat Oct 6 15:23:50 2018

#

Copyright 2018, dSPACE GmbH. All rights reserved. Brand names

or product names are trademarks or registered trademarks of their

respective companies or organizations.

=============================================================================

enable c++ support

USER BUILD CPP APPL = ON

=============================================================================

===== Define file version macro. Never change this value. ===================

=============================================================================

USER_MAKEFILE_VERSION = 2

=============================================================================

-----------------------------------------------------------------------------

Macros for user-specific settings.

#

All macros below may list several items (files or directories). You can

separate multiple items with blanks or list them on several lines using

the \ (backslash) as line continuation character.

#

The directory names may include absolute or partial path

descriptions, e.g., ".\project1\sources"

#

If path names contain white space characters they need to be set

in double quotes (").

White space characters and double quotes are not supported

with file names like "my source.c".

#

Note that white space characters and double quotes with path

names are available since RTI/RTI-MP of dSPACE Release 6.0.

Such paths do not work with previous versions of RTI/RTI-MP.

#

Examples:

#

USER_SRCS = qpOASES_SQProblem.cpp \ qpOASES_QProblem.cpp \ qpOASES_QProblemB.cpp \ SQProblem.cpp \ QProblem.cpp \ QProblemB.cpp \ Bounds.cpp \ Constraints.cpp \ SubjectTo.cpp \ Indexlist.cpp \ Flipper.cpp \ Utils.cpp \ Options.cpp \ Matrices.cpp \ BLASReplacement.cpp \ LAPACKReplacement.cpp \ MessageHandling.cpp

USER_SRCS = \

  file1.c \

  file2.c \

  file3.c

#

SFCN_DIR =

  "\project one\sfcns" \

  "\project two\sfcns"

#

-----------------------------------------------------------------------------

Directories where S-Function C source files are stored.

SFCN_DIR =

Additional C source files to be compiled (file name extension .c).

USER_SRCS =

Additional assembler source files to be compiled (file name extension .asm).

USER_ASM_SRCS =

Directories where additional C and assembler source files are stored.

USER_SRCS_DIR ="C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\interfaces\simulink"

Path names for user include files.

USER_INCLUDES_PATH = "C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\include\qpOASES" "C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\src" "C:\Users\Mech_tutor\Documents\MATLAB\dSPACEprojects\qpOASES\include"

Additional user object files to be linked.

USER_OBJS =

Additional user libraries to be linked.

USER_LIBS =

EOF -------------------------------------------------------------------------

svigerske commented 4 years ago

Comment by Shuai created at 2019-04-29 11:13:25

Hello, richard.hutter, I am also using qpOASES with dSPACE right now. I met some difficulty for getting the calculation result. Could you please tell me your email and I have some question for consultation. Thank you so much!

Shuai Liang

Replying to [comment:14 richard.hutter]:

I ran into exactly the same problem. The download to the DS1202 failed. I am using Matlab 2017a with Microsoft Windows SDK 7.1. With the help of dSPACE support, I was able to localize the problem in the dummy function for "snprintf". Finally, the download works fine if the following lines are deleted in qpOASES 3.2.1:

1) Function declaration in include/Types.hpp (line 128 to 130) 2) Dummy function in scr/Utils.cpp (line 56 to 67)

I think the real problem is that setting the flag "DSPACE" results in setting the "NO_SNPRINTF" (line 122 in Types.hpp).

MohamedAwadallah commented 4 years ago

Comment by cherrmann created at 2017-07-04 12:18:39

Hi guys,

I am not quite sure, what exactly is causing the problem. However, during the build process, the subsequent error occurs and the process is aborted:

LINKING APPLICATION ... 
< lnkppc > 
(E) #A0368-D Unresolved external: 
    dpotrf_ (first referenced in module: QProblem.cppm03) 
    __vtbl__18Q2_7qpOASES6Matrix__Q2_7qpOASES11DenseMatrix (first referenced in module: SQProblem.cppm03) 
    qpOASES::DenseMatrix::_vtbl (first referenced in module: SQProblem.cppm03) 
    qpOASES::Indexlist::getIndex(int) const (first referenced in module: QProblem.cppm03) 
    qpOASES::Bounds::swapFree(int, int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Options::print() const (first referenced in module: QProblemB.cppm03) 
    qpOASES::Flipper::get(qpOASES::Bounds *, double *, qpOASES::Constraints *, double *, double *) const (first referenced in module: QProblem.cppm03) 
    qpOASES::Flipper::set(const qpOASES::Bounds *, const double *, const qpOASES::Constraints *, const double *, const double *) (first referenced in module: QProblem.cppm03) 
    qpOASES::readFromFile(double *, int, int, const char *) (first referenced in module: SQProblem.cppm03) 
    qpOASES::SparseMatrix::_ct(int, int, int *, int *, double *) (first referenced in module: QProblemB.cppm03) 
    qpOASES::SparseMatrix::createDiagInfo() (first referenced in module: QProblemB.cppm03) 
    __T_Q2_7qpOASES6Matrix (first referenced in module: SQProblem.cppm03) 
    qpOASES::Matrix::_vtbl (first referenced in module: SQProblem.cppm03) 
    qpOASES::Bounds::_as(const qpOASES::Bounds &) (first referenced in module: QProblemB.cppm03) 
    qpOASES::Bounds::_ct(const qpOASES::Bounds &) (first referenced in module: SQProblem.cppm03) 
    qpOASES::getSimpleStatus(qpOASES::returnValue, qpOASES::BooleanType) (first referenced in module: qpOASES_SQProblem.cppm03) 
    qpOASES::Matrix::getSparseSubmatrix(const qpOASES::Indexlist *, const qpOASES::Indexlist *, int, int, int &, int *, int *, double *, qpOASES::BooleanType) const (first referenced in module: SQProblem.cppm03) 
    qpOASES::Matrix::getSparseSubmatrix(const qpOASES::Indexlist *, int, int, int, int &, int *, int *, double *, qpOASES::BooleanType) const (first referenced in module: SQProblem.cppm03) 
    qpOASES::Matrix::getSparseSubmatrix(int, const qpOASES::Indexlist *, int, int, int &, int *, int *, double *, qpOASES::BooleanType) const (first referenced in module: SQProblem.cppm03) 
    __vtbl__18Q2_7qpOASES6Matrix__Q2_7qpOASES11SymDenseMat (first referenced in module: SQProblem.cppm03) 
    __vtbl__28Q2_7qpOASES15SymmetricMatrix__Q2_7qpOASES11SymDenseMat (first referenced in module: SQProblem.cppm03) 
    qpOASES::SymDenseMat::_vtbl (first referenced in module: SQProblem.cppm03) 
    qpOASES::Bounds::moveFreeToFixed(int, qpOASES::SubjectToStatus) (first referenced in module: QProblem.cppm03) 
    qpOASES::Constraints::moveInactiveToActive(int, qpOASES::SubjectToStatus) (first referenced in module: QProblem.cppm03) 
    qpOASES::Bounds::setupBound(int, qpOASES::SubjectToStatus) (first referenced in module: QProblemB.cppm03) 
    qpOASES::Constraints::setupConstraint(int, qpOASES::SubjectToStatus) (first referenced in module: QProblem.cppm03) 
    qpOASES::writeIntoMatFile(_iobuf *, const double *, int, int, const char *) (first referenced in module: QProblem.cppm03) 
    qpOASES::myPrintf(const char *) (first referenced in module: QProblem.cppm03) 
    qpOASES::Indexlist::getNumberArray(int **) const (first referenced in module: QProblem.cppm03) 
    qpOASES::Options::_ct() (first referenced in module: QProblemB.cppm03) 
    qpOASES::Options::_dt() (first referenced in module: QProblemB.cppm03) 
    qpOASES::Options::ensureConsistency() (first referenced in module: qpOASES_SQProblem.cppm03) 
    qpOASES::Options::setToMPC() (first referenced in module: qpOASES_SQProblem.cppm03) 
    qpOASES::readFromFile(double *, int, const char *) (first referenced in module: QProblem.cppm03) 
    qpOASES::MessageHandling::reset() (first referenced in module: QProblemB.cppm03) 
    qpOASES::Constraints::_ct(int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Constraints::flipFixed(int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Constraints::init(int) (first referenced in module: SQProblem.cppm03) 
    qpOASES::Constraints::moveActiveToInactive(int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Constraints::_ct() (first referenced in module: QProblem.cppm03) 
    qpOASES::Constraints::_dt() (first referenced in module: SQProblem.cppm03) 
    qpOASES::Constraints::setupAllInactive() (first referenced in module: SQProblem.cppm03) 
    qpOASES::Constraints::_as(const qpOASES::Constraints &) (first referenced in module: QProblem.cppm03) 
    qpOASES::Constraints::_ct(const qpOASES::Constraints &) (first referenced in module: SQProblem.cppm03) 
    qpOASES::Flipper::init(unsigned int, unsigned int) (first referenced in module: QProblem.cppm03) 
    qpOASES::getNorm(const double *, int, int) (first referenced in module: QProblemB.cppm03) 
    qpOASES::Flipper::_ct() (first referenced in module: QProblemB.cppm03) 
    qpOASES::Flipper::_dt() (first referenced in module: QProblemB.cppm03) 
    qpOASES::writeIntoMatFile(_iobuf *, const int *, int, int, const char *) (first referenced in module: QProblem.cppm03) 
    qpOASES::Bounds::_ct(int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Bounds::flipFixed(int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Bounds::init(int) (first referenced in module: SQProblem.cppm03) 
    qpOASES::Bounds::moveFixedToFree(int) (first referenced in module: QProblem.cppm03) 
    qpOASES::Bounds::_ct() (first referenced in module: QProblemB.cppm03) 
    qpOASES::Bounds::_dt() (first referenced in module: SQProblem.cppm03) 
    qpOASES::Bounds::setupAllFree() (first referenced in module: SQProblem.cppm03) 
    qpOASES::MessageHandling::throwError(qpOASES::returnValue, const char *, const char *, const char *, unsigned long, qpOASES::VisibilityStatus) (first referenced in module: SQProblem.cppm03) 
    qpOASES::MessageHandling::throwInfo(qpOASES::returnValue, const char *, const char *, const char *, unsigned long, qpOASES::VisibilityStatus) (first referenced in module: QProblem.cppm03) 
    qpOASES::MessageHandling::throwWarning(qpOASES::returnValue, const char *, const char *, const char *, unsigned long, qpOASES::VisibilityStatus) (first referenced in module: QProblem.cppm03) 
    qpOASES::getCPUtime() (first referenced in module: SQProblem.cppm03) 
    qpOASES::getGlobalMessageHandler() (first referenced in module: SQProblem.cppm03) 
    qpOASES::printCopyrightNotice() (first referenced in module: QProblemB.cppm03) 
    qpOASES::Options::_as(const qpOASES::Options &) (first referenced in module: QProblemB.cppm03) 
    __vtbl__18Q2_7qpOASES6Matrix__Q2_7qpOASES12SymSparseMat (first referenced in module: QProblemB.cppm03) 
    __vtbl__25Q2_7qpOASES12SparseMatrix__Q2_7qpOASES12SymSparseMat (first referenced in module: QProblemB.cppm03) 
    qpOASES::SymSparseMat::_vtbl (first referenced in module: QProblemB.cppm03) 
    qpOASES::Flipper::_as(const qpOASES::Flipper &) (first referenced in module: QProblemB.cppm03) 
 Errors: 1, Warnings: 0 
-- call "C:\dSPACE RCPHIL 7.2\Compiler\PPCTools37\BIN\lnkppc.exe"  -K0 -QmsA0314 -QmsA0407 -QmeA0307 -QmeA0329 -m..\MyModel.map -o ..\MyModel.ppc -c _tmp_MyModel.lk  
LINKING FAILED (1) 

MAKE PROCESS ABORTED 

I am not able to detect the fault and therefore, I am asking you, if you have any idea? I followed all given instructions so far

I have the same issue Could you please tell me how you solved it? (attachment) I'm using "simulink2016_b 64" and "Simcenter Amesim 16" and dSPACE 2016b

skyhook1_build_20200529_143622.txt

tayloryoung6396 commented 1 year ago

[Offtopic] Using a microlab box for some control, would love to run code as c++. Tried adding the USER_CPP flag mentioned above to some dummy c++ test code and i get the linking error. Anyone got a solution? No where on the internet seems to exist a solution for this