ftn
Synopsis
ftn [-[no-]add-rpath
] [-[no-]add-rpath-shared
] [-[no-]add-runpath
] [--[no-]as-needed
] [--[no-]custom-ld-script
] [--cray-bypass-pkgconfig
] [--cray-print-opts
[=option]
] [--craype-append-opt
[=flag]
] [--craype-prepend-opt
[=flag]
] [-default64
] [-craympich-mt
] [-craype-verbose
] [-dynamic
] [-help
] [-shared
] [-static
] [-target-cpu
=cpu
] [-target-network
=network
] [-target-accel
=accelerator
] [Cray_options
|AMD_options
|GCC_options
|Intel_options
|Nvidia_options
]files
IMPLEMENTATION
Cray Linux Environment (CLE)
DESCRIPTION
The ftn
command invokes the Fortran compiler in the currently loaded
Cray Programming Environment. The command links in the fundamental
header files and libraries provided for Cray applications.
To see which Programming Environment (PrgEnv) is currently loaded, enter:
> module list
To see which Programming Environments are available on your system, enter:
> module avail PrgEnv
Cray recommends against calling the AMD, GCC, Intel, or Nvidia Fortran compiler directly to build code intended for compute nodes, login nodes, or service nodes. If you choose to do this, you are responsible for properly constructing the link options.
The ftn
command options are:
- -[no-]add-rpath
Controls whether or not
-Wl,-rpath
options are added for all pkg-config-generated-L
options and disables new dtags. This can be useful to lock in specific versions of libraries at runtime for dynamically linked applications. The -add-rpath option is ignored with the -shared option. In order to build a shared object (dynamic library), see the -add-rpath-shared option.Default: off
Controls whether or not
-Wl,-rpath
options are added for all pkg-config-generated-L
options and disables new dtags. This can be useful to lock in specific versions of libraries at runtime for dynamically linked applications. The -add-rpath-shared also affects builds targeting -shared object creation. This will create dynamic libraries that include RPATHs. This option is separate because some environments discourage or prohibit adding RPATHs to dynamic libraries.Default: off
- -[no-]add-runpath
Controls whether or not
-Wl,-rpath
options are added for all pkg-config-generated-L
options and enables new dtags. This can be useful to lock in specific versions of libraries at runtime for dynamically linked applications, while still allowing users to use alternate versions by settingLD_LIBRARY_PATH
.Default: off
- --[no-]as-needed
Controls whether or not
-l
options provided by the driver will be wrapped withWl,as-needed
and-Wl,-no-as-needed
when possible to minimize unnecessary dependencies when linking dynamically.Default: on
- --[no-]custom-ld-script[=script]
Controls whether or not CrayPE attempts to pass
ld
a custom linker script. If a script is provided, it will be used. Otherwise, a custom script will be used if beneficial.Default: on
- --cray-bypass-pkgconfig
Disable linking PE libraries via pkg-config.
- --cray-print-opts [=option]
Print the results generated by pkg-config, where option can be:
all
Print all include and library information.
cflags
Print include information.
cray_ld_library_path
Print a dynamically generated
CRAY_LD_LIBRARY_PATH
libs
Print library information
pcfiles
Print the pcfiles that pkg-config will be called with.
pkg_config_path
Print the
PKG_CONFIG_PATH
used.variables
Print the variable definitions that pkg-config will be called with.
- --craype-append-opt[=flag]
Add flag after all CrayPE-generated flags. This can effectively be used to override flags set by CrayPE.
- --craype-prepend-opt[=flag]
Add flag before all CrayPE-generated flags.
- -default64
Nvidia: Passes the
-i8
and-r8
options to the compiler. The-i8
option directs the compiler to use 64 bits for the data size of default integer and logical operations. The-r8
option directs the compiler to use 64 bits for the data size of default real variables. The-default64
option also sends to the linker the path to the appropriate 64-bit MPI or SHMEM library.CCE: Passes the
-sdefault64
option to the compiler. The-default64
option also sends the path to the appropriate 64-bit MPI or SHMEM library to the linker. For CCE, theftn
command will also recognize the-sdefault64
option and perform the same functionality as the-default64
option.GCC or Intel: The
-default64
option is not supported for the GCC or Intel programming environments.
- Cray_options
Specify one or more options of the Cray Fortran compiler command (ftn). For a description of options, see the crayftn(1) man page and the S-3901 Cray Fortran Reference Manual.
- AMD_options
Specify one or more options of the AMD Fortran compiler command (amdflang). For a description of options, see
amdflang --help
.
- GCC_options
Specify one or more options of the GCC Fortran compiler command (gfortran). For a description of options, see the gfortran(1) man page or the Using GNU Fortran manual.
- Intel_options
Specify one or more options of the Intel Fortran compiler command (ifort). For a description of options, see the ifort(1) man page or the Intel® Parallel Studio user guide.
- Nvidia_options
Specify one or more options of the Nvidia Fortran compiler command (nvfortran). For a description of options, see the nvfortran(1) man page.
- files
Specifies the files to be compiled and/or linked.
- -craympich-mt
Directs the driver to link in an alternate version of the Cray-MPICH library which provides fine-grained multi-threading support to applications that perform MPI operations within threaded regions. See the intro_mpi(3) man page.
- -craype-verbose
Print the command which is forwarded to compiler invocation.
- -dynamic
Directs the compiler driver to link dynamic libraries at runtime, rather than linking static libraries in at compile time. The linker stores the internal name of the dynamic library in the executable file. The actual library that is loaded at runtime must have the same internal name, but may differ from the filename of the library found at link time. This option is used to create dynamically linked executable files and may not be used with the
-static
or-shared
options.
- -help
Display programming environment specific options.
Creates a library which may be dynamically linked at runtime.
- -static
Directs the linker to use the static version of the libraries, not the dynamic version of the libraries, to create an executable file.
- -target-cpu=cpu
Set CPU target. This setting overrides the default setting defined by the users’ module environment. To see which CPU targets are available on your system, enter this command:
>
module avail craype-
- -target-network=network
Set network target to either Aries, Gemini, Infiniband, or none. This setting overrides the default setting defined by the users’ module environment. To see which network targets are available on your system, enter this command:
>
module avail craype-network
- -target-accel=accelerator
Set accelerator target to either a specific GPU or host. This setting overrides the default setting defined by the users’ module environment. To see which accelerator targets are available on your system, enter this command:
>
module avail craype-accel
In addition, the following predefined macros are supported. These macro
values are set when the associated craype
module is loaded for
example, if craype-ivybridge
is loaded, -D__CRAY_cpu
is set to
-D__CRAY_IVYBRIDGE
but can be overridden by using the
-target
command line arguments listed above.
-D__CRAYsystem
Provided based on the network target used. For example, if the
craype-network-aries
module is loaded, this is set to-D__CRAYXC
.-D__CRAY_cpu
Provided based on the cpu target used. For example, if the
craype-sandybridge
module is loaded, this is set to-D__CRAY_SANDYBRIDGE
.-D__CRAY_accelerator
Provided based on the accelerator target used. For example if the
craype-accel-nvidia35
module is loaded, this is set to-D__CRAY_NVIDIA35
.
NOTES
The Fortran compiler is part of the Cray, AMD, GCC,Intel, and Nvidia
compiler suites. Verify that the desired module (PrgEnv-cray
,
PrgEnv-amd
, PrgEnv-gnu
, PrgEnv-intel
, or PrgEnv-nvhpc
)
is loaded before attempting to compile.
CrayPE supports link line generation for the multi-threaded versions of the LibSci library based on the OpenMP option the user specifies with each compiler.
CCE 8.7.x or earlier by default links to the OpenMP LibSci library. CrayPE will link-in the serial version of LibSci when the CCE flag
-h noomp
is used.CCE 8.7.x or earlier by default uses
static
linking.CCE 9.0.x or later by default links to the serial version of the LibSci library. CrayPE will link-in the OpenMP version of LibSci when the CCE flag
-h omp
(Fortran) or-fopenmp
(C, C++) is used.CCE 9.0.x or later by default uses
dynamic
linking.CCE-SVE by default links to the serial version of the LibSci library. CrayPE will link-in the OpenMP version of LibSci when the CCE flag
-h omp
is used.GNU by default links to the serial LibSci library. CrayPE will link-in the OpenMP version of LibSci when the gcc flag
-f openmp
is used.INTEL by default links to the serial LibSci library. CrayPE will link-in the OpenMP version of LibSci when the Intel flag
-qopenmp
is used.
EXAMPLES
Example 1: Compiling a Fortran CNL program
The first command compiles Fortran programs proga.f
and progb.f
,
creating object files proga.o
and progb.o
. The second command
links the *.o
files and any required library functions, creating
executable progab
.
% ftn -c proga.f progb.f
% ftn -o progab proga.o progb.o
Example 2: Using the 64-bit MPI Library
The following command compiles Nvidiaprogram mp1.f90
to use 64-bit
precision. The command passes the -i8
and -r8
options to the
compiler and the path to the 64-bit MPI library to the linker.
% module load PrgEnv-Nvidia
% ftn -default64 -o mp1 mp1.f90
ENVIRONMENT VARIABLES
- CRAY_LD_LIBRARY_PATH
The environment variable containing paths to be combined with
LD_LIBRARY_PATH
. It is designed for overriding the default path as provided by ld.so.cache (for systems that make use of CPE ld.so.cache), or to add search paths for the run-time linker for systems that do not make use of the CPE ld.so.cache.
- CRAYPE_LINK_TYPE
Specifies the default linking behavior. The valid values are:
dynamic
,shared
, orstatic
. The default value isdynamic
. This environment variable takes priority over the command line options
- CRAY_ADD_RPATH
Instruct the driver to add RPATHs for library dependencies resolved via PE pkg-config, excluding shared objects. This environment variable takes priority over the command line options
- CRAY_ADD_RUNPATH
Instruct the driver to add RUNPATHs for library dependencies resolved via PE pkg-config. This environment variable takes priority over the command line options
- CRAY_ADD_RPATH_SHARED
Instruct the driver to add RPATHs for library dependencies resolved via PE pkg-config, including for shared objects. This environment variable takes priority over the command line options
EXAMPLES
SEE ALSO
CC(1), cc(1), aprun(1), intro_hugepages(1)