Magick++: Crosscompile to Android

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
ethanhs
Posts: 5
Joined: 2016-06-26T19:39:11-07:00
Authentication code: 1151

Magick++: Crosscompile to Android

Post by ethanhs »

I'm trying to build ImageMagick, with ImageMagick++ for use in a Qt project. Most of what I am building is done through Qt creator on Windows, but since ImageMagick (and ImageMagick++) use a configure script, I am building libimagemagick on the linux subsystem, which provides an Ubuntu environment. configure is being a problem.

My command line is:

Code: Select all

./configure --host=arm-eabi CC=/ndktoolchain/bin/arm-linux-androideabi-gcc CXX=/ndktoolchain/bin/arm-linux-androideabit-g++
With the two compilers coming from generating a build environment for Android using the latest ndk tools.

However, when I run the command, I get

Code: Select all

checking for _FILE_OFFSET_BITS value needed for large files... unknown
checking for _LARGE_FILES value needed for large files... unknown
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for native large file support... configure: error: in `/home/ethanhs/ImageMagick':
configure: error: cannot run test program while cross compiling
See `config.log' for more details
What can I do to disable this check? I looked through configure and it did not appear to have anything that looked like it was running anything...
Any help would be appreciated.
ethanhs
Posts: 5
Joined: 2016-06-26T19:39:11-07:00
Authentication code: 1151

Re: Magick++: Crosscompile to Android

Post by ethanhs »

I was able to disable large files and I am now able to complete configure, now I need to figure out what config will optimize for Android, and also build it...
ethanhs
Posts: 5
Joined: 2016-06-26T19:39:11-07:00
Authentication code: 1151

Re: Magick++: Crosscompile to Android

Post by ethanhs »

It doesn't want to build Magick++, since it is cross compiling, it won't pass the tests, disabling it. Is there a way to disable this and build Magick++ wihout the tests passsing?

I should add the command line I am using is

Code: Select all

./configure --host=arm-eabi CC=/ndktoolchain/bin/arm-linux-androideabi-gcc CXX=/ndktoolchain/bin/arm-linux-androideabit-g++ --disable-largefile --without-perl --without-lzma --prefix=/home/ethanhs/Magick++ --without-xml --without-zlib --without-x --enable-static=yes --enable-shared=no
.

It still fails when I change the conditions in configure.ac to the following too :

Code: Select all

########
#
# C++ Support Tests (For Magick++)
#
########
have_magick_plus_plus='yes'
if test "$with_magick_plus_plus" = 'yes'; then
    OLIBS="$LIBS"
    LIBS=''
    AC_LANG_PUSH(C++)

    # Full set of headers used...
    # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
    # functional iomanip iosfwd iostream iterator list string strstream utility
    AC_LANG([C++])
    AC_PROG_CXX
    AX_CXX_BOOL
    AX_CXX_NAMESPACES
    AX_CXX_NAMESPACE_STD
    AC_CXX_HAVE_STD_LIBS
    AC_OPENMP([C++])
    AC_LANG_POP

    AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
    if \
        test $ax_cv_cxx_bool = 'yes' && \
        test $ax_cv_cxx_namespaces = 'yes' && \
        test $ac_cv_cxx_have_std_libs = 'yes' && \
        test $ax_cv_cxx_have_std_namespace = 'yes'; then
        have_magick_plus_plus='yes'
    else
        have_magick_plus_plus='yes'
    fi
    AC_MSG_RESULT([$have_magick_plus_plus])
    LIBS="$OLIBS"
fi
AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test 'yes' = 'yes')
drunkensapo
Posts: 23
Joined: 2013-08-14T15:40:56-07:00
Authentication code: 6789

Re: Magick++: Crosscompile to Android

Post by drunkensapo »

I was able to compile and successfully run Magic++ on Android using a custom build script found here: https://github.com/paulasiimwe/Android-ImageMagick
I'm thinking about uploading my version soon. Let me know if you are interested.
ethanhs
Posts: 5
Joined: 2016-06-26T19:39:11-07:00
Authentication code: 1151

Re: Magick++: Crosscompile to Android

Post by ethanhs »

drunkensapo wrote:I was able to compile and successfully run Magic++ on Android using a custom build script found here: https://github.com/paulasiimwe/Android-ImageMagick
I'm thinking about uploading my version soon. Let me know if you are interested.
That would be super! I found that repo, but it only built Magick, not the C++ wrapper. If you have a script that would also build the wrapper, I am very interested! :D
ethanhs
Posts: 5
Joined: 2016-06-26T19:39:11-07:00
Authentication code: 1151

Re: Magick++: Crosscompile to Android

Post by ethanhs »

drunkensapo wrote:I was able to compile and successfully run Magic++ on Android using a custom build script found here: https://github.com/paulasiimwe/Android-ImageMagick
I'm thinking about uploading my version soon. Let me know if you are interested.
drunkensapo, do you have a timeline of when you might publish your script? I would very much appreciate the script. :D
amit1411
Posts: 8
Joined: 2015-08-03T22:24:14-07:00
Authentication code: 1151

Re: Magick++: Crosscompile to Android

Post by amit1411 »

drunkensapo wrote:I was able to compile and successfully run Magic++ on Android using a custom build script found here: https://github.com/paulasiimwe/Android-ImageMagick
I'm thinking about uploading my version soon. Let me know if you are interested.
Hi drunkensapo, I would be very interested in your version, please let me know when you will publish it. Also will it allow me to use all the methods/properties of latest Imagemagick?
drunkensapo
Posts: 23
Joined: 2013-08-14T15:40:56-07:00
Authentication code: 6789

Re: Magick++: Crosscompile to Android

Post by drunkensapo »

Dear amit1411,
Sorry for the delay. I was working on another projects. As soon as I get some time I will be uploading it.
Post Reply