如何在终端 mac OS X 中使用和安装 SystemC? [英] how to use and install SystemC in terminal mac OS X?

查看:35
本文介绍了如何在终端 mac OS X 中使用和安装 SystemC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在终端 mac OS X 中使用和安装 SystemC?
我尝试了 Logic 诗人应用程序,但我使用的是 os x 10.10,所以它不起作用.
所以我想知道如何在终端中编译和执行 SystemC.
我在终端中找不到 SystemC 的详细信息.

谢谢

解决方案

确保你有 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

这篇关于如何在终端 mac OS X 中使用和安装 SystemC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