// Example from https://docs.julialang.org/en/v1/manual/embedding/
#include <julia.h>
JULIA_DEFINE_FAST_TLS // only define this once, in an executable (not in a shared library) if you want fast code.
int main(int argc, char *argv[])
{
return 0;
}
On purpose I exclude linking at this stage, and compile using
In file included from main1.C:2:
In file included from /Users/djplahaye/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/include/julia/julia.h:80:
In file included from /Users/djplahaye/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/include/julia/julia_threads.h:7:
/Users/djplahaye/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/include/julia/work-stealing-queue.h:41:13: error: expected parameter declarator
alignas(JL_CACHE_BYTE_ALIGNMENT) _Atomic(int64_t) top;
<cut>
It’s not mentioned there in Julia’s docs, that it’s needed. In fact it’s about embedding into C, and thus I would have thought any old (C and) C++ ok too.
FYI: Jluna project since you’re using C++, as better than just using Julia docs. Please make a PR about requiring C++17 if that for sure needed, and mention maybe only needed for macOS.
What did the AI tell you, or why do you think this was needed (and only on macOS?)?
Longer answer: I asked perplexity.ai if the advice applied to Intel Windows and Linux systems, or does it apply to only Mac or ARM CPU’s. Perplexity.ai returned:
The advice to use C++17 or later for better compatibility with C11 atomics is generally applicable across different platforms and CPU architectures, including Intel-based Windows and Linux computers, as well as macOS and ARM CPUs.
The advice to use C++17 for better C11 atomic compatibility is based on the C++17 standard’s improvements in this area, which are implemented by compiler vendors across different platforms and architectures