-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supporting Julia 1.0+ #12
Comments
I have not used this code for years, as I have not really needed it. I have no plans to keep working on it. However, it should not be too hard to update it for 1.0+ and I would be happy to review any changes. But note that there is a serious issue with focus when using IDL graphics from julia. The IDL widgets do not get any clicks or other interactions. I just want to point this out in case using IDL graphics is your primary goal in using IDL from Julia. |
Thanks for the reply! Actually my goal is not to use the graphics in IDL, but to gradually convince my advisor that the legacy IDL scripts can be transferred to Julia with ease. I thought it would be interesting to get this working in Julia 1.0+, and I have already made some commits. When I attempted to use the rpc yesterday, first I just typed
with the idlrpc hard-coded on my Mac, it showed me
Any idea about that error message? |
You need to start |
Okay, I found the new command. This works for me (you may have to change the path and
|
For me, the following parts work so far:
The idlrpc executable and libidl_rpc are actually under different directories. I'll continue to see what happens next. Now I managed to call IDL through RPC! Things still need to be cleaned up. Several things are bothering me at the moment:
line = """
a = 1 \$
+1
b = '1 \$';; comments
""" to be correctly passed to IDL. I got stuck with ruling out the [;|$] inside quotes. If I ignore that, simply line = """
a = 1 \$
+1
b = '1 +1';;comments
"""
line = replace(line, r"(;|\$).*(\n|$)"=>"") would work in Julia 1.3.
parr = reinterpret(Ptr{IDL_Array}, convert(Int, var.buf))
idl_arr = unsafe_load(parr)
jl_t = jl_type(var.vtype)
pdata = reinterpret(Ptr{jl_t}, idl_arr.data)
arr = unsafe_wrap(Array, pdata, dims(idl_arr.dim, idl_arr.n_dim))
#=
arr = Array{jl_t}(undef, dims(idl_arr.dim, idl_arr.n_dim))
for i = 1:idl_arr.n_elts
arr[i] = unsafe_load(pdata, i)
end
=#
# If you don't copy, the pointer will be freed!
return copy(arr) In the above code, julia> line = """
1+1
"""
"1+1\n"
julia> execute(line)
1+1
^
% Syntax error. This is not working probably because currently we cannot capture expressions that do not assign to any variable or function. However, this shouldn't matter too much.
using Libdl
const idlcall = "/Applications/exelis/idl85/bin/bin.darwin.x86_64/libidl.dylib"
Libdl.dlopen(idlcall) Error message:
This works perfectly fine if I just say
I don't quite understand why. I asked the same question on discourse. Summary so far: |
Hi,
Is there any plan to continue supporting Julia version 1.0+?
The text was updated successfully, but these errors were encountered: