-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Description
I am trying to create a Debian package for LibTorch (C++ API for PyTorch) and encounter linking issues that do not appear with the CMake project.
Steps:
-
Clone the project
git clone --recurse-submodule https://github.com/pytorch/pytorch.git -b v2.1.2 cd pytorch
-
Create a
package.xml
with content:<?xml version="1.0"?> <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> <package format="3"> <name>libtorch</name> <version>2.1.2</version> <description>PyTorch C++ API</description> <maintainer email="Rauch.Christian@gmx.de">Christian Rauch</maintainer> <license>MIT</license> <buildtool_depend>cmake</buildtool_depend> <build_depend>nvidia-cuda</build_depend> <build_depend>python3</build_depend> <build_depend>python3-yaml</build_depend> <build_depend>python3-setuptools</build_depend> <export> <build_type>cmake</build_type> </export> </package>
-
Create Debian package:
bloom-generate rosdebian --ros-distro humble fakeroot debian/rules binary
This results in linking errors related to LTO:
[ 97%] Linking CXX shared library ../lib/libtorch_cpu.so
[...]
/tmp/ccPB8088.s: Assembler messages:
/tmp/ccPB8088.s:74: Error: unsupported instruction `mov'
/tmp/ccPB8088.s:107: Error: junk `(%rdi)' after expression
/tmp/ccPB8088.s:195: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:196: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:197: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:224: Error: unsupported instruction `mov'
/tmp/ccPB8088.s:240: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:251: Error: junk `(%rbp)' after expression
/tmp/ccPB8088.s:283: Error: junk `(%rbp)' after expression
/tmp/ccPB8088.s:291: Error: missing ')'
/tmp/ccPB8088.s:291: Error: junk `)' after expression
/tmp/ccPB8088.s:301: Error: junk `(%rbp)' after expression
/tmp/ccPB8088.s:312: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:370: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:379: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:385: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:391: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:427: Error: junk `(%rcx)' after expression
/tmp/ccPB8088.s:436: Error: missing ')'
/tmp/ccPB8088.s:436: Error: junk `)' after expression
/tmp/ccPB8088.s:462: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:476: Error: operand size mismatch for `sal'
/tmp/ccPB8088.s:512: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:542: Error: junk `(%rbp)' after expression
/tmp/ccPB8088.s:560: Error: missing ')'
/tmp/ccPB8088.s:560: Error: junk `)' after expression
/tmp/ccPB8088.s:568: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:570: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:572: Error: junk `(%rbp)' after expression
/tmp/ccPB8088.s:583: Error: junk `(%rax)' after expression
/tmp/ccPB8088.s:585: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:593: Error: missing ')'
/tmp/ccPB8088.s:593: Error: junk `)' after expression
/tmp/ccPB8088.s:596: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:612: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:616: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:623: Error: missing ')'
/tmp/ccPB8088.s:623: Error: junk `)' after expression
/tmp/ccPB8088.s:647: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:649: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:778: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:856: Error: junk `(%rdi)' after expression
/tmp/ccPB8088.s:898: Error: junk `(%rdi)' after expression
/tmp/ccPB8088.s:903: Error: junk `(%rdi)' after expression
/tmp/ccPB8088.s:909: Error: junk `(%rdi)' after expression
/tmp/ccPB8088.s:914: Error: junk `(%rdi)' after expression
/tmp/ccPB8088.s:916: Error: junk `(%rdi)' after expression
/tmp/ccPB8088.s:922: Error: junk `(%rdi)' after expression
/tmp/ccPB8088.s:925: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:930: Error: junk `(%rdi)' after expression
/tmp/ccPB8088.s:943: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:951: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:971: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:986: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:987: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1010: Error: junk `(%rbp)' after expression
/tmp/ccPB8088.s:1011: Error: junk `(%rbp)' after expression
/tmp/ccPB8088.s:1058: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1184: Error: junk `(%rbp)' after expression
/tmp/ccPB8088.s:1188: Error: junk `(%rbp)' after expression
/tmp/ccPB8088.s:1194: Error: junk `(%rax)' after expression
/tmp/ccPB8088.s:1237: Error: junk `(%rax)' after expression
/tmp/ccPB8088.s:1247: Error: junk `(%r13)' after expression
/tmp/ccPB8088.s:1268: Error: junk `(%rbp)' after expression
/tmp/ccPB8088.s:1279: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1281: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1282: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1293: Error: junk `(%r13)' after expression
/tmp/ccPB8088.s:1308: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1309: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1319: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1334: Error: junk `(%r13)' after expression
/tmp/ccPB8088.s:1342: Error: missing ')'
/tmp/ccPB8088.s:1342: Error: junk `)' after expression
/tmp/ccPB8088.s:1352: Error: junk `(%r13)' after expression
/tmp/ccPB8088.s:1363: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1388: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1391: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1406: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1414: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1419: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1420: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1471: Error: junk `(%rcx)' after expression
/tmp/ccPB8088.s:1480: Error: missing ')'
/tmp/ccPB8088.s:1480: Error: junk `)' after expression
/tmp/ccPB8088.s:1486: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1490: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1497: Error: missing ')'
/tmp/ccPB8088.s:1497: Error: junk `)' after expression
/tmp/ccPB8088.s:1513: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1521: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1530: Error: operand size mismatch for `sal'
/tmp/ccPB8088.s:1547: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1578: Error: junk `(%r13)' after expression
/tmp/ccPB8088.s:1598: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1618: Error: missing ')'
/tmp/ccPB8088.s:1618: Error: junk `)' after expression
/tmp/ccPB8088.s:1626: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1628: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1630: Error: junk `(%r13)' after expression
/tmp/ccPB8088.s:1641: Error: junk `(%rax)' after expression
/tmp/ccPB8088.s:1643: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1651: Error: missing ')'
/tmp/ccPB8088.s:1651: Error: junk `)' after expression
/tmp/ccPB8088.s:1654: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1695: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1697: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1723: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1725: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1937: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:1943: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:1952: Error: operand size mismatch for `sal'
/tmp/ccPB8088.s:2023: Error: junk `(%rbx)' after expression
/tmp/ccPB8088.s:2029: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:2038: Error: operand size mismatch for `sal'
/tmp/ccPB8088.s:2078: Error: junk `(%rsp)' after expression
/tmp/ccPB8088.s:2079: Error: junk `(%rbx)' after expression
[...]
make[5]: *** [/tmp/cc7Efm3E.mk:383: /tmp/ccGPxvUX.ltrans127.ltrans.o] Error 1
make[5]: *** [/tmp/cc7Efm3E.mk:380: /tmp/ccGPxvUX.ltrans126.ltrans.o] Error 1
make[5]: *** [/tmp/cc7Efm3E.mk:362: /tmp/ccGPxvUX.ltrans120.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
However, running the cmake steps manually does work without these issues.
Metadata
Metadata
Assignees
Labels
No labels