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
The other answer is correct and perfectly fine, however, I thought I'd also answer and provide a little more detail.
Install Apple's "Command Line Tools"
You have two options: install Xcode (a big download), or just the command line tools (a much smaller download). If your goal is simply building SystemC applications at the command line, then I recommend the latter.
Install Apple's "Command Line Tools" by launching Terminal, entering
then clicking Install. After that, you'll have
make
,clang
and more available at the command line.Build and install Accellera's SystemC implementation
Download the latest release from the Accellera Downloads page (annoyingly, you'll have to provide a few personal details) and extract the contents of the .zip file.
I like to keep a copy of the SystemC source code available, because it can be useful for debugging or understanding how something works. Therefore, I move the extracted folder (
systemc-2.3.1
) into~/Work/Other
. That's where I keep source code for third party libraries. However, you can put it wherever you like.Open Terminal, change into the extracted folder (
systemc-2.3.1
), and execute:The
--with-arch-suffix=
option prevents a-macosx64
suffix being add to thelib
folder name, allowing your build scripts to be simpler.After that process, the salient
include
andlib
folders should be available within thesystemc-2.3.1
folder.Configure your build environment
There are many ways you can do this; I have a simple approach that I believe is close to what the SystemC maintainers envisioned. I define two environment variables in my
.bash_profile
(which is executed for every new Terminal session on OS X):Build a SystemC application
You could use Make, the quintessential build tool, which you get with Apple's "Command Line Tools", or any one of the plethora of other options. I use SCons with
SConstruct
files that look something like this:View trace (VCD) files
Scansion is a nice tool for this. GTKWave is another option, but it's a bit clunky.
Install
Go here click the first link and fill in your information to get the source code
http://www.accellera.org/downloads/standards/systemc
Then
cd
to the folderThen run the following commands
After you do that it should all be saved in your use/local/(lib&include) directories
To Use
In code do this #include "systemc.h"
I use a single makefile normally. But you could write the following to link the library. Given your cpp file is called main.
Ensure you have xcode command line tools installed.
Follow instructions provided in the official repository.
From personal experience.
Compiling SystemC library with
clang
results insegmentation fault: 11
error every time I includesystemc
library into my code. To avoid this usegcc
instead.Use
$ make check
to launch examples compilation and unit tests.To compile and run hello world example: