Skip to content

ADD_LIBRARY called with SHARED option but the target platform does not support dynamic linking. #3048

@ilot95

Description

@ilot95

After installing mlir-aie on Ubuntu 26.04 LTS and running the memcpy example I get the Error:

(ironenv) yyy@xxx:~/mlir-aie/programming_examples/basic/memcpy$ make run
rm -rf _build
mkdir -p _build
cd _build &&  cmake /home/tgaulke/mlir-aie/programming_examples/basic/memcpy -DTARGET_NAME=memcpy
CMake Error at /opt/xilinx/xrt/share/cmake/XRT/xrt-targets.cmake:59 (add_library):
  ADD_LIBRARY called with SHARED option but the target platform does not
  support dynamic linking.
Call Stack (most recent call first):
  /opt/xilinx/xrt/share/cmake/XRT/xrt-config.cmake:58 (include)
  /home/tgaulke/mlir-aie/programming_examples/common.cmake:39 (find_package)
  CMakeLists.txt:18 (include)

-- Configuring incomplete, errors occurred!
make: *** [Makefile:67: memcpy.exe] Error 1

The is also true for other examples. (I tried passthrough_kernel)
This can be fixed by moving the project(${ProjectName}) call to the front of the file.
I attached a fix CMakeLists.txt

FixedCMakeList.txt
I assume that this is a because of the cmake Version.

cmake version 4.3.2

xrt-smi examine 
System Configuration
  OS Name              : Linux
  Release              : 7.0.0-15-generic
  Machine              : x86_64
  CPU Cores            : 24
  Memory               : 60866 MB
  Distribution         : Ubuntu 26.04 LTS
  GLIBC                : 2.43
  Model                : AI Series
  BIOS Vendor          : American Megatrends International, LLC.
  BIOS Version         : 1.03
  Processor            : AMD Ryzen AI 9 HX 370 w/ Radeon 890M

XRT
  Version              : 2.23.0
  Branch               : HEAD
  Hash                 : bb927f7ea6d946dc9a6720e7c0ca35400a078da3
  Hash Date            : Thu, 30 Apr 2026 10:56:23 +0530
  amdxdna Version      : 2.23.0_20260504, e227eaa2a62763def6453f6991f1317a21ab6d03
  virtio-pci Version   : 7.0.0-15-generic
  NPU Firmware Version : 1.1.2.64

Device(s) Present
|BDF             |Name       |Architecture  |Topology  |
|----------------|-----------|--------------|----------|
|[0000:c6:00.1]  |NPU Strix  |aie2p         |6x8       |

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions