Skip to content

TruffleRuby support #189

Closed
Closed
@mtortonesi

Description

@mtortonesi

In my quest of getting torch.rb to work, have been trying to build rice on top of TruffleRuby (truffleruby+graalvm-23.0.0 installed with rbenv+ruby-build on my M1 Mac) but I ran into some linking issues:

...
  "_ruby_init_loadpath", referenced from:
      fixture__Address_Registration_Guard__setup() in lto.o
      fixture_Array_setup() in lto.o
      fixture_Attribute_setup() in lto.o
      fixture__Builtin_Object__setup() in lto.o
      fixture_Class_setup() in lto.o
      fixture_Array_setup() (.263) in lto.o
      fixture__Data_Object__setup() in lto.o
      ...
  "_ruby_sysinit", referenced from:
      fixture__Address_Registration_Guard__setup() in lto.o
      fixture_Array_setup() in lto.o
      fixture_Attribute_setup() in lto.o
      fixture__Builtin_Object__setup() in lto.o
      fixture_Class_setup() in lto.o
      fixture_Array_setup() (.263) in lto.o
      fixture__Data_Object__setup() in lto.o
      ...
ld: symbol(s) not found for architecture arm64
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [unittest] Error 1
rake aborted!
Failed
/Users/mauro/code/test/truffleruby/rice/rakefile:12:in `block in run_command'
/Users/mauro/code/test/truffleruby/rice/rakefile:8:in `run_command'
/Users/mauro/code/test/truffleruby/rice/rakefile:33:in `block (3 levels) in <top (required)>'
<internal:core> core/dir.rb:321:in `chdir'
/Users/mauro/code/test/truffleruby/rice/rakefile:31:in `block (2 levels) in <top (required)>'
<internal:core> core/kernel.rb:381:in `load'
Tasks: TOP => build => /Users/mauro/code/test/truffleruby/

And that is even after I manually changed CMakeLists.txt to include header dirs and library files:

  target_include_directories (unittest PRIVATE "/Users/mauro/.rbenv/versions/truffleruby+graalvm-23.0.0/graalvm/Contents/Home/languages/ruby/lib/cext/include")
  target_include_directories (unittest PRIVATE "/Users/mauro/.rbenv/versions/truffleruby+graalvm-23.0.0/graalvm/Contents/Home/languages/llvm/include")
  target_link_libraries (unittest "/Users/mauro/.rbenv/versions/truffleruby+graalvm-23.0.0/graalvm/Contents/Home/languages/ruby/lib/cext/librubysignal.dylib")
  target_link_libraries (unittest "/Users/mauro/.rbenv/versions/truffleruby+graalvm-23.0.0/graalvm/Contents/Home/languages/ruby/lib/cext/libtruffleruby.dylib")
  target_link_libraries (unittest "/Users/mauro/.rbenv/versions/truffleruby+graalvm-23.0.0/graalvm/Contents/Home/languages/ruby/lib/cext/libtruffleposix.dylib")

I am rather lost at the moment. Do you have any ideas / suggestions on how to move on from here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions