Add library / source files path for SFunction when using Rapid Accelerator

2 views (last 30 days)
Hi all,
i'm using a Simulink model, which contains a s function to include custom c code. When using normal or accelerated mode in Simulink, everything works fine as i can use the following mex command:
mex('-largeArrayDims','-I..\CodeFramework\lib\','-I..\CodeFramework\src\','sfuncCustomCppCode.cpp','-g');
The sfunc-cpp file contains various #include commands to include all files needed for the code to "work" as intended. The includes are done as follows:
#include "subfolder\file.hpp"
Here, subfolder is a folder either in the folder "src" or in the folder "lib". Unfortunately, this does not work for rapid accelerator mode as it is not able to detect the additional source files located somewhere in a folder with the two subfolders "lib" and "src". As I need some files from both folders (but may not use files from "lib" in the future), they are both added via "-I" in the mex command.
However,if I change the includes to complete relative paths, e.g.
#include "..\CodeFramework\src\subfolder\file.hpp"
it works. The problem is, I can not use these complete relative paths, as they may change due to different storage locations on different computers and so on. In the mex commands, this is done programmatically as the right path is detected and then used in the mex command.
Is there a possibility to run the rapid accelerator with similar commands as the mex command?
Thanks for your help and greetings, Daniel

Answers (0)

Categories

Find more on Simulation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!