armgong / rjulia

R package which integrating R and Julia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot compile RJulia: JL_SET_STACK_BASE is not defined

mmaechler opened this issue · comments

I'm using the latest version of R, R 3.1.2-patched of a few days ago
and also the latest julia "0.4.0-dev" as updated on Dec.30, 2014 -- via ubuntu package julia, specifically

$ dpkg -s julia
Package: julia
Status: install ok installed
Priority: extra
Section: science
Installed-Size: 62942
Maintainer: Debian Julia Team <pkg-julia-devel@lists.alioth.debian.org>
Architecture: amd64
Version: 0.4.0-1647~ubuntu14.04.1
...
...

I did export JULIA_SRC=/usr
which seems fine, but compilation files (ends in a fatal error) when compiling embedding.c, specifically line 34 with the JL_SET_STACK_BASE macro ...
and indeed that is not defined -- neither in the RJulia header (*.h) files, nor in the julia
include files.
Here is the relevant source code line:

https://github.com/armgong/RJulia/blob/master/src/embedding.c#L34

julia v0.4 changed C API, delete JL_SET_STACK_BASE,so code need change.

code changed, should fix

Thank you, Yu Gong... I'm getting a bit further now. The package can be compiled and I can load it in R.
The next step, julia_init() is again not working.
The reason is I use the "development" julia package for ubuntu -- from https://launchpad.net/~staticfloat/+archive/ubuntu/julia-deps (i.e. managed by Elliot Saba), and it puts different julia parts in different places (bin, lib, include) in a somewhat standard ubuntu way, so your assumptions (about paths and relative paths) don't quite meet.
I think the setup needs to become a bit more flexible: At least the 'bin' and the 'lib' parts must be "separated" and they should be known as variables inside the package, so, the demo()s and even julia_init() should automatically work.

I'm not at all a julia expert - not even close - but am an R expert. Should we start collaborating on this,
at least I could clone RJulia and produce pull requests?

as a long time Arch Linux user (since 2003), I not familiar with other Linux Distribution,so current test code only on Arch Linux and windows.
it will be great if we can modify code meet Ubuntu or Other Linux Distribution (Fedora and Debian) way.
looking forward to your reply

as a temp fix, comment out some code in rjulia.r , could you try it and tell me the result.

now I rewrite Makevar and zzz.R and julia_init. don't need user add any env variable.
and julia_init() should work ,don't need add any julia_home.
could you test on your Ubuntu system,I already test on archlinux and fedora and windows ,It works indeed

also modify readme.MD , please read it

Excellent. Yes, it also works on ubuntu.

Congratulations! Do you want me to help you writing documentation (help files) ... in order to make the package ready for CRAN ?

But you've solved all my problems --- way time to close this issue. Thank you once more!

I've also confirmed that it compiles and loads OK with R 3.1.2/Xubuntu 14.04

The demo examples so far also seem to be working with julia version 0.4.0-dev+2417

Thanks for creating this library!

@mmaechler

it would be great you help write document!

Actually I already wrote a paper draft,which can be Modified into document, but not finish yet. maybe in 1-2 month it will be finished. I am not native speaker,write in English take long time :(

but put rjulia to CRAN is a bit trouble, on windows, R package build both 32 and 64 bit, but now when compiling RJulia , makefile only use one version julia (32 or 64 bit),can't build two version package in one time.
I will try to find a way to solve this problem,but right now I have no idea how to do this.