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:
- Read
Compiling and Porting Serial Applications
- 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.
- Run this and all remaining labs from one of the CTC linux login nodes.
Instructions:
- Move to the directory where source files are located:
cd $HOME/lab or cd ~/lab
- Check that you are in the lab subfolder, and that the files are there:
ls -l
- Compile:
For Gnu C/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