-
Notifications
You must be signed in to change notification settings - Fork 90
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
Windows Support #101
Comments
First of all, please notice that personally my experience with windows is limited, so I can not provide as much giudance as with linux. That said, in windows you can either:
If you try out any of them, I would appreciate to get feedback on it :) |
If some other user like e.g. @jkoendev has some experience to share, it would be great :) |
i compiled acados on windows using cmake and mingw-w64 which also builds blasfeo, so it is probably similar. I documented the procedure here: |
@giaf , Where can I find how to build CMake + MSVC with the GENERIC target? What prevents using other targets? |
Personally I don't have first-hand experience on windows systems using MSVC, but in that case building the GENERIC target of BLASFEO using cmake shouldn't be any different than building any other C project. About the use of other targets than GENERIC, the issue there is that the assembly .S files are coded in the AT&T syntax, while MSVC requires the Intel syntax (while GENERIC is entirely written in C without assembly). |
What about Clang? By the way, on Windows when I set Remark: I'm under the impression the |
I managed to build it in Windows with CMake, creating a solution for VS then you can build either, static or dynamic libraries. There was a bit of fiddling with the c code. Apparently void* is handled in a different way by gcc. |
@TureganoJose , could you share your code and configuration? Thank You. |
I'm fine with sharing as long as @giaf is ok with it. I'm using for my own purposes. |
@TureganoJose sure I would be happy to include the changes (code and configuration description) in the repo to improve Windows compatibility. Thanks for the work on that! Can you make a pull request or share a git diff or something similar with the changes you did? |
The code has now been fixed to build library and examples using cmake on windows with visual studio compiler, for the GENERIC target in BLASFEO. @TureganoJose posted some pictures to show the necessary setup steps, they can be found in here #119 |
@giaf , This is great! Is there a hope to have non generic as well? |
Hi @RoyiAvital If you want to experiment and give some feedback, it would be great :) |
So no need for MSYS or Cygwin, just GCC on MinGW64 and it will work? Which dialect of assembly do you use? Which is used by VS? |
In theory you just need MinGW-w64 and cmake. For x86 and x86_64 targets, I use AT&T syntax, while visual studio only accepts Intel syntax AFAIK. |
This is what I thought. Maybe using GIT LFS we can add pre compiled object files of the assembly for Windows users? I can try generating them and build something to automate their creation (Given it is easy to do using MinGW64). |
The issue is that I edit also the assembly files on a regular basis while developing new features. Whatever is in any |
OK, I'm trying to compile the project on Windows using I get an error no matter what target I chose: Generic Target
Automatic Target
Intel Core Target
This is the log file if you're interested: |
Hi @RoyiAvital In this regard, I also notice that the compiler is |
@giaf , You're the one setting the
Probably to use the static run time. The compile is By the way, even when I remove it I get:
|
OK,
Into:
By the way, no need for the The question now is what difference does it make to have By the way, |
I don't have the flag |
I'm sorry, so it might be me who has done it before and forgot. Sorry for that. |
What is the difference between the two codes in the fix besides the Yes |
I think I just ran I chose I think the best policy is to make |
In BLASFEO memory alignment is handled explicitly, so I think there shouldn't be issues in that regards. Actually I just fixed some remaining alignments which may have created issues with visual studio compiler for non-GENERIC targets. |
Could you make a new release? |
Yes once all of this is fixed I can make a release, also because I'm planning some change which shouldn't get into it. |
I am working on a Pull Request to fix things. |
Ok then, thanks a lot :) |
Could you give me permission for the Wiki? By the way, I think it is good to let anyone to edit the Wiki. |
We have the wiki source on a gitlab private repo on the uni server. |
In any case, you can send me stuff via email, my address should be on the licence of all sources. |
I meant the Wiki of this repository - https://github.com/giaf/blasfeo/wiki. |
Yes but there there is only a link to the wiki on our server. |
I will add a new page (If you give me permission). By the way, I'd give anyone permission to edit the Wiki. |
Ok everyone should have permission now. |
Great. I guess Windows is the only system all 3 compilers are available on :-). |
OK, We do compile the files but something is wrong (I am working with your latest commit - https://github.com/giaf/blasfeo/tree/windows_support). On Windows using MSVC I do:
As I want access to The output DLL contains no functions! Namely something is wrong. I tried:
To try the static library. This is the result of the objects embedded in the file: Output of `lib /LIST`
When trying to link I get:
I tried also with Any idea? |
No idea, and it shouldn't be related to the changes we did for windows. |
It seems you don't expose the functions correctly for Windows. In the DLL nothing is exposed hence nothing is linked and for the static one, even with the |
If you try to call standard BLAS routines from windows, there may be some mess with names due to fortran name mangling |
I am saying that Something is wrong with the export of functions on Windows as the DLL compiled has no functions in it as well. I think that on Linux by default any function is exported in Shared Library while on Windows none. |
In linux everything works as expected, e.g. I get from the cmake build for a shared library
So I can't reproduce the issue on linux, and I don't have access to a window machine ATM. At the very least, the windows support is at the point of being able to compile a static library of the GENERIC target using visual studio, with the routines needed in HPIPM and acados, which is already a good achievement given the lack of a testing machine. |
There are 2 unrelated (???) problem in Windows. Export of Function in a DLLIn order to make functions exposed in a DLL in Windows they need to be decorated. FORTRAN API Doesn't Work on WindowsFor some reason when compiling the objects on Windows even if the |
Hi @RoyiAvital I added a travis test to build BLASFEO in windows using visual studio and run an example (using the BLASFEO API). |
|
For what it's worth, I made an first pass at defining a vcpkg package for blasfeo: https://github.com/ThijsWithaar/vcpkg/tree/blasfeo Those two use gcc from msys as assembler and MSVC for the .c compilation. The advantage of this is that for the user, vcpkg takes care of setting everything up. Any thoughts, feedback? |
It seems that Windows Support is implied yet I couldn't find any explicit documentation about it in the web site (For instance, Installation section in https://blasfeo.syscop.de).
Are there any official instructions to create a Static and Shared libraries of BLASFEO under Windows?
The text was updated successfully, but these errors were encountered: