- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 ubuntu 19.04 docker 的 docker 来安装 PyCarl。我有卡尔和卡尔解析器(master14版本)。但是,“python setup.pydevelop”命令在 setup.py 中失败,并出现调用进程异常,退出代码为 2。初始命令为:
subprocess.check_output(['cmake', '--build', '.', '--target', ext.name] + build_args, cwd=self.build_temp)
归结为:
cmake --build . --target core --config Release -- -j4
但是,我最终遇到了退出代码为 2 的 CalledProcessError。任何建议我可能出现错误的帮助都会有很大帮助。
此外,看来上述错误是由于评论中建议的先前 Unresolved 错误造成的。
root@196abd768845:/pycarl# python setup.py develop
running develop
running egg_info
writing lib/pycarl.egg-info/PKG-INFO
writing dependency_links to lib/pycarl.egg-info/dependency_links.txt
writing top-level names to lib/pycarl.egg-info/top_level.txt
reading manifest file 'lib/pycarl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'lib/pycarl.egg-info/SOURCES.txt'
running build_ext
Pycarl - Using carl with master14 branch.
Pycarl - Using carl 14.18.10 from /carl/build
Pycarl - carl parser extension from included.
Pycarl - Support for CLN found and included.
Pycarl - CMake args=['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/pycarl/lib/pycarl/', '-DPYTHON_EXECUTABLE=/usr/bin/python3', '-DCMAKE_BUILD_TYPE=Release', '-Dcarl_DIR=/carl/build']
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgmpxx.a(osdoprnti.o): relocation R_X86_64_PC32 against symbol `__gmp_allocate_func' can not be used when making ashared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgmpxx.a(osfuns.o): relocation R_X86_64_PC32 against symbol `_ZNKSt5ctypeIcE8do_widenEc' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgmp.a(memory.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
上面继续了很多变量,最后显示:
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgmp.a(randmt.o): relocation R_X86_64_PC32 against symbol `__gmp_free_func' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/core.dir/build.make:142: ../../lib/pycarl/core.cpython-37m-x86_64-linux-gnu.so] Error 1
make[2]: *** [CMakeFiles/Makefile2:295: CMakeFiles/core.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:307: CMakeFiles/core.dir/rule] Error 2
make: *** [Makefile:196: core] Error 2
我确实尝试了export CXXFLAGS="$CXXFLAGS -fPIC"
,但这并没有解决错误。
补充2:谢谢你们的意见。但我可以看到 .a 和 .so 都存在于库中。那么为什么它不选择共享的呢?或者如何动态链接它?我尝试了 LD_LIBRARY_PATH 但没有解决问题。
最佳答案
感谢您铺路@Tsyparev和 @Darklighter 。我想我已经明白了。Carl 安装了 gmp 6.2.1,因为它发现默认的 gmp tp 是 6.0.0。我所要做的就是将路径(即 LD_RUN_PATH
和 LD_LIBRARY_PATH
,对于像我这样的菜鸟来说)链接到该文件夹(即 carl/build/对我来说是 resources/lib
)。
关于python - PyCarl 的 cmake 构建过程失败,并要求使用 -fPIC 重新编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58047469/
运行 pip install cmake 时出现上述错误在 alpine linux (WSL) 上。 完整错误: /home/user# pip install cmake Collecting c
我的项目依赖 mariadb-connector-c我正在尝试使用 cmake 自动化下载、构建和链接过程。 我目前将项目下载到一个目录中,然后尝试执行生成忍者文件并运行它们,但我根本无法运行 cma
我正在尝试像这样在 cmake 中执行 execute_process execute_process(COMMAND ${CMAKE_COMMAND} -P myScript.cmake 这仅在文件
我想知道如果我没有给它任何变量告诉它在哪里找到它,cmake 如何找到我的 llvm cmake 配置。 我是 LLVM 新手。我正在构建一个 Hello World LLVM pass。我在 Ubu
我正在开发一个使用 CMake 的项目。顶CMakeLists.txt文件包含以下行: cmake_minimum_required(VERSION 3.7.2) # Kittens will die
我正在使用 Meego 1.2 工具链使用 cmake 运行构建(长话短说)。这个特定的工具链需要使用 --sysroot 选项来查找它需要的任何库。 set (CMAKE_CXX_FLAGS "-f
我们有一些源代码处理工具,可以从多个“片段”生成原始汇编文件等内容。 当使用 make 中的这些工具时,我们可以通过让源处理工具发出“依赖文件”来确保最新的构建,就像 gcc 一样-MD 标志。 例如
如何在 MSYS2 中安装和配置“cmake”?我尝试安装以下 MSYS 包 我在运行任何 cmake 命令时都收到以下错误 '''CMakeLists.txt:5 (cmake_minimum_re
有没有办法在 CMake 中得到一个变量列表?具体来说,我想要做的是调用一个现有函数,该函数接受多个变量并检查它们的计算结果是否为 true。 在某些情况下,其中一些变量将是空列表(计算结果为 fal
我有两组测试(功能测试和单元测试),我希望能够指定通过 cmake 运行哪一组。 一组测试是我想通过“make test”运行的单元测试。 另一组测试是我想通过“制作功能测试”来运行的功能测试。 目前
我的目标是查看有关调用 g++ 的详细信息由 cmake 直接调用从命令行。我不关心 make 的输出就这个问题而言。 根据official FAQ和 the accepted answer on a
我有一个生成库的CMake项目。我已经编写了一个CMake脚本FindXXX.cmake来帮助我的图书馆的用户。这样,他们可以使用find_package(XXX)并获取所需的变量。到现在为止还挺好。
当我看到带有命名空间的 CMake 库时,它们总是在表单中Parent::Component . 如果我有一个足够大的库,那么该库的子部分可能包含组件。我想知道是否可以/适合做 ParentProje
CMake 变量和属性似乎完成了非常相似的事情,我一直无法理解它们之间的区别。 它们每个都有自己的文档部分,但两者都会影响构建系统,两者都是“预先存在的”,并且两者都可以基于其他 CMake 命令动态
我有一个包含多个子目录的 CMake 项目,例如: dir1 subdir11 subdir12 dir2 subdir21 subdir22 根 CMakeLists
如果您想将静态库链接到共享库或可执行文件,同时保持所有符号可见(例如,您可以稍后打开它以找到它们),在 Linux/BSD 上执行此操作的一种非可移植方式是使用标志-Wl,--whole-archiv
CMake 自动创建一个 FooTarget.cmake文件例如添加 install(EXPORT FooTargets FILE FooTargets.cmake NAMESPACE Foo
在CMake中,ELSE和ENDIF控制流函数将表达式作为参数。根据文档,这些是optional。那么这些目的是什么?仅仅是为了维护目的而使原始IF表达式更清晰,还是提供某些功能? 最佳答案 正如您所
我是 cmake 的新手,我发现它非常令人沮丧。我试图在构建运行时评估的文件路径中使用通配符,而不是在生成构建时。 我创建了一个构建,它使用 SWIG 为某些 C++ 代码生成 Java 包装器。我可
我可能在谷歌上搜索错误,但我无法找到 .cmake 文件的用途。 我刚刚偶然发现了一个我必须使用的项目的 CMake 工具,我很难理解它是如何工作的。我明白在包含 CMakeLists.txt 的目录
我是一名优秀的程序员,十分优秀!