Generate s_function on Matlab with external libraries for use on an embedded dSPACE systemCompiling Matlab shared library with image processing toolboxMex dynamic memory management issue with std::vector in linked external DLL; Segmentation errorOptimizing a Vectorized Matlab FunctionHow to Convert a structure from Matlab code to C code (using Matlab Compiler)relating issues with mcc error & mbuild -setup settings for R2013b & deploytool for matlabMatLab C++ Shared Dll Library Initialization CrashCalling fmincon from SimulinkNo supported SDK compiler found on this computer/LIBSVMHow to generate .NET DLL Library from Simulink and StateflowHow to simulate fixed plane using SimScape Multibody Contact Forces Library?

How do changes to your speed that occur on your own turn affect your available movement?

Are symplectomorphisms of Weil–Petersson symplectic form induced from surface diffeomorphisms?

Why is chess failing to attract big name sponsors?

Why are there not any MRI machines available in Interstellar?

Other than a swing wing, what types of variable geometry have flown?

Navigating the multiverse of bifurcated parallel realities

How could an engineer advance human civilization by time traveling to the past?

Where is this photo of a group of hikers taken? Is it really in the Ural?

Are gangsters hired to attack people at a train station classified as a terrorist attack?

how to add 1 milliseconds on a datetime string?

Using paddles to support a bug net

Why is a dedicated QA team member necessary?

How can the artificial womb be made affordable for the common people?

Historicity doubted by Romans

Are glider winch launches rarer in the USA than in the rest of the world? Why?

What's the 1 inch size square knob sticking out of wall?

What would be the side effects on the life of a person becoming indestructible?

The 50,000 row query limit is not actually a "per APEX call" as widely believed

Alternative methods for solving a system of one linear one non linear simultaneous equations

What is an Eternal Word™?

What's the explanation for this joke about a three-legged dog that walks into a bar?

what to say when a company asks you why someone (a friend) who was fired left?

Film where a boy turns into a princess

Travelling from Venice to Budapest, making a stop in Croatia



Generate s_function on Matlab with external libraries for use on an embedded dSPACE system


