Compiling and Linking - 2.0 English

RFSoC DFE PRACH LogiCORE IP Product Guide (PG391)

Document ID
PG391
Release Date
2024-11-20
Version
2.0 English

To use the C model, the user executable must be linked against the correct libraries for the target platform.

Place the header files (xdfe_nr_prach_v2_0_bitacc_cmodel.h, xip_common_bitacc_cmodel.h, and gmp.h) with other header files in your project. Compilation varies from platform to platform.

Linux

To compile the example code, run_bitacc_cmodel.c, follow these steps:

  • Ensure that the directory in which the files libIp_xdfe_nr_prach_v2_0_bitacc_cmodel.so, libgmp.so.11 and libgmpxx.so.4 are located is present on your $LD_LIBRARY_PATH environment variable. These shared libraries are referenced during the compilation and linking process.
  • Place the header file and C++ source file in a single directory. Then in that directory, compile using the GNU C++ compiler:
    gcc -x c++ -lm -I. -L. -lIp_xdfe_nr_prach_v2_0_bitacc_cmodel -Wl,-rpath,. -o run_bitacc_cmodel run_bitacc_cmodel.c
    Note: The C model dynamically links to libgmpxx.so.4 and therefore this library must be visible to the model while running.

Windows

When compiling on Windows, the symbol 'NT' must be defined either by a compiler option or in the user source code before the xdfe_nr_prach_v2_0_bitacc_cmodel.h header file is included.

Link to the import libraries libIp_xdfe_nr_prach_v2_0_bitacc_cmodel.lib and libgmp.lib. For example, in Microsoft Visual Studio.NET, in Project Properties, under Linker > Input, for Additional Dependencies, specify libIp_xdfe_nr_prach_v2_0_bitacc_cmodel.lib and libgmp.lib.