11.5. Packaging Object Files Into a Library
Collect object files in a library file so that others can incorporate the library into their projects and call the functions that are contained in the objects in the library. Package object files into a library with the fpga_libtool command.
Before you package object files into a library, ensure that you have the path information for all of the object files that you want to include in the library.
All objects to be packaged in the library must have the same version number. This library can be used only by an Intel® high-level design tool with the same version number.
The fpga_libtool command creates libraries encapsulated in operating system specific archive files (.a on Linux, .lib on Windows).Create the HLS library file with the following command:
fpga_libtool --target target_HLD_tool --create library_name[.a | .lib | .aoclib] object_file_1 [object_file_2 ... object_file_n]
The target Intel® high-level design tool for this library. This parameter can have one of the following values:
Target this library for components developed with the Intel® HLS Compiler.
Libraries built for the Intel® HLS Compiler are encapsulated in operating system specific archive files (.a on Linux, .lib on Windows). You cannot use HLS libraries created on one operating system with the Intel® HLS Compiler running on a different operating system.
Target this library for kernels developed with the Intel® FPGA SDK for OpenCL™ .
Libraries built for the Intel® FPGA SDK for OpenCL™ are not operating system specific. The objects are created as Intel® FPGA SDK for OpenCL™ object files (.aoclib).
You must have the Intel® FPGA SDK for OpenCL™ Pro Edition installed to use this option. The version of the SDK must be the same as your version of Intel® HLS Compiler.
The name of the library file.Specify the file extension of the library files as follows, depending on the target high-level design tool:
- Intel® HLS Compiler
Specify the operating-system specific archive extension: .a for Linux-platform libraries and .lib for Windows-platform libraries.
- Intel® FPGA SDK for OpenCL™
Specify .aoclib as the file extension for an OpenCL* library.
OpenCL* libraries are not operating-system specific.
- Intel® HLS Compiler
You can specify one or more object files to include in the library.
fpga_libtool --create libdemo.a prim1.o prim2.o prim3.o --target hls