With libc++ 21 math/symengine fails to build, with errors similar to: In file included from /wrkdirs/usr/ports/math/symengine/work/symengine-0.14.0/cmake/checkcxx11.cpp:1: In file included from /usr/include/c++/v1/unordered_map:589: In file included from /usr/include/c++/v1/__algorithm/is_permutation.h:13: In file included from /usr/include/c++/v1/__algorithm/comp.h:14: In file included from /usr/include/c++/v1/__type_traits/is_integral.h:14: /usr/include/c++/v1/__type_traits/remove_cv.h:22:32: error: unknown type name '__remove_cv'; did you mean 'remove_cv'? using type _LIBCPP_NODEBUG = __remove_cv(_Tp); ^ /usr/include/c++/v1/__type_traits/remove_cv.h:21:35: note: 'remove_cv' declared here struct _LIBCPP_NO_SPECIALIZATIONS remove_cv { ^ This is because libc++ 21 does not officially support clang < 19, and even though I added quite a few patches to libc++ 21 to non-officially support older gcc and clang versions, I never managed to make it support clang 15 or gcc 12. It seems that either removing the USES=llvm:min=15,max=15 fixes this problem, as it then compiles with the default llvm 19. Alternatively, the minimum version could be bumped to at least 16.
Created attachment 268141 [details] math/symengine: fix build with libc++ 21
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=8adee5d2725328f88639daca828779689301bd92 commit 8adee5d2725328f88639daca828779689301bd92 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2026-02-17 10:28:31 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2026-03-13 08:27:02 +0000 math/symengine: fix build with libc++ 21 With libc++ 21 math/symengine fails to build, with errors similar to: In file included from /wrkdirs/usr/ports/math/symengine/work/symengine-0.14.0/cmake/checkcxx11.cpp:1: In file included from /usr/include/c++/v1/unordered_map:589: In file included from /usr/include/c++/v1/__algorithm/is_permutation.h:13: In file included from /usr/include/c++/v1/__algorithm/comp.h:14: In file included from /usr/include/c++/v1/__type_traits/is_integral.h:14: /usr/include/c++/v1/__type_traits/remove_cv.h:22:32: error: unknown type name '__remove_cv'; did you mean 'remove_cv'? using type _LIBCPP_NODEBUG = __remove_cv(_Tp); ^ /usr/include/c++/v1/__type_traits/remove_cv.h:21:35: note: 'remove_cv' declared here struct _LIBCPP_NO_SPECIALIZATIONS remove_cv { ^ This is because libc++ 21 does not officially support clang < 19, and even though I added quite a few patches to libc++ 21 to non-officially support older gcc and clang versions, I never managed to make it support clang 15 or gcc 12. It seems that either removing the USES=llvm:min=15,max=15 fixes this problem, as it then compiles with the default llvm 19. Alternatively, the minimum version could be bumped to at least 16. PR: 293246 Approved by: maintainer timeout (2 weeks) MFH: 2026Q1 math/symengine/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)