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

Installation problems on RedHatEnt6 #78

Closed
leemm opened this issue Aug 17, 2014 · 9 comments
Closed

Installation problems on RedHatEnt6 #78

leemm opened this issue Aug 17, 2014 · 9 comments

Comments

@leemm
Copy link

leemm commented Aug 17, 2014

Hi,

Got a bit of a weird problem which I can't pin down. I'm trying to set up sharp on Red Hat Enterprise 6 but can't get node to start the app. Any advice would be greatly appreciated, thanks in advance.

> node app.js 

module.js:356
  Module._extensions[extension](this, filename);
                               ^
Error: libvips.so.38: cannot open shared object file: No such file or directory
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/var/www/testapp/node_modules/sharp/index.js:5:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

The strange thing is libvips.so.38 is exactly where I would expect it to be, /usr/local/lib.

libvips was compiled from source.
A few things I've checked.

ls -la
total 52380
drwxr-xr-x.  5 root root     4096 Aug 15 17:24 .
drwxr-xr-x. 12 root root     4096 Aug 13 12:07 ..
drwxr-xr-x.  3 root root     4096 Aug 15 17:24 gio
drwxr-xr-x.  3 root root     4096 Aug 15 17:24 glib-2.0
-rwxr-xr-x.  1 root root     1080 Aug 15 17:24 libgio-2.0.la
lrwxrwxrwx.  1 root root       22 Aug 15 17:24 libgio-2.0.so -> libgio-2.0.so.0.4102.0
lrwxrwxrwx.  1 root root       22 Aug 15 17:24 libgio-2.0.so.0 -> libgio-2.0.so.0.4102.0
-rwxr-xr-x.  1 root root  6132519 Aug 15 17:24 libgio-2.0.so.0.4102.0
-rwxr-xr-x.  1 root root      956 Aug 15 17:24 libglib-2.0.la
lrwxrwxrwx.  1 root root       23 Aug 15 17:24 libglib-2.0.so -> libglib-2.0.so.0.4102.0
lrwxrwxrwx.  1 root root       23 Aug 15 17:24 libglib-2.0.so.0 -> libglib-2.0.so.0.4102.0
-rwxr-xr-x.  1 root root  3740140 Aug 15 17:24 libglib-2.0.so.0.4102.0
-rwxr-xr-x.  1 root root     1009 Aug 15 17:24 libgmodule-2.0.la
lrwxrwxrwx.  1 root root       26 Aug 15 17:24 libgmodule-2.0.so -> libgmodule-2.0.so.0.4102.0
lrwxrwxrwx.  1 root root       26 Aug 15 17:24 libgmodule-2.0.so.0 -> libgmodule-2.0.so.0.4102.0
-rwxr-xr-x.  1 root root    39211 Aug 15 17:24 libgmodule-2.0.so.0.4102.0
-rwxr-xr-x.  1 root root     1010 Aug 15 17:24 libgobject-2.0.la
lrwxrwxrwx.  1 root root       26 Aug 15 17:24 libgobject-2.0.so -> libgobject-2.0.so.0.4102.0
lrwxrwxrwx.  1 root root       26 Aug 15 17:24 libgobject-2.0.so.0 -> libgobject-2.0.so.0.4102.0
-rwxr-xr-x.  1 root root  1205231 Aug 15 17:24 libgobject-2.0.so.0.4102.0
-rwxr-xr-x.  1 root root     1004 Aug 15 17:24 libgthread-2.0.la
lrwxrwxrwx.  1 root root       26 Aug 15 17:24 libgthread-2.0.so -> libgthread-2.0.so.0.4102.0
lrwxrwxrwx.  1 root root       26 Aug 15 17:24 libgthread-2.0.so.0 -> libgthread-2.0.so.0.4102.0
-rwxr-xr-x.  1 root root     8977 Aug 15 17:24 libgthread-2.0.so.0.4102.0
-rw-r--r--.  1 root root 27535512 Aug 15 17:01 libvips.a
-rw-r--r--.  1 root root  2522104 Aug 15 17:01 libvipsCC.a
-rwxr-xr-x.  1 root root     1071 Aug 15 17:01 libvipsCC.la
lrwxrwxrwx.  1 root root       19 Aug 15 17:01 libvipsCC.so -> libvipsCC.so.38.0.3
lrwxrwxrwx.  1 root root       19 Aug 15 17:01 libvipsCC.so.38 -> libvipsCC.so.38.0.3
-rwxr-xr-x.  1 root root  1034249 Aug 15 17:01 libvipsCC.so.38.0.3
-rwxr-xr-x.  1 root root     1031 Aug 15 17:01 libvips.la
lrwxrwxrwx.  1 root root       17 Aug 15 17:01 libvips.so -> libvips.so.38.0.3
lrwxrwxrwx.  1 root root       17 Aug 15 17:01 libvips.so.38 -> libvips.so.38.0.3
-rwxr-xr-x.  1 root root 11349279 Aug 15 17:01 libvips.so.38.0.3
drwxr-xr-x.  2 root root     4096 Aug 15 17:24 pkgconfig
echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin:/usr/local/lib/

