Clemapfel / jluna

Julia Wrapper for C++ with Focus on Safety, Elegance, and Ease of Use
https://clemens-cords.com/jluna
MIT License
239 stars 12 forks source link

Installation failed on Ubuntu 22.04 with Julia 1.10.0-beta3 #59

Closed liuyxpp closed 7 months ago

liuyxpp commented 9 months ago

OS: Ubuntu 22.04 g++: 11.4.0 Julia version: 1.10.0-beta3

Error message after running make install:

[  7%] Building CXX object CMakeFiles/jluna.dir/.src/exceptions.cpp.o
[ 15%] Building CXX object CMakeFiles/jluna.dir/.src/unsafe_utilities.cpp.o
/home/lyx/opt/jluna/.src/unsafe_utilities.cpp: In function ‘void jluna::unsafe::resize_array(jluna::unsafe::Array*, uint64_t)’:
/home/lyx/opt/jluna/.src/unsafe_utilities.cpp:197:41: error: cannot convert ‘_jl_value_t*’ to ‘jl_datatype_t*’ {aka ‘_jl_datatype_t*’}
  197 |             auto* tuple = jl_new_struct(tuple_type, jl_box_int64(static_cast<Int64>(one_d)));
      |                                         ^~~~~~~~~~
      |                                         |
      |                                         _jl_value_t*
In file included from /home/lyx/opt/jluna/include/julia_wrapper.hpp:13,
                 from /home/lyx/opt/jluna/include/typedefs.hpp:8,
                 from /home/lyx/opt/jluna/include/unsafe_utilities.hpp:8,
                 from /home/lyx/opt/jluna/.src/unsafe_utilities.cpp:6:
/home/lyx/.julia/juliaup/julia-1.10.0-beta3+0.x64.linux.gnu/include/julia/julia.h:1573:55: note:   initializing argument 1 of ‘jl_value_t* jl_new_struct(jl_datatype_t*, ...)’
 1573 | JL_DLLEXPORT jl_value_t *jl_new_struct(jl_datatype_t *type, ...);
      |                                        ~~~~~~~~~~~~~~~^~~~
In file included from /home/lyx/.julia/juliaup/julia-1.10.0-beta3+0.x64.linux.gnu/include/julia/julia.h:80,
                 from /home/lyx/opt/jluna/include/julia_wrapper.hpp:13,
                 from /home/lyx/opt/jluna/include/typedefs.hpp:8,
                 from /home/lyx/opt/jluna/include/unsafe_utilities.hpp:8,
                 from /home/lyx/opt/jluna/.src/unsafe_utilities.cpp:6:
/home/lyx/.julia/juliaup/julia-1.10.0-beta3+0.x64.linux.gnu/include/julia/julia_threads.h:245:12: note: class type ‘_jl_value_t’ is incomplete
  245 |     struct _jl_value_t *sig_exception;
      |            ^~~~~~~~~~~
/home/lyx/opt/jluna/.src/unsafe_utilities.cpp: In function ‘void jluna::unsafe::resize_array(jluna::unsafe::Array*, uint64_t, uint64_t)’:
/home/lyx/opt/jluna/.src/unsafe_utilities.cpp:222:41: error: cannot convert ‘_jl_value_t*’ to ‘jl_datatype_t*’ {aka ‘_jl_datatype_t*’}
  222 |             auto* tuple = jl_new_struct(tuple_type, jl_box_int64(static_cast<Int64>(one_d)), jl_box_int64(static_cast<Int64>(two_d)));
      |                                         ^~~~~~~~~~
      |                                         |
      |                                         _jl_value_t*
In file included from /home/lyx/opt/jluna/include/julia_wrapper.hpp:13,
                 from /home/lyx/opt/jluna/include/typedefs.hpp:8,
                 from /home/lyx/opt/jluna/include/unsafe_utilities.hpp:8,
                 from /home/lyx/opt/jluna/.src/unsafe_utilities.cpp:6:
/home/lyx/.julia/juliaup/julia-1.10.0-beta3+0.x64.linux.gnu/include/julia/julia.h:1573:55: note:   initializing argument 1 of ‘jl_value_t* jl_new_struct(jl_datatype_t*, ...)’
 1573 | JL_DLLEXPORT jl_value_t *jl_new_struct(jl_datatype_t *type, ...);
      |                                        ~~~~~~~~~~~~~~~^~~~
In file included from /home/lyx/.julia/juliaup/julia-1.10.0-beta3+0.x64.linux.gnu/include/julia/julia.h:80,
                 from /home/lyx/opt/jluna/include/julia_wrapper.hpp:13,
                 from /home/lyx/opt/jluna/include/typedefs.hpp:8,
                 from /home/lyx/opt/jluna/include/unsafe_utilities.hpp:8,
                 from /home/lyx/opt/jluna/.src/unsafe_utilities.cpp:6:
/home/lyx/.julia/juliaup/julia-1.10.0-beta3+0.x64.linux.gnu/include/julia/julia_threads.h:245:12: note: class type ‘_jl_value_t’ is incomplete
  245 |     struct _jl_value_t *sig_exception;
      |            ^~~~~~~~~~~
make[2]: *** [CMakeFiles/jluna.dir/build.make:90: CMakeFiles/jluna.dir/.src/unsafe_utilities.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:113: CMakeFiles/jluna.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
liuyxpp commented 9 months ago

It seems the issue is caused by the Julia version 1.10.0-beta3. With Julia 1.9.3, I can install Jluna successfully on the same machine.

Clemapfel commented 7 months ago

Sorry for the late reply, I can reproduce this, I assume they changed the API under us so it should be a simple fix.

Clemapfel commented 7 months ago

Fixed by https://github.com/Clemapfel/jluna/commit/3eac77882ed696a0c51cc5d088f62a584c85a3a5, this will go live with version 1.1.

liuyxpp commented 7 months ago

Thanks! I am looking forward to using Jluna with Julia 1.10.