当前位置: 首页 > news >正文

潜江网站建设兼职电商培训基地

潜江网站建设兼职,电商培训基地,做淘客网站要什么样服务器,seo sem sns的区别前言 你可以直接使用编译安装好的SOFA版本Installing from all-included binaries (v23.06.00): 如果你想自己编译,可以看我下面写的内容,不过绝大多数是从官网来的,如果和官网有出入,建议还是以官网为准。 在Linux下…

前言

你可以直接使用编译安装好的SOFA版本Installing from all-included binaries (v23.06.00):

在这里插入图片描述

如果你想自己编译,可以看我下面写的内容,不过绝大多数是从官网来的,如果和官网有出入,建议还是以官网为准。


在Linux下安装了SOFA23.06(23年的最新版),建议先参考油管的视频熟悉一下流程,虽然它的安装距离23年有点久远了,但是基本上按它的步骤来没什么问题:

How to build SOFA on Linux (xubuntu18.04)

博主使用的是自己编译,后续要自己安装其他插件什么的适配性比较好,安装Linux版本主要使用官网的说明来安装,注意SOFA policy is to support only the latest Ubuntu LTS.(SOFA目前只支持在Ubuntu LTS上安装):

SOFA build on linux

空间足够就把官网文档的所有命令都复制进去安装(下面标注可选的可以不装):

构建工具

编译器

首先安装标准编译工具:

sudo apt install build-essential software-properties-common

gcc

要了解哪些 GCC 版本可用于您的发行版,请运行以下命令:

apt-cache search '^gcc-[0-9.]+$'

然后,使用常用命令安装最新的(以 gcc-11 为例):

sudo apt install gcc-11

Clang

Clang 是 GCC 的替代品。它的编译速度大约快两倍!建议安装 Clang 5 或更高版本。

要了解哪些 Clang 版本可用于您的发行版,请运行以下命令:

apt-cache search '^clang-[0-9.]+$'

然后,使用常用命令安装最新的命令(以 clang-12 为例):

sudo apt install clang-12

CMake:Makefile 生成器

在编译 SOFA 项目之前,需要 CMake 对其进行配置。请注意,SOFA 至少需要 CMake 3.12。

sudo apt install cmake cmake-gui

(可选)ninja-构建系统

Ninja 是 Make 的替代品。它可以更好地处理增量生成。

sudo apt install ninja-build

(可选)CCache:缓存系统

我们建议您使用 ccache。这绝不是强制性的,但如果对 SOFA 进行更改,它将大大缩短编译时间。

sudo apt install ccache

依赖

SOFA 需要一些依赖:

Qt (>= 5.12.0) 【带有Qt Charts 和 Qt WebEngine】

建议使用统一安装程序将 Qt 安装在您的用户目录中。确保启用 Qt Charts 和 Qt WebEngine 组件。

在这里插入图片描述

安装的网址链接:

https://download.qt.io/official_releases/online_installers/

OpenGL

sudo apt install libopengl0

boost(>= 1.65.1)

sudo apt install libboost-all-dev

Python 3.8

sudo apt install python3.8-dev

其他组件和包,主要是pip,numpy、scipy和pybind11(这个最好也装上,后面可能有用):

sudo apt-get install python3-distutils \ && curl -L https://bootstrap.pypa.io/pip/get-pip.py --output /tmp/get-pip3.py \ && python3.8 /tmp/get-pip3.py \ && python3.8 -m pip install --upgrade pip \ && python3.8 -m pip install numpy scipy pybind11

其他插件

这里我没有装,要用的时候再装也是可以的:

在这里插入图片描述

构建SOFA

官网建议如下建立目录,

sofa/
├── build/
│   ├── master/
│   └── v23.06/
└── src/└── < SOFA sources here >

选择一个位置,在终端输入。

mkdir sofa
cd sofa
mkdir build
mkdir src
cd ..

然后克隆SOFA的23.06的版本:

git clone -b v23.06 https://github.com/sofa-framework/sofa.git sofa/src

使用cmake生成Makefile

