Search


DASWG LAL Doxygen

Docs

How-To's
Technical
Software Docs
Minutes

Download

Browse CVS, Git, or SVN
Software Repositories
OS Security Updates
LIGO software virtual machine
VMware SL6 Install

Participate

SCCB - Software Change Control Board
Edit these pages
Sub-committees
Mailing List
Telecon

Projects

aLIGO Planning
BAYESTAR
DMT
Glue
GraceDB
gstlal
LALSuite
LDAS
LDG Client/Server
LDM
LDR
ligoDV
LIGOtools
LIGOtools
LVAlert Administration
LVAlert
MatApps
LSCGIS
Metaio
NDS Client
OSG-LIGO
PyCBC
PyLAL
LSCSOFT VM

Legacy Projects

geopp
Onasys

LSC MATLAB Applications

Links

Setting Environment variables for MatApps use

After checking out a version of the matapps repository from CVS, it is necessary to let MATLAB know where the matapps directories are located. To do this, in csh or tcsh, there is a shell script that can be sourced in the SDE directory of matapps. To use the shell script for csh or tcsh do:

source ${MATAPPS_TOP}/SDE/matapps.cshrc ${MATAPPS_TOP}

for bash do:

source ${MATAPPS_TOP}/SDE/matapps.sh ${MATAPPS_TOP}

where ${MATAPPS_TOP} is the full path to the matapps directory. If you wish to not have to use this command repeatedly, add this line to your .cshrc file. This will add a MATAPPS_TOP and MATAPPS_SDE environment variable, as well as all of the matapps directories to your MATLABPATH. If, instead, you wish to add the matapps into your path while running in an interactive MATLAB session that did not have the MATLABPATH set, you may use:

${MATAPPS_TOP}/SDE/matapps_paths.m(${MATAPPS_TOP})

This will only add to the path for that particular session of MATLAB. Another alternative if you wish to have these paths always initialised on interactive startup (but not when running the compiler from the terminal or when using the make system!)is to add the following lines to the user's startup.m file:

verNum = str2num(version('-release'));
if(~isempty(verNum))
    verOld = verNum < 14;
else
    verOld = false;
end
if( (verOld == true) || (~isdeployed))
    ${MATAPPS_TOP}/SDE/matapps_paths.m(${MATAPPS_TOP}) 
end
clear verNum;
clear verOld;


This prevents the compiled executable from trying to use addpath, since this operation is redundant and can conflict with Release 14 and later use of expanded 'ctf' files. The tortured logic is required because as of Release 2006a, the version function returns a non-numeric string.

Adding New Directories

To add new directories to the list of matapps directories, one should edit the SDE/matapps_paths.txt file. This file is parsed by both the matapps.cshrc and matapps_paths.m to determine which files to add. This method was chosen as opposed to using the genpath function in matlab, since temporary directories (*_mcr) made by compiled MATLAB (Release 14 and later) executables in the directory that they are run from, will interfere with future compilation and need to be excluded from the MATLAB path. A more automated way of doing this would be nice, but has not been made at this time.

Using the Makefile Scheme with MATLAB Release 14 and later

After setting up your environment, and making sure that you have gone through the "how to compile MATLAB" , it is possible to use make to compile the matapps executable files. The following commands may either be used with make in individual directories to make individual executables, or, if used in the top level directory to make all the executables. Typical usage would be "make clean", etc...
cleanclean up all temporary files and MATLAB executables from the directory.
matlab_exe make all MATLAB executables.
exemake all MATLAB executables and other executables.
mexmake mexglx files.
goalsfor each item in ${GOALS} make it.
allmake mex exe docs test_exe goals;
test_execd into the test directory and make all ${TESTS} executables.
testmake test_exe and then run the tests.
docscd into documentation directory and make all ${DOCS} files (.pdf and .ps files are presumed to come from .tex files)
installcopy MATLAB executables and .ctf files to ${MATLAB_USER_BIN}. copy other executables to ${USER_BIN}
updaterecursively update all of matapps with cvs update -APdR (only in the ${MATLAB_TOP} directory)
envprintenv
pwdpwd
matlab_pathrun MATLAB and print the path within matlab.

Adding new executables to make scheme

The best bet for doing this is to copy an existing Makefile and modify it. Basically, adding

include ${MATAPPS_SDE}/default.mk

will set up the default make scheme and you will want to define the MATLAB_SRCS variable. For more advanced users, the following list of variables determine what and how things will be made:
MATLAB_SRCSlist of MATLAB files that are to be made into executables. Other MATLAB files that are called from within these files do not need to be listed.
EXECUTABLESnon-matlab executables (such as shell scripts).
MCC_USER_OPTIONSoptions to be used in the compiler (ie. '-R -nojvm -R -nojit -R -nodisplay')
DOCSlist of files to make within the documentation directory
TESTSlist of test files to make/run within the test directory
MEX_OPTIONS options for compiling mex files
MEXGLX_FILESthe main mexglx file to be made (there should be an associated .c and .m file)
MEX_C_SRCSother files to be included when making the the mexglx file
GOALSother goals for make
MATLAB_USER_BINdirectory to copy MATLAB executables and .ctf files to, when installing.
USER_BINdirectory to copy all ${EXECUTABLES} files to, when installing.
$Id: matapps_howto.html 2193 2008-10-15 04:30:42Z patrick $