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>

-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