-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add Windows (MSVC) support #76
Comments
👍 |
Indeed, we could then make a detailed installation process on the website. |
Dear Dr.Crétien Thank you for the e-mail.
Among them, I compiled boost, log4cxx, and libtool myself. After preparing the libraries, the file encoding of RobOptim codes has to If Intel Compiler is available, the project files generated by CMake will If you have any question, please contact me. Best regards, Ko AYUSAWA, researcher e-mail: [email protected]2014-10-07 20:20 GMT+09:00 Benjamin Chrétien [email protected]:
|
Dear Dr. Chrétien I'm so sorry that I misspelled your name. If you want to need the pre-compiled binaries or modified codes of the Best regards,Ko AYUSAWA, researcher e-mail: [email protected]2014-10-08 19:35 GMT+09:00 Ko AYUSAWA [email protected]:
|
@kayusawa Hi, I would be interested in testing roboptim on windows. Could Thanks.
|
Dear Ayusawa-san, Thanks for the quick answer. Don't worry about my name, I know it's a difficult one :-) For UTF-8 with BOM, this may be something that can be solved by CMake when generating the MSVC project files. If the compiler is the issue, a fix similar to this one may be what we need, especially if that means we do not need to add a BOM to all the files that contain UTF-8 characters. For pre-compiled libraries, these could be released for our next major release. For the dependencies, I guess we could provide them ( For the Eigen error, is it something that happened in RobOptim or Eigen itself? |
Dear Chrétien-san, Keith-san For UTF-8 with BOM, this may be something that can be solved by CMake when
Thank you for the advice. For pre-compiled libraries, these could be released for our next major
I attached the pre-compiled log4cxx and libtool (both x86 and x64). I also attached the modified code of them. For the Eigen error, is it something that happened in RobOptim or Eigen
I'm sorry that I almost forgot about where the problem occured. If there are problems, please don't hesitate to contact me. Best regards, Ko AYUSAWA, researcher e-mail: [email protected]2014-10-08 21:40 GMT+09:00 Benjamin Chrétien [email protected]:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1. open libltdl.sln 2. build libltdl |
Note regarding CI support for Windows: I recently noticed that some open-source projects now use AppVeyor, which could very roughly be seen as Travis for Windows. |
In the latest stable there seems alot of issues with a windows build, that aren't dependencies. |
Windows support is not available yet, although we are slowly getting there (cc @aescande). |
We have worked out quite few issues, but are still working on a lot of templating issues, e.g.:
Will keep you informed. Is there an old binary of an older commit? |
Thanks for looking into this. Alas I don't think anyone shared any binary yet. |
Just putting my 2 cents here. I have tried to compile roboptim-core on windows very recently (I must be 1-2 commits late wrt master). Here are the errors I found (as I remember them, so this is not as precise as I'd like it to be).
Those are some leads. |
Awesome, this is exactly what we are seeing.
number 2:
|
I don't think it is required to keep the ROBOPTIM_DLLAPI macro for the templated class (e.g. Problem) since the definition of the method is in the .hxx and those files are installed as well. I compiled the unit tests as well as roboptim/roboptim-core-plugin-eigen without having any symbol issue. |
Indeed, I'll clean this up a bit. I recently added the possibility to precompile most of the templated classes, since they are now only templated on the matrix traits (dense/sparse). However this is disabled by default since explicit template instantiation is a C++11 feature. I guess the error will appear in some other classes. |
|
Yes, otherwise some compilation issues may raise. |
Ok, we can easily fix that then. I was also considering making a PR to jrl-cmakemodules to have the deprecated macros support version numbers, e.g.: #define ROBOPTIM_CORE_DEPRECATED(X) __attribute__ ((deprecated))
...
typedef Foo Bar ROBOPTIM_CORE_DEPRECATED(3.2); They use this for Gazebo, that way you can see exactly when a given function was deprecated when you get the warning while compiling. |
And talking about Gazebo, they had the exact same problem: #if defined(__GNUC__)
#define GAZEBO_DEPRECATED(version) __attribute__((deprecated))
#define GAZEBO_FORCEINLINE __attribute__((always_inline))
#elif defined(_WIN32)
// GAZEBO_DEPRECATED should be defined as something like
// __declspec(deprecated), but it needs to go *before* the function name,
// and we're putting GAZEBO_DEPRECATED *after* the function.
#define GAZEBO_DEPRECATED(version)
#define GAZEBO_FORCEINLINE __forceinline
#else
#define GAZEBO_DEPRECATED(version) ()
#define GAZEBO_FORCEINLINE
#endif |
Bear in mind, getting Gazebo on windows is still not an easy experience. But this looks good. |
@phuicy I pushed on https://github.com/francois-keith/roboptim-core the current state of my windows version.
@bchretien No Pull request for now, mainly because of the test issue and the fact that the result file is different between the Win32 and UNIX systems. |
@francois-keith good catch on the bug recently added to |
@francois-keith well apparently _set_output_format is obsolete, still any alternative workaround should probably be applied in our test fixtures. |
Complementary information here:
So we can just check the Visual C++ version, and use |
Awesome. Thank you |
Does anyone know how MSVC behaves with explicit template instantiations and symbol exports? The weird symbol exports I had all around the code solved this problem, i.e. gcc and clang behave differently (either one returns a |
AFAIK, you can export the specialization of templated methods or methods of templated class. To be honest, it was much more tricky in my memory (cf stack-of-tasks/dynamic-graph@5721ccb98), so maybe I'm missing the point / the difficulty here. |
The problem is that gcc and clang behave quite differently, so I was wondering if msvc exhibited the same problem.
// In the header
template <typename T>
class Problem { ... };
...
extern template class ROBOPTIM_CORE_DLLAPI Problem<EigenMatrixDense>;
extern template class ROBOPTIM_CORE_DLLAPI Problem<EigenMatrixSparse>;
// In the implementation cpp
template class Problem<EigenMatrixDense>;
template class Problem<EigenMatrixSparse>; With clang and the explicit template instantiation: $ nm -CD src/libroboptim-core.so | grep "W roboptim::Problem<roboptim::EigenMatrixDense>::initialize()"
00000000000f5170 W roboptim::Problem<roboptim::EigenMatrixDense>::initialize() Without it, the symbol is not exported as expected. gcc error: roboptim-core/include/roboptim/core/problem.hxx:656:46: error: type attributes ignored after type is already defined [-Werror=attributes]
extern template class ROBOPTIM_CORE_DLLAPI Problem<EigenMatrixSparse>;
^
// In the header
template <typename T>
class ROBOPTIM_CORE_DLLAPI Problem { ... };
...
extern template class Problem<EigenMatrixDense>;
extern template class Problem<EigenMatrixSparse>;
// In the implementation cpp
template class Problem<EigenMatrixDense>;
template class Problem<EigenMatrixSparse>; With gcc we finally get: $ nm -CD src/libroboptim-core.so | grep "W roboptim::Problem<roboptim::EigenMatrixDense>::initialize()"
00000000000f9e10 W roboptim::Problem<roboptim::EigenMatrixDense>::initialize() EDIT: removed |
Experimental Windows support is currently available on the |
Some people are interested in using RobOptim on Windows, so this is worth investigating.
@kayusawa could you make a summary of your tests regarding the compilation of RobOptim on Windows? Thanks! :-)
The text was updated successfully, but these errors were encountered: