Skip to content
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

Compilation fails with Matlab 2019b #1

Open
gabrielenava opened this issue Mar 23, 2020 · 3 comments
Open

Compilation fails with Matlab 2019b #1

gabrielenava opened this issue Mar 23, 2020 · 3 comments

Comments

@gabrielenava
Copy link

gabrielenava commented Mar 23, 2020

I tried to generate the yoga controller. In whole-body-controllers, I used the latest branch and I had no issues: I was able to generate both the code and the associated CMakeLists.

Then I ported them in this repo, but when I tried to compile (on branch test) I got an error:

../../lib/libtorqueControlBalancing.a(torqueControlBalancing.cpp.o): In function `torqueControlBalancingModelClass::step()':
torqueControlBalancing.cpp:(.text+0x11b57): undefined reference to `torqueControlBalancingModelClass::torqueControlBalancing_P'
torqueControlBalancing.cpp:(.text+0x11b5e): undefined reference to `torqueControlBalancingModelClass::torqueControlBalancing_P'
torqueControlBalancing.cpp:(.text+0x11b65): undefined reference to `torqueControlBalancingModelClass::torqueControlBalancing_P'
torqueControlBalancing.cpp:(.text+0x1219f): undefined reference to `torqueControlBalancingModelClass::torqueControlBalancing_P'
torqueControlBalancing.cpp:(.text+0x12614): undefined reference to `torqueControlBalancingModelClass::torqueControlBalancing_P'
../../lib/libtorqueControlBalancing.a(torqueControlBalancing.cpp.o):torqueControlBalancing.cpp:(.text+0x1286b): more undefined references to `torqueControlBalancingModelClass::torqueControlBalancing_P' follow
collect2: error: ld returned 1 exit status
autogenerated/torqueControlBalancing_grt_rtw/CMakeFiles/RuntorqueControlBalancing.dir/build.make:87: recipe for target 'bin/RuntorqueControlBalancing' failed
make[2]: *** [bin/RuntorqueControlBalancing] Error 1
CMakeFiles/Makefile2:140: recipe for target 'autogenerated/torqueControlBalancing_grt_rtw/CMakeFiles/RuntorqueControlBalancing.dir/all' failed
make[1]: *** [autogenerated/torqueControlBalancing_grt_rtw/CMakeFiles/RuntorqueControlBalancing.dir/all] Error 2
Makefile:83: recipe for target 'all' failed

It seems some linked libraries are missing. I am using Matlab 2019b, but @diegoferigo successfully managed to compile with Matlab 2018. We are both using the latest version of robotlotogy-superbuild. So, either there is a mismatch between different Matlab versions, or I am doing something wrong with the generation pipeline, or there is something wrong in my local configuration.

@diegoferigo
Copy link
Member

I want to add that this is happening when @gabrielenava generates the sources with his Matlab version, replaces the autogenerated sources committed here, and tries to compile them. I suspect that recent matlab versions changed somehow the autogenerated class and this torqueControlBalancingModelClass::torqueControlBalancing_P symbol is missing (indeed, I couldn't find it in the committed version).

I'm curious, can you try to just compile the sources already committed? This means that you're going to try compiling the sources generated with my Matlab 2018a version using the headers of your Matlab 2019b version. In this way, that symbol problem should not be there since you're not using your autogenerated sources.

@gabrielenava
Copy link
Author

@diegoferigo you were right:

[ 25%] Building CXX object autogenerated/torqueControlBalancing_grt_rtw/CMakeFiles/torqueControlBalancing.dir/torqueControlBalancing.cpp.o
[ 50%] Linking CXX static library ../../lib/libtorqueControlBalancing.a
[ 50%] Built target torqueControlBalancing
Scanning dependencies of target RuntorqueControlBalancing
[ 75%] Building CXX object autogenerated/torqueControlBalancing_grt_rtw/CMakeFiles/RuntorqueControlBalancing.dir/driver.cpp.o
[100%] Linking CXX executable ../../bin/RuntorqueControlBalancing
[100%] Built target RuntorqueControlBalancing

So it is a problem of Matlab versions!

@diegoferigo
Copy link
Member

Ok then, we need to understand what's missing in the sources generated from new Matlab versions. Right now I cannot update my Matlab installation, considering that now this problem is not currently blocking anyone, we could leave the issue open and try to resume it in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants