Re: MacOS build fail "SSE4.2 instruction set not enabled"

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: MacOS build fail "SSE4.2 instruction set not enabled"

Mariuz

On Thu, May 11, 2017 at 1:01 PM, Tomaž Vajngerl <[hidden email]> wrote:
Hi,

On Thu, May 11, 2017 at 10:17 AM, julien2412 <[hidden email]> wrote:
> Hello,
>
> I submitted a gerrit patch to bump Firebird to 3.0.2 (see
> https://gerrit.libreoffice.org/#/c/37488/)
> MacOs build fails on Jenkins with these logs:
> In file included from
> /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/workdir/UnpackedTarball/firebird/src/common/CRC32C.cpp:34:
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/include/nmmintrin.h:28:2:
> error: "SSE4.2 instruction set not enabled"
> #error "SSE4.2 instruction set not enabled"
>  ^
> /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/workdir/UnpackedTarball/firebird/src/common/CRC32C.cpp:41:10:
> error: use of undeclared identifier '_mm_crc32_u8'
>                 return _mm_crc32_u8(hash_value, *value);
> (idem with  _mm_crc32_u16 and  _mm_crc32_u32)
>
> Would it be possible to enable SSE4.2 on Jenkins MacOs machine or have we
> got some compatibility constraint to fulfil?

The file CRC32C.cpp must be compiled with compiler flag -msse4
otherwise you get such a compile error - I'm not sure how we compile
firebird but we will probably need to adapt this.

> Julien

Regards, Tomaž
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: MacOS build fail "SSE4.2 instruction set not enabled"

Dimitry Sibiryakov-3
12.05.2017 11:05, marius adrian popa wrote:
> Known issue in Firebird 3.0.x

   On Linux required flag is set in prefix.linux file like this:

> # This file must be compiled with SSE4.2 support
> %/CRC32C.o: COMMON_FLAGS += -msse4

   I have no idea how Firebird is built on MacOS, but if it uses the same set of makefiles
for POSIX, it should include this line in appropriate prefix file(s).

--
   WBR, SD.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: MacOS build fail "SSE4.2 instruction set not enabled"

Alex Peshkoff
In reply to this post by Mariuz
On 05/12/17 12:05, marius adrian popa wrote:
> Known issue in Firebird 3.0.x
>
> http://firebird.1100200.n4.nabble.com/std-c-11-added-to-CXXFLAGS-in-3-0-on-linux-td4645224.html
>
> introduced by this commit
>
> https://github.com/FirebirdSQL/firebird/commit/52d9a05a0f3d

I can't check myself mac issues, but sooner of all attached patch should
help.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel

Mac_X86_SSE4.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MacOS build fail "SSE4.2 instruction set not enabled"

Mariuz
In reply to this post by Mariuz
Also in firebird/extern/cloop/src/tests/test1/CTest.c

related to this patch 
https://gerrit.libreoffice.org/#/c/37488/6/external/firebird/firebird-macosx.patch.1

these lines and changes are still needed for osx 
 
 #include "CalcCApi.h"
-#include <malloc.h>
+#include <stdlib.h>
 #include <stdio.h>


On Fri, May 12, 2017 at 1:10 PM, Tomaž Vajngerl <[hidden email]> wrote:
Hi,

On Fri, May 12, 2017 at 11:05 AM, marius adrian popa <[hidden email]> wrote:
> Known issue in Firebird 3.0.x
>
> http://firebird.1100200.n4.nabble.com/std-c-11-added-to-CXXFLAGS-in-3-0-on-linux-td4645224.html
>
> introduced by this commit
>
> https://github.com/FirebirdSQL/firebird/commit/52d9a05a0f3d
>

They would need to add something like "%/CRC32C.o: COMMON_FLAGS +=
-msse4" to prefix.darwin too (clang should have compatible switches)

For Windows It is complicated as it depends if the particular VS
version supports the instructions or not, but you need to add some
compile switch too...

That's only for compiler - in addition you also need run-time
detection, but I see this is already covered by SSE4_2Supported()
method.

Regards, Tomaž


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: MacOS build fail "SSE4.2 instruction set not enabled"

Alex Peshkoff
On 05/12/17 15:33, marius adrian popa wrote:
> Also in firebird/extern/cloop/src/tests/test1/CTest.c

The simplest fix is to disable tests on mac

> related to this patch
> https://gerrit.libreoffice.org/#/c/37488/6/external/firebird/firebird-macosx.patch.1
>
> these lines and changes are still needed for osx
>
>   #include "CalcCApi.h"
> -#include <malloc.h>
> +#include <stdlib.h>
>   #include <stdio.h>
>
> now build fails
> https://ci.libreoffice.org/job/lo_gerrit/11317/Config=macosx_clang_dbgutil/
>
> On Fri, May 12, 2017 at 1:10 PM, Tomaž Vajngerl <[hidden email]> wrote:
>
>> Hi,
>>
>> On Fri, May 12, 2017 at 11:05 AM, marius adrian popa <[hidden email]>
>> wrote:
>>> Known issue in Firebird 3.0.x
>>>
>>> http://firebird.1100200.n4.nabble.com/std-c-11-added-to-
>> CXXFLAGS-in-3-0-on-linux-td4645224.html
>>> introduced by this commit
>>>
>>> https://github.com/FirebirdSQL/firebird/commit/52d9a05a0f3d
>>>
>> They would need to add something like "%/CRC32C.o: COMMON_FLAGS +=
>> -msse4" to prefix.darwin too (clang should have compatible switches)
>>
>> For Windows It is complicated as it depends if the particular VS
>> version supports the instructions or not, but you need to add some
>> compile switch too...
>>
>> That's only for compiler - in addition you also need run-time
>> detection, but I see this is already covered by SSE4_2Supported()
>> method.
>>
>> Regards, Tomaž
>>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
>
> Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: MacOS build fail "SSE4.2 instruction set not enabled"

Alex Peshkoff
In reply to this post by Mariuz
On 05/12/17 22:13, Julien wrote:
> I gave a try but had this:
> lo/lode/dev/core/workdir/UnpackedTarball/firebird/src/common/CRC32C.cpp:41:10: error: always_inline function '_mm_crc32_u8' requires target feature 'sse4.1', but would be inlined into function 'CRC32C' that is compiled without support for 'sse4.1'
>                  return _mm_crc32_u8(hash_value, *value);
>                         ^
> Are you sure msse4 shouldn't be added in CXXFLAGS instead of COMMON_FLAGS?

In linux COMMON_FLAGS is used and it appears to be correct choice from
general POV - msse4 makes sense for both plain C & C++.
But what about darwin - yes, looks like it does not use COMMON_FLAGS at
all, with CXXFLAGS this should work.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: MacOS build fail "SSE4.2 instruction set not enabled" (abandonned)

Mariuz
In reply to this post by Mariuz
I will check your patch this week on a mac / windows and linux , It's still a hack so the proper way to solve it is like described in this stackoverflow solution 

On Sat, May 13, 2017 at 9:31 AM, Julien Nabet <[hidden email]> wrote:
Hi,

As I put on the gerrit patch, I give up with this patch because:
- it's too complicated to modify the patch : the patching part was working on my Mac and it fails to apply on Jenkins Mac
- sse4 pb. Even if it builds, LO may crash on pc which aren't compatible with sse4

Julien

On 12/05/2017 14:33, marius adrian popa wrote:
Also in firebird/extern/cloop/src/tests/test1/CTest.c

related to this patch 
https://gerrit.libreoffice.org/#/c/37488/6/external/firebird/firebird-macosx.patch.1

these lines and changes are still needed for osx 
 
 #include "CalcCApi.h"
-#include <malloc.h>
+#include <stdlib.h>
 #include <stdio.h>


On Fri, May 12, 2017 at 1:10 PM, Tomaž Vajngerl <[hidden email]> wrote:
Hi,

On Fri, May 12, 2017 at 11:05 AM, marius adrian popa <[hidden email]> wrote:
> Known issue in Firebird 3.0.x
>
> http://firebird.1100200.n4.nabble.com/std-c-11-added-to-CXXFLAGS-in-3-0-on-linux-td4645224.html
>
> introduced by this commit
>
> https://github.com/FirebirdSQL/firebird/commit/52d9a05a0f3d
>

They would need to add something like "%/CRC32C.o: COMMON_FLAGS +=
-msse4" to prefix.darwin too (clang should have compatible switches)

For Windows It is complicated as it depends if the particular VS
version supports the instructions or not, but you need to add some
compile switch too...

That's only for compiler - in addition you also need run-time
detection, but I see this is already covered by SSE4_2Supported()
method.

Regards, Tomaž




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: MacOS build fail "SSE4.2 instruction set not enabled" (abandonned)

Dimitry Sibiryakov-3
15.05.2017 22:24, marius adrian popa wrote:
>
> and eliminated msse4 flag from compiler command line
>
> https://gist.github.com/mariuz/753f6fce7ebe0ac9bcf2cb26905c1cc1

   Did you check that it can be compiled? For me the trick with attribute did not work:
compilation failed with subj error.


--
   WBR, SD.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: MacOS build fail "SSE4.2 instruction set not enabled" (abandonned)

Mariuz
It's on Visual C++ ?

On Tue, May 16, 2017 at 12:05 AM, Dimitry Sibiryakov <[hidden email]> wrote:
15.05.2017 22:24, marius adrian popa wrote:
>
> and eliminated msse4 flag from compiler command line
>
> https://gist.github.com/mariuz/753f6fce7ebe0ac9bcf2cb26905c1cc1

   Did you check that it can be compiled? For me the trick with attribute did not work:
compilation failed with subj error.


--
   WBR, SD.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: MacOS build fail "SSE4.2 instruction set not enabled" (abandonned)

Dimitry Sibiryakov-3
16.05.2017 9:29, marius adrian popa wrote:
> It's on Visual C++ ?

   Both VC and GCC.


--
   WBR, SD.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: MacOS build fail "SSE4.2 instruction set not enabled" (abandonned)

Mariuz
Could you specifiy compiler versions and the error messages ?

On Tue, May 16, 2017 at 11:28 AM, Dimitry Sibiryakov <[hidden email]> wrote:
16.05.2017 9:29, marius adrian popa wrote:
> It's on Visual C++ ?

   Both VC and GCC.


--
   WBR, SD.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: MacOS build fail "SSE4.2 instruction set not enabled" (abandonned)

Dimitry Sibiryakov-3
16.05.2017 15:54, marius adrian popa wrote:
> Could you specifiy compiler versions and the error messages ?

   No. It was years ago. MSVC was 2013, GCC can't remember, perhaps 4.8.


--
   WBR, SD.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|

Re: MacOS build fail "SSE4.2 instruction set not enabled" (abandonned)

Mariuz
On firebird3.0.3 and i7 host works ok the above patch 

Got a crash when compiling on a non sse4 host (Pentium Dual-Core  CPU  E5400)


On Tue, May 16, 2017 at 5:21 PM, Dimitry Sibiryakov <[hidden email]> wrote:
16.05.2017 15:54, marius adrian popa wrote:
> Could you specifiy compiler versions and the error messages ?

   No. It was years ago. MSVC was 2013, GCC can't remember, perhaps 4.8.


--
   WBR, SD.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel