Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sharp v0.16.1, OS X, "readelf: command not found" when using a custom global vips #602

Closed
caoko opened this issue Oct 14, 2016 · 10 comments
Closed
Labels
Milestone

Comments

@caoko
Copy link

caoko commented Oct 14, 2016

npm install sharp
(sharp@0.16.1)

node -v v6.8.0
node-gyp -v v3.4.0

/bin/sh: readelf: command not found
gyp: Call to 'if readelf -Ws "$(PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.11:$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" pkg-config --libs-only-L vips-cpp | cut -c 3- | sed -e "s/^$//usr/lib/")/libvips-cpp.so" | c++filt | grep -qF __cxx11;then echo "1";else echo "0";fi' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 15.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

@lovell
Copy link
Owner

lovell commented Oct 14, 2016

Hello, the use of readelf was recently introduced via commit 07d66da. The OS X CI build passes quite happily, but I guess that environment may have more tools installed on it than provided by clang/xcode on a "stock" OS X machine.

The command is only needed for gcc, so I suspect limit use of that command to Linux only will "fix" this. Leave it with me, thanks for reporting.

@lovell
Copy link
Owner

lovell commented Oct 14, 2016

This problem only affects OS X users who already have a globally-installed version of vips, probably via homebrew.

A workaround, assuming you don't need a custom installation of vips, is to remove it via brew remove vips and re-install sharp so it uses own pre-compiled version.

@caoko
Copy link
Author

caoko commented Oct 14, 2016

yes

brew uninstall --force vips

npm install ok.

thx.

@caoko caoko closed this as completed Oct 14, 2016
@lovell
Copy link
Owner

lovell commented Oct 14, 2016

Thanks for confirming. If it's OK with you I'd like to leave this issue open whilst I fix things for those who wish to use a custom installation of vips on OS X.

@lovell lovell reopened this Oct 14, 2016
@lovell lovell changed the title Can't install sharp on Mac sharp v0.16.1, OS X, "readelf: command not found" when using a custom global vips Oct 14, 2016
@lovell lovell added bug and removed triage labels Oct 14, 2016
@caoko
Copy link
Author

caoko commented Oct 14, 2016

readelf command for mac os x.
ref> http://stackoverflow.com/questions/3286675/readelf-like-tool-for-mac-os-x

brew install binutils
sudo ln -s /usr/local/bin/greadelf /usr/local/bin/readelf

but, sharp does not install.

readelf: Error: '/usr/local/Cellar/vips/8.3.3/lib -L/usr/local/Cellar/glib/2.48.1/lib -L/usr/local/opt/gettext/lib/libvips-cpp.so': No such file
gyp: Call to 'if readelf -Ws "$(PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.11:$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" pkg-config --libs-only-L vips-cpp | cut -c 3- | sed -e "s/^$//usr/lib/")/libvips-cpp.so" | c++filt | grep -qF __cxx11;then echo "1";else echo "0";fi' returned exit status 0 while in binding.gyp. while trying to load binding.gyp

@Meekohi
Copy link

Meekohi commented Oct 14, 2016

Yeah I am in exactly this situation that would benefit from a fix here -- I want to keep my global install of vips on my development machine for other projects, but am building a small side project that will be deployed on EC2 or etc, so would rather leave it with the local version.

@lovell lovell added this to the v0.16.2 milestone Oct 14, 2016
@lovell
Copy link
Owner

lovell commented Oct 14, 2016

Commit 1a0030e should limit the use of readelf to Linux. Are you able to test?

npm install lovell/sharp

@caoko
Copy link
Author

caoko commented Oct 17, 2016

first test env is not installed global vips.
so. i install brew install vips

ok. test commit version 1a0030e. (by chekout)

test env.

$ brew info vips
homebrew/science/vips: stable 8.4.2 (bottled)
Image processing library
http://www.vips.ecs.soton.ac.uk/
/usr/local/Cellar/vips/8.4.2 (174 files, 12.4M) *
Poured from bottle on 2016-10-17 at 12:06:02
From: https://github.com/Homebrew/homebrew-science/blob/master/vips.rb
==> Dependencies
Build: pkg-config ✔
Required: fontconfig ✔, gettext ✔, glib ✔
Recommended: libpng ✔, jpeg ✔, orc ✔, libgsf ✔, libtiff ✔, fftw ✔, little-cms2 ✔, pango ✔, libexif ✔, gobject-introspection ✔, pygobject3 ✔, python ✔, poppler ✔, librsvg ✔, giflib ✔
Optional: openslide ✘, imagemagick ✘, graphicsmagick ✔, openexr ✘, cfitsio ✘, webp ✔, python3 ✘, libmatio ✘, mozjpeg ✘, jpeg-turbo ✘

