User Tools

Site Tools


programming:cross-compilation_of_artimagen_and_gaig_for_windows_under_debian_linux

Cross-Compilation of Artimagen and gAIG for Windows under Debian Linux

For details about ARTIMAGEN and gAIG see ARTIMAGEN homepage.

Windows users are not generally willing to compile things. However, the may still be interested in using the software. For this reason, it is worth to compile a binary Windows version of artimagen (a .DLL) and gAIG (.EXE).

Installation of Cross Compiler

The task does not seem trivial; especially, when one does not have Windows installed. Therefore, everything needed will be cross-compiled using the MinGW compiler. However, in Debian, the installation of the cross compiler is easy:

apt-get install mingw32

Installation of Dependencies

The Artimagen library depends on two other libraries: libfftw3, and libtiff. If Lua-scripting functionality is desired, liblua5.1 is also required. All libraries must be cross-compiled. libfftw33 and libtiff libraries use Linux-standard autotools, so both of them may be compiled using the following command sequence:

./configure --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc --enable-shared
make && sudo make install

This installs the libraries into the /usr/i586-mingw32msvc directory, where all mingw-related binaries and libraries are located. Then, the same procedure is repeated to install the Artimagen library as well.

To compile Lua, dowlnoad the library from http://www.lua.org/ftp/.

To cross-compile it for Windows, you need to apply the following patch:

lua-5.1.4_mingw32.patch
--- lua-5.1.4/Makefile  2008-08-11 20:40:48.000000000 -0400
+++ lua-5.1.4.new/Makefile      2010-08-04 11:50:58.000000000 -0400
@@ -9,7 +9,7 @@
 
 # Where to install. The installation starts in the src and doc directories,
 # so take care if INSTALL_TOP is not an absolute path.
-INSTALL_TOP= /usr/local
+INSTALL_TOP= /usr/i586-mingw32msvc
 INSTALL_BIN= $(INSTALL_TOP)/bin
 INSTALL_INC= $(INSTALL_TOP)/include
 INSTALL_LIB= $(INSTALL_TOP)/lib
diff -dru lua-5.1.4/src/Makefile lua-5.1.4.new/src/Makefile
--- lua-5.1.4/src/Makefile      2008-01-19 14:37:58.000000000 -0500
+++ lua-5.1.4.new/src/Makefile  2010-08-04 11:49:45.000000000 -0400
@@ -7,10 +7,10 @@
 # Your platform. See PLATS for possible values.
 PLAT= none
 
-CC= gcc
+CC= i586-mingw32msvc-gcc
 CFLAGS= -O2 -Wall $(MYCFLAGS)
-AR= ar rcu
-RANLIB= ranlib
+AR= i586-mingw32msvc-ar rcu
+RANLIB= i586-mingw32msvc-ranlib
 RM= rm -f
 LIBS= -lm $(MYLIBS)
 

Then in the unpacked Lua-source directory, invoke

patch -p1 < lua-5.1.4_mingw32.patch
make mingw
sudo make install

Compilation of ARTIMAGEN

ARTIMAGEN now uses CMake to build Makefiles. To install it, invoke

apt-get install cmake

The ARTIMAGEN installation procedure follows:

mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=/usr/i586-mingw32msvc ..
make && sudo make install

Installation of wxWidgets library

Now, a bit more complicated procedure applies to the wxWidgets library. The difference is in the configuration parameters. I use the following:

./configure --build= --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc --enable-shared --enable-monolithic
make && sudo make install

Compilation and Packaging gAIG

This is enough to compile gAIG and make a distribution .zip archive:

./configure --host=i586-mingw32msvc --with-wx-config=/usr/i586-mingw32msvc/bin/wx-config
make
mkdir build
cp src/gaig.exe build/
cp /usr/i586-mingw32msvc/bin/{libartimagen-0.dll,libfftw*.dll,libtiff*.dll,libtiffxx*.dll} build/
cp /usr/i586-mingw32msvc/lib/wx*_gcc_custom.dll build/
zcat /usr/share/doc/mingw32-runtime/mingwm10.dll.gz > build/mingwm10.dll
cd build; zip ../gaig-0.XrcX_win32.zip *

Early version og gAIG running under Windows

programming/cross-compilation_of_artimagen_and_gaig_for_windows_under_debian_linux.txt · Last modified: 2017/05/16 11:10 (external edit)