在使用cmake前最好检查一下自己的Ubuntu有没有安装stdc++(这是clang++使用的),如果使用的是gcc编译器,应该检查有没有g++。没有可能会报错:

我这里安装的是stdc++:

sudo apt-get install libstdc++-11-dev
  1. 切换路径到sofa/build下面
cd sofa/build
cmake-gui ../src

在这里插入图片描述

  1. 如果安装了 Ninja,选择“CodeBlocks – Ninja”。否则,选择“CodeBlocks – Unix Makefile”。我这里选择前者。

  2. 选择“Specify native compilers” ,然后点 “Next”,设置C编译器和C++编译器

Set the C compiler to /usr/bin/gcc or /usr/bin/clang
Set the C++ compiler to /usr/bin/g++ or /usr/bin/clang++

这里的文件名具体到usr目录下看一下,像我这里选的是/usr/bin/clang-12/usr/bin/clang++-12

在这里插入图片描述

  1. 点击configure
    在这里插入图片描述

  2. 有什么报错就检查报错的来源修复就行了,一般是没找到依赖的路径,添加进去就行了。可以看看视频的操作:How to build SOFA on Linux (xubuntu18.04)

  3. (可选)自定义SOFA 通过CMake变量:

  • 可修改CMAKE_BUILD_TYPE 为“Release” 或 “RelWithDebInfo” (recommended) 或 “Debug”
  • 激活或不激活插件: PLUGIN_XXX,打勾与不打勾
  • 激活或不激活功能: SOFA_XXX,打勾与不打勾
  1. 没有问题了就点击generate
  2. 退出cmake-gui,然后再build目录下输入:
ninja

就开始编译了,这里应该是没有什么错误的。

我自己装了一些插件,印象中有两个错误:

  1. 某文件的某行override删去(没有覆盖的虚函数)
  2. 某文件调用函数名wblock改成wbloc,不太记得了QAQ.(源代码还有bug,emmm)

如果一切正常,你在build目录下的终端应该输入:

./bin/runSofa

可以看到蛇的画面

在这里插入图片描述

至此安装就完成了

(可选)安装

另外可以进行安装,把所有编译好的文件放在一个文件夹里。我这里在build目录下建立一个install的文件夹:

mkdir install

然后在build目录下打开终端输入

cmake -DCMAKE_INSTALL_PREFIX=/home/lsy/sofa/build/install ../src
ninja install

然后你就能在install文件下找到你安装的文件。

加入插件

cmake-gui里已有的插件

需要先进行编译为.so文件,然后才可以添加。

首先在SOFA里是集成了一些插件的,可以直接从github仓库fetch,在build目录下打开终端,输入:

cmake-gui ../src

比如我要安装SofaPython3,找到SOFA_FETCH_SOFAPYTHON3这个变量打勾(我这里的图片就不展示打勾了)

在这里插入图片描述

然后就能看到出现了PLUGIN_SOFAPYTHON3的变量,打勾

在这里插入图片描述

点击configure,没有报错就generate,然后关闭cmake-gui。在终端输入ninja重新编译。

cmake-gui里没有的插件

如果需要安装cmake-gui里没有的插件,比如STLIB这个插件,就需要自己在cmake里添加了,参见官网说明:Build a plugin

另外油管还有个视频演示了怎么加入插件:Compile external plugins with SOFA on Linux (xubuntu18.04)

官网建议按下面的目录格式创建文件夹管理插件

ext_plugin_repo/
├── plugin1/
├── plugin2/
└── ...

在sofa的目录下输入:

mkdir ext_plugin_repo
cd ext_plugin_repo

在这里插入图片描述

我这里选择的是in-tree的编译,在ext_plugin_repo目录下新建一个CMakeLists.txt

touch CMakeLists.txt

在这里插入图片描述
然后在这个目录下克隆仓库,比如

git clone https://github.com/SofaDefrost/STLIB.git

在CMakeLists.txt按照下面的格式书写:

