How to enable HDRI support for ImageMagick in Ubuntu? - imagemagick

I have installed ImageMagick through apt-get in Ubuntu 12.04. Now I need to enable HDRI support for my ImageMagick scripts. How can I do that?

You should run
convert -list configure | grep FEATURES
If the result does not list HDRI, then you need to get a different build of ImageMagick. Your current one will not support it (it cannot be "added in" by the simple change of a local configuration setting).
Either build it yourself from sources, or ask your Ubuntu package maintainer in the most friendly way you can to provide an alternative build.
It's possibly still disabled in Ubuntu because the ImageMagick developer themselves call it an "experimental feature".

Related

Installing imagemagick using homebrew -- can't find command

I tried installing imagemagick using homebrew on a Mac. Specifically, I did:
brew install imagemagick
in terminal. There were no error messages. When I go to use imagemagick, e.g. using the command:
magick convert
I don't see the magick command available when I try to tab complete. I'm a bit uncertain how to debug this -- it seems like it should have installed fine?
As part of installing homebrew you need to set your PATH so your shell knows where the executable binaries are installed.
Depending on your homebrew version and macOS hardware and software, you may need:
export PATH=/opt/homebrew/bin:$PATH
or
export PATH=/usr/local/bin:$PATH
You can tell which of the two commands above you need with:
find {/opt/homebrew,/usr/local}/bin -name magick
Then run:
hash -r
and all homebrew commands like magick should work for your current session.
If you want the PATH set correctly for all future sessions you will need to add the export command from above to your login profile. That will depend on your shell, but is probably:
$HOME/.zprofile
or
$HOME/.profile
Note that you should read this answer to understand why you do NOT want to use magick convert.

Link hadoop installed with sdkman to brew

I installed hadoop with sdkman and now I'm trying to install Hive with homebrew but brew wants to install hadoop again because it doesn't know hadoop is already installed on my computer.
I use --ignore-dependencies flag as workaround but it's not a best practice.
Do you know how can I link my hadoop installation done with sdkman to brew?
It is not possible to use a non-Homebrew hadoop with Homebrew hive, see https://docs.brew.sh/Building-Against-Non-Homebrew-Dependencies
To improve quality and reduce variation, Homebrew now exclusively supports using the default formula, as an ordinary dependency, and no longer supports using arbitrary alternatives.
You will have to install Hive manually: https://cwiki.apache.org/confluence/display/hive/gettingstarted#GettingStarted-InstallingHivefromaStableRelease
Installing Hive from a Stable Release
Start by downloading the most recent stable release of Hive from one of the Apache download mirrors (see Hive Releases).
Next you need to unpack the tarball. This will result in the creation of a subdirectory named hive-x.y.z (where x.y.z is the release number):
$ tar -xzvf hive-x.y.z.tar.gz
Set the environment variable HIVE_HOME to point to the installation directory:
$ cd hive-x.y.z
$ export HIVE_HOME={{pwd}}
Finally, add $HIVE_HOME/bin to your PATH:
$ export PATH=$HIVE_HOME/bin:$PATH

Ubuntu Docker image with minimal mono runtime in order to run F# app

I need to build a "slim" docker image which only contains the mono runtime in order to execute a pre-compiled F# app. In other words, I want to create the leanest possible image for executing mono apps, without any of the additional stuff for compiling/building apps. I am using Ubuntu:16.04 as a my base image (which weighs at around 47MB).
If I try to install mono on top of that image (using apt-get install mono-devel), then the image grows to whopping 500MB. This of course happens because the entire mono development tools are installed.
How can I proceed to only create an image containing the mono runtime? Is there a way installing through apt-get the mono runtime?
I'm answering the question as it is stated:
How can I proceed to only create an image containing the mono runtime?
For that, the answer is yes. There is a package for just the runtime called mono-runtime. In addition to that, there is an apt option to ignore installing recommended packages (usually docs and other stuff that may not be necessary for a runtime) with --no-install-recommends. Combining the two, we can get down to around 240 MB on the Ubuntu base:
FROM ubuntu
RUN apt update && apt install -qy --no-install-recommends mono-runtime libfsharp-core4.3-cil
Also mentioned in comments, there are some more minimal images based on Alpine linux that may be of interest such as https://hub.docker.com/r/frolvlad/alpine-mono/ (which at the moment is around 200 MB).

asdf-erlang doesn't install man pages

