Changes between Initial Version and Version 1 of cypress/CompilerUsage


Ignore:
Timestamp:
Aug 22, 2016 2:35:47 PM (5 years ago)
Author:
fuji
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • cypress/CompilerUsage

    v1 v1  
     1[[PageOutline]]
     2= C/C++/Fortran Compilers =
     3GNU and Intel compilers are available on Cypress.
     4
     5== GNU Compiler ==
     6The default compiler is GNU compiler, version 4.4.7. To use a newer version, for example,
     7{{{
     8[tulaneID@cypress1 ~]$ module load gcc/4.7.4
     9}}}
     10=== Compilation Commands ===
     11==== C ====
     12For example. the command below will make an executable from the source code 'hello.c'.
     13{{{
     14[tulaneID@cypress1 ~]$ gcc hello.c
     15}}}
     16The default executable file name will be 'a.out'. If you want to specify the executable file name,
     17{{{
     18[tulaneID@cypress1 ~]$ gcc -o hello hello.c
     19}}}
     20Now 'hello' is the executable file name.
     21
     22There are many option for the compiler command. You can see those by,
     23{{{
     24[tulaneID@cypress1 ~]$ man gcc
     25}}}
     26For example, to set optimization level 3 and optimize for Xeon CPU,
     27{{{
     28[tulaneID@cypress1 ~]$ gcc -O3 -mavx -o hello hello.c
     29}}}
     30
     31==== C++ ====
     32For example. the command below will make an executable from the source code 'hello.cpp'.
     33{{{
     34[tulaneID@cypress1 ~]$ g++ hello.cpp
     35}}}
     36The default executable file name will be 'a.out'.
     37The basic options are same with 'gcc' command. You can see those by,
     38{{{
     39[tulaneID@cypress1 ~]$ man g++
     40}}}
     41
     42==== Fortran ====
     43For example. the command below will make an executable from the source code 'hello.f90'.
     44{{{
     45[tulaneID@cypress1 ~]$ gfortran hello.f90
     46}}}
     47The basic options are same with 'gcc' command. You can see those by,
     48{{{
     49[tulaneID@cypress1 ~]$ man gfortran
     50}}}
     51
     52== Intel Compiler ==
     53To use Intel Compiler,
     54{{{
     55[tulaneID@cypress1 ~]$ module load intel-psxe
     56}}}
     57=== Compilation Commands ===
     58==== C ====
     59For example. the command below will make an executable from the source code 'hello.c'.
     60{{{
     61[tulaneID@cypress1 ~]$ icc hello.c
     62}}}
     63The default executable file name will be 'a.out'. If you want to specify the executable file name,
     64{{{
     65[tulaneID@cypress1 ~]$ icc -o hello hello.c
     66}}}
     67Now 'hello' is the executable file name.
     68
     69There are many option for the compiler command. You can see those by,
     70{{{
     71[tulaneID@cypress1 ~]$ man icc
     72}}}
     73For example, to set optimization level 3 and optimize for Xeon CPU,
     74{{{
     75[tulaneID@cypress1 ~]$ icc -O3 -xavx -o hello hello.c
     76}}}
     77
     78==== C++ ====
     79For example. the command below will make an executable from the source code 'hello.cpp'.
     80{{{
     81[tulaneID@cypress1 ~]$ icpc hello.cpp
     82}}}
     83The default executable file name will be 'a.out'.
     84The basic options are same with 'icc' command. You can see those by,
     85{{{
     86[tulaneID@cypress1 ~]$ man icpc
     87}}}
     88
     89==== Fortran ====
     90For example. the command below will make an executable from the source code 'hello.f90'.
     91{{{
     92[tulaneID@cypress1 ~]$ ifort hello.f90
     93}}}
     94The basic options are same with 'icc' command. You can see those by,
     95{{{
     96[tulaneID@cypress1 ~]$ man ifort
     97}}}