網站首頁 編程語言 正文
以下為centos7下配置方法
下載systemc源碼包:SystemC (accellera.org)
將壓縮包放置到用戶目錄下,并解壓
tar -zxvf systemc-2.3.3.tar.gz
進入到systemc-2.3.3文件夾
cd systemc-2.3.3
新建臨時文件夾tmp,并進入其中
mkdir tmpcd tmp
運行如下命令
../configure make make install
至此,文件夾中生成include與lib-linux64兩個文件夾
設置環境變量
export LD_LIBRARY_PATH=home/centos7/systemc-2.3.3/lib-linux64 //其中/home/cnetos7/為文件解壓路徑,根據自身情況確定
執行該命令只在當前可用,重啟后即失效,若需要長期可用,建議在用戶目錄下的.bashrc下添加該條命令,并需要執行以下命令,重啟終端生效。
source .bashrc
運行一個systemc程序進行測試。
test.cpp
//all systemc modules should include systemc.h header file #inlcude"systemc.h" //hello_world is module name SC_MODULE(hello_world){ SC_CTOR(hello_world){ //nothing in constructor } void say_hello(){ //Print "Hello world!!!" to the console. cout<<"Hello World!!!"<<endl; } }; //此處分號不要忘了 //sc_main in top level function like in C++ main int sc_main(int argc, char* argv[]){ hello_world hello("HELLO"); return 0; }
編譯并運行
g++ test.cpp -I/home/cp/Simulator/systemc/include -L/home/cp/Simulator/systemc/lib-linux64 -o test -lsystemc ./test
屏幕上將會顯示
makefile
LIBDIR=-L/home/cp/Simulator/systemc/lib-linux64 INCDIR=-I/home/cp/Simulator/systemc/include LIB=-lsystemc all: g++ -o test test.cpp $(LIBDIR) $(INCDIR) $(LIB) clean: rm -rf *.o
原文鏈接:https://blog.csdn.net/weixin_44381276/article/details/121641494
相關推薦
- 2022-07-16 不同存圖方式下的DFS和BFS實現
- 2022-07-18 Stack和Queue容器的系列操作( 詳解 )
- 2023-03-02 Flutter有狀態組件StatefulWidget生命周期詳解_Android
- 2022-04-09 windows中查看進程(netstat)和殺掉進程(taskkill)的幾個命令
- 2022-05-12 C++線程安全的隊列你了解嘛_C 語言
- 2022-09-01 C語言中的程序環境與預處理詳情_C 語言
- 2022-05-13 larvel8 批量刪除
- 2022-11-02 Python+eval函數實現動態地計算數學表達式詳解_python
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支