Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang 15 compilation issues on macOS #92

Closed
jakirkham opened this issue Jun 27, 2023 · 6 comments · Fixed by #93
Closed

Clang 15 compilation issues on macOS #92

jakirkham opened this issue Jun 27, 2023 · 6 comments · Fixed by #93
Labels
bug Something isn't working installation

Comments

@jakirkham
Copy link

When using Clang 15 on macOS, we saw the following issue ( conda-forge/pp-sketchlib-feedstock#40 (comment) ), which is inlined below:

compiler line:

2023-06-08T09:23:51.9438150Z   [ 93%] Building CXX object CMakeFiles/pp_sketchlib.dir/src/random/random_match.cpp.o
2023-06-08T09:23:51.9544530Z   /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_build_env/bin/x86_64-apple-darwin13.4.0-clang++ -DPYTHON_EXT -Dpp_sketchlib_EXPORTS -I/Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_build_env/include -I/Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/work/vendor/highfive/include -I/Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/work/src -isystem /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.10/site-packages/pybind11/include -isystem /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/include/python3.10 -isystem /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/include/eigen3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/work=/usr/local/src/conda/pp-sketchlib-2.1.1 -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh=/usr/local/src/conda-prefix -DVERSION_INFO=\"2.1.1\" -Wall -DEIGEN_USE_BLAS -O3 -DNDEBUG -ffast-math -funroll-loops -m64 -std=gnu++14 -flto=thin -isysroot /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -fPIC -fvisibility=hidden -fopenmp=libomp -MD -MT CMakeFiles/pp_sketchlib.dir/src/random/random_match.cpp.o -MF CMakeFiles/pp_sketchlib.dir/src/random/random_match.cpp.o.d -o CMakeFiles/pp_sketchlib.dir/src/random/random_match.cpp.o -c /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/work/src/random/random_match.cpp

error:

2023-06-08T09:24:01.3657440Z   In file included from /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/work/src/random/random_match.cpp:12:
2023-06-08T09:24:01.3662070Z   In file included from /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_build_env/bin/../include/c++/v1/random:1689:
2023-06-08T09:24:01.3666480Z   /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_build_env/bin/../include/c++/v1/__random/discrete_distribution.h:216:5: error: static assertion failed due to requirement '__libcpp_random_is_valid_urng<Xoshiro, void>::value':
2023-06-08T09:24:01.3668000Z       static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
2023-06-08T09:24:01.3669030Z       ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-06-08T09:24:01.3670680Z   /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_build_env/bin/../include/c++/v1/__random/discrete_distribution.h:117:17: note: in instantiation of function template specialization 'std::discrete_distribution<>::operator()<Xoshiro>' requested here
2023-06-08T09:24:01.3672060Z           {return (*this)(__g, __p_);}
2023-06-08T09:24:01.3672980Z                   ^
2023-06-08T09:24:01.3674510Z   /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/work/src/random/random_match.cpp:414:43: note: in instantiation of function template specialization 'std::discrete_distribution<>::operator()<Xoshiro>' requested here
2023-06-08T09:24:01.3675780Z         random_seq_buffer << RCMAP[base_dist(generator)];
2023-06-08T09:24:01.3677300Z                                             ^
2023-06-08T09:24:01.3678550Z   In file included from /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/work/src/random/random_match.cpp:12:
2023-06-08T09:24:01.3679990Z   In file included from /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_build_env/bin/../include/c++/v1/random:1682:
2023-06-08T09:24:01.3681310Z   In file included from /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_build_env/bin/../include/c++/v1/__random/bernoulli_distribution.h:14:
2023-06-08T09:24:01.3683720Z   /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_build_env/bin/../include/c++/v1/__random/uniform_real_distribution.h:119:5: error: static assertion failed due to requirement '__libcpp_random_is_valid_urng<Xoshiro, void>::value':
2023-06-08T09:24:01.3685090Z       static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
2023-06-08T09:24:01.3686050Z       ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-06-08T09:24:01.3687950Z   /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_build_env/bin/../include/c++/v1/__random/uniform_real_distribution.h:84:17: note: in instantiation of function template specialization 'std::uniform_real_distribution<>::operator()<Xoshiro>' requested here
2023-06-08T09:24:01.3689270Z           {return (*this)(__g, __p_);}
2023-06-08T09:24:01.3690160Z                   ^
2023-06-08T09:24:01.3691750Z   /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_build_env/bin/../include/c++/v1/__random/discrete_distribution.h:219:65: note: in instantiation of function template specialization 'std::uniform_real_distribution<>::operator()<Xoshiro>' requested here
2023-06-08T09:24:01.3693660Z              _VSTD::upper_bound(__p.__p_.begin(), __p.__p_.end(), __gen(__g)) -
2023-06-08T09:24:01.3694590Z                                                                   ^
2023-06-08T09:24:01.3696190Z   /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/_build_env/bin/../include/c++/v1/__random/discrete_distribution.h:117:17: note: in instantiation of function template specialization 'std::discrete_distribution<>::operator()<Xoshiro>' requested here
2023-06-08T09:24:01.3697770Z           {return (*this)(__g, __p_);}
2023-06-08T09:24:01.3698840Z                   ^
2023-06-08T09:24:01.3700190Z   /Users/runner/miniforge3/conda-bld/pp-sketchlib_1686215809509/work/src/random/random_match.cpp:414:43: note: in instantiation of function template specialization 'std::discrete_distribution<>::operator()<Xoshiro>' requested here
2023-06-08T09:24:01.3701530Z         random_seq_buffer << RCMAP[base_dist(generator)];
2023-06-08T09:24:01.3702440Z                                             ^

Think this is due to libcxx 15.0.0+ (used by clang++ 15.0.0+ on macOS) being stricter about random number generators implementations

The result_type defined by Xoshiro is size_t, which libcxx expect to match the return type of operator(). However Xoshiro::operator() returns uint64_t. Hence this check fails

Maybe Xoshiro::result_type should be uint64_t? Or perhaps another solution to align these could be pursued?

@jakirkham
Copy link
Author

cc @johnlees (for vis)

@jakirkham
Copy link
Author

Am curious. Has this been looked into?

@johnlees
Copy link
Member

Yes sorry I haven't had a chance to fix this, but I will do so this week so we can fix the conda recipe issues!

@jakirkham
Copy link
Author

Thanks John! 🙏

Hoping the exploration I did before (and wrote-up above) makes this somewhat easier

@johnlees johnlees added bug Something isn't working installation labels Nov 30, 2023
@johnlees
Copy link
Member

Working on this in #93 but facing a CI issue which I suspect is caused by inconsistent HDF5 versions, will take me a bit longer to resolve as a result

@jakirkham
Copy link
Author

Thanks John! 🙏

Commented in the PR: #93 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working installation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants