ubuntu18.04系统.so库的查看

1. 查看软件的依赖项

ldd xxx.so;
ldd application;

2. 查看.so库中函数

在.so 库目录下执行下面代码

readelf -s xxx.so 

3.未完待续

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
对于Ubuntu 18.04,你可以使用以下步骤在C++中使用TensorFlow: 1. 安装依赖项: ``` sudo apt-get update sudo apt-get install build-essential curl sudo apt-get install libcurl3-dev libfreetype6-dev libpng-dev libzmq3-dev pkg-config sudo apt-get install python3-dev python3-pip python3-wheel python3-setuptools ``` 2. 安装TensorFlow C++: - 通过pip安装TensorFlow C++: ``` pip3 install tensorflow ``` - 或者,从源代码构建TensorFlow C++: - 克隆TensorFlow仓: ``` git clone https://github.com/tensorflow/tensorflow.git cd tensorflow ``` - 配置构建选项并构建TensorFlow C++: ``` ./configure bazel build --config=opt //tensorflow:libtensorflow_cc.so ``` - 在.bashrc或.bash_profile文件中设置LD_LIBRARY_PATH环境变量: ``` export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/tensorflow/bazel-bin/tensorflow/ ``` 3. 编写C++代码并链接TensorFlow: - 创建一个C++文件,比如example.cpp,并添加以下代码: ```cpp #include <tensorflow/cc/client/client_session.h> #include <tensorflow/cc/ops/standard_ops.h> #include <tensorflow/core/framework/tensor.h> int main() { using namespace tensorflow; using namespace tensorflow::ops; Scope root = Scope::NewRootScope(); auto A = Const(root, { {3.f, 2.f}, {-1.f, 0.f} }); auto b = Const(root, { {3.f, 5.f} }); auto product = MatMul(root.WithOpName("product"), A, b, MatMul::TransposeB(true)); std::vector<Tensor> outputs; ClientSession session(root); TF_CHECK_OK(session.Run({product}, &outputs)); for (const auto& tensor : outputs) { std::cout << tensor.matrix<float>() << std::endl; } return 0; } ``` - 编译C++代码: ``` g++ -std=c++11 -I/path/to/tensorflow -L/path/to/tensorflow/bazel-bin/tensorflow example.cpp -ltensorflow_cc -o example ``` - 运行生成的可执行文件: ``` ./example ``` 这样,你就可以在Ubuntu 18.04上使用C++编写和运行TensorFlow代码了。请确保将`/path/to/tensorflow`替换为你实际的TensorFlow安装路径。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值