Unable to compile stan models on MacOS Ventura
jamesmbaazam opened this issue · 15 comments
Describe the issue
I am unable to compile the example model that comes with the package.
Below is a reproducible example
> library("cmdstanr")
This is cmdstanr version 0.5.3
- CmdStanR documentation and vignettes: mc-stan.org/cmdstanr
- CmdStan version: 2.32.2
> file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan")
> mod <- cmdstan_model(file)
Compiling Stan program...
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:26:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_traits.hpp:10:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iterator:679:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:50:9: error: no member named 'nullptr_t' in the global namespace
using ::nullptr_t;
~~^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:26:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_traits.hpp:10:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iterator:679:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:16:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:452:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_compound.h:14:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_fundamental.h:14:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_null_pointer.h:24:49: error: use of undeclared identifier 'nullptr_t'; did you mean 'nullptr'?
template <> struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_null_pointer.h:24:49: error: template argument for template type parameter must be a type
temp
late <> struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_null_pointer.h:23:17: note: template parameter is declared here
template <class _Tp> struct __is_nullptr_t_impl : public false_type {};
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:26:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_traits.hpp:10:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iterator:684:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/common_iterator.h:22:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/variant:214:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:45: error: field has incomplete type 'std::exception_ptr'
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:144:24: note: definition of 'std::exception_ptr' is not complete until the closing '}'
class _LIBCPP_TYPE_VIS exception_ptr
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
^
/Application
s/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:689:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
# define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:673:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
__attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_VERSIONED_IDENTIFIER))))
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:26:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_traits.hpp:10:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iterator:684:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/common_iterator.h:22:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/variant:214:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:55: error: expected ';' at end of declaration list
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:38:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/functions.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/size.hpp:21:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/size_type.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/concepts.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_concepts.hpp:26:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:1712:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:860:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:28:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:3: error: non-static data member cannot be constexpr; did you intend to make it const?
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:728:31: note: expanded from macro '_LIBCPP_CONSTEXPR'
# define _LIBCPP_CONSTEXPR constexpr
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:38:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/functions.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/size.hpp:21:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/size_type.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/concepts.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_concepts.hpp:26:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:1712:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:860:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:28:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:32: error: member 'nullptr_t' declared as a template
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:42: error: expected ';' at end of declaration list
_LIBCPP_CONSTEXPR u
nique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:262:25: error: unknown type name 'nullptr_t'
unique_ptr& operator=(nullptr_t) _NOEXCEPT {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:395:3: error: non-static data member cannot be constexpr; did you intend to make it const?
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:728:31: note: expanded from macro '_LIBCPP_CONSTEXPR'
# define _LIBCPP_CONSTEXPR constexpr
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:38:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/functions.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/size.hpp:21:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/size_type.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/concepts.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_concepts.hpp:26:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:1712:
In file included from /Applications
/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:860:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:28:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:395:32: error: member 'nullptr_t' declared as a template
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:395:42: error: expected ';' at end of declaration list
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:484:25: error: unknown type name 'nullptr_t'
unique_ptr& operator=(nullptr_t) _NOEXCEPT {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:533:14: error: unknown type name 'nullptr_t'
void reset(nullptr_t = nullptr) _NOEXCEPT {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:533:24: error: cannot initialize a parameter of type 'int' with an rvalue of type 'std::nullptr_t'
void reset(nullptr_t = nullptr) _NOEXCEPT {
^ ~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:533:24: note: passing argument to parameter here
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:594:45: error: unknown type name 'nullptr_t'
operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:602:12: error: unknown type name 'nullptr_t'
operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:610:45: error: unknown type name 'nullptr_t'
operator!=(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [src/cmdstan/main.o] Error 1
Error: An error occured during compilation! See the message above for more information.
CmdStanR version number
Your CmdStanR version number (e.g. from packageVersion("cmdstanr")
).
0.5.3
Here is the results of sessionInfo()
> sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.4.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: Europe/London
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] cmdstanr_0.5.3
loaded via a namespace (and not attached):
[1] vctrs_0.6.3 knitr_1.43 cli_3.6.1 xfun_0.39 rlang_1.1.1 processx_3.8.2
[7] generics_0.1.3 tensorA_0.36.2 jsonlite_1.8.7 glue_1.6.2 colorspace_2.1-0 backports_1.4.1
[13] ps_1.7.5 distributional_0.3.2 scales_1.2.1 fansi_1.0.4 grid_4.3.0 munsell_0.5.0
[19] tibble_3.2.1 abind_1.4-5 lifecycle_1.0.3 compiler_4.3.0 dplyr_1.1.2 posterior_1.4.1
[25] pkgconfig_2.0.3 rstudioapi_0.15.0 farver_2.1.1 R6_2.5.1 tidyselect_1.2.0 utf8_1.2.3
[31] pillar_1.9.0 magrittr_2.0.3 checkmate_2.2.0 withr_2.5.0 tools_4.3.0 gtable_0.3.3
[37] ggplot2_3.4.2
@jamesmbaazam Sorry for the slow reply. Does rebuild_cmdstan(cores = 4)
run successfully (there may be warnings, but without fatal errors) or does that error too?
Yes, it errors too. Same errors as above.
It looks like your system isn't delegating to the commandline-tools properly.
Can you first check that the commandline tools are installed by opening up a terminal and running:
sudo xcode-select --install
This will either open up the installer to install the tools, or will message that they are already installed.
After that, specify that the system should delegate to the command line tools by running:
sudo xcode-select --switch /Library/Developer/CommandLineTools
Then can you try starting a new R session and running the rebuild_cmdstan(cores=4)
command again?
Thanks for your help so far but unfortunately, I'm still struggling.
When I run rebuild_cmdstan()
, I get a lot of warnings. An abridged version below:
/usr/local/include/stdlib.h:364:13: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
extern char *suboptarg; /* getsubopt(3) external variable */
^
/usr/local/include/stdlib.h:364:13: note: insert '_Nullable' if the pointer may be null
extern char *suboptarg; /* getsubopt(3) external variable */
^
_Nullable
/usr/local/include/stdlib.h:364:13: note: insert '_Nonnull' if the pointer should never be null
extern char *suboptarg; /* getsubopt(3) external variable */
^
_Nonnull
193 warnings generated.
193 warnings generated.
Now, when I run the following
> file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan")
> mod <- cmdstan_model(file)
I get
Compiling Stan program...
error: PCH file built from a different branch () than the compiler ((clang-1403.0.22.14.1))
1
error generated.
make: *** [/var/folders/vr/dn4r1_zj417drd1zr9301trw0000gp/T/RtmpWDQj0N/model-1c4858495cb4] Error 1
Error: An error occured during compilation! See the message above for more information.
In addition: Warning message:
CmdStan's precompiled header (PCH) files may need to be rebuilt.
If your model failed to compile please run rebuild_cmdstan().
If the issue persists please open a bug report.
Are you using homebrew/macports and have installed another toolchain? The output is referencing files in /usr/local/include
, which indicates a non-default c++ toolchain
Yes, I've installed gcc
and llvm
with homebrew.
It appears that your system isn't properly configured to handle the multiple toolchains, and there are files/libraries being included when they shouldn't.
Can you try removing gcc and llvm and trying again?
I just removed them and re-run the example but still getting an error as follows:
> library("cmdstanr")
This is cmdstanr version 0.6.0
- CmdStanR documentation and vignettes: mc-stan.org/cmdstanr
- CmdStan path: /Users/lshja16/.cmdstan/cmdstan-2.32.2
- CmdStan version: 2.32.2
> file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan")
> mod <- cmdstan_model(file)
Compiling Stan program...
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:26:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_traits.hpp:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iterator:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:15:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:50:9: error: no member named 'nullptr_t' in the global namespace
using ::nullptr_t;
~~^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:26:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_traits.hpp:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iterator:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__debug:16:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:452:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_compound.h:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_fundamental.h:14:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_null_pointer.h:24:49: error: use of undeclared identifier 'nullptr_t'; did you mean 'nullptr'?
template <> struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_null_pointer.h:24:49: error: template argument for template type parameter must be a type
template <> struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
^~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_null_pointer.h:23:17: note: template parameter is declared here
template <cla
ss _Tp> struct __is_nullptr_t_impl : public false_type {};
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:26:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_traits.hpp:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iterator:684:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/common_iterator.h:22:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/variant:214:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:45: error: field has incomplete type 'std::exception_ptr'
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:144:24: note: definition of 'std::exception_ptr' is not complete until the closing '}'
class _LIBCPP_TYPE_VIS exception_ptr
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:689:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
# define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
^
/Library/Developer/CommandLineTo
ols/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:673:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
__attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_VERSIONED_IDENTIFIER))))
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:26:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_traits.hpp:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iterator:684:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/common_iterator.h:22:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/variant:214:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:55: error: expected ';' at end of declaration list
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:38:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/functions.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/size.hpp:21:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/size_type.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/concepts.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_concepts.hpp:26:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:1712:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:860:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:28:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:3: error: non-static data member cannot be constexpr; did you intend to make it const?
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:728:31: note: expanded from macro '_LIBCPP_CONSTEXPR'
# define _LIBCPP_CONSTEXPR constexpr
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/argum
ents/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:38:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/functions.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/size.hpp:21:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/size_type.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/concepts.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_concepts.hpp:26:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:1712:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:860:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:28:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:32: error: member 'nullptr_t' declared as a template
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:42: error: expected ';' at end of declaration list
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:262:25: error: unknown type name 'nullptr_t'
unique_ptr& operator=(nullptr_t) _NOEXCEPT {
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:395:3: error: non-static data member cannot be constexpr; did you intend to make it const?
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:728:31: note: expanded from macro '_LIBCPP_CONSTEXPR'
# define _LIBCPP_CONSTEXPR constexpr
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/lexical_cast.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/iterator_range_core.hpp:38:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/functions.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/size.hpp:21:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/size_type.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/range/concepts.hpp:20:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/iterator/iterator_concepts.hpp:26:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:1712:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:860:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:28:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:395:32: error: member 'nullptr_t' declared as a template
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _N
OEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:395:42: error: expected ';' at end of declaration list
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:484:25: error: unknown type name 'nullptr_t'
unique_ptr& operator=(nullptr_t) _NOEXCEPT {
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:533:14: error: unknown type name 'nullptr_t'
void reset(nullptr_t = nullptr) _NOEXCEPT {
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:533:24: error: cannot initialize a parameter of type 'int' with an rvalue of type 'std::nullptr_t'
void reset(nullptr_t = nullptr) _NOEXCEPT {
^ ~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h
:533:24: note: passing argument to parameter here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:594:45: error: unknown type name 'nullptr_t'
operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:602:12: error: unknown type name 'nullptr_t'
operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:610:45: error: unknown type name 'nullptr_t'
operator!=(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [src/cmdstan/main.o] Error 1
Error: An error occured during compilation! See the message above for more information.
The next step is to check the include/library paths that your compiler is looking through.
Can you post the output from:
echo "int main(){}" >> foo.cpp
clang++ --verbose foo.cpp
I get
>echo "int main(){}" >> foo.cpp
>clang++ --verbose foo.cpp
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
"/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple arm64-apple-macosx13.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name foo.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fobjc-msgsend-selector-stubs -target-sdk-version=13.3 -fvisibility-inlines-hidden-static-local-var -target-cpu apple-m1 -target-feature +v8.5a -target-feature +crc -target-feature +lse -target-feature +rdm -target-feature +crypto -target-feature +dotprod -target-feature +fp-armv8 -target-feature +neon -target-feature +fp16fml -target-feature +ras -target-feature +rcpc -target-feature +zcm -target-feature +zcz -target-feature +fullfp16 -target-feature +sm4 -target-feature +sha3 -target-feature +sha2 -target-feature +aes -target-abi darwinpcs -fallow-half-arguments-and-returns -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=lldb -target-linker-version 857.1 -v -fcoverage-compilation-dir=/Users/lshja16 -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -stdlib=libc++ -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1 -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include -internal-externc-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdeprecated-macro -fdebug-compilation-dir=/Users/lshja16 -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -no-opaque-pointers -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -fcolor-diagnostics -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -mllvm -disable-aligned-alloc-awareness=1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /var/folders/vr/dn4r1_zj417drd1zr9301trw0000gp/T/foo-5915cc.o -x c++ foo.cpp
clang -cc1 version 14.0.3 (clang-1403.0.22.14.1) default target arm64-apple-darwin22.6.0
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
/Library/Developer/CommandLineTools/usr/include
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
End of search list.
"/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -no_deduplicate -dynamic -arch arm64 -platform_version macos 13.0.0 13.3 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o a.out -L/usr/local/lib /var/folders/vr/dn4r1_zj417drd1zr9301trw0000gp/T/foo-5915cc.o -lc++ -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/lib/darwin/libclang_rt.osx.a
The most likely culprit is something in your /usr/local/include
folder, since files there are included before any of the toolchain files.
What output do you get from:
brew list | grep llvm
brew list | grep gcc
ls /usr/local/include
Oh, interesting. When I run that, I get
> brew list | grep llvm
> brew list | grep gcc
> ls /usr/local/include
AppleArchive mach.modulemap
AppleEXR.h mach_debug
AppleTextureEncoder.h mach_debug.modulemap
AssertMacros.h mach_machine.modulemap
Availability.h machine
AvailabilityInternal.h machine.modulemap
AvailabilityMacros.h malloc
AvailabilityVersions.h math.h
Block.h membership.h
CommonCrypto memory.h
ConditionalMacros.h menu.h
Darwin.apinotes miscfs
EndpointSecurity module.modulemap
MacTypes.h monetary.h
NSSystemDirectories.h monitor.h
Spatial mpool.h
TargetConditionals.h nameser.h
Xplugin.h nc_tparm.h
__cxxabi_config.h ncurses.h
__libunwind_config.h ncurses_dll.h
__wctype.h ndbm.h
_ctermid.h net
_ctype.h net-snmp
_locale.h net.modulemap
_regex.h netdb.h
_stdio.h netinet
_types netinet.modulemap
_types.h netinet6
_types.modulemap netinet6.modulemap
_wctype.h netkey
_xlocale.h networkext
aio.h nfs
aliasdb.h nl_types.h
alloca.h nlist.h
apache2 nlopt.f
apr-1 nlopt.hpp
ar.h notify.h
architecture notify_keys.h
arm ntsid.h
arm64 objc
arpa odmodule
asl.h os
assert.h panel.h
atm paths.h
bank pcap
bank.modulemap pcap-bpf.h
bitstring.h pcap-namedb.h
bootparams.h pcap.h
bootstrap.h pexpert
bsm poll.h
bzlib.h printerdb.h
c++ printf.h
cache.h profile.h
cache_callbacks.h protocols
checkint.h pthread
com_err.h pthread.h
complex.h pthread_impl.h
compression.h pthread_spis.h
copyfile.h pwd.h
corpses ranlib.h
cpio.h readline
crt_externs.h readpassphrase.h
ctype.h regex.h
cups removefile.h
curl resolv.h
curses.h rpc
cxxabi.h rpcsvc
darwin_c_xlocale.modulemap rune.h
darwin_cdefs.modulemap runetype.h
darwin_posix_pthread.modulemap sandbox.h
darwin_posix_sys_types.modulemap sasl
db.h sched.h
default_pager search.h
device secure
device.modulemap secure.modulemap
dirent.h security
disktab.h semaphore.h
dispatch servers
dlfcn.h setjmp.h
dns.h sgtty.h
dns_sd.h signal.h
dns_util.h simd
dtrace.h slapi-plugin.h
editline spawn.h
editline.modulemap sqlite3.h
err.h sqlite3ext.h
errno.h stab.h
eti.h standards.h
execinfo.h stddef.h
expat.h stdint.h
expat_external.h stdio.h
fcntl.h stdlib.h
fenv.h strhash.h
ffi string.h
float.h string_x86.h
fmtmsg.h stringlist.h
fnmatch.h strings.h
form.h struct.h
fsproperties.h sys
fstab.h sys__pthread.modulemap
fts.h sysdir.h
ftw.h sysexits.h
get_compat.h syslog.h
gethostuuid.h tar.h
getopt.h term.h
glob.h term_entry.h
grp.h termcap.h
gssapi termios.h
gssapi.h tgmath.h
hfs tic.h
histedit.h tidy
i386 time.h
iconv.h timeconv.h
ifaddrs.h tkIntXlibDecls.h
inttypes.h tkMacOSX.h
iso646.h ttyent.h
kcdata.modulemap tzfile.h
kern ucontext.h
krb5 ulimit.h
krb5.h unctrl.h
langinfo.h unicode
launch.h unistd.h
lber.h unwind.h
lber_types.h util.h
ldap.h utime.h
ldap_cdefs.h utmp.h
ldap_features.h utmpx.h
ldap_schema.h uuid
ldap_utf8.h uuid.modulemap
ldif.h vfs
libDER vis.h
libc.h voucher
libcharset.h vproc.h
libexslt wchar.h
libgen.h wctype.h
libkern wordexp.h
libproc.h xar
libunwind.h xattr_flags.h
libxml xcselect.h
libxml2 xcselect.modulemap
libxslt xlocale
limits.h xlocale.h
localcharset.h xpc
locale.h xpc.modulemap
mach zconf.h
mach-o zlib.h
Yep, that list includes many C/C++ library headers that are being included before the toolchain headers, breaking the imports.
The fastest solution would be to delete the /usr/local/include
folder entirely. Homebrew libraries should be installed in /opt/homebrew/include
by default, so it shouldn't affect your other libraries
The fastest solution would be to delete the /usr/local/include folder entirely. Homebrew libraries should be installed in /opt/homebrew/include by default, so it shouldn't affect your other libraries
With the caveat that it might affect your other libraries, if your homebrew installation is installing in /usr/local/include
for some reason
Thanks so much for your patience and help. Deleting the directory worked for me. 😄