Open funatsufumiya opened 3 weeks ago
Hey! Not sure what's up. The error looks like a C++ standard version difference, or an out of date compiler, since the constexpr stuff definitely works. However, the log for the command looks right and CMake says clang/llvm 19.0.0. I suspect this may have to do with your local xcode developer tool version, if you wanted to dig deeper.
If not, hang tight for binary releases in the coming weeks. :slightly_smiling_face:
@jeaye Thank you very much. I often run into similar errors myself in other code builds on Mac/Win, so probably sure it is a subtle difference in compiler versions and specifications. (especially often with Windows.)
I will do some more research to see if I change the settings myself or change the version of the original compiler.
I tried upgrading my llvm
(clang) version and tried once, but nothing changed.
And I'm also sure CC
and CXX
has set properly.
$ echo $CC
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/clang
$ echo $CXX
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/clang++
$ $CC --version
clang version 19.0.0git (https://github.com/jank-lang/llvm-project.git 60f04db1bc58fde5de5bc0c66a2361e83fbffdf2)
Target: arm64-apple-darwin23.6.0
Thread model: posix
InstalledDir: /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin
$ $CXX --version
clang version 19.0.0git (https://github.com/jank-lang/llvm-project.git 60f04db1bc58fde5de5bc0c66a2361e83fbffdf2)
Target: arm64-apple-darwin23.6.0
Thread model: posix
InstalledDir: /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin
This is log of configure (./bin/configure -GNinja -DCMAKE_BUILD_TYPE=Release
) :
-- Running vcpkg install - done
-- The C compiler identification is Clang 19.0.0
-- The CXX compiler identification is Clang 19.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /opt/homebrew/bin/git (found version "2.47.0")
-- Looking for histedit.h
-- Looking for histedit.h - found
-- Found LibEdit: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include (found version "2.11")
-- Found ZLIB: /Users/fu/lab/jank/compiler+runtime/build/vcpkg_installed/x64-clang-static/lib/libz.a (found version "1.3.1")
-- Found LibXml2: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/lib/libxml2.tbd (found version "2.9.13")
-- Found supported version: LLVM 19.0.0git
-- Using LLVMConfig.cmake in: /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local
-- Clang install prefix: /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local
-- Found supported version: Clang 19.0.0git
-- Using ClangConfig.cmake in: /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local
-- Linker detection: Apple
-- Performing Test LLVM_LINKER_SUPPORTS_NO_EXPORTED_SYMBOLS
-- Performing Test LLVM_LINKER_SUPPORTS_NO_EXPORTED_SYMBOLS - Success
-- Performing Test LLVM_LINKER_SUPPORTS_NO_WARN_DUPLICATE_LIBRARIES
-- Performing Test LLVM_LINKER_SUPPORTS_NO_WARN_DUPLICATE_LIBRARIES - Success
-- Performing Test LLVM_LIBSTDCXX_MIN
-- Performing Test LLVM_LIBSTDCXX_MIN - Success
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Success
-- Performing Test C_SUPPORTS_FPIC
-- Performing Test C_SUPPORTS_FPIC - Success
-- Performing Test CXX_SUPPORTS_FPIC
-- Performing Test CXX_SUPPORTS_FPIC - Success
-- Building with -fPIC
-- Performing Test C_SUPPORTS_FNO_SEMANTIC_INTERPOSITION
-- Performing Test C_SUPPORTS_FNO_SEMANTIC_INTERPOSITION - Failed
-- Performing Test CXX_SUPPORTS_FNO_SEMANTIC_INTERPOSITION
-- Performing Test CXX_SUPPORTS_FNO_SEMANTIC_INTERPOSITION - Failed
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG - Success
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL - Success
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Success
-- Performing Test C_SUPPORTS_MISLEADING_INDENTATION_FLAG
-- Performing Test C_SUPPORTS_MISLEADING_INDENTATION_FLAG - Success
-- Performing Test CXX_SUPPORTS_MISLEADING_INDENTATION_FLAG
-- Performing Test CXX_SUPPORTS_MISLEADING_INDENTATION_FLAG - Success
-- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
-- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Success
-- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
-- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Success
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS - Failed
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - found
-- Performing Test macos_signposts_usable
-- Performing Test macos_signposts_usable - Success
-- CLANG_INCLUDE_DIRS: /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/include
-- LLVM_INCLUDE_DIRS: /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/include
-- LLVM_DEFINITIONS_LIST: -D__STDC_CONSTANT_MACROS;-D__STDC_FORMAT_MACROS;-D__STDC_LIMIT_MACROS
CMake Warning (dev) at build/vcpkg_installed/x64-clang-static/share/boost/vcpkg-cmake-wrapper.cmake:3 (_find_package):
Policy CMP0167 is not set: The FindBoost module is removed. Run "cmake
--help-policy CMP0167" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
Call Stack (most recent call first):
third-party/vcpkg/scripts/buildsystems/vcpkg.cmake:813 (include)
CMakeLists.txt:232 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found Boost: /Users/fu/lab/jank/compiler+runtime/build/vcpkg_installed/x64-clang-static/share/boost/BoostConfig.cmake (found version "1.85.0") found components: filesystem preprocessor
-- Configuring done (8.0s)
-- Generating done (0.5s)
-- Build files have been written to: /Users/fu/lab/jank/compiler+runtime/build
Incidentally, when I replaced -std=gnu++20
with -std=gnu++23
and set(jank_cxx_standard cxx_std_20)
with set(jank_cxx_standard cxx_std_23)
, the error message changed again, but probably not meaningful.
(The fact that the error about constexpr disappeared is not irrelevant. but not surprising.)
-- Configuring done (2.9s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/fu/lab/jank/compiler+runtime/build
[15/90] Building CXX object CMakeFiles/jank_lib.dir/cmake_pch.hxx.pch
FAILED: CMakeFiles/jank_lib.dir/cmake_pch.hxx.pch
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/clang++ -DCLI11_COMPILE -D__STDC_CONSTANT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/fu/lab/jank/compiler+runtime/build -I/Users/fu/lab/jank/compiler+runtime -I/Users/fu/lab/jank/compiler+runtime/include/cpp -isystem /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/include -isystem /Users/fu/lab/jank/compiler+runtime/third-party/nanobench/include -isystem /Users/fu/lab/jank/compiler+runtime/third-party/folly -isystem /Users/fu/lab/jank/compiler+runtime/third-party/bpptree/include -isystem /Users/fu/lab/jank/compiler+runtime/build/vcpkg_installed/x64-clang-static/include -isystem /opt/homebrew/include -isystem /Users/fu/lab/jank/compiler+runtime/build/vcpkg_installed/x64-clang-static/include/libzippp -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -O3 -DNDEBUG -std=gnu++23 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -fcolor-diagnostics -std=gnu++23 -DIMMER_HAS_LIBGC=1 -DIMMER_TAGGED_NODE=0 -DHAVE_CXX14=1 -DFMT_HEADER_ONLY=1 -DJANK_RELEASE -Wall -Wextra -Wpedantic -Wfloat-equal -Wuninitialized -Wswitch-enum -Wnon-virtual-dtor -Wold-style-cast -Wno-gnu-case-range -Wno-gnu-conditional-omitted-operand -Wno-implicit-fallthrough -Wno-covered-switch-default -fno-common -frtti -fexceptions -O2 -DJANK_VERSION=\"0.1-14692b2ed6968c350a21dedef72424fcbe2f75bc\" "-DJANK_JIT_FLAGS=\"-std=gnu++23 -DIMMER_HAS_LIBGC=1 -DIMMER_TAGGED_NODE=0 -DHAVE_CXX14=1 -DFMT_HEADER_ONLY=1 -DJANK_RELEASE -w\"" -DJANK_CLANG_PREFIX=\"/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local\" -Winvalid-pch -fpch-instantiate-templates -Xclang -emit-pch -Xclang -include -Xclang /Users/fu/lab/jank/compiler+runtime/build/CMakeFiles/jank_lib.dir/cmake_pch.hxx -x c++-header -MD -MT CMakeFiles/jank_lib.dir/cmake_pch.hxx.pch -MF CMakeFiles/jank_lib.dir/cmake_pch.hxx.pch.d -o CMakeFiles/jank_lib.dir/cmake_pch.hxx.pch -c /Users/fu/lab/jank/compiler+runtime/build/CMakeFiles/jank_lib.dir/cmake_pch.hxx.cxx
In file included from <built-in>:1:
In file included from /Users/fu/lab/jank/compiler+runtime/build/CMakeFiles/jank_lib.dir/cmake_pch.hxx:5:
In file included from /Users/fu/lab/jank/compiler+runtime/include/cpp/jank/prelude.hpp:3:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/random:1688:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__random/discrete_distribution.h:19:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/vector:325:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__format/formatter_bool.h:19:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__format/formatter_integral.h:35:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__locale:15:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__memory/shared_ptr.h:32:
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__memory/unique_ptr.h:65:19: error: invalid application of 'sizeof' to an incomplete type 'llvm::orc::LLJITBuilder'
65 | static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type");
| ^~~~~~~~~~~
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__memory/unique_ptr.h:278:7: note: in instantiation of member function 'std::default_delete<llvm::orc::LLJITBuilder>::operator()' requested here
278 | __ptr_.second()(__tmp);
| ^
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__memory/unique_ptr.h:248:71: note: in instantiation of member function 'std::unique_ptr<llvm::orc::LLJITBuilder>::reset' requested here
248 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
| ^
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/include/clang/Interpreter/Interpreter.h:115:69: note: in instantiation of member function 'std::unique_ptr<llvm::orc::LLJITBuilder>::~unique_ptr' requested here
115 | std::unique_ptr<llvm::orc::LLJITBuilder> JITBuilder = nullptr);
| ^
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/include/clang/Interpreter/Interpreter.h:33:7: note: forward declaration of 'llvm::orc::LLJITBuilder'
33 | class LLJITBuilder;
| ^
1 error generated.
[16/90] Building CXX object CMakeFiles/jank_exe.dir/cmake_pch.hxx.pch
FAILED: CMakeFiles/jank_exe.dir/cmake_pch.hxx.pch
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/clang++ -DBOOST_FILESYSTEM_NO_LIB -DBOOST_FILESYSTEM_STATIC_LINK=1 -D__STDC_CONSTANT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Djank_exe_EXPORTS -I/Users/fu/lab/jank/compiler+runtime/build -I/Users/fu/lab/jank/compiler+runtime -I/Users/fu/lab/jank/compiler+runtime/include/cpp -isystem /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/include -isystem /Users/fu/lab/jank/compiler+runtime/third-party/nanobench/include -isystem /Users/fu/lab/jank/compiler+runtime/third-party/folly -isystem /Users/fu/lab/jank/compiler+runtime/third-party/bpptree/include -isystem /opt/homebrew/include -isystem /Users/fu/lab/jank/compiler+runtime/build/vcpkg_installed/x64-clang-static/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -O3 -DNDEBUG -std=gnu++23 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -fcolor-diagnostics -std=gnu++23 -DIMMER_HAS_LIBGC=1 -DIMMER_TAGGED_NODE=0 -DHAVE_CXX14=1 -DFMT_HEADER_ONLY=1 -DJANK_RELEASE -Wall -Wextra -Wpedantic -Wfloat-equal -Wuninitialized -Wswitch-enum -Wnon-virtual-dtor -Wold-style-cast -Wno-gnu-case-range -Wno-gnu-conditional-omitted-operand -Wno-implicit-fallthrough -Wno-covered-switch-default -fno-common -frtti -fexceptions -O2 -DJANK_VERSION=\"0.1-14692b2ed6968c350a21dedef72424fcbe2f75bc\" "-DJANK_JIT_FLAGS=\"-std=gnu++23 -DIMMER_HAS_LIBGC=1 -DIMMER_TAGGED_NODE=0 -DHAVE_CXX14=1 -DFMT_HEADER_ONLY=1 -DJANK_RELEASE -w\"" -DJANK_CLANG_PREFIX=\"/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local\" -w -Winvalid-pch -fpch-instantiate-templates -Xclang -emit-pch -Xclang -include -Xclang /Users/fu/lab/jank/compiler+runtime/build/CMakeFiles/jank_exe.dir/cmake_pch.hxx -x c++-header -MD -MT CMakeFiles/jank_exe.dir/cmake_pch.hxx.pch -MF CMakeFiles/jank_exe.dir/cmake_pch.hxx.pch.d -o CMakeFiles/jank_exe.dir/cmake_pch.hxx.pch -c /Users/fu/lab/jank/compiler+runtime/build/CMakeFiles/jank_exe.dir/cmake_pch.hxx.cxx
In file included from <built-in>:1:
In file included from /Users/fu/lab/jank/compiler+runtime/build/CMakeFiles/jank_exe.dir/cmake_pch.hxx:5:
In file included from /Users/fu/lab/jank/compiler+runtime/include/cpp/jank/prelude.hpp:3:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/random:1688:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__random/discrete_distribution.h:19:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/vector:325:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__format/formatter_bool.h:19:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__format/formatter_integral.h:35:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__locale:15:
In file included from /Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__memory/shared_ptr.h:32:
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__memory/unique_ptr.h:65:19: error: invalid application of 'sizeof' to an incomplete type 'llvm::orc::LLJITBuilder'
65 | static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type");
| ^~~~~~~~~~~
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__memory/unique_ptr.h:278:7: note: in instantiation of member function 'std::default_delete<llvm::orc::LLJITBuilder>::operator()' requested here
278 | __ptr_.second()(__tmp);
| ^
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/bin/../include/c++/v1/__memory/unique_ptr.h:248:71: note: in instantiation of member function 'std::unique_ptr<llvm::orc::LLJITBuilder>::reset' requested here
248 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
| ^
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/include/clang/Interpreter/Interpreter.h:115:69: note: in instantiation of member function 'std::unique_ptr<llvm::orc::LLJITBuilder>::~unique_ptr' requested here
115 | std::unique_ptr<llvm::orc::LLJITBuilder> JITBuilder = nullptr);
| ^
/Users/fu/lab/jank/compiler+runtime/build/llvm-install/usr/local/include/clang/Interpreter/Interpreter.h:33:7: note: forward declaration of 'llvm::orc::LLJITBuilder'
33 | class LLJITBuilder;
| ^
1 error generated.
ninja: build stopped: subcommand failed.
I was using Xcode 16.0, and now I'm trying update it.
For information, my SDKROOT
is below. (before upgrading Xcode.)
$ export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
$ echo $SDKROOT
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk
I upgraded Xcode to 16.1 (and naturally upgraded macOS SDK to 15.1), but nothing changed.
$ xcodebuild -version
Xcode 16.1
Build version 16B40
$ echo $SDKROOT
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk
And I think in most case it is not so easy to upgrade Xcode always latest, so I'd like to know (or find) proper clang (cmake) configuration, or creating batch for code in this case.
By checking this stackoverflow comment, some C++20 feature may not be enabled here (in my environment).
(This is the comment of stackoverflow, may not directly relevant.)
If you can add the feature test macro that checks the presence of this feature, it would be would be like gravy. I think it's
__cpp_constexpr_dynamic_alloc
(P0784R7
), but I'm not 100% certain.
I tried build on macOS and it failed. (macOS sonoma 14.7, arm64, M1 Mac)
This is log after
./bin/compile
on branch current main 72836c5.(I folllowed build.md for build process.)
Any helps are welcome.
and, this is clang version info. (used to build clang and cling)