Compiling Matlab shared library with image processing toolboxMex dynamic memory management issue with std::vector in linked external DLL; Segmentation errorOptimizing a Vectorized Matlab FunctionHow to Convert a structure from Matlab code to C code (using Matlab Compiler)relating issues with mcc error & mbuild -setup settings for R2013b & deploytool for matlabMatLab C++ Shared Dll Library Initialization CrashCalling fmincon from SimulinkNo supported SDK compiler found on this computer/LIBSVMHow to generate .NET DLL Library from Simulink and StateflowHow to simulate fixed plane using SimScape Multibody Contact Forces Library?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am looking to run an MPC (Model Predictive Control) controller on an embedded system (dSPACE autobox). The MPC algorithm is formulated using the framework Casadi (https://web.casadi.org/). This framework does not allow for C code generation for the nonlinear programming solver itself but only for its dependencies. Therefore I would like to link the Casadi library and nonlinear programming solver (IPOPT).



I would like to generate an s_function such that it can be used within the Real-Time Interface (RTI) for Matlab/Simulink and dSPACE.



My question is: How do I go about creating a shared library that can be used in conjunction within Matlab in an S-Function on Matlab R2013B using Microsoft Visual Studio 10 with Windows 7.1 SDK?



  • I tried to use 'mcc' and 'mex' in Matlab (see code (1)). This does not work, probably due to compatibility issues between different compilers, used for the Casadi code and these commands.

  • I tried this way (see code (2)): https://nl.mathworks.com/matlabcentral/fileexchange/44197-calling-shared-libraries-from-simulink. It's either complaining about:'exlib.exp' not found or Link of 'exlib.mexw64' failed.

  • I tried to get CMake into matlab but so far without success (https://nl.mathworks.com/matlabcentral/fileexchange/45522-mex_cmake).

% (1)
% Create shared library
mcc -v -W lib:mylib -T link:lib nlp.c



% Create S-function
mex s_function.c nlp.c mylib.lib -g -v



% (2)
mex('LDEXT=.dll','LINKEXPORT=','LINKEXPORTVER=','CMDLINE300="del exlib.exp exlib.dll.manifest"','exlib.c');
% or
mex('LDEXT=.dll','LINKEXPORT=','LINKEXPORTVER=','exlib.c');










share|improve this question
























  • You might be able to run the s function on your host pc once you solved your problems linking, but that won't succeed. To run it on the autobox you need the library either built for that architecture (a ds1005 ppc inside?) or the complete source code. Or do you have compatible binaries available?

    – Daniel
    Jun 15 at 14:14

















0















I am looking to run an MPC (Model Predictive Control) controller on an embedded system (dSPACE autobox). The MPC algorithm is formulated using the framework Casadi (https://web.casadi.org/). This framework does not allow for C code generation for the nonlinear programming solver itself but only for its dependencies. Therefore I would like to link the Casadi library and nonlinear programming solver (IPOPT).



I would like to generate an s_function such that it can be used within the Real-Time Interface (RTI) for Matlab/Simulink and dSPACE.



My question is: How do I go about creating a shared library that can be used in conjunction within Matlab in an S-Function on Matlab R2013B using Microsoft Visual Studio 10 with Windows 7.1 SDK?



  • I tried to use 'mcc' and 'mex' in Matlab (see code (1)). This does not work, probably due to compatibility issues between different compilers, used for the Casadi code and these commands.

  • I tried this way (see code (2)): https://nl.mathworks.com/matlabcentral/fileexchange/44197-calling-shared-libraries-from-simulink. It's either complaining about:'exlib.exp' not found or Link of 'exlib.mexw64' failed.

  • I tried to get CMake into matlab but so far without success (https://nl.mathworks.com/matlabcentral/fileexchange/45522-mex_cmake).

% (1)
% Create shared library
mcc -v -W lib:mylib -T link:lib nlp.c



% Create S-function
mex s_function.c nlp.c mylib.lib -g -v



% (2)
mex('LDEXT=.dll','LINKEXPORT=','LINKEXPORTVER=','CMDLINE300="del exlib.exp exlib.dll.manifest"','exlib.c');
% or
mex('LDEXT=.dll','LINKEXPORT=','LINKEXPORTVER=','exlib.c');










share|improve this question
























  • You might be able to run the s function on your host pc once you solved your problems linking, but that won't succeed. To run it on the autobox you need the library either built for that architecture (a ds1005 ppc inside?) or the complete source code. Or do you have compatible binaries available?

    – Daniel
    Jun 15 at 14:14













0












0








0








I am looking to run an MPC (Model Predictive Control) controller on an embedded system (dSPACE autobox). The MPC algorithm is formulated using the framework Casadi (https://web.casadi.org/). This framework does not allow for C code generation for the nonlinear programming solver itself but only for its dependencies. Therefore I would like to link the Casadi library and nonlinear programming solver (IPOPT).



I would like to generate an s_function such that it can be used within the Real-Time Interface (RTI) for Matlab/Simulink and dSPACE.



My question is: How do I go about creating a shared library that can be used in conjunction within Matlab in an S-Function on Matlab R2013B using Microsoft Visual Studio 10 with Windows 7.1 SDK?



  • I tried to use 'mcc' and 'mex' in Matlab (see code (1)). This does not work, probably due to compatibility issues between different compilers, used for the Casadi code and these commands.

  • I tried this way (see code (2)): https://nl.mathworks.com/matlabcentral/fileexchange/44197-calling-shared-libraries-from-simulink. It's either complaining about:'exlib.exp' not found or Link of 'exlib.mexw64' failed.

  • I tried to get CMake into matlab but so far without success (https://nl.mathworks.com/matlabcentral/fileexchange/45522-mex_cmake).

% (1)
% Create shared library
mcc -v -W lib:mylib -T link:lib nlp.c



% Create S-function
mex s_function.c nlp.c mylib.lib -g -v



% (2)
mex('LDEXT=.dll','LINKEXPORT=','LINKEXPORTVER=','CMDLINE300="del exlib.exp exlib.dll.manifest"','exlib.c');
% or
mex('LDEXT=.dll','LINKEXPORT=','LINKEXPORTVER=','exlib.c');










share|improve this question
















I am looking to run an MPC (Model Predictive Control) controller on an embedded system (dSPACE autobox). The MPC algorithm is formulated using the framework Casadi (https://web.casadi.org/). This framework does not allow for C code generation for the nonlinear programming solver itself but only for its dependencies. Therefore I would like to link the Casadi library and nonlinear programming solver (IPOPT).



I would like to generate an s_function such that it can be used within the Real-Time Interface (RTI) for Matlab/Simulink and dSPACE.



My question is: How do I go about creating a shared library that can be used in conjunction within Matlab in an S-Function on Matlab R2013B using Microsoft Visual Studio 10 with Windows 7.1 SDK?



  • I tried to use 'mcc' and 'mex' in Matlab (see code (1)). This does not work, probably due to compatibility issues between different compilers, used for the Casadi code and these commands.

  • I tried this way (see code (2)): https://nl.mathworks.com/matlabcentral/fileexchange/44197-calling-shared-libraries-from-simulink. It's either complaining about:'exlib.exp' not found or Link of 'exlib.mexw64' failed.

  • I tried to get CMake into matlab but so far without success (https://nl.mathworks.com/matlabcentral/fileexchange/45522-mex_cmake).

% (1)
% Create shared library
mcc -v -W lib:mylib -T link:lib nlp.c



% Create S-function
mex s_function.c nlp.c mylib.lib -g -v



% (2)
mex('LDEXT=.dll','LINKEXPORT=','LINKEXPORTVER=','CMDLINE300="del exlib.exp exlib.dll.manifest"','exlib.c');
% or
mex('LDEXT=.dll','LINKEXPORT=','LINKEXPORTVER=','exlib.c');







matlab optimization cmake embedded dspace-ecu






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 15:36









terrywb

2,6151 gold badge11 silver badges30 bronze badges




2,6151 gold badge11 silver badges30 bronze badges










asked Mar 26 at 15:17









AlexAlex

11 bronze badge




11 bronze badge












  • You might be able to run the s function on your host pc once you solved your problems linking, but that won't succeed. To run it on the autobox you need the library either built for that architecture (a ds1005 ppc inside?) or the complete source code. Or do you have compatible binaries available?

    – Daniel
    Jun 15 at 14:14

















  • You might be able to run the s function on your host pc once you solved your problems linking, but that won't succeed. To run it on the autobox you need the library either built for that architecture (a ds1005 ppc inside?) or the complete source code. Or do you have compatible binaries available?

    – Daniel
    Jun 15 at 14:14
















You might be able to run the s function on your host pc once you solved your problems linking, but that won't succeed. To run it on the autobox you need the library either built for that architecture (a ds1005 ppc inside?) or the complete source code. Or do you have compatible binaries available?

– Daniel
Jun 15 at 14:14





You might be able to run the s function on your host pc once you solved your problems linking, but that won't succeed. To run it on the autobox you need the library either built for that architecture (a ds1005 ppc inside?) or the complete source code. Or do you have compatible binaries available?

– Daniel
Jun 15 at 14:14












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55360624%2fgenerate-s-function-on-matlab-with-external-libraries-for-use-on-an-embedded-dsp%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55360624%2fgenerate-s-function-on-matlab-with-external-libraries-for-use-on-an-embedded-dsp%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript