Sharp: libMagickCore.so.5 and libcfitsio.so.3 missing on upgrade to Ubuntu 15.04

Created on 14 May 2015  ·  19Comments  ·  Source: lovell/sharp

When trying to use sharp on Ubuntu 15.04, I get errors about the absence of libMagickCore.so.5 and libcfitsio.so.3 (maybe because libmagickcore5 isn't available in 15.04?)

Anyway, I was only able to get it working by linking to the libraries like so:

cd /usr/lib/x86_64-linux-gnu
sudo ln -sf libMagickCore-6.Q16.so libMagickCore.so.5
sudo ln -sf libcfitsio.so libcfitsio.so.3
question

All 19 comments

Hi Brian, are you using the pre-packaged libvips-dev? Is this on a fresh or upgraded OS install?

@lovell I'm using Ubuntu's libvips-dev - this system was upgraded from 14.10, though, so may be an upgrade issue...

Perhaps try sudo apt-get install --reinstall libvips-dev

In Vivid, libvips-dev depends on libmagickcore-dev, which depends on libmagickcore-6.q16-dev so it should "just work".

Perhaps there was a conflict/problem upgrading from Utopic's libmagickcore5 to Vivid's libmagickcore-6?

@bdunnette Were you able to make any progress with this problem without resorting to soft links?

@lovell Unfortunately, no - I tried sudo apt-get install --reinstall libvips-dev, but that still results in the following error when sharp is loaded:

Error: libMagickCore.so.5: cannot open shared object file: No such file or directory

Thanks for the update Brian. I've just tried sudo apt-get install libgsf-1-dev libvips-dev on a fresh 15.04 VM and everything worked OK, so this is almost certainly an upgrade thing.

I'll leave this open for now to see if others reporting the same thing have any better suggestions.

I did an upgrade from 14.x to 15.04 and:

sudo apt-get install --reinstall libvips-dev
sudo apt-get install libgsf-1-dev libvips-dev

did not resolve the issue.

the sym links did work:

cd /usr/lib/x86_64-linux-gnu
sudo ln -sf libMagickCore-6.Q16.so libMagickCore.so.5
sudo ln -sf libcfitsio.so libcfitsio.so.3

I tried symlinking but still no luck https://github.com/lovell/sharp/issues/252

seeing these errors

/usr/bin/ld: cannot find -lMagickWand
/usr/bin/ld: cannot find -lMagickCore

@binarykitchen If you've not already done so, you may need to run sudo ldconfig after creating the symlinks.

Ok, ran sudo ldconfig but no difference. Still seeing the same error :(

Maybe a naming issue?

$ pkg-config --libs MagickWand
-lMagickWand-6.Q16 -lMagickCore-6.Q16 

but doesn't show -lMagickWand

Here more data

$ vips -v                                                                                 
vips-7.42.0-Thu Nov 27 00:00:33 NZDT 2014
$ pkg-config --print-provides vips                                                              
vips = 7.42.0

I think the g++ command uses a wrong parameter:

g++ -shared -pthread -rdynamic -m64 -Wl,-soname=sharp.node -o Release/obj.target/sharp.node -Wl,--start-group Release/obj.target/sharp/src/common.o Release/obj.target/sharp/src/metadata.o Release/obj.target/sharp/src/operations.o Release/obj.target/sharp/src/pipeline.o Release/obj.target/sharp/src/sharp.o Release/obj.target/sharp/src/utilities.o -Wl,--end-group -L/usr/local/lib -L/usr/lib -L/usr/lib/x86_64-linux-gnu/hdf5/serial/lib -lvips -lMagickWand -lMagickCore -lpng12 -ltiff -lz -ljpeg -Wl,--export-dynamic -lgmodule-2.0 -pthread -lxml2 -lgobject-2.0 -lglib-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -llcms2 -lIlmImf -lz -pthread -lImath -lHalf -lIex -lIlmThread -lopenslide -lcfitsio -lpthread -lwebp -lmatio -lhdf5 -lz -lexif -lm -lstdc++ -lxml2 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lMagickWand-6.Q16 -lMagickCore-6.Q16 -llcms2 -lIlmImf -lz -pthread -lImath -lHalf -lIex -lIlmThread -lopenslide -lmatio -lhdf5 -lz -lcfitsio -lpthread -lwebp -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -ltiff -lpng12 -lexif

it is using -lMagickWand -lMagickCore but should be -lMagickWand-6.Q16 -lMagickCore-6.Q16 I guess?

i managed it to crack that problem myself with this:

# michael-heuberger at M1 in ~/binarykitchen/code/videomail.io on git:staging x [18:16:18]
$ echo $PKG_CONFIG_PATH                                                                                                                                     staging 


# michael-heuberger at M1 in ~/binarykitchen/code/videomail.io on git:staging x [18:16:20]
$ locate Wand.pc                                                                                                                                            staging 
/usr/lib/x86_64-linux-gnu/pkgconfig/MagickWand.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/Wand.pc

# michael-heuberger at M1 in ~/binarykitchen/code/videomail.io on git:staging x [18:16:26]
$ export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/                                                                                               staging 

# michael-heuberger at M1 in ~/binarykitchen/code/videomail.io on git:staging x [18:17:42]
$ echo $PKG_CONFIG_PATH                                                                                                                                     staging 
/usr/lib/x86_64-linux-gnu/pkgconfig/

# michael-heuberger at M1 in ~/binarykitchen/code/videomail.io on git:staging x [18:17:45]
$ npm i                                                                                                                                                     staging 
\
> [email protected] install /home/michael-heuberger/binarykitchen/code/videomail.io/node_modules/sharp
> node-gyp rebuild

make: Entering directory '/home/michael-heuberger/binarykitchen/code/videomail.io/node_modules/sharp/build'
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/operations.o
  CXX(target) Release/obj.target/sharp/src/pipeline.o
  CXX(target) Release/obj.target/sharp/src/sharp.o
  CXX(target) Release/obj.target/sharp/src/utilities.o
  SOLINK_MODULE(target) Release/obj.target/sharp.node
  COPY Release/sharp.node
make: Leaving directory '/home/michael-heuberger/binarykitchen/code/videomail.io/node_modules/sharp/build'
[email protected] node_modules/sharp
├── [email protected]
├── [email protected]
└── [email protected] ([email protected], [email protected])

there is definitely a mess with the pkg configuration ...

@binarykitchen Glad to hear you got it working. Hopefully your comments will help others in the same situation.

A clean Ubuntu 15.04 install works so this is mostly an Ubuntu 14 to 15 package upgrade problem. As you suggest it looks like out of sync pkg-config and libMagickCore paths, but different machines seem to exhibit slightly different problems.

yeah, fixing $PKG_CONFIG_PATH was the solution.

Closing this question as there have been no further reports. Feel free to re-open should anyone have a better solution. Thanks everyone for your help and comments.

I've been hassling with same problem after updating to Ubuntu 15.04 for couple of days. Tried everything from here and also other places, including the $PKG_CONFIG_PATH. However, mine got fixed through symbolic linking (libMagickCore-6.Q16.so to libMagickCore.so.5). Thanks a lot! @bdunnette

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vermin1337 picture vermin1337  ·  3Comments

zhump picture zhump  ·  3Comments

AVVS picture AVVS  ·  3Comments

genifycom picture genifycom  ·  3Comments

natural-law picture natural-law  ·  3Comments