Skip to content

Compile a C program using icx

icx is an Intel C compiler. This page describes how to compile C code using icx.

Procedure

1. Load the modules

load an these modules:

module load intel-oneapi 
module load compiler/2023.1.0

2. Write the C program

Create and write a C source file called hello_world.c:

nano hello_world.c

In nano, write the C program as such:

#include <stdio.h>

int main() {
  printf("hello, world\n");
}

3. Compile the C program

After saving and closing nano, compile as such:

icx hello_world.c

4. Run the executable

Run the program:

./a.out 

Output:

hello, world