Closed RAR1989 closed 4 years ago
It is a problem about global variables in Windows using VS compiler. We already encountered it in the past I think with @bemilio https://github.com/robotology/blockfactory/issues/44. The fix however still didn't go upstream.
@diegoferigo, @RAR1989 and I tried the solutions suggested in the issue you linked but they did not work.
cc @drdanz
If @bemilio has still access to the PC where we fixed it, maybe you can check what we did. I don't remember exactly the patch I applied.
I remember we finally managed to complete the installation. The only thing not working was the WBToolbox-MATLAB integration.
I am not sure what we should check on the monster. Maybe the global variables? I remember that in solving this issue I didn't understand much of what was going on and that in the end Diego and silvio managed to solve it. But I have no idea what the steps were.
The PC was the monster and it is still available, just as far as I understand @isorrentino proceeded in cleaning the build, so I don't know the status of the PC anymore
We managed to build the superbuild with @RAR1989, and we found a few issues in several projects.
1) blockfactory
is built with the CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
that as explained in the WINDOWS_EXPORT_ALL_SYMBOLS
property documentation requires to use __declspec(dllimport)
in order to import global symbols from the dll (in this case the symbol is blockfactory::core::BlockOptionPrioritizeOrder
). We fixed this by changing in blockfactory/sources/Core/include/BlockFactory/Core/BlockInformation.h
(this is obviously not a good fix because it won't work on linux)
+extern const std::string BlockOptionPrioritizeOrder;
-extern __declspec(dllimport) const std::string BlockOptionPrioritizeOrder;
2) qpOases
and blockfactory
have a broken FindMatlab.cmake
file, applying the fix proposed in the upstream issue on all the files worked.
3) the yarp-matlab-bindings
has 2 files Vocab.m
and VOCAB.m
in the same directory. As a consequence the update
step fails. In order to fix this we disabled the update
step by enabling the DEVEL_MODE
for the project. I cannot guarantee that this will not cause other issues.
Thanks @drdanz for taking care of that. I'll take care of blockfactory as soon as I'll be back to IIT and have access to a Windows machine.
the yarp-matlab-bindings has 2 files Vocab.m and VOCAB.m in the same directory. As a consequence the update step fails. In order to fix this we disabled the update step by enabling the DEVEL_MODE for the project. I cannot guarantee that this will not cause other issues.
This was fixed in https://github.com/robotology/yarp-matlab-bindings/pull/43 .
1. `blockfactory` is built with the [`CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS`](https://cmake.org/cmake/help/latest/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.html) that as explained in the [`WINDOWS_EXPORT_ALL_SYMBOLS`](https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html) property documentation requires to use `__declspec(dllimport)` in order to import global symbols from the dll (in this case the symbol is `blockfactory::core::BlockOptionPrioritizeOrder`). We fixed this by changing in `blockfactory/sources/Core/include/BlockFactory/Core/BlockInformation.h` (this is obviously not a good fix because it won't work on linux)
+extern const std::string BlockOptionPrioritizeOrder; -extern __declspec(dllimport) const std::string BlockOptionPrioritizeOrder;
This was fixed by https://github.com/robotology/blockfactory/pull/54 .
I tried to build the robotology-superbuild on Windows starting from a clean build, however it always failed. I got the error below:
cc @traversaro @diegoferigo @nunoguedelha @isorrentino