Install GraphicsMagick in Ubuntu 14.04

Source: Internet
Author: User

Install GraphicsMagick in Ubuntu 14.04

Note: If you need to use torch and GraphicsMagick and read jpg images, you 'd better install libjpeg first, then install GraphicsMagick, and then install torch.

Because GraphicsMagick called jpeg just now, but a module in torch prompts that libjpeg cannot be found. so library, and then you can only force uninstall the image package: luarocks CKS remove image -- force, and then re-luarocks install image. Then it will be normal...

Ubuntu can really drive people crazy... Previously, GraphicsMagick was installed on ubuntu16. It seems that there is no problem. There is no error in directly using require 'graphicsmagick' in torch. However, after installing graphicsmagick on ubuntu14, the following message is displayed:

/Home/xxx/torch/install/share/lua/5.1/trepl/init. lua: 384:/home/xxx/torch/install/share/lua/5.1/trepl/inti. lua: 384 :... /Xx/torch/install/share/lua/5.1/graphicsmagick/Image. lua: 322: libGraphicsMagickWand. so: cannot open shared object file: No such file or directory.

For example:

Note: This is the command in lua. After installing torch and https://github.com/clementfarabet/graphicsmagick, run the command. Install graphicsmagick of torch and use luarocks directly.

Then I searched on the internet... Well, it's been a long time and finally solved. However, this method does not apply to other people who encounter this problem.

To install GraphicsMagick, follow these steps:

1. Go to the official website to download GraphicsMagick: http://www.graphicsmagick.org/

2. decompress the package and add the cd to the folder.

3. Run the following command:

./configure '--with-magick=wand/GraphicsMagickWand-config' '--enable-shared'

Note: The first with is to generate libGraphicsMagickWand. so (this may not be generated by default, but this library is not seen in lib). The second with is to generate a shared library (it may be static by default. I didn't use the second one at first, the database suffix is. a)

4. Run the following command:

makesudo make install

5. After that, the system prompts that libGraphicsMagickW. so.3 cannot be found, and then continues searching online. URL: http://comments.gmane.org/gmane.comp.video.graphicsmagick.core/514nguyen Vu Hung provides the solution:

Try to run the following commands on the terminal:

sudo echo “/usr/local/lib”sudo /sbin/ldconfig

As follows:

Well, I don't know what these commands mean, and I didn't search for them. The second name is even more unclear about whether it is typed or how it is obtained. The prompt is that the permission is insufficient. Then I typed the third command. Then there will be no more.

6. Knock on gm in the terminal and install it successfully, as shown below:

 

Note: I don't remember how I succeeded in starting ubuntu16. I did not remember it at the time. It can also be installed automatically. Search for the command online, but I don't seem to have installed it automatically.

Update:

I went to ubuntu16 and looked at it. the/usr/local/lib does not contain libGraphicsMagickWand. so, for example:

However, if require 'graphicsmagick' is directly used in th, there is no error, for example:

Cannot understand.

Update 160714: Use graphicsmagick's Image to load a jpg Image. The following prompt is displayed:

No decode delegate for this image format

The jpg decoding package is not installed. So download iis9. After installation, reinstall graphicsmagick. The following message is displayed:

Wrong JPEG library version: library is 80, caller expects 90

Go to the ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/delegates/ (this Web site does not know whether the content is more or the speed of the slag or what is going on, in the win system, open the inside nothing... In ubuntudownload, you can download the corresponding src.v6b.tar.gz file, install graphicsmagick, and load the jpg image normally.

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.