Munipack's logo

Munipack

An astronomical image processing software

📘
Guide
📁
Documents

Building of Munipack from source code

Building Munipack from a source code

This is a canonical way to install of Munipack on any unix-like platform. A packaging system is unused.

As prerequisite, it is supposed to run commands introduced by # as root

# id
uid=0(root) ..

and ones denoted by $ as an ordinary user:

$ id
uid=12345(user) ...

Summary

There is a short summary of installation steps which will install latest stable release (replace X.Y by an appropriate number) of Munipack to a system:

$ cd /usr/src
$ wget https://integral.physics.muni.cz/ftp/munipack/munipack-0.X.Y.tar.gz
$ tar zxf munipack-0.X.Y.tar.gz
$ cd munipack-0.X.Y
$ ./configure
$ make
# make install

More detailed description is below.

Source building

Introduction

This page describes how to build Munipack from source codes. The source code distribution is the most portable way how to get Munipack. Some experience with a software building is required.

The building takes phases:

At the moment, Munipack can be clearly compiled under GNU/Linux, g++, gfortran and wxWidgets ver. 3.0.0 (and above) only.

Other combinations compilers, operating systems, etc. should require some additional tuning. Munipack is designed pretty much portable and multi-platform (Mac OS X, MS Windows) but every platform should need some fine tuning.

Download

There are two ways how to get sources of Munipack. Source tarball offers more reliable way opposite to Mercurial's way on base of the cutting edge code.

The preferred path for placing sources is /usr/src, for example /usr/src/munipack-0.6.X. The path is available only for system administrator. If you haven't root privileges, use src (for example) directory in your home $HOME/src

$ mkdir $HOME/src

and replace all references /usr/src to $HOME/src in following text.

Tarball

The tarball contains the stable branch (a relative stable and updated) version of Munipack.

Download: https://integral.physics.muni.cz/ftp/munipack/

To get source tree, download archive and unpack the tarball as:

# cd /usr/src
# wget https://integral.physics.muni.cz/ftp/munipack/munipack-0.6.X.tar.gz
# gzip -dc munipack-0.6.XXX.tar.gz | tar -xf -

Mercurial

Sources stored in Mercurial repository contains the development branch. The branch contains latest development files which can be unstable, buggy, etc.

To get source tree, follow instructions for Mercurial or try:

# cd /usr/src
# hg clone https://integral.physics.muni.cz/hg/munipack munipack-Z.Y.X/

Prerequisites

Following tools are required for compiling of Munipack:

All libraries must be installed in the development version. Common package systems contains development libraries as -dev (-devel) packages.

The requirement for 3+ version of wxWidgets is mainly due to support of the event handling system for command-line applications. The instructions for wxWidgets installation can be found on wiki: http://wiki.wxwidgets.org/Prerequisites.

Minpack needs Fortran 77 compiler (a backward-compatibility provided by modern Fortran compilers).

PLPlot is necessary for advanced plotting. The default driver is Cairo which provides high quality graphs having anti-aliasing or alpha transparency. If the driver is unsuitable, user is prompted; an alternative driver can be selected in xmunipack/plplot.cpp.

Autoconfig is required for bootstrap (the configure script generation) when source is downloaded via Mercurial version system.

Initialisation

Required only in case of Mercurial's source tree.

Initialisation requires:

Munipack building is on base of Autotools which is most widely portable way working under common computer systems. The initialisation of building framework is required.

The building is controlled by configure.ac (top) and set of Makefile.am-s (all building directories).

This phase creates configure.ac and auxiliary files:

$ ./bootstrap --dev

Next step is to activate Autotools, and to make Makefiles by processing of the control files:

$ autoreconf -i

Configure and install

The initialised source is ready for compilation. This can be done quite easy on Linux based distributions, same as other Unix's systems. The configuration, compilation and installation is provided by the standard GNU way. Simply, run the following sequence of commands:

$ ./configure
$ make
$ make install

Munipack will check available tools and will be installed by default under tree /usr/local.

The phase will work under any supported system. C++ and Fortran compilers and appropriate development libraries needs to be installed, of course.

There is limited possibility to fit the installation according to your needs. Running of the command

./configure --help

will display possible switches to fine tuning of building.

The recommended setup of flags is:

./configure FCFLAGS="-O2 -ffpe-summary=invalid,zero,overflow" \
            CFLAGS="-O2 -DNDEBUG" CXXFLAGS="-O2 -DNDEBUG"

Certain setting of the environment variables affects of the compilation process. For example, more progressive optimisation of the output code for 32-bit machines (64-bit machines are optimised on the level by default) and GNU compilers (g++, gfortran) is provided by FCFLAGS and CFLAGS variables

$ ./configure CXXFLAGS="-march=i686 -O2" FCFLAGS="-march=i686 -O2"

The installation under FreeBSD would work with parameters:

csh:> ./configure LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include

The installation under Fedora/RHEL will require

./configure CXXFLAGS=-I/usr/include/cfitsio

On finish, the configure command will print some summary:

Configured Munipack:

                      Virtual Observatory support enabled: yes
                           Command line interface enabled: yes
                         Graphical User Interface enabled: yes

When the configure script had found successfully wxWidgets library, the first and second options will be set to yes. Note that both command line and graphical interfaces requires wxWidgets. Without wxWidgets, only processing engines are compiled. Engine utilities has no user interfaces and any communication is released only via standard input and output (which can be very useful for daemons, web interfaces, etc.).

Alternatives for configure

There are some alternative ways to fit a uncommon requirements:

Use of all the options (--disable-[gui|cli|vo]) together does to eliminate completely dependency on both wxWidgets and PLPlot. cFITSIO, Oak Leaf and Minpack libraries are necessary in any case.

Un-Installation

Use commands

# cd /usr/src/munipack-0.6.X
# make uninstall

in the installation directory to uninstall Munipack.

This implying that it is not a good idea to remove the source directory immediately after installation (the reason to use /usr/src or an equivalent path).

Known issues

Failed compilation when run make with -j flag

The compilation might fail when you run make with parallel build enabled (by -j switch or via MAKEFLAGS). Workaround: run make as many as needed or unset the -j option. One usually appears when compiler is looking for Fortran modules.