Find topicGeneral websQuicklinksWeb toolsHelp |
Cranium: CompilersThis page contains instructions on how to use the different compilers we have installed in the Cranium cluster like the GCC, Intel and PGI.
GCC Here is a guide on how to use the GCC compiler. Here is a general description on how to compile with C++:
Intel The Intel C++ Compiler lets you build and optimize C/C++ applications for Intel IA-32, Intel Extended Memory 64 Technology (Intel EM64T), and Intel Itanium-based systems running Linux operating systems. You can check a detailed user guide by following this link. For the 64 bit compiler (please check the appropriate paths), setenv ICCPATH /usr/local/intel_cc-10.1.008_64bit This should enable you to compile and link programs using the Intel compiler. In case you are using Makefiles, it's also helpful to set up the path as Use the Intel compiler,CC = /usr/local/intel_cc-10.1.008_64bit/bin/iccUse the Intel Linker, LD = /usr/local/intel_cc-10.1.008_64bit/bin/icpc Optimizing with the Intel compiler, most gcc options such as -g, -O2, -O1 should work. Additionally, exclusive optimizing options are provided as follows: For parallelizing loops, -parallel Enables the auto-parallelizer to generate multithreaded code for loops that can be safely executed in parallel. General faster optimization, -fast Provides a single, simple optimization that enables a collection of optimizations that favor run-time performance. For targetting specific processors, -mtune=itanium2or -mtune=itanium For generating vectorized code, -xS Can generate SSE4 Vectorizing Compiler and Media Accelerators instructions for future Intel processors that support the instructions. Can generate SSSE3, SSE3, SSE2, and SSSE4 instructions and it can optimize for future Intel processors. -xT Can generate SSSE3, SSE3, SSE2, and SSE instructions for Intel processors, and it can optimize for the Intel Core Duo processor family. -xP Can generate SSE3, SSE2, and SSE instructions for Intel processors, and it can optimize for processors based on Intel Core microarchitecture and Intel NetBurst microarchitecture, like Intel Core Duo processors, Pentium 4 processors with SSE3, and Intel Xeon processors with SSE3. Linking with the intel compiler, icpc -L$(LIBDIR) <.o files> -o Additionally, if one is using C++ and requires -lstdc++, it's better to specify -lguide -lpthread before -lstdc++ to avoid linker errors. PGI To compile PGI applications for 32 bits, please set the following variables (if you are using a tcsh shell): Set the PGI variable,setenv PGI /usr/local/pgi-7.1.3_64bitSet the variable for the license file, setenv LM_LICENSE_FILE ${PGI}/license.datInclude PGI in your current path, setenv PATH ${PGI}/linux86/7.1-3/bin:${PATH}Set the compiler variables, setenv CC ${PGI}/linux86/7.1-3/bin/pgCCIf you have to set additional include directories, INCLUDES = -I/needed_include_pathAnd, for additional libraries needed when compiling your code, INCLUDES = -L/needed_library_path For 64 bits, follow a similar procedure like with 32 bits: setenv PGI /usr/local/pgi-7.1.3_64bit setenv PGI /usr/local/pgi-7.1.3_64bit A complete guide for PGI can be found by clicking here. Check also: PGI User's guide,PGI Tools guide, PGI Compiler suite. | ||