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

Installing libvips on Heroku #57

Closed
dbousamra opened this issue Jun 5, 2014 · 22 comments
Closed

Installing libvips on Heroku #57

dbousamra opened this issue Jun 5, 2014 · 22 comments
Labels

Comments

@dbousamra
Copy link

Any idea if this is possible?

@lovell
Copy link
Owner

lovell commented Jun 5, 2014

Very likely possible, yes, but I've yet to try it.

As I mentioned in #42 (comment) there's a Heroku Buildpack at https://github.com/alex88/heroku-buildpack-vips that is only slightly out of date with respect to required version numbers. Perhaps send a PR to upgrade to libvips 7.38.5 and liborc 0.4.19.

@dbousamra
Copy link
Author

Ah thanks. Will give that a try.

@lovell lovell added the question label Jun 5, 2014
@dbousamra
Copy link
Author

Hi lovell,

So I've given this another go. I've upgraded the buildpack to 7.38.5 and 0.4.19 as above. The buildpack can be found here (https://github.com/dbousamra/heroku-buildpack-vips).

When I run:

npm install sharp

I am greeted with this error:

~ $ npm install sharp
npm WARN package.json mongoose-schema@0.0.6 No repository field.
npm WARN package.json path@0.4.9 path is also the name of a node core module.

> sharp@0.5.0 install /app/node_modules/sharp
> node-gyp rebuild

Package vips was not found in the pkg-config search path.
Perhaps you should add the directory containing `vips.pc'
to the PKG_CONFIG_PATH environment variable
No package 'vips' found
gyp: Call to 'PKG_CONFIG_PATH="/usr/local/Library/ENV/pkgconfig/10.8:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" pkg-config --libs vips' returned exit status 1. 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 (/app/vendor/node/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 3.8.11-ec2
gyp ERR! command "node" "/app/vendor/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /app/node_modules/sharp
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm ERR! sharp@0.5.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.5.0 install script.
npm ERR! This is most likely a problem with the sharp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls sharp
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.8.11-ec2
npm ERR! command "/app/vendor/node/bin/node" "/app/vendor/node/bin/npm" "install" "sharp"
npm ERR! cwd /app
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /app/npm-debug.log
npm ERR! not ok code 0

Any ideas?

@lovell
Copy link
Owner

lovell commented Jun 15, 2014

That buildpack looks like it uses /app/vendor/vips/lib/pkgconfig as the path for the pkg-config library.

It also looks like it attempts to set up PKG_CONFIG_PATH to point to that same path at start-up.

To help me confirm this, what does the following return, if anything?

echo $PKG_CONFIG_PATH

I'm hoping this provides the path automagically. If so, this should be a one-line config fix to the binding.gyp file to get you up and running.

@dbousamra
Copy link
Author

Echoing $PKG_CONFIG_PATH returns

:/app/vendor/vips/lib/pkgconfig

Notice the : at the beginning?

@lovell
Copy link
Owner

lovell commented Jun 15, 2014

The : is the path separator. As well as the very useful actual path it also contains a harmless empty path. I'll patch up binding.gyp to accommodate the useful bit, thanks.

@dbousamra
Copy link
Author

Ah cool.

Appreciate the help!

On Mon, Jun 16, 2014 at 8:02 AM, Lovell Fuller notifications@github.com
wrote:

The : is the path separator. As well as the very useful actual path it
also contains a harmless empty path. I'll patch up binding.gyp to
accommodate the useful bit, thanks.


Reply to this email directly or view it on GitHub
#57 (comment).

@lovell
Copy link
Owner

lovell commented Jun 17, 2014

Please can you try installing sharp on Heroku using the master branch:

npm install lovell/sharp

If this works, are you OK with me linking to your Heroku buildpack in sharp's README?

@dbousamra
Copy link
Author

Bit closer. For some reason it's complaining I don't have fftw3. Shouldn't be necessary right?

Running `npm install lovell/sharp` attached to terminal... up, run.7567
npm WARN package.json mongoose-schema@0.0.6 No repository field.
npm WARN package.json path@0.4.9 path is also the name of a node core module.

> sharp@0.5.1 install /app/node_modules/sharp
> node-gyp rebuild

Package fftw3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `fftw3.pc'
to the PKG_CONFIG_PATH environment variable
Package 'fftw3', required by 'vips', not found
gyp: Call to 'PKG_CONFIG_PATH=":$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" pkg-config --libs vips' returned exit status 1. 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 (/app/vendor/node/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 3.8.11-ec2
gyp ERR! command "node" "/app/vendor/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /app/node_modules/sharp
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm ERR! sharp@0.5.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.5.1 install script.
npm ERR! This is most likely a problem with the sharp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls sharp
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.8.11-ec2
npm ERR! command "/app/vendor/node/bin/node" "/app/vendor/node/bin/npm" "install" "lovell/sharp"
npm ERR! cwd /app
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /app/npm-debug.log
npm ERR! not ok code 0

@lovell
Copy link
Owner

lovell commented Jun 17, 2014

Getting closer... try adding the --without-fftw flag to libvips' ./configure step.

@dbousamra
Copy link
Author

No go. Same error sorry.

@lovell
Copy link
Owner

lovell commented Jul 2, 2014

As author of the original buildpack, I wonder if @alex88 is able to help us here?

I suspect Heroku will be providing a new stack soon, hopefully based on Ubuntu 14.04 LTS, which will make this significantly easier.

@alex88
Copy link

alex88 commented Jul 3, 2014

Hi guys, seems strange it requires fftw3.
In the sharp readme it seems asking for libfftw3-dev in the ubuntu instructions.

Btw I'm going to update the buildpack with the latest 7.40 vips version and I'll try to add fftw3 support to see if that fixes it, just give me some hours.

@lovell
Copy link
Owner

lovell commented Jul 3, 2014

Hi @alex88, thank you for offering to help us here, this is very much appreciated.

Package 'fftw3', required by 'vips', not found

The libvips-dev package in Ubuntu 14.04 has libfftw3-dev as a required dependency.

The vips package in Homebrew has fftw as a recommended dependency.

There's logic in libvips' source that checks whether we HAVE_FFTW, which suggests it is optional when compiling from source.

There's a certain irony here in that AFAIK sharp doesn't use any feature of libvips that depends on Fourier transformations. I will at least remove it as a dependency from the manual compilation steps.

@alex88
Copy link

alex88 commented Jul 3, 2014

I've updated the library to 7.40.3 including fftw 3.3.4, could you please try that and see if the problem still occurs?

@lovell
Copy link
Owner

lovell commented Jul 3, 2014

Fast work @alex88, thank you. Over to you @dbousamra.

@alex88 as an aside, you may want to upgrade liborc to the latest 0.4.21 as versions .18 and .19 both have pretty serious memory leak/overflow bugs.

@alex88
Copy link

alex88 commented Jul 3, 2014

@lovell ok I'll do that asap, I've some work for my job to finish this weekend so maybe next week, I'm having serious dependency issues trying to install libgsf too (required to use vips dzsave) so I'll do a release with all the updates!

Thanks for the tips

@dbousamra
Copy link
Author

Boom! All working!

So in the sharp README, we should link the Alex's buildpack repo, not my fork.

Thanks heaps guys. Can switch from gm to sharp now.

@alex88
Copy link

alex88 commented Jul 4, 2014

@lovell a tip, where you've found .21 version of orc?

I can see just .18 here http://code.entropywave.com/download/orc/

@alex88
Copy link

alex88 commented Jul 4, 2014

@lovell ok found them, problem is, heroku ships with autoconf 2.65 and 2.68 is required

@lovell
Copy link
Owner

lovell commented Jul 6, 2014

Thanks again @alex88, I've added a link in the README to your buildpack.

liborc version 0.4.18 is the least bad of the pre .21 versions. Probably best to wait until Heroku adds a new stack rather then dive deeper into that particular dependency hell.

@lovell lovell closed this as completed Jul 6, 2014
@alex88
Copy link

alex88 commented Jul 7, 2014

Thanks for the mention!

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