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

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현