Prerequisites

Operating system

This entire documentation package assumes that you are using a unix-based operating system (most commonly linux or macos). CGCAM can be built and run on a windows based system but you will need to translate many of the commands given here to windows syntax.

Required supporting software

Building and running CGCAM relies on a small number of fairly standard software packages. These are:

  1. git - version control software.
  2. perl - scripting language.
  3. A fortran compiler such as gcc (gfortran), intel (ifort), Portland Group (pgif90), or cray (ftn).
  4. An mpi library and runtime environment such as openmpi or mpich.

git

Most recent versions of linux or macos will have git installed. To verify this type git --version. If this command returns something like git version 2.17.2 then git is indeed installed. On the other hand, if you receive an error message like git: command not found then git is either not installed or is not included on your search path. In order to rule out the latter possibility, issue whereis git. If this command returns something like /usr/bin/git, they git is installed but the directory in which it resides is not on your search path. In this case modify the PATH environment variable in your shell start-up file in order to include the path to git. Consult google if you do not know how to do this.

If git is not present on your system, then install it using the appropriate package manager for your system (e.g. sudo apt install git, or sudo yum install git, or sudo port install git or brew install git)

perl

Most recent versions of linux or macos will have perl installed. To verify this type perl --version. If this command returns something like This is perl 5, version 26, subversion 2 (v5.26.2) then perl is indeed installed. On the other hand, if you receive an error message like perl: command not found then perl is either not installed or is not included on your search path. In order to rule out the latter possibility, issue whereis perl. If this command returns something like /usr/bin/perl, they perl is installed but the directory in which it resides is not on your search path. In this case modify the PATH environment variable in your shell start-up file in order to include the path to perl. Consult google if you do not know how to do this.

If perl is not present on your system, then install it using the appropriate package manager for your system (e.g. sudo apt install perl, or sudo yum install perl, or sudo port install perl or brew install perl)

Fortran compiler and MPI environment

If you are installing CGCAM at a computing facility, they will almost certainly have a fortran compiler and an MPI environment installed. The chances are less likely if you are installing on a smaller computer such as a linux desktop or on mac. In any case, issue mpif90 --version and look for several lines of output, including a line that indicates the compiler type and its version number. If you see this information, then both a fortran compiler and an MPI environment is already installed and you can skip the remainder of this section. If instead you receive an error message such as mpif90: command not found then it is likely that at least the MPI environment is missing. In this case hunt for a fortran compiler by issuing things like which ifort, which gfortran, which pgf90, which ftn. If you find a compiler, then you only need to install the mpi environment, otherwise you will need to install both a compiler and MPI.

It is difficult to provide detailed instructions on installing a fortran compiler as well as an MPI environment since there is such a large combination of compiler and MPI packages, OS types, and package managers. The intel and Portland Group compilers typically require license fees but they will also provide an MPI environment and will have good installation instructions. It may be possible to reduce or eliminate the license fee if you are a student or educator. gfortran is part of the gcc package and is free to install and use. It produces fairly well-optimized code and has been used extensively for CGCAM builds. openmpi is also free to use and it couples well with gfortran. You should be able to find lots of information for installing gcc/openmpi on your particular system.