Linking AMD Library - Linking AMD Library - 57222

AOCC User Guide

Document_ID
57222
Release_Date
2026-05-12
Revision
5.2 English
  • AMDLIBM

    Execute the following command to link AMDLIBM with the linker.

    $ clang [command line flags] xyz.c -L<compdir>/aocc-compiler-<ver>/lib -lamdlibm -lm -o xyz.out
    Note: Only 64-bit mode AMDLIBM is supported on Linux platforms.
  • AMD Vector Library

    Execute the following command to link vector library calls from AOCC.

    $ clang -ffast-math [command line flags] xyz.c -fveclib=AMDLIBM -lamdlibm -lm -o xyz.out
  • AMD FASTMATH Library

    -ffastlib=AMDLIBM with -Ofast enables the use of the fastmath functions from amdlibm. Linking may fail with undefined symbols if the correct library is not used for linking.

    Execute the following command to link AMDLIBMFAST with the linker.

    $ clang -Ofast [other command line flags] xyz.c -ffastlib=AMDLIBM -lamdlibmfast -lamdlibm -lm -o xyz.out
  • amdalloc

    amdalloc is AMD's memory allocation library based on jemalloc and is available as a part of AOCC binary package. Execute the following command to link amdalloc with the linker.

    $ clang [command line flags] xyz.c -L<Path to Libraries in AOCC package> -lamdalloc -o xyz.out
  • amdalloc-ext

    amdalloc-ext is AMD's memory allocation library optimized for performance and is available as a part of the AOCC binary package. This library provides optimized implementation of allocation routines malloc(), calloc(), realloc() and free(). It is C99 standard compliant.

    $ clang [command line flags] xyz.c -L<Path to Libraries in AOCC package> -lamdalloc-ext -o xyz.out
    Note: This is not a general-purpose library and only supports 64-bit mode on Linux platforms. This library is not thread safe; do not use it in any multi-threaded application.