uuid_v4 icon indicating copy to clipboard operation
uuid_v4 copied to clipboard

problem with string representation

Open hschwane opened this issue 2 years ago • 4 comments

Hi, I encountered a problem when generating the string representation. The result of:

    UUIDv4::UUIDGenerator<std::mt19937_64> uuidGenerator {};
    std::cout << uuidGenerator.getUUID().str() << std::endl;

comes out as:

e4-718a-83ba179eb88d6589-a33a-  a69d

Any idea what could be wrong?

hschwane avatar Jun 28 '22 13:06 hschwane

When I try to print the generated UUIDs (using the code above) it didn't even compile due to the following error:

error: inlining failed in call to always_inline ‘__m256i _mm256_set1_epi8(char)’: target specific option mismatch

so I needed to set:

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")

in my CMakeLists.txt.

Then, the string representation looks fine to me.

drux007 avatar Sep 26 '22 09:09 drux007

That makes sense. I don't think I compiled with arch=native enabled. Tanks for the info.

When I was not able get the UUID generation working back in June, found a different way of solving my problem, not using any UUIDs at all. So I am not using the package at the moment.

hschwane avatar Sep 27 '22 14:09 hschwane

Anyway to fix it in Windows?

xjsxujingsong avatar Jan 10 '23 13:01 xjsxujingsong

You need to enable at least -msse4.1 -mavx -mavx2 to use this library. The -march=native will enable everything you cpu support so will enable these flags automatically.

crashoz avatar Mar 16 '23 12:03 crashoz