Page 1 of 1

Compile standalone convert for Mac OSX

Posted: 2016-08-07T00:55:00-07:00
by jansuhr
I'm making a plugin for a graphic system and need to embed ImageMagick in to it. I only need Convert and it to be able to save TIFF, JPEG, PNG and GIF.

I found the Convert for Windows that worked perfectly but I need the same standalone executable for Mac.

I've seen that it needs to be compiled but how do I set it up to do this? Or is there any available somewhere to download?

Thanks


Jan

Re: Compile standalone convert for Mac OSX

Posted: 2016-08-08T03:58:45-07:00
by jansuhr
I have tried to compile a standalone Convert but ending up with this error:
checking whether the C compiler works... no
configure: error: in `/Users/xxxxx/Desktop/ImageMagick-7.0.2-6':
configure: error: C compiler cannot create executables
I have done this after this post: viewtopic.php?f=1&t=13145&start=15#p123535

In the log I find this:
configure:5118: checking for C compiler version
configure:5127: gcc --version >&5
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
configure:5138: $? = 0
configure:5127: gcc -v >&5
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
configure:5138: $? = 0
configure:5127: gcc -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:5138: $? = 1
configure:5127: gcc -qversion >&5
clang: error: unknown argument: '-qversion'
clang: error: no input files
configure:5138: $? = 1
configure:5158: checking whether the C compiler works
configure:5180: gcc -l/libTIFF/include -L/libTIFF/lib conftest.c >&5
ld: library not found for -l/libTIFF/include
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:5184: $? = 1
configure:5222: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "ImageMagick"
| #define PACKAGE_TARNAME "ImageMagick"
| #define PACKAGE_VERSION "7.0.2-6"
| #define PACKAGE_STRING "ImageMagick 7.0.2-6"
| #define PACKAGE_BUGREPORT "https://github.com/ImageMagick/ImageMagick/issues"
| #define PACKAGE_URL "http://www.imagemagick.org"
| #define PACKAGE "ImageMagick"
| #define VERSION "7.0.2-6"
| #define MAGICK_TARGET_CPU x86_64
| #define MAGICK_TARGET_VENDOR apple
| #define MAGICK_TARGET_OS darwin14.5.0
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:5227: error: in `/Users/jannes/Desktop/ImageMagick-7.0.2-6':
configure:5229: error: C compiler cannot create executables
See `config.log' for more details
Appreciate any help.

Thanks

Jan

Re: Compile standalone convert for Mac OSX

Posted: 2016-08-08T06:50:40-07:00
by snibgo
jansuhr wrote:configure:5180: gcc -l/libTIFF/include -L/libTIFF/lib conftest.c >&5
ld: library not found for -l/libTIFF/include
Perhaps the problem is a missing libTIFF library.

Re: Compile standalone convert for Mac OSX

Posted: 2016-08-08T09:00:31-07:00
by jansuhr
Yes there is a problem with that. The folder "libTIFF/include" is there and also "libTIFF/lib" but the file "contest.c" isn't. The libTIFF is created with this command: ./configure --enable-static --disable-shared --prefix=/libTIFF

If I remove the libTIFF stuff from the command it starts working but ends with another error: cannot compute sizeof (long double)


Jan

Re: Compile standalone convert for Mac OSX

Posted: 2016-08-08T10:32:22-07:00
by jansuhr
If I run the compiler with this line it do compile, ./configure --enable-delegate-build --enable-static --disable-shared --disable-installed --prefix=/imagick and I get a full ImageMagick installation with a lot of files and folders.

How do I get it to compile just standalone executables like it is in the Windows version available here: http://www.imagemagick.org/download/bin ... 16-x86.zip

Re: Compile standalone convert for Mac OSX

Posted: 2016-09-02T12:36:54-07:00
by utnuc
Has anyone been able to crack this yet? I need convert for my app as well.

Re: Compile standalone convert for Mac OSX

Posted: 2016-10-20T06:55:08-07:00
by jansuhr
I have a programmer that will try to solve this but he is very busy and can't take it on until a month or so.

Jan

Re: Compile standalone convert for Mac OSX

Posted: 2016-10-20T10:17:05-07:00
by fmw42
Have you searched the Users and Developers forum to see if anyone has posted a method to compile for Mac as standalone. This question has been asked before. Sorry I do not know the answer.

Re: Compile standalone convert for Mac OSX

Posted: 2016-10-27T08:05:42-07:00
by jwoelper
I have done some research here:
http://blog.schdbr.de/imagemagic-osx-st ... ble-build/

TL;DR: Use homebrew,
brew edit imagemagick
in def install:
--disable-shared to disallow shared libs
brew install imagemagick --without-modules --with-zero-configuration

gave me what I wanted (including freetype)
Delegates (built-in): bzlib freetype jng jpeg lzma png tiff xml zlib

Pro tip: Mac Photoshop comes with a static convert included (Those sneaky guys):
"/Applications/Adobe Photoshop CC 2015/Adobe Photoshop CC 2015.app/Contents/MacOS/convert"