node-julia icon indicating copy to clipboard operation
node-julia copied to clipboard

fix for building on OSX against Node 6.2.2 / Julia 0.4.6

Open complyue opened this issue 8 years ago • 4 comments

this is my fix to build NJ against latest Node/Julia releases on Mac

complyue avatar Jun 28 '16 01:06 complyue

It looks like there is a problem with Julia 0.5, but it's likely to be an aspect of a change to Julia; I can work on that. LGTM otherwise. I'm interested in the effect you found of changing delete [] to delete as well. I'm going to check how to deal with Julia 0.5 first and then merge shortly after.

waTeim avatar Jul 04 '16 22:07 waTeim

So far I just confirmed npm test all passed after changing delete[], haven't go deeper in using NJ. BTW I read Julia is using uv too, and a different version than Node.js' uv are bundled together (perhaps with isolation?). I'm curious if they can be compiled with a same uv copy (so does the version), then Julia code can run cooperatively with other Node's threaded parts like fs etc. I'm new to Julia, but very delighted by its strength on computing power, to help overcome Node's shortcoming in this area, while I believe async is even more powerful to handle big data floating around. I'm really excited by the possibility that data be async-ly arranged get async-ly computed on and deducted, with no redundant copies in RAM, which NJ is offering.

complyue avatar Jul 05 '16 04:07 complyue

I forgot to mention, I changed delete to delete[] due to a warning during build:

  CXX(target) Release/obj.target/nj/src/Call.o
../src/Call.cpp:165:10: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
         delete jl_args;
         ^
               []
../src/Call.cpp:157:33: note: allocated with 'new[]' here
         jl_value_t **jl_args = new jl_value_t*[numArgs];
                                ^
1 warning generated.

I do think the compiler is correct so did the change. For your reference.

complyue avatar Jul 08 '16 05:07 complyue

Your change removed the delete warning, however the following error still persists

error: cannot cast from type 'union jl_typemap_t' to
      pointer type 'jl_value_t *' (aka '_jl_value_t *')
         if(val && jl_is_function(val)) filteredNames.push_back(*s);
                   ^~~~~~~~~~~~~~~~~~~
../src/Import.cpp:14:28: note: expanded from macro 'jl_is_function'
#define jl_is_function(v) ((jl_value_t*)jl_gf_mtable(v)->defs != jl_nothing)
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

OSX node 6.7 julia .5

wolfiex avatar Mar 16 '17 15:03 wolfiex