Skip to content

03 – Aruspix Command line

Laurent Pugin edited this page Jan 8, 2015 · 6 revisions

This section outlines the steps involved in compiling the Command-line version of Aruspix. The library dependencies are identical as to the ones for the GUI version, with the exception of wxWidgets for which only the wxbase module is necessary. Also, the Command-line version can be built for 64-bits architectures.

Mac OS X

wxWidgets Library (base)

  • Create one directory within the wxWidgets directory: osx-static-base
  • In the osx-static-base directory run the following commands:

Configure command:

cd osx-static-base
../configure LDFLAGS="-arch i386" OBJCFLAGS="-arch i386" OBJCXXFLAGS="-arch i386" CFLAGS="-arch i386" CXXFLAGS="-arch i386" CPPFLAGS="-arch i386" --disable-shared --with-libjpeg=builtin --with-libpng=builtin --disable-universal-binary --enable-debug --disable-gui --disable-unicode
make clean (if necessary)
make

Compilation of with XCode

For compiling the Command-line tool with XCode, you need to set the environment variables as for the GUI version. The values can refer to the GUI version ones of to other values if necessary. From OS X 10.9, they have to be set in the /etc/launchd.conf.

Example:

setenv ARUSPIX_WX_VERSION_CL 3.0
# setenv ARUSPIX_WX_CL ARUSPIX_WX
setenv ARUSPIX_WX_CL /Path/to/libs/wx3.0.1
# setenv ARUSPIX_IMLIB_CL ARUSPIX_IMLIB 
setenv ARUSPIX_IMLIB_CL /Path/to/libs/imlib3.6_10.6
# setenv ARUSPIX_TORCH_CL ARUSPIX_TORCH
setenv ARUSPIX_TORCH_CL /Path/to/libs/Torch3_10.6 

After the modification of the /etc/launchd.conf file, you need to restart your machine. Then open aruspix/osx/aruspix.xcodeproj with Xcode and select the aruspix-cmdline scheme. Aruspix should be ready to be compiled in both Debug and Release mode.

Compilation with CMake

With CMake on OS X, you need to specify the paths to the libraries using -D parameters.

Run:

cd cmd-line
cmake . -DwxDir=/Path/to/libs/wx3.0.1/osx-static-base -DimDir=/Path/to/libs/imlib3.6_10.6 -DtorchDir=/Path/to/libs/Torch3_10.6
make

Linux Set Up

This was tested on Ubuntu 12.04 (32-bits) and 14.10 (64-bits).

IM Lib (3.6)

IM Lib is available from http://www.tecgraf.puc-rio.br/im/. The version currently used (3.6) is available from SourceForge. Only version 3.6 will work for now.

Make sure the that the library (pre-compiled or built from sources) has the following sturcture:

\imlib
	\include : should contain all include files
	\lib : should contain all library files (libim.*, libim_process.* and libim_fftw.*)

Note: the LUA modules are not required and

Torch 3

For 64-bits machines, an updated version of Torch 3 is required. It is available from here. The original version of Torch 3 is available from http://torch.ch/torch3/downloads.html. For building the library, you also need xmake (http://www.backplane.com/xmake/).

The a sample configuration file is available here. The file needs to be copied in the root of the library directory and renamed according to the platform on which the library is being build (uname -s). That is, on Makefile_options_Linux on Ubuntu or Makefile_options_Darwin on MacOS X. Then run:

make depend
make

Make sure the that the library (pre-compiled or built from sources) has a file structure that matches the following example:

\torch
	\include : should contain all include files
	\lib : should contain all library files (libim.a, libim_process.a and libim_fftw.a)

the \include directory is not by default in the Torch3 source package. You might need to run:

mkdir include
cp */*.h include

wxWidgets

Because Aruspix is not a Unicode application, wxWidgets cannot be installed using apt-get and needs to be compiled. It is available from SourceForge.

Configure command:

mkdir cmd-build
cd cmd-build
../configure --disable-unicode --disable-shared --disable-gui
make
sudo make install

Other dependencies

Aside from the typical development utilities, a few additional libraries might have to be installed

sudo apt-get install libxml2-dev libuuid-dev uuid-dev

For building the Command-line version on Linux, you have to run:

cd cmd-line
cmake . -DwxDir=/usr/local/bin -DimDir=/path/to/imlib -DtorchDir=/path/to/torch
make

Using the Command-line version

The Command-line version simply takes a TIFF image as input and generates an Aruspix file with the recognition content. Using the sample image sample/test.tiff in ./cmd-line, you can run:

./aruspix-cmdline sample/test.tiff

This should generate a sample/test.axz Aruspix recognition file. The file can be edited using the Aruspix GUI version. It is also possible to extract its content for other uses. Since Aruspix files are ZIP archives, you need to run:

cd sample
unzip test.axz page.mei

This will extract the MEI file for the page.