- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
system:windowsAffects only WindowsAffects only Windows
Description
I am using Julia 1.6.0-rc1. As stated at https://docs.julialang.org/en/v1/manual/embedding/, I made the necessary settings in Visual Studio 2019, but when I compile the code, I get the error 'jl_atomic_load_relaxed: identifier not found.'
Code:
#include <uv.h>
#include <Windows.h>
#include <julia.h>
int main(int argc, char* argv[])
{
jl_init();
jl_eval_string("print(sqrt(2.0))");
jl_atexit_hook(0);
return 0;
}
Error:
'jl_atomic_load_relaxed': identifier not found julia.h 880
'jl_atomic_load_relaxed': identifier not found julia.h 924
'jl_atomic_load_relaxed': identifier not found locks.h 24
'jl_atomic_load_relaxed': identifier not found locks.h 40
Metadata
Metadata
Assignees
Labels
system:windowsAffects only WindowsAffects only Windows
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Keno commentedon Feb 14, 2021
Looks like the MSVC versions of these are missing from atomics.h
ytecer commentedon Feb 14, 2021
Thank you for your answer. I think the following lines should be added to Atomics.h file.
balenamiaa commentedon Apr 4, 2021
Is there a reason compiler builtins are used instead of a higher level abstraction like stdatomic.h or mintomic?
toivoh commentedon Apr 10, 2021
I got it to work with
I guess this is not ideal, since
jl_atomic_load_acquire
should be stronger thanjl_atomic_load_relaxed
, but at least that means that is should work.Some googling led me to believe that
InterlockedOrNoFence
might be used instead in MSVC, but I'm not sure enough about the details to try it myself.toivoh commentedon Apr 10, 2021
I also had to handle #34201 to get embedding to work (tried with Julia 1.6.0 in MSVC 2017), described what I did in that issue.
vtjnash commentedon Sep 28, 2022
Duplicate of #42098, fixed by #42152