Hello,
I am mostly an R and ruby user. I recently discovered the very promissing julia (I love her too!) . I like the fact that R is very easily embeddable in C code and then in ruby code. I would like to embed julia in ruby.
To do that, I am using or adapting the jlapi.c file.
Here are a few comments from my very early trials:
.) jl_bytestring_ptr is missing in src/julia.expmap (linux fails to compile even with DLLEXPORT)
.) htableh.inc is not directly embedded in the include/julia directory but only in the src/support. As a direct consequence, I can't compile my ruby extension. My solution was to copy it by hand in include/julia. Is it possible to do it in the "make install" command?
.) in client.jl: is it possible to split the function init_load_path into 2 files like this:
function init_load_path()
vers = "v$(VERSION.major).$(VERSION.minor)"
global const LOAD_PATH = ByteString[
abspath(JULIA_HOME,"..","local","share","julia","site",vers),
abspath(JULIA_HOME,"..","share","julia","site",vers)
]
# To delete: global const DL_LOAD_PATH = ByteString[]
end
function init_dl_load_path()
global const DL_LOAD_PATH = ByteString[]
end
Of course, for the julia repl to be still useable, one needs to update the run_repl function as follows:
init_load_path()
init_dl_load_path() # to be added
The reason why I am asking this is that, I need to load init_dl_load_path() first when embedding julia in ruby in order to load libpcre properly. Indeed, joinpath (called by init_load_path) uses libpcre.In particular abspath("/Users") returns false instead of true. LOAD_PATH is then abnormally prefixed with my current working directory. No require or using is then possible. One solution is to set LD_LIBRARY_PATH to the lib/julia directory but I think it is much better to do the same task by setting DL_LOAD_PATH used in dlopen by julia.