Back to Table of Contents

Installing and running COSMOS

Using existing installations

 

Using the virtual machine

 

Installing precompiled binaries

Compiling your own binaries

Using existing installations

At the telescope

COSMOS is located in /usr/local/magellan/Cosmos3.

Before running any programs, you must execute the following commands:

Remember to execute "source /usr/local/magellan/cosmos3/magellan-setup" in any new windows that you open or put it in your shell startup script.

 

Santa Barbara Street

The COSMOS software is installed on our software server and should be usable from any local machine running CentOS 6.

Before running any programs, you must do the following:

·        
·       source /data/software/Cosmos/cosmos3-setup

NOTE: Sourcing the cosmos3-setup file will now automatically set up your Perl environment also.

·        
·       cd /home/joe/reductions/April_run/
·       cp $COSMOS_HOME/Cospar/* .

NOTE: By default, COSMOS_PAR_DIR is set to ".", which means it expects the parameter files in your current directory (recommended). If you copy the entire Cospar directory over or copy the parameter files to a different directory, you will need to set the COSMOS_PAR_DIR environment variable to the full path of the directory that contains those parameter files you want to edit and use, e.g.:

 
cd /home/joe/reductions/April_run/
cp -r $COSMOS_HOME/Cospar /home/joe/reductions/
setenv COSMOS_PAR_DIR /home/joe/reductions/Cospar

The documentation is available locally at code.obs.carnegiescience.edu/cosmos

Installing Mac OS X Binaries

A pre-compiled distribution of COSMOS3 is available for recent Mac OS X versions, and may be obtained from here. This includes everything needed to run all of COSMOS3 except viewspectra. To install, you need to do the following:

·      put the downloaded tar file in your home directory /Users/whoeveryouare and extract:

 tar -xzvf cosmosversion.tgz

where cosmosversion is the version you have downloaded. This will create a COSMOS3 directory structure in $HOME/COSMOS3, within which are all the files that Cosmos needs to operate.

·    Either add “source cosmos3-setup” to your startup file or enter “source ~/cosmos3-setup” in each new window in which you wish to use Cosmos.

·      ensure that you have ds9 and Xquartz installed.

·      If you wish to use viewspectra, and do not already have all of the required perl packages, you will need to also install a set of perl packages, which is available here. Move this file into your new COSMOS3 directory, then

tar -xzvf  viewspectra-perlversion.tgz

·      Beginning with version Monterey 12.3, Mac OS no longer includes the python support needed to run programs defineobs, adjust-mask, editpar, whatsthat, display, fitsheader, and mark-slits. To restore this functionality:

Download the file   cosmos3python.tgz    from https://code.obs.carnegiescience.edu/cosmos3   and place in your root COSMOS3 directory, then:

tar -xzvf cosmos3python.tg

rehash

Note that this installation assumes that the COSMOS3 distribution is installed in your home directory, and that the Cospar parameter file directory is at $COSMOS_HOME/Cospar. If you wish to change either of these locations, you must edit the first few lines of cosmos3-setup to reflect your changes.

Using the virtual machine

 

Cosmos in now available as a VirtualBox virtual machine running CentOS7. Cosmos runs on the virtual machine almost as fast as in a native installation. If you are not familiar with VirtualBox you should:

·      Read the documentation, particularly Sections 1, 2, and 4.3.

·      Download and install VirtualBox

·      Download the Carnegie Observatories Virtual Machine, which contains both COSMOS2 and COSMOS3, available from this page, and follow the instructions

 

Compiling your own binaries

You may chose to build your own system. This can be a challenging task because of all the software packages required, and is not recommended unless the other alternatives will not work.

To download the latest source, click here.

COSMOS is known to work with the following:

Architecture

Operating System

x86

Redhat 8, 9; Fedora Core 1, 4, 5; Mac OS X 10.4, 10.5

x86_64

Fedora Core 8, Fedora 13, CentOS 6; Mac OS X 10.6, 10.7, 10.8, 10.9

PowerPC (G4, G5)

Mac OS X 10.3, 10.4

COSMOS should work on most other Linux systems, and may work on any UNIX variant.

Please Note: On newer 64-bit operating systems, such as Fedora 13, Mac OS X 10.6, and Mac OS X 10.7, you have to be wary when building the PGPLOT Fortran libraries, in order to get the viewspectra program to work. In particular, the GIF, PPM, and WD driver files need to be edited.

Dependencies

Besides the usual stuff, you will need:

 

IMPORTANT NOTES (for Mac users): It's recommended that you use separate installations of the above dependencies, instead of using ones that are part of a package such as scisoft to prevent any compatibility issues. If you're running Mac OS X 10.6.x (Snow Leopard) or later, make sure you have both the 64-bit gcc and gfortran compilers for your system installed (download here) and that the location of their executables are at the front of your $PATH environment variable BEFORE installing these dependencies.

 

You need the following python modules:

 

·      numpy

·      scipy

·      tkinter

·      jsonschema

·      pyds9


If you wish to use process-spec or viewspectra, you will also need the following Perl modules:

NOTE: It's ideal to install the Perl modules in a local directory so as to not interfere or replace any system libraries.

 

Installation

  1. Retrieve the COSMOS tarfile.
  2. On your system, create a directory into which the COSMOS system will be installed, e.g.
3.   
4.  mkdir /home/joe_user/COSMOS3
  1. move the tarfile to this directory
  2. cd into that directory
  3. extract the tarfile: tar -xzvf CosmosYYYY.tar.gz
  4. define the environment variable COSMOS_HOME to be the extracted directory, e.g.
9.   
10.setenv COSMOS_HOME "/home/joe_user/COSMOS3/CosmosYYYY"
  1. execute cd source
  2. You are now ready to build the executable files, but first make sure that the library files (and possibly their associated include files) that are needed are in the expected locations, which are specified in the Makefile. The libraries in question are:
    1. libcpgplot
    2. libcfitsio
    3. libpgplot
    4. libX11

If they are not, you must do one of the following:

    1. copy the files into $COSMOS_HOME/lib
    2. create symbolic links to the files in $COSMOS_HOME/lib, (and $COSMOS_HOME/include)
    3. edit the Makefile definitions of PGLIB, FITSLIB, and XLIB, (and PGINC, FITSINC, XINC)
    4. specify the locations on the make command line, as seen below,

 

IMPORTANT (for Mac users): If you're running Mac OS X 10.6.x (Snow Leopard) or later, make sure you have both the 64-bit gcc and gfortran compilers for your system installed (download here) and that the location of their executables are at the front of your $PATH environment variable BEFORE running the following 'make' command. If you didn't install the 64-bit compilers by this point, see previous "IMPORTANT" note.


Now, you are ready to execute the make command

 
make -f Makefile.system [PGLIB=pgplot-dir XLIB=Xll-dir FITSLIB=fits-dir 
    PGINC=pgplot.h-dir XINC=X11.h-dir FITSINC=fits.h-dir]
 

where system is either "Mac" or "linux", and the options in brackets are only needed if the above mentioned library and header files are not in their expected locations. With a little luck, you will get no error messages, and at the end you will have a completely installed system. If you encounter any errors, they are most likely due to a failure to find all the library and header files, in which case you should check their locations. If you're still having trouble, please refer to the FAQ page.

 

Some final tidying:

  1. To set up your COSMOS environment, edit your cosmos3-setup file so that it points to your extracted directory:
 setenv COSMOS_HOME "/home/joe-user/COSMOS/Cosmos3" 
  1. By default, COSMOS_PAR_DIR is set to ".", which means that it looks for the parameter files in your current directory. So it's best that you do either of the following:
 setenv COSMOS_PAR_DIR "/home/joe-user/reductions/Cospar" 
  1. Either way, it's best to copy the parameter files to a different location so that the default parameter files are preserved in $COSMOS_HOME/Cospar.
  2. In order to use the built-in Perl programs, you need to edit your cosmos2-setup file to set the PERLLIB environmental variable to the location of your Perl modules (<module_name>.pm), e.g.:
5.   
6.  setenv PERLLIB "/home/joe_user/my-perl-modules-directory"

If you are using COSMOS on a Mac, you may have Fink installed. If so, you may find a PERL5LIB environmental variable set, in which case you want to append PERLLIB to it by executing the following*:

 
setenv PERL5LIB "${PERLLIB}:${PERL5LIB}"

If you are using COSMOS on Mac OS X 10.6 (Snow Leopard) booted in 32-bit mode, then you will also need to change the value of the environmental variable VERSIONER_PERL_PREFER_32_BIT by executing the following*:

 
setenv VERSIONER_PERL_PREFER_32_BIT no
  1. Then you can explicitly source your cosmos3-setup file, e.g.:
source /home/joe-user/COSMOS/Cosmos3/cosmos3-setup

You can also put the above command in your shell startup file (e.g. ~/.cshrc) so that COSMOS can be used right away in every new terminal you open.

 

The HTML documentation will be available on your own computer at $COSMOS_HOME/docs/COSMOS.html.

 

Need some help?

If you have trouble with installing COSMOS, consider using the virtual machine. Although there is a modest performance hit, getting it up and running is much simpler than building your own system. If you are having trouble running COSMOS, please

  1. Make sure that you have the latest version
  2. Make sure that you have carefully read all of the documentation
  3. If things still don't work, you can contact cosmos[at]obs.carnegiescience.edu for assistance.

 

Next: COSMOS Cookbook

Back to Table of Contents