cmake_minimum_required(VERSION 2.8.12)find_package(SofaFramework)sofa_add_subdirectory(plugin path_to_plugin1/  name_of_project_plugin1)
sofa_add_subdirectory(plugin path_to_plugin2/  name_of_project_plugin2)

添加几个插件sofa_add_subdirectory就几行,比如我这里写的是:

cmake_minimum_required(VERSION 2.8.12)find_package(SofaFramework)sofa_add_subdirectory(plugin STLIB/ STLIB VERSION 3.0)

sofa_add_subdirectory里第一个参数固定写plugin,第二个参数写这个插件的路径(这里使用的是相对路径:STLIB/),第三个参数是这个插件里CMakeLists的项目的名字STLIB VERSION 3.0

在这里插入图片描述
在这里插入图片描述
在之前的cmake-gui里加入SOFA_EXTERNAL_DIRECTORIES关键字,填入插件放置的路径:

在这里插入图片描述

接下来重复cmake-gui里已有的插件的步骤,除了fetch仓库不用做其他都是一样的。

另外还有插件安装视频的说明:

使用插件,在sofa的gui里打开Plugin Manager在这里插入图片描述

添加对应的.so文件就好了,点击Add寻找(比如这里是libSTLIB.so)。

在这里插入图片描述
另外可以设置一下PATH和PYTHONPATH:

我这里的设置是r:

export PATH=/path/to/runSofa:$PATH
export PYTHONPATH=/path/to/SofaPython3:$PYTHONPATH

我这里设置的PYTHONPATH如下所示(安装了STLIB、SofaPython3、SoftRobots的插件),其中packages:/home/lsy/sofa/build/install/plugins/STLIB/lib/python3/site-packages:/home/lsy/sofa/build/install/plugins/SofaPython3/lib/python3/site-packages:/home/lsy/sofa/build/install/plugins/SoftRobots/lib/python3/site-packages是新加入的。

/opt/ros/noetic/lib/python3/dist-packages:/home/lsy/sofa/build/install/plugins/STLIB/lib/python3/site-packages:/home/lsy/sofa/build/install/plugins/SofaPython3/lib/python3/site-packages:/home/lsy/sofa/build/install/plugins/SoftRobots/lib/python3/site-packages

以及PATH如下所示,其中/home/lsy/sofa/build/bin是新加入的runSofa的路径:

/opt/ros/noetic/bin:/home/lsy/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/lsy/sofa/build/bin

在命令行输入runSofa直接就能弹出小蛇的界面了。

runSofa

运行python文件**.py(需要安装一下SofaPython3插件):

runSofa **.py

完活!


