Windows 10でRubyを扱っています。
Rubyにrumaleをインストールしようとしたところ、次のようなエラーが出ました。
C:\Users****\ruby>gem install rumale _0.23.0_ Temporarily enhancing PATH for MSYS/MINGW... Building native extensions. This could take a while... ERROR: Error installing rumale: ERROR: Failed to build gem native extension. current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rumale-0.23.1/ext/rumale C:/Ruby30-x64/bin/ruby.exe -I C:/Ruby30-x64/lib/ruby/3.0.0 -r ./siteconf20210915-14872-n25knt.rb extconf.rb checking for numo/narray.h... yes checking for nary_new() in -lnarray... yes creating Makefile current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rumale-0.23.1/ext/rumale make "DESTDIR=" clean current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rumale-0.23.1/ext/rumale make "DESTDIR=" generating rumaleext-x64-mingw32.def compiling rumaleext.c compiling tree.c linking shared-object rumale/rumaleext.so C:/Ruby30-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: tree.o:tree.c:(.text+0x21ad): undefined reference to `__imp_mRumale' collect2.exe: error: ld returned 1 exit status make: *** [Makefile:261: rumaleext.so] エラー 1 make failed, exit code 2 Gem files will remain installed in C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rumale-0.23.1 for inspection. Results logged to C:/Ruby30-x64/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/rumale-0.23.1/gem_make.out ERROR: Could not find a valid gem '_0.23.0_' (>= 0) in any repository C:\Users***\ruby>gem install rumale -v '0.23.0' Fetching rumale-0.23.0.gem Temporarily enhancing PATH for MSYS/MINGW... Building native extensions. This could take a while... ERROR: Error installing rumale: ERROR: Failed to build gem native extension. current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rumale-0.23.0/ext/rumale C:/Ruby30-x64/bin/ruby.exe -I C:/Ruby30-x64/lib/ruby/3.0.0 -r ./siteconf20210915-15140-ny9tpy.rb extconf.rb checking for numo/narray.h... yes checking for nary_new() in -lnarray... yes creating Makefile current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rumale-0.23.0/ext/rumale make "DESTDIR=" clean current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rumale-0.23.0/ext/rumale make "DESTDIR=" generating rumale-x64-mingw32.def compiling rumale.c compiling tree.c linking shared-object rumale/rumale.so C:/Ruby30-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: tree.o:tree.c:(.text+0x21ad): undefined reference to `__imp_mRumale' collect2.exe: error: ld returned 1 exit status make: *** [Makefile:261: rumale.so] エラー 1 make failed, exit code 2 Gem files will remain installed in C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rumale-0.23.0 for inspection. Results logged to C:/Ruby30-x64/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/rumale-0.23.0/gem_make.out
環境の問題らしいというところまでは分かったのですが
c++の領域らしく、どう扱っていいのかイメージできません。
ご教授いただけると助かります。
gem_make.out にはどんな内容が出力されていますか?
current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rumale-0.23.1/ext/rumale
C:/Ruby30-x64/bin/ruby.exe -I C:/Ruby30-x64/lib/ruby/3.0.0 -r ./siteconf20210915-14872-n25knt.rb extconf.rb
checking for numo/narray.h... yes
checking for nary_new() in -lnarray... yes
creating Makefile
current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rumale-0.23.1/ext/rumale
make "DESTDIR=" clean
current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rumale-0.23.1/ext/rumale
make "DESTDIR="
generating rumaleext-x64-mingw32.def
compiling rumaleext.c
compiling tree.c
linking shared-object rumale/rumaleext.so
C:/Ruby30-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: tree.o:tree.c:(.text+0x21ad): undefined reference to `__imp_mRumale'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:261: rumaleext.so] エラー 1
make failed, exit code 2
----------------------------
このように書き込まれていました
情報ありがとうございます。
すみません。だいぶ調べたのですが、私には原因が分かりませんでした。
GitHub の issue で訊く方が良いかも知れません。
調べていただいてありがとうございます!
自分でも探していきたいと思います!
同じエラーが出ますね。これは直接Rumaleのissueに聞きましょう。
issueに入れていただきありがとうございます!
numo-narrayもrumaleもWindowsだけ分岐しているので、たぶんWindowsの場合は何かのフラグを追加しなければならないとか、そういう感じのエラーだと思いますが、
https://github.com/ruby-numo/numo-narray/blob/6f5c91250c0cb948f6b811385d384c3f15af4dcd/ext/numo/narray/extconf.rb#L23-L26
https://github.com/yoshoku/rumale/blob/04e4e45b324fff67053ef52945654a76504178e0/ext/rumale/extconf.rb#L18-L29
C言語に詳しい人じゃないと解決できないので作者に聞いてしまった方が早いです。

回答1件
あなたの回答
tips
プレビュー