GNU Compilers

GNU C/C++/Fortran on the HPCC

Create C Program File

Create a .c file with your commands, for example:

#include<stdio.h>
main()
{
printf("Hello world.n");
}

Submit gcc compile job

qrsh gcc -o myHelloWorld hello.c

Create a Job Script to run the compiled program

If the compiler successfully compiled the source code into an executable (myhw), the executable will be placed in your working directory. This executable is meant to be run on the cluster’s compute nodes — the head node is to be used exclusively for creating programs and scripts and to interact with the cluster. Executables should not be run on the head node!

Create a .sh file (myHelloWorld.sh in this case) with the following contents:

#!/bin/bash
./myHelloWorld

Submit the executable

qsub myHelloWorld.sh

SHORT Jobs

If the executable above is a short job (yes, that’s subjective! :)), you could also run it with qrsh:

qrsh ./myHelloWorld