Midas build options and operation considerations

previous.gif CAMAC and VME access function call - Top - Midas Code and Libraries next.gif

The section covers the Building Options for customization of the DAQ system as well as the different Environment variables options for its operation.


Building Options

By default Midas is build with a minimum of pre-compiler flags. But the Makefile contains options for the user to apply customization by enabling internal options already available in the package.

Other flags are avaiable at the application level:

By default the midas applications are built for use with dynamic library libmidas.so. If static build is required the whole package can be built using the option static

make static

For development it could be useful to built individual application in static. This can be done using the USERFLAGS option such as:

rm linux/bin/mstat; make USERFLAGS=-static linux/bin/mstat

The current OS support is done through fix flag established in the general Makefile. Currently the OS supported are:

For OS_IRIX please contact Pierre. The OS_VMS is not included in the Makefile as it requires a particular makefile and since several years now the VMS support has been dropped.

OSFLAGS = -DOS_LINUX ...

Other OS supported are:


USERFLAGS

This flag can be used at the command prompt for individual application built.
make USERFLAGS=-static linux/bin/mstat


MIDAS_PREF_FLAGS

This flag is for internal global Makefile preference. Included in the OSFLAGS.
MIDAS_PREF_FLAGS  = -DYBOS_VERSION_3_3 -DEVID_TWIST


HAVE_CAMAC

This flag enable the CAMAC RPC service within the frontend code. The application mcnaf task and the web CNAF page are then enabled (default undefined).


HAVE_ROOT

This flag is used for the midas analyzer task in the case ROOT environment is required. An example of the makefile resides in examples/experiment/Makefile. This flag is enabled by the presence of a valid ROOTSYS environment variable. In the case ROOTSYS is not found the analyzer is build without ROOT support. In this later case, the application rmidas task will be missing. (See also MANA_LITE).


HAVE_HBOOK

This flag is used for examples/hbook/Makefile for building the midas analyzer task against HBOOK and PAW. In the case the HBOOK library is not found the analyzer will be is build without HBOOK support.

In this later case, this "lite" version of the analyzer without CERN library or ROOT, no histograms nor Ntuples will be generated. This allow the user to implement his/her own graphical interface. This "lite" version provides a "analyzer like" environment for monitoring tasks where results may be put back in the ODB or pushed to a secondary logging channel. This flag affect: mana.c, fal.c, analyzer.c, adccalib.c, adcsum.c from the default distribution.


SPECIFIC_OS_PRG

This flag is for internal Makefile preference. Used in particular for additional applications build based on the OS selection. In the example below mspeaker, mlxspeaker tasks and dio task are built only under OS_LINUX.
SPECIFIC_OS_PRG = $(BIN_DIR)/mlxspeaker_task $(BIN_DIR)/dio_task


INCLUDE_FTPLIB

FTP support "INCLUDE_FTPLIB" Application such as the mlogger task, lazylogger task can use the ftp channel for data transfer.


INCLUDE_ZLIB

The applications lazylogger task, mdump task can be built with zlib.a in order to gain direct access to the data files with the extension mid.gz or ybs.gz (module ybos.c). Building the application static prevent to rebuild the whole midas package. The analyzer mana has this option already enabled.
make USERFLAGS=-DINCLUDE_ZLIB linux/lib/ybos.o
make USERFLAGS=-static linux/bin/mdump


YBOS_VERSION_3_3

The default built for ybos support is version 4.0. If lower version is required include YBOS_VERSION_3_3 during compilation of the ybos.c
make USERFLAGS=-DYBOS_VERSION_3_3 linux/lib/ybos.o


DM_DUAL_THREAD

Valid only under VxWorks. This flag enable the dual thread task when running the frontend code under VxWorks. The main function calls are the dm_xxxx in midas.c (Refer to Pierre for more information).


USE_EVENT_CHANNEL

To be used in conjunction with the DM_DUAL_THREAD.


USE_INT

In mfe.c. Enable the use of interrupt mechanism. This option is so far only valid under VxWorks Operating system. (refer to Stefan or Pierre for further information).


Environment variables

Midas uses a several environment variables to facilitate the different application startup.

MIDAS_EXPTAB

This variable specify the location of the exptab file containing the predefined midas experiment. The default location is for OS_UNIX: /etc, /. For OS_WINNT: \system32, \system.

MIDAS_SERVER_HOST

This variable predefines the names of the host on which the Midas experiment shared memories are residing. It is needed when connection to a remote experiment is requested. This variable is valid for Unix as well as Windows OS.

MIDAS_EXPT_NAME

This variable predefines the name of the experiment to connect by default. It prevents the requested application to ask for the experiment name when multiple experiments are available on the host or to add the -e <expt_name> argument to the application command. This variable is valid for Unix as well as Windows OS.

MIDAS_DIR

This variable predefines the LOCAL directory path where the shared memories for the experiment are located. It supersede the host_name and the expt_name as well as the MIDAS_SERVER_HOST and MIDAS_EXPT_NAME as a given directory path can only refer to a single experiment.

MCHART_DIR

This variable is ... for later... This variable is valid only under Linux as the -D is not supported under WindowsXX

previous.gif CAMAC and VME access function call - Top - Midas Code and Libraries next.gif


Midas DOC Version 1.9.3 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Suzannah Daviel - Doxygen - Peter Green - Greg Hackman - Gertjan Hofman - Paul Knowles - Rudi Meier - Glenn Moloney - Dave Morris - Konstantin Olchanski - Renee Poutissou - Andreas Suter - Piotr Adam Zolnierczuk