Skip to content

Commit

Permalink
deploy: 0124754
Browse files Browse the repository at this point in the history
  • Loading branch information
kira-96 committed Jan 20, 2024
1 parent 03bfd86 commit ae515fa
Show file tree
Hide file tree
Showing 17 changed files with 207 additions and 125 deletions.
2 changes: 1 addition & 1 deletion archives/index.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions categories/epics/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
前置步骤 这篇笔记是交叉编译EPICS和IOC内容的补充。
在进行下面步骤前,请完成配置交叉编译环境和编译 EPICS Base。
这里依旧以龙芯架构为例。
EPICS base 编译完成后,可以看到bin目录下有linux-loongarch64、linux-x86_64两个目录,linux-x86_64目录下比linux-loongarch64目录多出了许多perl脚本,我们需要把这些脚本复制到龙架构的目录下,下面编译需要用到。
1 $ cp ./bin/linux-x86_64/*.pl ./bin/linux-loongarch64/ 编译 在EPICS-Qt安装中已经介绍过编译ACAI。这次是使用交叉编译方式,步骤略有不同。
1 2 3 4 5 6 7 8 9 10 11 12 cd ~/loongson/ git clone https://github.com/andrewstarritt/acai.git cd acai vi configure/RELEASE.local # 修改交叉编译的目标架构,和EPICS base中保持一致 EPICS_HOST_ARCH=linux-loongarch64 # 修改EPICS_BASE路径,例: EPICS_BASE=/home/ubuntu/loongson/base-7.0.8 make LD=loongarch64-linux-gnu-ld CC=loongarch64-linux-gnu-gcc CCC=loongarch64-linux-gnu-g++ # 等待编译完成 编译完成后可以在lib/linux-loongarch64/目录下找到libacai.so。</p></div><footer class=entry-footer><span title='2023-12-26 19:31:56 +0800 +0800'>十二月 26, 2023</span>&nbsp;·&nbsp;1 分钟&nbsp;·&nbsp;63 字</footer><a class=entry-link aria-label="post link to 交叉编译 ACAI" href=https://kira-96.github.io/notes/cross-compiling-acai/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2 class=entry-hint-parent>交叉编译EPICS和IOC</h2></header><div class=entry-content><p>前言 之前已经讲过在龙芯3A5000(loongarch64)上编译运行EPICS,不过这种情况只适用于有完整开发环境的情况下进行编译。一些时候,我们只有编译器,而缺少make,perl等工具,比如一些开发板厂商提供的开发套件。这种情况下,就需要通过交叉编译(cross-compiling)的方式来编译EPICS。
EPICS base 编译完成后,可以看到bin目录下有linux-la64、linux-x86_64两个目录,linux-x86_64目录下比linux-la64目录多出了许多perl脚本,我们需要把这些脚本复制到龙架构的目录下,下面编译需要用到。
1 $ cp ./bin/linux-x86_64/*.pl ./bin/linux-la64/ 编译 在EPICS-Qt安装中已经介绍过编译ACAI。这次是使用交叉编译方式,步骤略有不同。
1 2 3 4 5 6 7 8 9 10 11 12 cd ~/loongson/ git clone https://github.com/andrewstarritt/acai.git cd acai vi configure/RELEASE.local # 修改交叉编译的目标架构,和EPICS base中保持一致 EPICS_HOST_ARCH=linux-la64 # 修改EPICS_BASE路径,例: EPICS_BASE=/home/ubuntu/loongson/base-7.0.8 make LD=loongarch64-linux-gnu-ld CC=loongarch64-linux-gnu-gcc CCC=loongarch64-linux-gnu-g++ # 等待编译完成 编译完成后可以在lib/linux-la64/目录下找到libacai.so。</p></div><footer class=entry-footer><span title='2023-12-26 19:31:56 +0800 +0800'>十二月 26, 2023</span>&nbsp;·&nbsp;1 分钟&nbsp;·&nbsp;63 字</footer><a class=entry-link aria-label="post link to 交叉编译 ACAI" href=https://kira-96.github.io/notes/cross-compiling-acai/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2 class=entry-hint-parent>交叉编译EPICS和IOC</h2></header><div class=entry-content><p>前言 之前已经讲过在龙芯3A5000(loongarch64)上编译运行EPICS,不过这种情况只适用于有完整开发环境的情况下进行编译。一些时候,我们只有编译器,而缺少make,perl等工具,比如一些开发板厂商提供的开发套件。这种情况下,就需要通过交叉编译(cross-compiling)的方式来编译EPICS。
这里以龙芯金龙2K500先锋开发板为例,我们使用Ubuntu-20.04作为构建系统,详细讲解如何构建出可以在开发板上运行的EPICS工具包,并部署在开发板上。
由于开发板上没有开发环境,即使编译出目标平台的EPICS Base,我们依然不能直接在开发板上创建和编译IOC。所以,我们还是使用Ubuntu-20.04作为构建系统,创建并编译IOC,最后在开发板上运行。
配置交叉编译环境 关于这一节,之前的文章已经详细讲过,参考配置交叉编译环境。
如果你使用的是其他开发套件,请按照开发手册安装配置好环境。
编译 EPICS Base 首先,下载、解压Base,参考以前的文章。
在龙芯3A5000(loongarch64)上编译运行EPICS中我已经详细讲解了如何在龙架构上编译EPICS,这次,需要在原来对源码修改的基础上,再增加对交叉编译的支持。
添加configure/os/CONFIG.linux-x86_64.linux-loongarch64
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 # CONFIG.linux-x86_64.linux-loongarch64 # # Definitions for linux-x86_64 host - linux-loongarch64 target builds # Sites may override these in CONFIG_SITE.linux-x86_64.linux-loongarch64 #------------------------------------------------------- VALID_BUILDS = Ioc Command GNU_TARGET = loongarch64-linux-gnu # prefix of compiler tools CMPLR_SUFFIX = CMPLR_PREFIX = $(addsuffix -,$(GNU_TARGET)) # Provide a link-time path for readline if needed OP_SYS_INCLUDES += $(READLINE_DIR:%=-I%/include) READLINE_LDFLAGS = $(READLINE_DIR:%=-L%/lib) RUNTIME_LDFLAGS_READLINE_YES_NO = $(READLINE_DIR:%=-Wl,-rpath,%/lib) RUNTIME_LDFLAGS += \ $(RUNTIME_LDFLAGS_READLINE_$(LINKER_USE_RPATH)_$(STATIC_BUILD)) SHRLIBDIR_LDFLAGS += $(READLINE_LDFLAGS) PRODDIR_LDFLAGS += $(READLINE_LDFLAGS) # Library flags STATIC_LDFLAGS_YES= -Wl,-Bstatic STATIC_LDFLAGS_NO= STATIC_LDLIBS_YES= -Wl,-Bdynamic STATIC_LDLIBS_NO= 添加configure/os/CONFIG_SITE....</p></div><footer class=entry-footer><span title='2023-12-12 16:26:35 +0800 +0800'>十二月 12, 2023</span>&nbsp;·&nbsp;4 分钟&nbsp;·&nbsp;712 字</footer><a class=entry-link aria-label="post link to 交叉编译EPICS和IOC" href=https://kira-96.github.io/posts/%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91epics%E5%92%8Cioc/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2 class=entry-hint-parent>Windows上使用MinGW编译安装EPICS
添加configure/os/CONFIG.linux-x86_64.linux-la64
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 # CONFIG.linux-x86_64.linux-la64 # # Definitions for linux-x86_64 host - linux-loongarch64 target builds # Sites may override these in CONFIG_SITE.linux-x86_64.linux-la64 #------------------------------------------------------- VALID_BUILDS = Ioc Command GNU_TARGET = loongarch64-linux-gnu # prefix of compiler tools CMPLR_SUFFIX = CMPLR_PREFIX = $(addsuffix -,$(GNU_TARGET)) # Provide a link-time path for readline if needed OP_SYS_INCLUDES += $(READLINE_DIR:%=-I%/include) READLINE_LDFLAGS = $(READLINE_DIR:%=-L%/lib) RUNTIME_LDFLAGS_READLINE_YES_NO = $(READLINE_DIR:%=-Wl,-rpath,%/lib) RUNTIME_LDFLAGS += \ $(RUNTIME_LDFLAGS_READLINE_$(LINKER_USE_RPATH)_$(STATIC_BUILD)) SHRLIBDIR_LDFLAGS += $(READLINE_LDFLAGS) PRODDIR_LDFLAGS += $(READLINE_LDFLAGS) # Library flags STATIC_LDFLAGS_YES= -Wl,-Bstatic STATIC_LDFLAGS_NO= STATIC_LDLIBS_YES= -Wl,-Bdynamic STATIC_LDLIBS_NO= 添加configure/os/CONFIG_SITE....</p></div><footer class=entry-footer><span title='2023-12-12 16:26:35 +0800 +0800'>十二月 12, 2023</span>&nbsp;·&nbsp;4 分钟&nbsp;·&nbsp;712 字</footer><a class=entry-link aria-label="post link to 交叉编译EPICS和IOC" href=https://kira-96.github.io/posts/%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91epics%E5%92%8Cioc/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2 class=entry-hint-parent>Windows上使用MinGW编译安装EPICS
<span class=entry-hint title=Draft><svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" fill="currentcolor"><path d="M160-410v-60h3e2v60H160zm0-165v-60h470v60H160zm0-165v-60h470v60H160zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22-4.5 22.5T862.09-380L643-160H520zm3e2-263-37-37 37 37zM580-220h38l121-122-18-19-19-18-122 121v38zm141-141-19-18 37 37-18-19z"/></svg></span></h2></header><div class=entry-content><p>需要使用的软件 Strawberry Perl for Windows EPICS Base 编译Base需要有gcc、g++、make、perl这些工具,但其实我们只需要安装Strawberry Perl就可以了,安装完成后就有了MinGW的编译环境,足够编译安装EPICS了。
这里使用MinGW环境编译EPICS,不使用MSVC编译器。
安装 Strawberry Perl 这里选择 Strawberry Perl 5.32.1.1。经测试base-7.0.7可正常编译,后续版本的perl编译会报错。
Expand Down Expand Up @@ -50,11 +50,11 @@
“Architecture ’loongarch64-linux-gnu-thread-multi’ not recognized”
既然识别不了loongarch64,那我们就手动添加一行,让它可以识别就行了,即使看不太懂上面的脚本也没关系,看个半懂就行了。
我们在如图的光标位置添加一行内容,来让它可以识别loongarch64架构。
1 return 'linux-loongarch64' if m/^loongarch64-linux/; 此时我们再执行一下make命令。
1 return 'linux-la64' if m/^loongarch64-linux/; 此时我们再执行一下make命令。
可以看到,现在已经可以识别出loongarch64-linux了,报错和在3A4000上编译时也基本一样了。
以下步骤同样适用于在3A4000(mips64)上编译EPICS,只需要将loongarch64全部替换为mips64
以下步骤同样适用于在3A4000(mips64)上编译EPICS,只需要将la64全部替换为mips64
剩下的报错就是,没有找到对应的编译配置项,我们同样可以仿照已经做了适配的架构来改写,直接按照下面步骤来就可以了。
添加 CONFIG.Common.linux-loongarch64 1 2 3 4 $ cd configure/os/ # 添加 CONFIG....</p></div><footer class=entry-footer><span title='2023-02-01 15:51:40 +0800 +0800'>二月 1, 2023</span>&nbsp;·&nbsp;3 分钟&nbsp;·&nbsp;474</footer><a class=entry-link aria-label="post link to 龙芯3A5000(loongarch64)上编译运行EPICS" href=https://kira-96.github.io/posts/%E9%BE%99%E8%8A%AF3a5000loongarch64%E4%B8%8A%E7%BC%96%E8%AF%91%E8%BF%90%E8%A1%8Cepics/></a></article></main><footer class=footer><span>© 2019-2024 <a href=/>kira</a> ·</span>
添加 CONFIG.Common.linux-la64 1 2 3 4 $ cd configure/os/ # 添加 CONFIG....</p></div><footer class=entry-footer><span title='2023-02-01 15:51:40 +0800 +0800'>二月 1, 2023</span>&nbsp;·&nbsp;4 分钟&nbsp;·&nbsp;776</footer><a class=entry-link aria-label="post link to 龙芯3A5000(loongarch64)上编译运行EPICS" href=https://kira-96.github.io/posts/%E9%BE%99%E8%8A%AF3a5000loongarch64%E4%B8%8A%E7%BC%96%E8%AF%91%E8%BF%90%E8%A1%8Cepics/></a></article></main><footer class=footer><span>© 2019-2024 <a href=/>kira</a> ·</span>
<span>Powered by
<a href=https://gohugo.io/ rel="noopener noreferrer" target=_blank>Hugo</a> &
<a href=https://github.com/adityatelange/hugo-PaperMod/ rel=noopener target=_blank>PaperMod</a></span></footer><a href=#top aria-label="go to top" title="Go to Top (Alt + G)" class=top-link id=top-link accesskey=g><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentcolor"><path d="M12 6H0l6-6z"/></svg></a><script>let menu=document.getElementById("menu");menu&&(menu.scrollLeft=localStorage.getItem("menu-scroll-position"),menu.onscroll=function(){localStorage.setItem("menu-scroll-position",menu.scrollLeft)}),document.querySelectorAll('a[href^="#"]').forEach(e=>{e.addEventListener("click",function(e){e.preventDefault();var t=this.getAttribute("href").substr(1);window.matchMedia("(prefers-reduced-motion: reduce)").matches?document.querySelector(`[id='${decodeURIComponent(t)}']`).scrollIntoView():document.querySelector(`[id='${decodeURIComponent(t)}']`).scrollIntoView({behavior:"smooth"}),t==="top"?history.replaceState(null,null," "):history.pushState(null,null,`#${t}`)})})</script><script>var mybutton=document.getElementById("top-link");window.onscroll=function(){document.body.scrollTop>800||document.documentElement.scrollTop>800?(mybutton.style.visibility="visible",mybutton.style.opacity="1"):(mybutton.style.visibility="hidden",mybutton.style.opacity="0")}</script><script>document.getElementById("theme-toggle").addEventListener("click",()=>{document.body.className.includes("dark")?(document.body.classList.remove("dark"),localStorage.setItem("pref-theme","light")):(document.body.classList.add("dark"),localStorage.setItem("pref-theme","dark"))})</script></body></html>
Loading

0 comments on commit ae515fa

Please sign in to comment.