Compile standalone convert for Mac OSX

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
jansuhr
Posts: 43
Joined: 2016-01-28T01:35:38-07:00
Authentication code: 1151

Compile standalone convert for Mac OSX

Post 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
jansuhr
Posts: 43
Joined: 2016-01-28T01:35:38-07:00
Authentication code: 1151

Re: Compile standalone convert for Mac OSX

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Compile standalone convert for Mac OSX

Post 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.
snibgo's IM pages: im.snibgo.com
jansuhr
Posts: 43
Joined: 2016-01-28T01:35:38-07:00
Authentication code: 1151

Re: Compile standalone convert for Mac OSX

Post 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
jansuhr
Posts: 43
Joined: 2016-01-28T01:35:38-07:00
Authentication code: 1151

Re: Compile standalone convert for Mac OSX

Post 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
utnuc
Posts: 12
Joined: 2014-09-17T06:41:13-07:00
Authentication code: 6789

Re: Compile standalone convert for Mac OSX

Post by utnuc »

Has anyone been able to crack this yet? I need convert for my app as well.
jansuhr
Posts: 43
Joined: 2016-01-28T01:35:38-07:00
Authentication code: 1151

Re: Compile standalone convert for Mac OSX

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Compile standalone convert for Mac OSX

Post 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.
jwoelper
Posts: 7
Joined: 2012-04-25T09:14:34-07:00
Authentication code: 13

Re: Compile standalone convert for Mac OSX

Post 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"
Post Reply