-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matlab remove os path dependency #896
Matlab remove os path dependency #896
Conversation
…iable path Modified building of casadi_ext_fun library such that the gcc version configured for building mex files is used. This avoids a linking error which happens when a version of gcc different than configured for mex building is in the OS environment PATH variable.
…iable path Modified building of casadi_ext_fun library such that the gcc version configured for building mex files is used. This avoids a linking error which happens when a version of gcc different than configured for mex building is in the OS environment PATH variable.
…piling for simulation
@@ -223,6 +226,13 @@ function ocp_generate_casadi_ext_fun(model_struct, opts_struct) | |||
% build | |||
compile_command = sprintf('"%s" & %s', msvc_env, build_cmd); | |||
else % gcc | |||
%Read the mex C compiler configuration and extract the location | |||
cCompilerConfig = mex.getCompilerConfigurations('C'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command is not available in Octave.
However, it seems that Octave automatically adds a path to compatible gcc version to the PATH environment variable when Octave starts, so it should be possible just to skip all of this if octave is used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, that's good to know.
I have to admit that I don't have a Casadi compatible Octave version on my machine right now, so I can't really test it.
However, that is why we have the Github tests in place.
Can you just add some if
s to make this work for Octave?
Then the tests should also pass and I will test it for Matlab locally as well.
9918857
to
59099b9
Compare
…ecting compiler in Matlab This also includes a slight cleanup as it merges two compiler checks (+1 squashed commits) Squashed commits: [fe59f9c] Matlab: Fix error when using octave introduced when automatically detecting compiler in Matlab This also includes a slight cleanup as it merges two compiler checks
6d9fd18
to
884d8e2
Compare
Seems I fixed the remaining bug :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing the Octave version! Now all tests pass.
I just did some minor edits and will merge this.
When generating a Simulink s-function a number of c-files are compiled using the mex compilation setup and these are linked with a library containing the casadi_ext_fun. The compilation of this library does not use mex compilation, but is rather a system call directly to the compiler. For this to work it is required that the compiler used by mex is added to the OS PATH environment variable.
As we need to have another (incompatible) version of gcc in our OS PATH environment variable acados will use this incompatible gcc version to compile the cadasdi_ext_fun library and the linking will subsequently fail.