Giter Club home page Giter Club logo

Comments (7)

dhalperi avatar dhalperi commented on August 16, 2024

Following up:

  • I uninstalled Xcode (4.6.3 btw) and reinstalled it, to no avail. Same for the command-line tools.
  • I downloaded MacCPUID from Intel and found that my processor is specifically an Intel Core2 Duo P8800, which (as the llvm link would suggest) indeed does not have SSE 4.2 support.

from powergraph.

dbickson avatar dbickson commented on August 16, 2024

Hi Daniel,
Would you mind trying to configure using the following flag:
./configure -D HAS_CRC32:BOOL=false
And then recompile.
Let us know if this works for you.

from powergraph.

dhalperi avatar dhalperi commented on August 16, 2024

It worked! (For the graph-analytics package.)

Thanks!

from powergraph.

dbickson avatar dbickson commented on August 16, 2024

Is it possible to prevent this error on MAC by adding a default -D HAS_CRC32:BOOL=false to any MAC compilation?

from powergraph.

ylow avatar ylow commented on August 16, 2024

Hmm... It is not exactly a Mac bug, but is more of an LLVM issue in certain versions of LLVM. Alternatively, I am happy to completely disable the CRC32 check. I am only using it one place as a hash function where it provides a small speedup. But it is most definitely not necessary.

Also, I am not sure why this line in CMakeLists should succeed.

check_cxx_source_compiles("int main(int argc, char** argv) { __builtin_ia32_crc32di(0,0);}" HAS_CRC32)

while when that fails when it is actually used. (perhaps it got optimized away?)

from powergraph.

erickt avatar erickt commented on August 16, 2024

@ylow / @dbickson: the reason why CMake is succeeding when it shouldn't be is because clang is optimizing away __builtin_ia32_crc32di before it gets to the Cannot select: intrinsic %llvm.x86.sse42.crc32.64.64 error. A simple way to make sure it gets compiled is to change the check to:

check_cxx_source_compiles("int main(int argc, char** argv) { return __builtin_ia32_crc32di(0,0); }" HAS_CRC32)

According to the llvm bug report about this, the proper way to do this is to not use the intrinsic, but use a wrapper function defined in smmintrin.h, as in:

#include <smmintrin.h>

int main(int argc, char** argv) { return _mm_crc32_u64(0,0); }

Finally, it appears that at least on my mac that support sse4.2, setting clang -mtune=native doesn't actually appear to enable sse 4.2. In order to get that snippet above to compile, I need to do clang -msse4.2 crc.cc. @ylow: it seems you removed setting this flag in 627d587, would it be alright to re-enable it?

from powergraph.

ylow avatar ylow commented on August 16, 2024

Aha. cool. Thanks for looking this up. I will reenable the flag.

from powergraph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.