I am simply trying to run the first example attached in the embedding
documantation which is the following block of code:
#include <iostream>
#include <julia.h>
using namespace std;
int main() {
/* required: setup the julia context */
jl_init(NULL);
/* run julia commands */
jl_eval_string("print(sqrt(2.0))");
/* strongly recommended: notify julia that the
program is about to terminate. this allows
julia time to cleanup pending write requests
and run all finalizers
*/
jl_atexit_hook();
return 0;
}
And when I try to run the program in eclipse (after having linked the
library and defined the path of the header file) the above mentioned
error message appeas which says:
- System image file
"/home/kostas/workspace/juli/Debug/../lib/x86_64-linux-gnu/julia/sys.ji"
not found
On Wednesday, June 24, 2015 at 3:31:50 PM UTC+2, Isaiah wrote:
>
> You probably need to call `jl_init(NULL)` at the beginning of the program.
> If you have not done so yet, I would suggest to read the embedding
> documentation:
>
> http://docs.julialang.org/en/release-0.3/manual/embedding/
>
> and start with the embedding example in the source:
>
> https://github.com/JuliaLang/julia/blob/master/examples/embedding.c
>
>
>
>
> On Wed, Jun 24, 2015 at 9:05 AM, Kostas Tavlaridis-Gyparakis <
> [email protected] <javascript:>> wrote:
>
>> I did download the 0.4 nightbuilt which includes the above mentioned
>> files in the proper location, but now Eclipse is throwing me a different
>> error I can not sort out how to overcome. When I try to run a small cpp
>> file with a few julia comands Eclipse is compiling the file but when I
>> try to run it it throws me the following message:
>>
>> "System image file
>> "/home/kostas/workspace/juli/Debug/../lib/x86_64-linux-gnu/julia/sys.ji"
>> not found "
>>
>> Futhermore since I am really new to Julia I am not sure and I don't know
>> a lot of the existing tools, is it possible to write a function in julia
>> that takes as an argument some data creates a model and solves it and
>> call this function from inside my c++ project?
>> I am asking this as in the example in the link
>> <http://docs.julialang.org/en/release-0.3/manual/calling-c-and-fortran-code/#passing-julia-callback-functions-to-c>
>>
>> attached by Isaiah with the qsort, the whole process is done inside julia
>> framework.
>> Whereas in my case I would be interested to write a julia program, like
>> the one described above that I would be able to call as a function
>> (I want it to solve a subproblem actually) inside my c++ project in
>> eclipse.
>> Is this relatively easy to be done?
>> Because I think this would be the best approach for my case.
>>
>> On Tuesday, June 23, 2015 at 8:20:56 AM UTC+2, Jeff Waller wrote:
>>>
>>> Embedded Julia is of particular interest to me. To answer your question,
>>> everything in Julia is available via embedded Julia.
>>>
>>> I would very much discourage use of version 0.3.2; avoid it if you can.
>>> I think that particular version has the uv.h problem which is fixed in
>>> later versions. Can you gain root on this host? If so you can get 0.3.9
>>> via PPA. Or even better if you can get ahold of one of the nightly builds,
>>> then 0.4.x comes with julia_config.jl, which figures out all of the right
>>> compile flags automatically. You just have to cut and paste in a
>>> Makefile. But if no makefile, you can run it and know the necessary
>>> compile time flags.
>>>
>>>
>