echo $PKG_CONFIG_PATH
/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig
pkg-config --cflags vips
-pthread -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/libpng12

pkg-config --libs vips
-pthread -Wl,--export-dynamic -L/usr/local/lib -lvips -lz -lm -lstdc++ -lxml2 -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lrt -lpng12 -lglib-2.0  
@lovell
Copy link
Owner

lovell commented Aug 17, 2014

Hi @leemmccormick, this looks like the Redhat problem where /usr/local/lib is not included in the default list of paths for ldconfig.

A comment in the bug report suggests running the following to fix this.

echo /usr/local/lib > /etc/ld.so.conf.d/local.conf
/sbin/ldconfig

I should update the README to include information for installing libvips on RHEL-based distros.

@leemm
Copy link
Author

leemm commented Aug 17, 2014

Perfect, that's probably the only area I didn't investigate. Thanks for your help.

I agree, updating the README might be an idea. I think if I didn't have some sysadmin experience it may be difficult for others to install on anything other than Debian based distros - just a comment, not a criticism ;)

Thanks again for your help, and for the incredibly useful module.

@lovell
Copy link
Owner

lovell commented Sep 8, 2014

Adding --prefix=/usr when running configure should also prevent this problem.

./configure --prefix=/usr --enable-debug=no ...

@lovell lovell closed this as completed in ddc3f6e Sep 8, 2014
@xShirase
Copy link

Adding --prefix=/usr when running configure should also prevent this problem.

It doesn't here : Amazon Linux AMI

@lovell
Copy link
Owner

lovell commented Dec 14, 2014

Hi @xShirase, which version of Amazon Linux are you using?

The preinstall.sh script to install libvips uses --prefix=/usr but this is only tested with the latest 2014.09 release of the Amazon Linux AMI. Does this script work for you?

@xShirase
Copy link

Actually, I used the old-school ./configure --prefix = /usr,
then make && make install
I had no idea there was a preinstall script, which might have saved me some time :) I'm on the latest AMI.

In any case, the ldconfig trick worked.

Also, I must mention that installing other stuff, like Node.js with the prefix option works :)

@lovell
Copy link
Owner

lovell commented Dec 14, 2014

@xShirase glad to hear you got it working. If you have any problems with the preinstall.sh script in the future feel free to create a new issue with details - Pull Requests with fixes also accepted!

@XBDRX
Copy link

XBDRX commented Jan 28, 2015

Hi

I'm having what looks like a similar issue to the above and not sure what I'm doing wrong. Here are the steps I've taken (all from my ec2-user path).

1> $ sudo yum update
2> reboot instance from EC2 dashboard
3> $ sudo curl -s https://raw.githubusercontent.com/lovell/sharp/master/preinstall.sh | sudo bash -
4> $ npm install sharp
5> $ node server.js

[server.js located in ec2-user]
console.log ( "<<< START >>>" );

var http = require('http');
console.log ( "http = " + http );

var https = require('https');
console.log ( "https = " + https );

var sharp = require('sharp');
console.log ( "sharp = " + sharp );

I can see from the output that it found 'http' and 'https' ok, but I get the following error trying to require 'sharp'

module.js:356
Module._extensions[extension](this, filename);
^
Error: libvips.so.37: cannot open shared object file: No such file or directory
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/ec2-user/node_modules/sharp/index.js:11:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/ec2-user/server.js:8:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

I'm new to EC2 and Node so no doubt I'm just missing something fairly simple. Any suggestions?

@lovell
Copy link
Owner

lovell commented Jan 28, 2015

Hi @bedrocktv please can you open a new issue with the output from running steps 3 and 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants