IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> Xavier(6):ubuntu18.04安装casadi 报错与解决(recompile with -fPIC) -> 正文阅读

[系统运维]Xavier(6):ubuntu18.04安装casadi 报错与解决(recompile with -fPIC)

报错:

relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `N_VClone_Serial' which may bind externally can not be used when making a shared object; recompile with -fPIC

/usr/bin/ld: ../../../lib/libcasadi_sundials.a(nvector_serial.c.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `N_VClone_Serial' which may bind externally can not be used when making a shared object; recompile with -fPIC
../../../lib/libcasadi_sundials.a(nvector_serial.c.o): In function `N_VNewEmpty_Serial':
nvector_serial.c:(.text+0x1f0c): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../../lib/libcasadi_sundials.a(nvector_serial.c.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `N_VCloneEmpty_Serial' which may bind externally can not be used when making a shared object; recompile with -fPIC
nvector_serial.c:(.text+0x1f10): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../../lib/libcasadi_sundials.a(nvector_serial.c.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `N_VDestroy_Serial' which may bind externally can not be used when making a shared object; recompile with -fPIC
nvector_serial.c:(.text+0x1f14): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../../lib/libcasadi_sundials.a(nvector_serial.c.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `N_VSpace_Serial' which may bind externally can not be used when making a shared object; recompile with -fPIC
nvector_serial.c:(.text+0x1f18): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../../lib/libcasadi_sundials.a(nvector_serial.c.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `N_VGetArrayPointer_Serial' which may bind externally can not be used when making a shared object; recompile with -fPIC
nvector_serial.c:(.text+0x1f1c): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../../lib/libcasadi_sundials.a(nvector_serial.c.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `N_VSetArrayPointer_Serial' which may bind externally can not be used when making a shared object; recompile with -fPIC
nvector_serial.c:(.text+0x1f20): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../../lib/libcasadi_sundials.a(nvector_serial.c.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `N_VLinearSum_Serial' which may bind externally can not be used when making a shared object; recompile with -fPIC
nvector_serial.c:(.text+0x1f40): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../../lib/libcasadi_sundials.a(nvector_serial.c.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `N_VConst_Serial' which may bind externally can not be used when making a shared object; recompile with -fPIC
nvector_serial.c:(.text+0x1f48): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../../lib/libcasadi_sundials.a(nvector_serial.c.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `N_VProd_Serial' which may bind externally can not be used when making a shared object; recompile with -fPIC

解决--修改CMakeLists.txt

CMakeLists.txt418左右,添加在arm架构上可以使用fPIC的编译设置

修改前:

#######################################################################
############################# -fPIC ###################################
#######################################################################
# the following commands are needed to fix a problem with the libraries
# for linux 64 bits
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
  message(STATUS "x86_64 architecture detected - setting flag -fPIC")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fPIC")
endif()

修改后:

#######################################################################
############################# -fPIC ###################################
#######################################################################
# the following commands are needed to fix a problem with the libraries
# for linux 64 bits
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64"OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
  message(STATUS "x86_64 architecture detected - setting flag -fPIC")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fPIC")
endif()

编译通过

@meng

  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2022-04-15 00:46:32  更:2022-04-15 00:50:56 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/15 22:33:37-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码