You copied the Doc URL to your clipboard.

Linker options

Control linking behavior and performance.

Compiler linker options

Option

Description

-Wl,<arg>

Pass the comma separated arguments in <arg> to the linker.

Usage

armflang -Wl,<arg>, <arg2>...

-Xlinker <arg>

Pass <arg> to the linker.

Usage

armflang -Xlinker <arg>

-armpl

Instructs the compiler to load the optimum version of Arm Performance Libraries for your target architecture and implementation. This option also enables optimized versions of the C mathematical functions declared in the math.h library, tuned scalar and vector implementations of Fortran math intrinsics, and auto-vectorization of mathematical functions (disable this using -fno-simdmath).

Supported arguments are:

  • lp64: Use 32-bit integers.

  • ilp64: Use 64-bit integers. Inverse of lp64.

  • sequential: Use the single-threaded implementation of Arm Performance Libraries.

  • parallel: Use the OpenMP multi-threaded implementation of Arm Performance Libraries. Inverse of sequential.

Separate multiple arguments using a comma, for example: -armpl=<arg1>,<arg2>.

Default behavior

The default behavior of the -armpl option is also determined by the specification (or not) of the -i8 Workload compilation options and -fopenmp Actions option:

  • If the -i8 Workload compilation options option is specified, ilp64 is enabled by default. If -i8 is not specified, -lp64 is enabled by default.

  • If the -fopenmp Actions option is specified, parallel is enabled by default. If -fopenmp is not specified, sequential is enabled by default.

In other words, when:

  • Only specifying -armpl: -armpl=lp64,sequential.

  • Specifying -armpl and -i8: -armpl=ilp64,sequential.

  • Specifying -armpl and -fopenmp: -armpl=lp64,parallel.

  • Specifying -armpl, -i8, and -fopenmp: -armpl=ilp64,parallel.

For more information on using -armpl, see the Library selection web page.

Usage

armflang code_with_math_routines.f -armpl{=<arg1>,<arg2>}

Examples

To specify a 64-bit integer OpenMP multi-threaded implementation for ThunderX2: armflang code_with_math_routines.f -armpl=ilp64,parallel -mcpu=thunderx2t99

To specify a 32-bit integer single-threaded implementation on Cortex-A72: armflang code_with_math_routines.f -armpl=lp64,sequential -mcpu=cortex-a72

To use the serial, ilp64 ArmPL libraries, optimized for the CPU architecture of the build computer: armflang code_with_math_routines.f -i8 -armpl -mcpu=native

To use the parallel, lp64 ArmPL libraries, with portable output suitable for any Armv8-A computer: armflang code_with_math_routines.f -armpl -fopenmp -mcpu=generic

To use the parallel, ilp64 ArmPL libraries, optimized for Cortex-A72 based computers armflang code_with_math_routines.f -armpl=parallel,ilp64 -mcpu=cortex-a72

-l<library>

Search for the library named <library> when linking.

Usage

armflang -l<library>

-larmflang

At link time, include this option to use the default Fortran libarmflang runtime library for both serial and parallel (OpenMP) Fortran workloads.

Note

  • This option is set by default when linking using armflang.

  • You need to explicitly include this option if you are linking with armclang instead of armflang at link time.

  • This option only applies to link time operations.

Usage

armclang -larmflang

See notes in description.

-larmflang-nomp

At link time, use this option to avoid linking against the OpenMP Fortran runtime library.

Note

  • Enabled by default when compiling and linking using armflang with the -fno-openmp option.

  • You need to explicitly include this option if you are linking with armclang instead of armflang at link time.

  • Should not be used when your code has been compiled with the -lomp or -fopenmp options.

  • Use this option with care. When using this option, do not link to any OpenMP-utilizing Fortran runtime libraries in your code.

  • This option only applies to link time operations.

Usage

armclang -larmflang-nomp

See notes in description.

-shared

--shared

Causes library dependencies to be resolved at runtime by the loader.

This is the inverse of -static. If both options are given, all but the last option will be ignored.

Usage

armflang -shared

Or

armflang --shared

-static

--static

Causes library dependencies to be resolved at link time.

This is the inverse of -shared. If both options are given, all but the last option is ignored.

Usage

armflang -static

Or

armflang --static

To link serial or parallel Fortran workloads using armclang instead of armflang, include the -larmflang option to link with the default Fortran runtime library for serial and parallel Fortran workloads. You also need to pass any options required to link using the required mathematical routines for your code.

To statically link, in addition to passing -larmflang and the mathematical routine options, you also need to pass:

  • -static

  • -lomp

  • -lrt

To link serial or parallel Fortran workloads using armclang instead of armflang, without linking against the OpenMP runtime libraries, instead pass -armflang-nomp at link time. For example, pass:

  • -larmflang-nomp

  • Any mathematical routine options, for example: -lm or -lamath.

Again, to statically link, in addition to -larmflang-nomp and the mathematical routine options, you also need to pass:

  • -static

  • -lrt

Warning

  • Do not link against any OpenMP-utlizing Fortran runtime libraries when using this option.

  • All lockings and thread local storage will be disabled.

  • Arm does not recommend using the -larmflang-nomp option for typical workloads. Use this option with caution.

Note

The -lompstub option (for linking against libompstub) might still be needed if you have imported omp_lib in your Fortran code but not compiled with -fopenmp.

Was this page helpful? Yes No