Podger2016 / rapidjson

Automatically exported from code.google.com/p/rapidjson
0 stars 0 forks source link

Unable to build tests on Mac OS X #58

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am trying to build the tests for rapidjson 0.11 
(http://code.google.com/p/rapidjson/) on Mac OS X . It includes three projects: 
gtest (builds fine), unittest (build fails), and perftest (build fails), and 
when building make error out with Error 1 and Error 2. Actually, the first time 
I ran make, gtest and unittest built fine, but perftest failed. Now, unittest 
is failing as well.

The compiler output shows the following errors for both unittest and perftest 
which causes make to fail:

../../include/rapidjson/reader.h: In function ‘const char* 
rapidjson::SkipWhitespace_SIMD(const char*)’:
../../include/rapidjson/reader.h:116: error: ‘_SIDD_UBYTE_OPS’ was not 
declared in this scope
../../include/rapidjson/reader.h:116: error: ‘_SIDD_CMP_EQUAL_ANY’ was not 
declared in this scope
../../include/rapidjson/reader.h:116: error: ‘_SIDD_BIT_MASK’ was not 
declared in this scope
../../include/rapidjson/reader.h:116: error: ‘_SIDD_NEGATIVE_POLARITY’ was 
not declared in this scope

These pre-processor constants are related to SSE4 instructions. The makefile 
includes the -msse4.2 compiler switch to enable SSE4.2 support, and looking 
through the header files reveal that on OS X, both SSE4_1 and SSE4_2 
pre-processor constants need to be defined for the SIDD... constants to be 
defined. For some reason, these SIDD... constants aren't being defined.

Further research showed that the -msse4 switch enables support for both SSE4.1 
and SSE4.2, so I tried changing the switch to -msse4, but it still errors out.

Not sure if the -msse4.2 switch automatically defines SSE4_2__ , but I tried 
manually defining it, and sill no luck.

NOTE: If you want to try building it yourself on Mac, you will need to download 
a different premake script file, as the included one doesn't work. You can 
download the corrected script from the attachment on the second post here 
https://code.google.com/p/rapidjson/issues/detail?id=54

Any ideas on how to get it building successfully on OS X ?

Original issue reported on code.google.com by keith3...@rocketmail.com on 23 Jan 2013 at 5:28

GoogleCodeExporter commented 8 years ago
Whoops! I had forgotten I had already reported this as Issue 55. Apologies.

Original comment by keith3...@rocketmail.com on 23 Jan 2013 at 5:31

GoogleCodeExporter commented 8 years ago

Original comment by milo...@gmail.com on 30 Jun 2014 at 10:51