usnistgov / SP800-90B_EntropyAssessment

The SP800-90B_EntropyAssessment C++package implements the min-entropy assessment methods included in Special Publication 800-90B.
195 stars 88 forks source link

Flags not supported on MacOS #158

Closed QuentinGouchet closed 2 years ago

QuentinGouchet commented 4 years ago

Two compilation flags are not supported on MacOS Mojave (10.14.6). I created a patch that compiles on MacOS:

diff --git a/cpp/Makefile b/cpp/Makefile index d5ac13f..8b258c7 100644 --- a/cpp/Makefile +++ b/cpp/Makefile @@ -1,5 +1,11 @@ CXX = g++ -CXXFLAGS = -std=c++11 -fopenmp -O2 -msse2 -ffloat-store -march=native +CXXFLAGS = -std=c++11 -O2 -msse2 -march=native + +UNAME_S := $(shell uname -s) +ifneq ($(UNAME_S),Darwin)

joshuaehill commented 4 years ago

If you don't have a compiler that supports OpenMP ("-fopenmp"), then for some testing, your test tool is going to be profoundly slow as compared to platforms that do support OpenMP on any platform with multiple cores (in particular, on all modern hardware); all threading is done using OpenMP. If you're going to be doing much with this tool on this platform, you should install a compiler that supports OpenMP functionality.

For GCC, the "-ffloat-store" forces IEEE forces IEEE 754 behavior on Intel platforms; you may see a different accumulation of floating point error than occurs in the reference tool absent this option. That said, the default compiler on all recent MacOS platforms is actually clang behind the scenes. You should try using the clang options that are in the Makefile.

joshuaehill commented 2 years ago

@celic I think that this issue can be closed.