Page 1 of 1

Installing IM from source on OSX

Posted: 2016-02-03T19:45:34-07:00
by fmw42
This is a repeat of a previous note that I made quite some time ago about how I install IM from source on Mac OSX using delegates installed from MacPorts.

This is my original post:

I first install all my delegate libraries via MacPorts. Then rather than waiting for macports to create a version of IM, I install IM from source code available at http://www.imagemagick.org/download/. I modify the normal install instructions for the ./configure command from http://www.imagemagick.org/download/www ... .html#unix and customize it using certain options from http://www.imagemagick.org/script/advan ... #configure. See also http://www.imagemagick.org/script/advan ... php#macosx

so I do

./configure ....
make
sudo make install

My ./configure command is:

./configure CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' \
--enable-delegate-build --enable-shared --disable-static \
--with-modules --with-quantum-depth=16 --with-gslib --without-wmf \
--disable-silent-rules --disable-dependency-tracking \
--with-gs-font-dir=/opt/local/share/ghostscript/fonts/

The first two options in blue are the ones that link IM installed at /user/local/bin to my delegates installed by MacPorts at /opt/local/bin

Re: Installing IM from source on OSX

Posted: 2016-02-03T19:46:17-07:00
by fmw42
This is my update:

Recently, I tried to install IM on a MacPro OSX El Capitan. The install worked fine as above, except that OpenMP was not enabled.

Apparently, last May (2015), Apple changed their compilers on their OSX releases.

With help from Magick, we were able to make the install work to enable OpenMP. The compilers that are needed are at:

/opt/local/bin/gcc-mp-5
/opt/local/bin/g++-mp-5

I suspect these came with an install of gcc5 from MacPorts, but cannot say for sure. They are not from the Apple OSX install.

So the following is what I used for my ./configure command that worked:

Code: Select all

./configure CC='/opt/local/bin/gcc-mp-5' CXX='/opt/local/bin/g++-mp-5'  \
 CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' \
  --enable-delegate-build --enable-shared --disable-static \
  --with-modules --with-quantum-depth=16 --enable-hdri --with-gslib \
  --disable-silent-rules --disable-dependency-tracking --with-rsvg \
  --with-gs-font-dir=/opt/local/share/ghostscript/fonts/
Hope this is helpful to anyone else trying to install from source.

Re: Installing IM from source on OSX

Posted: 2017-04-26T10:48:16-07:00
by fmw42
I had the same issue with OSX Sierra on my Mac mini. But to get that to compile IM from source, I had to install the Macports port clang-9 (suggested by Ken Cunningham on the MacPorts mailing list).

The following is my ./configure command that worked.

Code: Select all

./configure CC=/opt/local/bin/clang-mp-3.9 CXX=/opt/local/bin/clang++-mp-3.9 \
CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' \
--enable-openmp --with-quantum-depth=16 \
--enable-delegate-build --enable-shared --disable-static \
--with-modules --without-wmf --with-rsvg --with-lqr  \
--disable-silent-rules --disable-dependency-tracking \
--with-gslib --with-gs-font-dir=/opt/local/share/ghostscript/fonts/

Re: Installing IM from source on OSX

Posted: 2019-04-01T07:17:06-07:00
by stonesteps
Mahalo for all the helpful responses.

Re: Installing IM from source on OSX

Posted: 2019-04-01T12:09:01-07:00
by stonesteps
Aloha. I followed your advice and install MacPorts and managed to build IM with gcc-mp-5. In order to use --enable-modules I also had to load libtool.

The only problem I seem to still have is that the PNG delegate is not being recognized despite the fact that I installed it with macports. I'll try uninstalling and re-installing.

Re: Installing IM from source on OSX

Posted: 2019-04-01T12:19:38-07:00
by stonesteps
Update:
I deleted libpng and re-installed with no improvement. Here's the excerpt from the configure console:

-------------------------------------------------------------
checking for libpng >= 1.0.0... no

Any suggestions welcome.

Re: Installing IM from source on OSX

Posted: 2019-04-01T13:10:49-07:00
by stonesteps
Update:

I used MacPorts to install IM 6.9 and then re-ran the IM7 build and it found libpng and added all of the other delegates. So this case is closed although I would still like to know why libpng was not being detected.

Re: Installing IM from source on OSX

Posted: 2019-04-01T15:11:37-07:00
by fmw42
I do not understand your question.

Frist IM 6.9 from MacPorts is not the same as IM 7 and doing it that way may not install all the correct delegated for IM 7. You should use MacPorts to install all needed delegates, then install IM 7 from source.

I do not understand the issue about libpng