как решить, что libgomp.spe c отсутствует при попытке установить гем rmagick с ruby 2.3.8 | Рельсы 3.2.22.5 | Amazon Linux 2018.03 - PullRequest
0 голосов
/ 10 марта 2020

Ошибка при попытке установить rmagick на Amazon Linux Версия 2018.03

После yum install ImageMagick

при попытке gem install rmagick возникает следующая ошибка. Это происходит с любой версией rmagi c gem.

    Amazon Linux version: 2018.03
    AMI Profile: base
    https://aws.amazon.com/amazon-linux-ami/2018.03-release-notes/

[user@ip-x-x-x-x]$ gem install rmagick

Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
  ERROR: Failed to build gem native extension.

current directory: /home/user/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/rmagick-4.0.0/ext/RMagick
/home/user/.rbenv/versions/2.3.8/bin/ruby -r ./siteconf20200310-7185-ka0l3b.rb extconf.rb
checking for brew... no
checking for pacman... no
checking for gcc... yes
checking for pkg-config... yes
checking for outdated ImageMagick version (<= 6.7.7)... no
checking for __GNUC__... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/home/user/.rbenv/versions/2.3.8/bin/$(RUBY_BASE_NAME)
/home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:571:in `block in try_compile'
    from /home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:524:in `with_werror'
    from /home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:571:in `try_compile'
    from /home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:835:in `macro_defined?'
    from /home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:974:in `block in have_macro'
    from /home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
    from /home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
    from /home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:320:in `open'
    from /home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
    from /home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:320:in `open'
    from /home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
    from /home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
    from /home/user/.rbenv/versions/2.3.8/lib/ruby/2.3.0/mkmf.rb:973:in `have_macro'
    from extconf.rb:119:in `configure_compile_options'
    from extconf.rb:19:in `initialize'
    from extconf.rb:361:in `new'
    from extconf.rb:361:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/user/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/rmagick-4.0.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/user/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/rmagick-4.0.0 for inspection.
Results logged to /home/user/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/rmagick-4.0.0/gem_make.out

Дополнительная информация в rmagick 4.0.0 mkmf.rb

find_executable: checking for brew... -------------------- no

--------------------

find_executable: checking for pacman... -------------------- no

--------------------

find_executable: checking for gcc... -------------------- yes

--------------------

find_executable: checking for pkg-config... -------------------- yes

--------------------

configure_compile_options: checking for outdated ImageMagick version (<= 6.7.7)... -------------------- no

Detected ImageMagick version: 6.7.8
--------------------

"gcc -o conftest -I/home/user/.rbenv/versions/2.3.8/include/ruby-2.3.0/x86_64-linux -I/home/user/.rbenv/versions/2.3.8/include/ruby-2.3.0/ruby/backward -I/home/user/.rbenv/versions/2.3.8/include/ruby-2.3.0 -I.  -fopenmp -I/usr/include/ImageMagick    -fopenmp -I/usr/include/ImageMagick   conftest.c  -L. -L/home/user/.rbenv/versions/2.3.8/lib -Wl,-rpath,/home/user/.rbenv/versions/2.3.8/lib  -lMagickCore      -lMagickCore    -Wl,-rpath,/home/user/.rbenv/versions/2.3.8/lib -L/home/user/.rbenv/versions/2.3.8/lib -lruby-static  -lpthread -ldl -lcrypt -lm   -lc"
gcc: error: libgomp.spec: No such file or directory
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

1 Ответ

0 голосов
/ 10 марта 2020

Файл libgomp.spe c недоступен в ожидаемом месте. Чтобы решить эту проблему, мы должны были символическую ссылку libgomp.spec из g cc 6.4.1 в каталог /usr/lib64/

ln -s /usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgomp.spec /usr/lib64/libgomp.spec
ln -s /usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgomp.a /usr/lib64/libgomp.a
ln -s /usr/lib64/libgomp.so.1.0.0 /usr/lib64/libgomp.so

Спасибо @ 3D0G за решение из этого поста:

g cc: ошибка: libgomp.spe c: Нет такого файла или каталога с Amazon Linux 2017.09.1 ​​

Добавление этого вопроса / ответа для облегчения поиска решения в отношении проблемы с установкой rmagick gem.

...