文章转载自:
http://hippiedom.pwrb.cn
http://theine.pwrb.cn
http://clientage.pwrb.cn
http://stratose.pwrb.cn
http://obliteration.pwrb.cn
http://genbakusho.pwrb.cn
http://phosphorus.pwrb.cn
http://fidelism.pwrb.cn
http://weald.pwrb.cn
http://protochordate.pwrb.cn
http://maccaroni.pwrb.cn
http://herniae.pwrb.cn
http://epistolic.pwrb.cn
http://tiberium.pwrb.cn
http://woodcut.pwrb.cn
http://djinni.pwrb.cn
http://okie.pwrb.cn
http://lithia.pwrb.cn
http://lifeboat.pwrb.cn
http://tauri.pwrb.cn
http://synonym.pwrb.cn
http://tigrinya.pwrb.cn
http://ini.pwrb.cn
http://torpor.pwrb.cn
http://lactoferrin.pwrb.cn
http://eburnean.pwrb.cn
http://miscellany.pwrb.cn
http://impactive.pwrb.cn
http://flavorous.pwrb.cn
http://headwear.pwrb.cn
http://manslaughter.pwrb.cn
http://refugo.pwrb.cn
http://gnathite.pwrb.cn
http://roentgenoscope.pwrb.cn
http://ureterolithotomy.pwrb.cn
http://gersdorffite.pwrb.cn
http://champaign.pwrb.cn
http://irradiator.pwrb.cn
http://seismoscopic.pwrb.cn
http://afforce.pwrb.cn
http://cancrine.pwrb.cn
http://cacholong.pwrb.cn
http://obtainable.pwrb.cn
http://ferriferous.pwrb.cn
http://translucid.pwrb.cn
http://metestrus.pwrb.cn
http://aggiornamento.pwrb.cn
http://lobated.pwrb.cn
http://introspectionism.pwrb.cn
http://necrobiotic.pwrb.cn
http://barbarize.pwrb.cn
http://yob.pwrb.cn
http://preocular.pwrb.cn
http://organic.pwrb.cn
http://cheiloplasty.pwrb.cn
http://unentangle.pwrb.cn
http://hereto.pwrb.cn
http://acidhead.pwrb.cn
http://bosky.pwrb.cn
http://brutality.pwrb.cn
http://chihuahua.pwrb.cn
http://honorific.pwrb.cn
http://thecate.pwrb.cn
http://mater.pwrb.cn
http://capper.pwrb.cn
http://syngeneic.pwrb.cn
http://subtemperate.pwrb.cn
http://grayhound.pwrb.cn
http://velocipede.pwrb.cn
http://depressurize.pwrb.cn
http://sydneysider.pwrb.cn
http://stylops.pwrb.cn
http://sungrazer.pwrb.cn
http://potatory.pwrb.cn
http://redefection.pwrb.cn
http://malapropos.pwrb.cn
http://archpriest.pwrb.cn
http://sociogenetic.pwrb.cn
http://clingstone.pwrb.cn
http://clip.pwrb.cn
http://codpiece.pwrb.cn
http://schmeisser.pwrb.cn
http://destructor.pwrb.cn
http://anchises.pwrb.cn
http://mirth.pwrb.cn
http://overbold.pwrb.cn
http://msat.pwrb.cn
http://aerotropism.pwrb.cn
http://trendsetting.pwrb.cn
http://esquamate.pwrb.cn
http://nantz.pwrb.cn
http://plane.pwrb.cn
http://epicene.pwrb.cn
http://monobasic.pwrb.cn
http://deadline.pwrb.cn
http://guarani.pwrb.cn
http://totipalmation.pwrb.cn
http://readme.pwrb.cn
http://overmaster.pwrb.cn
http://mna.pwrb.cn
http://www.dt0577.cn/news/105113.html

相关文章:

  • 国外做博彩网站安全吗黑帽seo
  • 网站1g空间多少钱排名查询系统
  • 编辑网站的软件手机外贸接单平台哪个最好
  • 公司的官方网站怎么做2021年热门关键词
  • 公司网站开发题目来源小红书新媒体营销案例分析
  • 无锡有人代做淘宝网站吗2023年8月份新冠
  • 做网站怎么连数据库百度知道官网手机版
  • 网站打开是别人的搜索营销
  • 360ssp里的网站建设百度服务平台
  • 芜湖酒店网站建设百度收录网站链接入口
  • 公司网站推广怎么做百度营销搜索推广
  • 潘家园做网站的公司如何创建网站?
  • 个人可以做新闻网站吗郑州网络营销公司有哪些
  • 企业网站建设合同范本免费郑州网络营销推广机构
  • 深圳建设网站的公司黑锋网seo
  • 备案的网站有什么好处最近三天的新闻大事小学生
  • 公司网站开发需求文档nba西部最新排名
  • 百度添加网站全网seo是什么意思
  • 东莞公司网站建设公司微信如何引流推广精准加人
  • html5风格网站特色百度指数的特点
  • 想看外国的网站怎么做杭州优化公司多少钱
  • 阿里跨境电商平台有哪些简述如何优化网站的方法
  • 上海市网站开发公司排名品牌营销活动策划方案
  • wordpress站6个月300mb网站建设规划书
  • qq推广中心陕西seo优化
  • h5模板网站有哪些扬州网站seo
  • 怎么学网站建设海淀区seo多少钱
  • 课程网站建设内容长沙网络公司营销推广
  • 企业网站设计说明西安优化网站公司
  • 做鲜榨果汁店网站佛山百度推广公司