Skip to content

Instantly share code, notes, and snippets.

@kei2100
Last active November 6, 2019 15:40
Show Gist options
  • Save kei2100/4688805 to your computer and use it in GitHub Desktop.
Save kei2100/4688805 to your computer and use it in GitHub Desktop.
ImageMagick and JMagick install on Mac OSX
# imagemagick
brew install imagemagick --disable-openmp
すると色々怒られるので、
sudo brew link libtiff
sudo brew link little-cms
sudo brew link jasper
sudo brew link imagemagick
sudo brew link jpeg
する
brew install imagemagick --disable-openmp
$ brew info imagemagick
imagemagick 6.7.1-1
http://www.imagemagick.org
Depends on: jpeg, libtiff, little-cms, jasper
/usr/local/Cellar/imagemagick/6.7.1-1 (1390 files, 32M)
Installed with: --disable-openmp
Some tools will complain unless the ghostscript fonts are installed to:
/usr/local/share/ghostscript/fonts
http://github.com/mxcl/homebrew/commits/master/Library/Formula/imagemagick.rb
# jmagick
wget http://downloads.jmagick.org/6.4.0/jmagick-6.4.0-src.tar.gz
tar xfz jmagick-6.4.0-src.tar.gz
mv 6.4.0 jmagick-6.4.0
cd jmagick-6.4.0
./configure --with-java-home=/System/Library/Frameworks/JavaVM.framework/Versions/Current --with-magick-home=/usr/local/Cellar/imagemagick/6.7.1-1/
make all
sudo make install
sudo ln -s /usr/local/lib/libJMagick.so /Library/Java/Extensions/libJMagick.jnilib
@sgp2004
Copy link

sgp2004 commented Aug 1, 2013

../../Make.rules:175: *** missing separator. Stop.
solution:
On line 175 and 176 of the Make.rules file, there are 4 spaces at the start of the line instead of a tab - replace the spaces with a tab and make will succeed.

@cantidio
Copy link

cantidio commented Sep 3, 2013

I've replace the 4 spaces by a tab, and with no success...
ps: I`m using the same version of the imagemagick.
Anyone know how to fix this?

Now it gives this error:

/usr/bin/javac  -d /tmp/jmagick-6.4.0/classes   \
    -sourcepath /tmp/jmagick-6.4.0/src      \
    -classpath /tmp/jmagick-6.4.0/classes:/usr/local/lib/jmagick-6.4.0.jar MagickInfo.java
make[2]: [/tmp/jmagick-6.4.0/generated//privatemagick//privatemagick_PixelPacket.h] Error 1 (ignored)
"/usr/bin/javah" -d /tmp/jmagick-6.4.0/generated//privatemagick -jni            \
    -classpath /tmp/jmagick-6.4.0/classes:/usr/local/lib/jmagick-6.4.0.jar              \
    .privatemagick.PixelPacket

javadoc: error - Illegal package name: ".privatemagick.PixelPacket"
1 error
make[2]: [/tmp/jmagick-6.4.0/generated//privatemagick//privatemagick_ImageInfo.h] Error 1 (ignored)
"/usr/bin/javah" -d /tmp/jmagick-6.4.0/generated//privatemagick -jni            \
    -classpath /tmp/jmagick-6.4.0/classes:/usr/local/lib/jmagick-6.4.0.jar              \
    .privatemagick.ImageInfo
javadoc: error - Illegal package name: ".privatemagick.ImageInfo"
1 error
make[2]: [/tmp/jmagick-6.4.0/generated//privatemagick//privatemagick_QuantizeInfo.h] Error 1 (ignored)
"/usr/bin/javah" -d /tmp/jmagick-6.4.0/generated//privatemagick -jni            \
    -classpath /tmp/jmagick-6.4.0/classes:/usr/local/lib/jmagick-6.4.0.jar              \
    .privatemagick.QuantizeInfo
javadoc: error - Illegal package name: ".privatemagick.QuantizeInfo"
1 error
make[2]: [/tmp/jmagick-6.4.0/generated//privatemagick//privatemagick_DrawInfo.h] Error 1 (ignored)
"/usr/bin/javah" -d /tmp/jmagick-6.4.0/generated//privatemagick -jni            \
    -classpath /tmp/jmagick-6.4.0/classes:/usr/local/lib/jmagick-6.4.0.jar              \
    .privatemagick.DrawInfo
javadoc: error - Illegal package name: ".privatemagick.DrawInfo"
1 error
make[2]: [/tmp/jmagick-6.4.0/generated//privatemagick//privatemagick_MagickImage.h] Error 1 (ignored)
"/usr/bin/javah" -d /tmp/jmagick-6.4.0/generated//privatemagick -jni            \
    -classpath /tmp/jmagick-6.4.0/classes:/usr/local/lib/jmagick-6.4.0.jar              \
    .privatemagick.MagickImage
javadoc: error - Illegal package name: ".privatemagick.MagickImage"
1 error
make[2]: [/tmp/jmagick-6.4.0/generated//privatemagick//privatemagick_MontageInfo.h] Error 1 (ignored)
"/usr/bin/javah" -d /tmp/jmagick-6.4.0/generated//privatemagick -jni            \
    -classpath /tmp/jmagick-6.4.0/classes:/usr/local/lib/jmagick-6.4.0.jar              \
    .privatemagick.MontageInfo
javadoc: error - Illegal package name: ".privatemagick.MontageInfo"
1 error
make[2]: [/tmp/jmagick-6.4.0/generated//privatemagick//privatemagick_Magick.h] Error 1 (ignored)
"/usr/bin/javah" -d /tmp/jmagick-6.4.0/generated//privatemagick -jni            \
    -classpath /tmp/jmagick-6.4.0/classes:/usr/local/lib/jmagick-6.4.0.jar              \
    .privatemagick.Magick
javadoc: error - Illegal package name: ".privatemagick.Magick"
1 error
make[2]: [/tmp/jmagick-6.4.0/generated//privatemagick//privatemagick_MagickInfo.h] Error 1 (ignored)
"/usr/bin/javah" -d /tmp/jmagick-6.4.0/generated//privatemagick -jni            \
    -classpath /tmp/jmagick-6.4.0/classes:/usr/local/lib/jmagick-6.4.0.jar              \
    .privatemagick.MagickInfo
javadoc: error - Illegal package name: ".privatemagick.MagickInfo"
1 error
make[2]: *** No rule to make target `/privatemagick_PixelPacket.c', needed by `.jnidep'.  Stop.
make[2]: Leaving directory `/private/tmp/jmagick-6.4.0/src/magick'
make[1]: *** [dir_target] Error 2
make[1]: Leaving directory `/private/tmp/jmagick-6.4.0/src'
make: *** [dir_target] Error 2