I am using asdf + asdf-erlang as my version manager for Erlang. All seems to be working fine, except that typing erl -man mnesia results in No manual entry for mnesia.
I have installed all dependencies mentioned on the asdf-erlang github page. I have also installed xsltproc and fop. Unfortunately "man" folder located under ~/.asdf/installs/erlang/18.3/lib/erlang/erts-73/ is empty. I haven't found man pages being generated elsewhere.
I was trying to locate build log, but I was not successful with that either.
I am using 64bit Ubuntu 16.10 & 16.04.
OK. I finally managed to resolve the issue:
Go to https://www.erlang.org/downloads/ and download manpages for the version(s) of Erlang you have installed using asdf (so for 18.3 you're looking for: http://erlang.org/download/otp_doc_man_18.3.tar.gz)
Copy man folder with its content (extracted from the archive) to ~/.asdf/installs/erlang/<version>/lib/erlang/. After doing so, you should have .~/asdf/installs/erlang/<version>/lib/erlang/man containing man1, man3, man4, man6, man7 (and each of those folders should have some manpages in it).
Repeating steps above for all the versions installed using asdf, allows you to use manpages for specific version of Erlang you are using at the moment.
looks like erlang-manpages are not included in the asdf-erlang since you are using ubuntu i would suggest you add Erlang Solutions repository to your system, call the following commands:
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
then install erlang-manpages:
sudo apt-get install erlang-manpages
you could also install erlang-doc — HTML/PDF documentation
sudo apt-get install erlang-doc
check this page for more information
The man path in #MaciekTalaska 's answer seems not correct, it does not work at all, for erlang 18.3.
After reading ASDF's activate script(), here's one statement:
_KERL_MANPATH_REMOVABLE="$HOME/.asdf/installs/erlang/18.3/lib/erlang/man:$HOME/.asdf/installs/erlang/18.3/man"
Therefore, you just need to:
Go to https://www.erlang.org/downloads/ and download manpages for the version(s) of Erlang you have installed using asdf (so for 18.3 you're looking for: http://erlang.org/download/otp_doc_man_18.3.tar.gz)
Copy man folder with its content (extracted from the archive) to $HOME/.asdf/installs/erlang/${version}, but not $HOME/.asdf/installs/erlang/${version}/lib/erlang/ (in fact, there isn't a folder named erlang under lib).

Imagemagick only uses one core

I am running an Ubuntu server with 8 cores. However imagemagick always only uses 1 single core.
Running identify -version returns:
Version: ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
So OpenMP which is apparently needed for multi threading is enabled.
Running a benchmark with -bench option (e.g. convert logo: -resize 500% -bench 10 logo.png) as described here returns
Performance: 10i 1.17647ips 14.390u 0.14166666666833332977:08.500
It does not return Performance[1] through Performance[8] as described in the manual which makes me wonder.
Any ideas how I can get imagemagick to use all 8 cores?
Update: Here is the strace output from an imagemagick call: http://pastebin.com/Q0gC3k09
I was able to reproduce this behavior on Ubuntu 10.04. ImageMagick from apt-get seems to have the OpenMP feature, and configure with the -fopenmp flag, but the feature doesn't seem to be enabled. This can be verified by running the following line, and comparing the "FEATURES" list (if present) to the various configuration flags.
identify -list Configure | less
I was able to resolve this by following the article "Installing ImageMagick from Source on Ubuntu 8.04" which detailed the following process.
Remove ImageMagick
Install all the needed image/graphic dependency libraries through apt-get
Download
wget http://www.imagemagick.org/download/ImageMagick-6.8.6-6.tar.gz
Follow basic ./configure, make, & sudo make install steps
Export library path to /usr/local/lib
This seems to work as OpenMP is now present under "FEATURES" list, and when I execute convert logo: -resize 500% -bench 10 logo.png. I see the following
Performance[1]: 10i 0.750ips 1.000e 18.750u 0:13.330
Performance[2]: 10i 0.751ips 0.500e 18.660u 0:13.320
Performance[3]: 10i 0.738ips 0.496e 18.840u 0:13.550
Performance[4]: 10i 0.469ips 0.385e 19.560u 0:21.320
And these results match what I would expect.
Some tests I made on my side but I not able to setup a real or virtualized multicore machine to reproduce. So I don't come with a real solution but more with a strategy to investigate because it really seems to be system dependent.
But at least I can say that:
if you get the last ImageMagick source from http://www.imagemagick.org/script/install-source.php#unix, you should be able to rebuild IM for your system.
if you want to be sure that your compiler handle the code as expected, you can do the following before calling "make", Edit the magick/studio.h file, found the line 143, you should see the following.
#if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
# include <omp.h>
# define MAGICKCORE_OPENMP_SUPPORT 1
#endif
Modify those line to add a compiler diagnostic message:
#if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
# include <omp.h>
# define MAGICKCORE_OPENMP_SUPPORT 1
# pragma message "MAGICKCORE_OPENMP_SUPPORT 1"
#endif
Now run the './configure' and after the 'make' command, you should see the message you added every time studio.h is used and BTW MAGICKCORE_OPEN_SUPPORT macro set to 1.
MAGICKCORE_OPENMP_SUPPORT is the macro that IM use internally to enable/disable the preprocessing of the OpenMp directives, so if you see the message, all #pragma omp of the code will be process for real.
If everything is ok until now try to perform the 'make install' command and check if your 'bench' command work better (multicore) with your own version of convert (/usr/local/bin/convert)
if it's still not working, it means that it's not related to IM, but that openMP based program don't run correctly on your system. In that case you should consider the following question Why OpenMP program runs only in one thread, and check openMP support with a shorter program to build and run than IM !

Resources