使用C ++ API为Openfoam和pytorch设置ABI

问题描述 投票:0回答:1

我正在尝试通过PyTorch的C ++ API(Ubuntu 18.04)结合Openfoam(6.0)和PyTorch(1.2)。我正在通过cmake编译代码。我在PyTorch的ABI上遇到麻烦。一些研究表明这是与ABI相关的问题。

如果我设置-D_GLIBCXX_USE_CXX11_ABI = 1,则会得到

 undefined reference to `c10::Error::Error(c10::SourceLocation,
 std::__cxx11::basic_string<char, std::char_traits<char>,
 std::allocator<char> > const&)'

如果我使用-D_GLIBCXX_USE_CXX11_ABI = 0,我会得到

 data.rel.ro._ZTVN4Foam8OPstreamE[_ZTVN4Foam8OPstreamE]+0x80): undefined reference to `Foam::UOPstream::writeQuoted(std::string
 const&, bool)'

我有两个问题:

  1. 是否可以同时使用两个ABI编译代码。
  2. 如果我必须使用ABI = 1重新编译Openfoam,该怎么办?
c++ compiler-errors pytorch abi openfoam
1个回答
0
投票

抱歉,不是答案,但是您碰巧解决了这个问题吗?我有同样的问题。

© www.soinside.com 2019 - 2024. All rights reserved.