@marc-mcdonald
Copy link

The problem is the way the Mac implements the case insignificant file system. The file system is case insignificant by default but the way pwd is implemented is the problem. Pwd uses whatever case you typed in rather than the actual case of the directories. Connect to "/Users" as "/users" and pwd returns "/users" not "/Users"

This results in the subst() in the make.rules file failing to create a relative path (line 96) and hence the // concatenated absolute paths. The value of $(JAVA_SRC_DIR) has different case than $(CURRENT_DIR). The makefile uses pwd to set $(CURRENT_DIR).

My particular case was:
"/usr/bin/javah" -d /users/me/opensource/jmagic/6.4.0/generated//Users/me/OpenSource/JMagic/6.4.0/src/magick -jni
-classpath /users/me/opensource/jmagic/6.4.0/classes
.Users.me.OpenSource.JMagic.6.4.0.src.magick.Magick
javadoc: error - Illegal package name: ".Users.me.OpenSource.JMagic.6.4.0.src.magick.Magick"

To solve,

  • Reconnect to the JMagic directory using the correct (mixed) case matching the actual directories
  • Rerun configure
  • make all

Copy link

ghost commented Jul 18, 2018

On trying above I am getting following error

configure: error: 'Unable to find ImageMagick header files'

ImageMagick Info

brew info imagemagick
imagemagick: stable 7.0.8-6 (bottled), HEAD
Tools and libraries to manipulate images in many formats
https://www.imagemagick.org/
/usr/local/Cellar/imagemagick/7.0.8-6 (1,517 files, 23.1MB) *
Poured from bottle on 2018-07-11 at 15:20:02
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/imagemagick.rb
==> Dependencies
Build: pkg-config ✔
Required: libtool ✔, xz ✔
Recommended: jpeg ✔, libpng ✔, libtiff ✔, freetype ✔
Optional: fontconfig ✘, little-cms ✘, little-cms2 ✘, libheif ✘, libwmf ✘, librsvg ✘, liblqr ✘, openexr ✘, ghostscript ✘, webp ✘, openjpeg ✘, fftw ✘, pango ✘, perl ✘
==> Requirements
Optional: x11 ✘
==> Options

Copy link

ghost commented Jul 18, 2018

I am on the latest version of imagemagick

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