Difference between revisions of "LLVM-Clang"

(Created page with "== Description == ''From the Clang website'': The goal of the '''Clang''' project is to create a new C based language front-end: C, C++, Objective C/C++, OpenCL C and others...")
 
Line 9: Line 9:
Once you add the module above, you can either invoke the Clang compiler by typing:
Once you add the module above, you can either invoke the Clang compiler by typing:


<pre style="white-space:pre-wrap; width:20%; border:1px solid lightgrey; background:#000000; color:white;">
<pre style="white-space:pre-wrap; width:35%; border:1px solid lightgrey; background:#000000; color:white;">
[user@itn0 ~]$ clang helloworld.c -o helloworld
[user@itn0 ~]$ clang helloworld.c -o helloworld
</pre>&nbsp;<br>
</pre>&nbsp;<br>
Line 26: Line 26:
#SBATCH --time=01:00:00  
#SBATCH --time=01:00:00  
#SBATCH --nodes=2  
#SBATCH --nodes=2  
#SBATCH --ntasks=4  
#SBATCH --ntasks-per-node=4  
#SBATCH --mem-per-cpu=2048  
#SBATCH --mem-per-cpu=2048  
#SBATCH --output=clang-test.%j.txt  
#SBATCH --output=clang-test.%j.txt  

Revision as of 14:30, 17 August 2017

Description

From the Clang website: The goal of the Clang project is to create a new C based language front-end: C, C++, Objective C/C++, OpenCL C and others for the LLVM compiler.

Version

  • 4.0.1

Authorized Users

  • CIRCE account holders
  • RRA account holders
  • SC account holders

Platforms

  • CIRCE cluster
  • RRA cluster
  • SC cluster

Modules

LLVM-Clang requires the following module file to run:

  • apps/llvm/4.0.1

Using LLVM/Clang on CIRCE/SC

Once you add the module above, you can either invoke the Clang compiler by typing:

[user@itn0 ~]$ clang helloworld.c -o helloworld

 

Jobs Longer than 20 Minutes in Length

To run Clang compiling jobs on CIRCE/SC, users will need to submit their jobs to the scheduling environment if their jobs take more than 20 minutes to run on a standard PC.

If, for example, you have a Clang source code file named clang-test.c, you would set up a submit script to use like this:

  • The script below (for testing, name it “clang-test.sh”) can be copied into your job directory (the folder with your input files) and modified so that you can submit batch processes to the queue.
#!/bin/bash 
#SBATCH --job-name=clang-test 
#SBATCH --time=01:00:00 
#SBATCH --nodes=2 
#SBATCH --ntasks-per-node=4 
#SBATCH --mem-per-cpu=2048 
#SBATCH --output=clang-test.%j.txt 


module purge 
module initadd apps/llvm/4.0.1 

clang clang-test.c -o clang-test

 
Next, verify that you are in your job’s directory, and run the sbatch command to submit the job:

[user@itn0 ~]$ cd my/jobdir
[user@itn0 jobdir]$ sbatch ./clang-test.sh

 
This will submit a 2 node, 8 total cpu core job with 2 GB of memory per core and a 1 hour job time.

Documentation

Home Page, User Guides, and Manuals

Reporting Bugs

Report bugs with LLVM-Clang to the IT Help Desk: rc-help@usf.edu