Skip to main content

more options


Compile

Please use the "Switch to Details" button to return to the lab instructions.

The goal of the previous lab was to logon to a CTC linux login node and to copy the lab files into a directory "lab" in your home directory. In this section we will continue to work on the login node, compiling one of the files copied into your lab directory. You will need to decide on a programming language, C/C++ or Fortran. For the purposes of this lab, we will use the Intel compilers. For information on using the other compilers, please refer back to the modules listed in the prerequisites.

Prerequisites:

  1. Read Compiling and Porting Serial Applications
  2. Make sure you have copied the source code karp.c or karp.f as instructed in the previous section. The files should be in your directory called $HOME/lab or ~/lab.
  3. Run this and all remaining labs from one of the CTC linux login nodes.

Instructions:

  1. Move to the directory where source files are located:
    cd $HOME/lab or cd ~/lab
  2. Check that you are in the lab subfolder, and that the files are there:
    ls -l
  3. Compile:
    For Gnu C/C++: <
    • gcc -o karp karp.c
    For Intel C/C++:
    • bash: source /opt/intel/cc/9.1.045/bin/iccvars.sh
      tcsh: source /opt/intel/cc/9.1.045/bin/iccvars.csh
    • icc -o karp karp.c
    For Fortran :
    • bash: source /opt/intel/fc/9.1.032/bin/ifortvars.sh
      tcsh: source /opt/intel/fc/9.1.032/bin/ifortvars.csh
    • ifort -o karp karp.f

Results:

The executable created at the command prompt is:

~/lab/karp