Yves
Yves

Reputation: 12371

julia: system image file "sys.ji" not found

I am using the IDE Netbeans to code a project c++ under Linux(red hat 7). As I need to use some math functions, I try to embed the julia language into my c++ project.

Here is what I have done:

Download the Julia from here (I choose this: Generic Linux binaries)

Set project properties: build-->C++ Complier-->Include Directories, add the include of Julia, something like this: ../myjulia/include/julia

Add the libraries: open a terminal and type the command line: sudo ln -s ../myjulia/lib/julia/libjulia.so /usr/lib/libjulia.so

Now if I run my project, I will get this error: System image file "../myproject/dist/Debug/GNU-Linux-x86/../lib/julia/sys.ji" not found

I hve checked this file: ../myjulia/lib/julia, in this file, there are all of the lib files (libjulia.so etc) and a file named "sys.ji".

Upvotes: 3

Views: 892

Answers (2)

L_7337
L_7337

Reputation: 2738

I ran into this issue after installing Julia v0.3.10 on a Windows machine and thought I'd post it in case it can help someone else.

When I ran julia.exe it gave me the error message listed above.

Problem:

I had created a system environment variable called JULIA_HOME and pointed it to the directory where Julia was installed. Then, I added %JULIA_HOME%\bin to my PATH.

Solution:

I pointed JULIA_HOME to the \bin directory under the Julia install directory. Then, I added %JULIA_HOME% to my PATH

Upvotes: 4

Yves
Yves

Reputation: 12371

A "hello world" example from here

Now we know that we need to setup the julia context with this code:

jl_init(NULL);

In fact this code may not setup a good context because the project can't find the system image file "sys.ji". So what we need to do is using another function instead of jl_init: jl_init_with_image. This function accept two parameters: the first is the path of the image file, the second is the name of the image file. So we should use it like this: jl_init_with_image("/thePathOfSys.ji", "sys.ji"); One more thing: the path of sys.ji must be the absolute path.

Upvotes: 2

Related Questions