$ npm run clean
$ npm install
$ npm test

  • npm install test ok. (not use global vips?)
  • npm test failed.

438 passing (4m)
11 failing

  1. Image metadata GIF via giflib:
  Uncaught AssertionError: 4 === 3
  + expected - actual

  -4
  +3

  at test/unit/metadata.js:143:16
  1. Image metadata GIF grey+alpha via giflib:
  Uncaught AssertionError: 4 === 2
  + expected - actual

  -4
  +2

  at test/unit/metadata.js:159:16
  1. Rotation Override EXIF Orientation tag metadata after auto-rotate:
  Uncaught AssertionError: 3 === 8
  + expected - actual

  -3
  +8

  at test/unit/rotate.js:113:18
  1. Rotation Input image has Orientation EXIF tag value of 5 (270 degrees + flip), auto-rotate:
  Uncaught AssertionError: false === true
  + expected - actual

  -false
  +true

  at test/unit/rotate.js:130:18
  1. Rotation Flip - vertical:
  Uncaught AssertionError: false === true
  + expected - actual

  -false
  +true

  at test/unit/rotate.js:180:18
  1. Rotation Flop - horizontal:
  Uncaught AssertionError: false === true
  + expected - actual

  -false
  +true

  at test/unit/rotate.js:198:18
  1. Tile Deep Zoom layout:
 Uncaught Error: ENOENT: no such file or directory, scandir '/Users/caoko/github/sharp/test/fixtures/output.dz_files'
  at Error (native)
  at Object.fs.readdirSync (fs.js:951:18)
  at assertDeepZoomTiles (test/unit/tile.js:17:19)
  at test/unit/tile.js:153:13
  1. Tile Deep Zoom layout with custom size+overlap:
 Uncaught Error: ENOENT: no such file or directory, scandir '/Users/caoko/github/sharp/test/fixtures/output.dz.512_files'
  at Error (native)
  at Object.fs.readdirSync (fs.js:951:18)
  at assertDeepZoomTiles (test/unit/tile.js:17:19)
  at test/unit/tile.js:169:13
  1. Tile Zoomify layout:
 Uncaught Error: ENOENT: no such file or directory, stat '/Users/caoko/github/sharp/test/fixtures/output.zoomify/ImageProperties.xml'
  at Error (native)
  1. Tile Google layout:
 Uncaught Error: ENOENT: no such file or directory, stat '/Users/caoko/github/sharp/test/fixtures/output.google/0/0/0.jpg'
  at Error (native)
  1. Tile Write to ZIP container using container tile option:
 Uncaught Error: ENOENT: no such file or directory, stat '/Users/caoko/github/sharp/test/fixtures/output.dz.containeropt.zip'
  at Error (native)

@lovell
Copy link
Owner

lovell commented Oct 17, 2016

@caoko Brilliant, thank you for testing.

The failures from the master branch with vips 8.4.2 are expected and are fixed on the quill branch, which will become sharp v0.17.0 and have a dependency upon vips v8.4.2+.

@lovell
Copy link
Owner

lovell commented Oct 22, 2016

v0.16.2 out now with this fix, thanks for reporting.

@lovell lovell closed this as completed Oct 22, 2016
emilong added a commit to emilong/relax that referenced this issue Nov 7, 2016
sharp on Mac OS no longer needs libvips to be installed. In fact, it may cause a problem with installing sharp. Update the readme to reflect this fact. See lovell/sharp#602 for more information.
kirillelsukov pushed a commit to kirillelsukov/relax that referenced this issue Jun 15, 2018
sharp on Mac OS no longer needs libvips to be installed. In fact, it may cause a problem with installing sharp. Update the readme to reflect this fact. See lovell/sharp#602 for more information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants