fanvanzh / 3dtiles

The fastest tools for 3dtiles convert in the world!
Apache License 2.0
1.97k stars 594 forks source link

在ARM64的架构下,无法正常编译,有人遇到过这个问题吗 #263

Closed ideaww closed 1 year ago

ideaww commented 1 year ago

已经重新编译osg了 error: linking with cc failed: exit status: 1 | = note: LC_ALL="C" PATH="/root/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/bin:..................................................

= note: /usr/bin/ld: /data03/osgb_3dtiles/3dtiles-0.4/target/release/deps/_3dtile-ce939f82bd204161._3dtile.b735f8a5dcfe6b51-cgu.12.rcgu.o: in function _3dtile::shape::shape_batch_convert': _3dtile.b735f8a5dcfe6b51-cgu.12:(.text._ZN7_3dtile5shape19shape_batch_convert17h4c5e9f77bd57250bE+0x1b8): undefined reference toshp23dtile' /usr/bin/ld: /data03/osgb_3dtiles/3dtiles-0.4/target/release/deps/_3dtile-ce939f82bd204161._3dtile.b735f8a5dcfe6b51-cgu.2.rcgu.o: in function _3dtile::main': _3dtile.b735f8a5dcfe6b51-cgu.2:(.text._ZN7_3dtile4main17h003d126c958f8a29E+0xf60): undefined reference toosgb2glb' /usr/bin/ld: _3dtile.b735f8a5dcfe6b51-cgu.2:(.text._ZN7_3dtile4main17h003d126c958f8a29E+0x1504): undefined reference to wkt_convert' /usr/bin/ld: _3dtile.b735f8a5dcfe6b51-cgu.2:(.text._ZN7_3dtile4main17h003d126c958f8a29E+0x1d88): undefined reference toepsg_convert' /usr/bin/ld: /data03/osgb_3dtiles/3dtiles-0.4/target/release/deps/_3dtile-ce939f82bd204161._3dtile.b735f8a5dcfe6b51-cgu.7.rcgu.o: in function `core::ops::function::impls::<impl core::ops::function::FnMut for &F>::call_mut':

ideaww commented 1 year ago

在ARM64的架构下,需要修改参数类型 i8 ---> libc::c_char,要不然会报错。

使用 3dtiles-linux_osg_370 这个分支,在cargo、rustu、osg等都编译安装没有问题的情况下。

将build.rs最后那段配置修改如下: fn main() { match env::var("TARGET") { Ok(val) => match val.as_str() { "x86_64-pc-windows-gnu" => build_win_gun(), "aarch64-unknown-linux-gnu" => build_linux_unkonw(), "x86_64-pc-windows-msvc" => build_winmsvc(), & => {} }, _ => {} } } 这些修改了,就可以编译成功

还有能否再增加配置 限制使用CPU核数,要不然转换的时候所有cpu核数都用上了。 @fanvanzh