edwenger / emodlib

Python bindings of ported EMOD C++ libraries for disease-transmission modeling
MIT License
0 stars 1 forks source link

Address build error on Apple M1 from random-number headers #18

Closed edwenger closed 1 year ago

edwenger commented 2 years ago
In file included from /Users/ewenger/GitHub/emodlib/include/emodlib/utils/RANDOM.cpp:1:
In file included from /Users/ewenger/GitHub/emodlib/include/emodlib/utils/RANDOM.h:20:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/emmintrin.h:13:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/xmmintrin.h:13:
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:33:5: error: use of undeclared identifier '__builtin_ia32_emms'; did you mean '__builtin_isless'?
    __builtin_ia32_emms();
    ^

Seems to be related to these:

edwenger commented 2 years ago

This seems to be the trick: https://github.com/DLTcollab/sse2neon

Usage

edwenger commented 2 years ago

See b37441215deba484aa745b7f7ec0c0f0835811f4

edwenger commented 1 year ago

Generalizing to either the Mac M1 or Linux case with pre-processor directives (as described here):

See commit https://github.com/edwenger/emodlib/commit/88d6d7eef13981c4f081fff730791e90f658787d