-
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
Support for Clang-CL on Windows #120
Comments
I am not sure why, but it seems when the compiler is The way I define portable aligned array is: // SSE - 16 Byte Alignment, AVX - 32 Byte Alignment
// Example: DECLARE_ALIGN_PRE int array[5] DECLARE_ALIGN_POST = { 0, 1, 2, 3, 4 };
#if defined(USING_INTEL_COMPILER) || defined(_GCC_) || defined(__clang__)
#define DECLARE_ALIGN_PRE
#define DECLARE_ALIGN_POST __attribute__((aligned(SIMD_ALIGNMENT)))
#elif defined(_MSC_VER)
#define DECLARE_ALIGN_PRE __declspec(align(SIMD_ALIGNMENT))
#define DECLARE_ALIGN_POST
#else
#define DECLARE_ALIGN_PRE
#define DECLARE_ALIGN_POST
#endif // defined(USING_INTEL_COMPILER) || defined(_GCC_) || defined(__clang__) It might reduce few lines in your code. Do you have any idea what would trigger the issue with |
I see, My code is the other way around, so it would get into the MSC_VER. |
By the way, if I use the |
I think Could it be that the code has some issues in case both |
Even with 29329ec I get errors building anything but the
There also many warnings about unused variables. Since |
OK, I think I got it. You misplaced the Instead of I really think you should take my form of teh code and put it in the |
I can confirm that indeed what I wrote in #120 (comment) is the error. If I switched them as I wrote compilation is successful. Small fix in
|
I found a way using Do that and the little fix in #120 (comment) and I think we'll have a version which can, on Windows, have any target using |
Ok thanks for investigating and finding the issues! I will fix stuff now. |
Please. Wait a second, I will send you a pull. I am just finishing it. |
Done, Sent a pull request which enables full Windows support. |
Ok so now with this commit b2b1377 alignment should be managed in a portable way using a macro. @RoyiAvital could you check that this still works for you, then I can merge this in master. |
@giaf , Sorry, but it doesn't work:
Why won't you just copy the Macro I gave you? |
By the way, it didn't work with
So I think the Macro you defined is wrong is some way. UpdateI tried with |
Yes sorry I made a bit of mess, first I went for ALIGN and then finally ALIGNED, but I forgot some apparently. Strange that it compiled for me. I'll fix it now. About your macro, I didn't get what was the need for two macros (pre and post), while one seems to be enough. If one works, I would prefer it. Apart from that, the checks for the compiler are identical to yours. |
Where is the definition of your macro? |
Here it is https://github.com/giaf/blasfeo/blob/windows_support/include/blasfeo_common.h#L51 I just pushed the fixes ALIGN => ALIGNED. If this was the only issue, it should work now. |
OK, I see. It is nice. By the way:
Just to make it correct. I didn't put it before. My mistake. Tell me where I can download the push with the fixes (What I posted now included) and I will test it. |
There was another issue, apparently the correct macro for gcc is |
OK, @giaf , could you add in
It will allow Windows users to chose the Once you add this, I will update the Windows Compilation Guide accordingly. By the way, can we remove the |
While there is some Windows Support it is limited to the
GENERIC
code path.I suggest that support for
Clang-CL
will be added inCMAKELists.txt
so if the compiler isClang-CL
things will work likeGCC
on Linux asClang-CL
should have support forAT&T
style of assembly.The problem is the configuration somehow doesn't support that.
I get errors like:
Also it tries to use flags like
-fPIC -msse3
etc...Those flags matches
GCC
.SO I suggest that the configuration will support
Clang-CL
as it wasMSVC
with the only different it will allow it to use different configurations.I think the flags:
Needs to be decorated with
-XClang
or adapted to Windows.The text was updated successfully, but these errors were encountered: