This HTML automatically generated with rman for NEMO
Table of Contents

Name

mknemo - install NEMO (and related) libraries and programs

Synopsis

mknemo [options] program(s)

Description

mknemo was initially designed to quickly compile a NEMO program without the need to know where it is located, and build it locally and move it into $NEMOBIN. Later on, mknemo evolved to also become a convenient package manager, placing 3rd party software under $NEMO/opt, giving NEMO a convenient containerized option.

mknemo attempts to find the source code of the program(s) specified on the command line, and tries to compile them. If successfull, the binary will be placed in $NEMOBIN. Add the ’-u’ flag if your NEMO is under git control, so you can force a git pull before the build.

Finding the method how to install program takes several paths:

Another option are 3rd party software, frequently used with NEMO. Example are libraries such as gsl(3) and programs such as mcluster(1NEMO) .

A novel action is to create a new NEMO program using the -N flag. Users will still need to edit the template code, but takes away the hassle of starting with brand new code.

First, if a file $NEMO/src/scripts/mknemo.d/program exists, it is assumed to be a (shell) script with directions how to install this program. gyrfalcON is an example of such a complex program. In this case program can also be a package name, in which case the script will be more complex.

Next, within the $NEMO/src (optionally also the $NEMO/usr tree) a source file program.c (or C++ or Fortran) is looked for, which is compiled with a local Makefile (or a template if none is available). tsf is an example of this type of program, but also more specialized plotting programs such as snapplot or orboom, which need an extra 3rd party library.

Finally, if still no source code is found, a directory with the name program is searched for, and a local Makefile is then used to install the program. hackcode1 is an example of this type of program.

Initially mknemo was nothing more than a convenience tool to build (new) binaries from your working directory, without having to remember where the source code lived... but since it has also acquired being a semi-package manager, it should be mentioned there are many other options to solve this problem.

Options


  -c CODE   search for CODE.c to set the directory for target(s)
  -n N      selection of N-th element from unresolved list [1]
  -s DIR    root directory to start search [$NEMO/src]
  -r        remove lockfile before starting
  -d        also make doc file (only for true NEMO programs)
  -t        cleanup after having made the binaries
  -T        cleanup before making the binaries
  -u        update your NEMO git tree before (re)making
  -l        update the library before (re)making
  -L        force recompile the library before (re)making
  -g        use gmake, instead of make
  -a        also search $NEMO/usr 
  -v        more verbose, it will report version and cvsid of program (deprecated)
  -D        show special projects from the mknemo.d directory
  -N p k=v  create and compile template program ’p.c’ with set of ’key=val’

Makedefs

All compile flags and libraries that are used should have been configured in the $NEMOLIB/makedefs file. Here are some critical programs that you could use to test if that specific library was properly referenced in makedefs:
heated_plate_openmp      openmp
cfitsio                sdfits  (no test data present in NEMO)
fftw                -
gsl                -
hdf4                tsd (no test data present in NEMO) - hdf.h
hdf5                orboom eaglesnap (but needs install in $NEMO/usr/eagle)
miriad                -
pgplot                via YAPP_PGPLOT
plplot                  via YAPP_PLPLOT
png                 via YAPP_PGPLOT
yapp                tabhist
If any of these fail for obvious reasons, you can try and fix them by rerunning configure and comparing $NEMOLIB/makedefs with $NEMO/makedefs, or simply editing $NEMOLIB/makedefs directly.

Examples

Here are some examples of the non-default control files in $NEMO/src/scripts/mknemo.d:
firstn        the very first (?) nbody code
glnemo2       glnemo graphics (binaries are available for this)
gyrfalcON       falcON tools (gyrfalcON, mkplum, the acc’s and manip’s)
rotcur        rotcur program (there is also a conflicting rotcur.c via potential(5NEMO))
galaxy15    Sellwood’s GALAXY V15.
cfitsio        CFITSIO library
For a 3rd party library system type library, such as cfitsio, the sources will be under $NEMO/local, and built with --prefix=$NEMO/opt. Thus non-NEMO user could use this prefix to their shell environment and borrow this environment.

This command creates a new program "foo" in $NEMOBIN by creating foo.c in the current directory. It will accept two keywords with given defaults:b

    $ mknemo -N foo bar=10 fum=bar
    $ foo --help
    foo bar=10 fum=bar VERSION=0.0
    
If this is a program to be added to NEMO, also make a template manual page:
    $NEMO/src/scripts/mkman foo > $NEMO/man/man1/foo.1
    

Caveats

mknemo attempts to (re)install a program or package for NEMO, but there is no guarentee this works. For programs it typically depends on a matching sourcecode (e.g. name.c) and a proper Makefile in the directory where this code lives, or in more complicated cases, a matching script name in $NEMO/src/scripts/mknemo.d

The scripts in mknemo.d are guidelines that may have worked in the past, but may now fail and need some tinkering.

See Also

bake(8NEMO) , mkbin(8NEMO)

Author

Peter Teuben

Files


$NEMO/src/scripts/mknemo.d    directory with non-default control files for mknemo
$NEMO/src/scripts/template    NEMO program template generator
$NEMO/src/scripts/mkman        NEMO man page template generator
$NEMOLIB/makedefs    make variables
$NEMOLIB/libnemo.a    main NEMO library
$NEMOLIB/yapp*.o    various device drivers
$NEMO/src              source tree searched for programs/directories
$NEMO/adm/install/mknemo.log    logfile of all previous installs done
$NEMO/adm/install/mknemo.lock    lockfile, to prevent multiple usage
$NEMO/local/<package>        source of a <package>
$NEMO/opt/{bin,include,lib}    --prefix location of <package> binaries and headers
for public use

Update History


21-jun-91    V1.0: doc created           PJT
25-jun-91    V1.1: added lockfile         PJT
4-apr-01    V1.3: added extension making for NEMO V3    PJT
20-jun-03    V1.4: added -u flag    PJT
16-dec-03    V1.5: added -l flag, also cloned sbin/mkstarlab    PJT
11-jun-04    V2.4: added -a flag    PJT
11-apr-2019    V4.0: converted CVS -> git for -u        PJT
dec-2019    document critical binaries    PJT
jul-2020    added -L options, switch -L and -l meaning    PJT
mar-2024    V4.6: added -N flag    PJT


Table of Contents