更新时间:2023-09-30 10:22:52
确保你有 xcode 命令线路工具已安装.
按照官方存储库中提供的说明进行操作.
来自个人经验.
使用 clang
编译 SystemC 库导致 segmentation fault: 11
每次我将 systemc
库包含到我的代码中时都会出错.为避免这种情况,请改用 gcc
.
请注意,我使用 gcc-8,安装了 homebrew.
$ cd path/to/systemc-2.3.3$ mkdir objdir$ cd 目标目录$出口CXX=g++-8$ ../配置$ make$ 安装
使用 $ make check
启动示例编译和单元测试.
编译和运行hello world示例:
$ export SYSTEMC_HOME=path/to/systemc-2.3.3$ g++-8 hello.cpp -o hello.o -L $SYSTEMC_HOME/lib-macosx64 -I $SYSTEMC_HOME/include/-l systemc$ ./hello.o
在 macOS 10.13.6 上测试;gcc 8.2.0 版;systemc-2.3.3
how to use and install SystemC in terminal mac OS X?
I tried the Logic poet application, But i use os x 10.10 so it doesn't work.
so i want to know how can i compile and execute SystemC in terminal.
I could't find the detail of SystemC in terminal.
Thank you
Ensure you have xcode command line tools installed.
Follow instructions provided in the official repository.
From personal experience.
Compiling SystemC library with clang
results in segmentation fault: 11
error every time I include systemc
library into my code. To avoid this use gcc
instead.
Note that I use gcc-8, installed with homebrew.
$ cd path/to/systemc-2.3.3
$ mkdir objdir
$ cd objdir
$ export CXX=g++-8
$ ../configure
$ make
$ make install
Use $ make check
to launch examples compilation and unit tests.
To compile and run hello world example:
$ export SYSTEMC_HOME=path/to/systemc-2.3.3
$ g++-8 hello.cpp -o hello.o -L $SYSTEMC_HOME/lib-macosx64 -I $SYSTEMC_HOME/include/ -l systemc
$ ./hello.o
Tested on macOS 10.13.6; gcc version 8.2.0; systemc-2.3.3