我试图在Mac机器上安装SciRuby,但安装失败。我已经搜索了此问题,但并没有太大帮助,发出的问题与其他错误有关。
当我使用命令
gem install sciruby
Successfully installed sciruby-0.2.11
Parsing documentation for sciruby-0.2.11
Done installing documentation for sciruby after 0 seconds
1 gem installed
它成功安装了它。但是当我使用命令
gem install sciruby-full
我收到此错误
Building native extensions. This could take a while...
ERROR: Error installing sciruby-full:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ruby-minisat-2.2.0/ext/minisat
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20191203-21492-19ae7a3.rb extconf.rb
checking for -lminisat... no
checking for -lstdc++... yes
creating Makefile
current directory: /Library/Ruby/Gems/2.6.0/gems/ruby-minisat-2.2.0/ext/minisat
make "DESTDIR=" clean
current directory: /Library/Ruby/Gems/2.6.0/gems/ruby-minisat-2.2.0/ext/minisat
make "DESTDIR="
compiling minisat.c
compiling minisat-wrap.cpp
In file included from minisat-wrap.cpp:35:
In file included from ./../../minisat/minisat/core/Solver.h:24:
./../../minisat/minisat/mtl/Vec.h:99:97: warning: '&&' within '||' [-Wlogical-op-parentheses]
if (add > INT_MAX - cap || ((data = (T*)::realloc(data, (cap += add) * sizeof(T))) == NULL) && errno == ENOMEM)
~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
./../../minisat/minisat/mtl/Vec.h:99:97: note: place parentheses around the '&&' expression to silence this warning
if (add > INT_MAX - cap || ((data = (T*)::realloc(data, (cap += add) * sizeof(T))) == NULL) && errno == ENOMEM)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from minisat-wrap.cpp:35:
In file included from ./../../minisat/minisat/core/Solver.h:27:
./../../minisat/minisat/utils/Options.h:63:44: warning: '&&' within '||' [-Wlogical-op-parentheses]
return test1 < 0 || test1 == 0 && strcmp(x->type_name, y->type_name) < 0;
~~ ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./../../minisat/minisat/utils/Options.h:63:44: note: place parentheses around the '&&' expression to silence this warning
return test1 < 0 || test1 == 0 && strcmp(x->type_name, y->type_name) < 0;
^
( )
In file included from minisat-wrap.cpp:35:
In file included from ./../../minisat/minisat/core/Solver.h:28:
./../../minisat/minisat/core/SolverTypes.h:50:16: error: friend declaration specifying a default argument must be a definition
friend Lit mkLit(Var var, bool sign = false);
^
./../../minisat/minisat/core/SolverTypes.h:58:14: error: friend declaration specifying a default argument must be the only declaration
inline Lit mkLit (Var var, bool sign) { Lit p; p.x = var + var + (int)sign; return p; }
^
./../../minisat/minisat/core/SolverTypes.h:50:16: note: previous declaration is here
friend Lit mkLit(Var var, bool sign = false);
^
2 warnings and 2 errors generated.
make: *** [minisat-wrap.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ruby-minisat-2.2.0 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ruby-minisat-2.2.0/gem_make.out
我正在使用
ProductName: Mac OS X
ProductVersion: 10.15.1
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
Apple clang version 11.0.0 (clang-1100.0.33.12)
我认为该错误是由于gcc
或clang
相关的原因引起的。
高度赞赏有关上述问题的详细说明和解决方案。