Installing SystemC on Windows, Linux, and macOS
SystemC is distributed as source code — there is no apt package, no brew formula, no installer. You download the source from Accellera, build it with CMake, and link your own simulations against the resulting library. This guide walks through the complete process on all three major platforms.
Prerequisites
| Platform | Required | Optional |
|---|---|---|
| Linux | g++ ≥ 7, cmake ≥ 3.14, make | ninja, gdb |
| macOS | Xcode Command Line Tools, cmake ≥ 3.14 | Homebrew, lldb |
| Windows | Visual Studio 2019/2022 (C++), cmake ≥ 3.14 | Git Bash, Ninja |
Download SystemC
The official source is Accellera. SystemC 2.3.3 is the latest stable release (IEEE 1666-2023 compliant).
- Go to accellera.org/downloads/standards/systemc
- Download systemc-2.3.3.tar.gz (free, requires creating an Accellera account)
- Or clone the open-source mirror:
git clone https://github.com/accellera-official/systemc.git
libsystemc-dev but it's usually outdated (2.3.1 or older). Always build from Accellera source to get the latest IEEE standard compliance.
Linux Installation
Step 1 — Install dependencies
# Ubuntu / Debian sudo apt-get update sudo apt-get install -y g++ cmake make # Fedora / RHEL / CentOS sudo dnf install -y gcc-c++ cmake make
Step 2 — Extract and build
tar -xzf systemc-2.3.3.tar.gz cd systemc-2.3.3 mkdir build && cd build cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/local/systemc-2.3.3 make -j$(nproc) sudo make install
This installs SystemC under /usr/local/systemc-2.3.3/ with headers in include/ and the library in lib/.
Step 3 — Set environment variables
Add to your ~/.bashrc or ~/.zshrc:
export SYSTEMC_HOME=/usr/local/systemc-2.3.3 export LD_LIBRARY_PATH=$SYSTEMC_HOME/lib:$LD_LIBRARY_PATH
source ~/.bashrc
Step 4 — Compile your first simulation
g++ -std=c++14 \ -I$SYSTEMC_HOME/include \ -L$SYSTEMC_HOME/lib \ -lsystemc \ -DSC_CPLUSPLUS=201402L \ hello.cpp -o hello ./hello
macOS Installation
Step 1 — Install dependencies
# Install Xcode Command Line Tools (if not already installed) xcode-select --install # Install CMake via Homebrew brew install cmake
Step 2 — Extract and build
tar -xzf systemc-2.3.3.tar.gz cd systemc-2.3.3 mkdir build && cd build cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=$HOME/systemc-2.3.3 \ -DCMAKE_CXX_STANDARD=14 make -j$(sysctl -n hw.logicalcpu) make install
lib-macosxarm
On ARM64 Macs the build system names the library directory lib-macosxarm (not lib). Use this exact name in your -L flag and DYLD_LIBRARY_PATH. Check with arch that you're not running under Rosetta.
Step 3 — Set environment variables
Add to your ~/.zshrc:
export SYSTEMC_HOME=$HOME/systemc-2.3.3 # ARM64 Mac — library dir is lib-macosxarm export DYLD_LIBRARY_PATH=$SYSTEMC_HOME/lib-macosxarm:$DYLD_LIBRARY_PATH
source ~/.zshrc
Step 4 — Compile your first simulation
g++ -std=c++14 \ -I$SYSTEMC_HOME/include \ -L$SYSTEMC_HOME/lib-macosxarm \ -lsystemc \ -DSC_CPLUSPLUS=201402L \ hello.cpp -o hello ./hello
Windows Installation
Step 1 — Install prerequisites
- Download and install Visual Studio 2022 — select the Desktop development with C++ workload
- Download and install CMake — tick "Add CMake to the system PATH" during install
Step 2 — Extract and build (Developer Command Prompt)
Open Developer Command Prompt for VS 2022 (not regular CMD):
:: Extract the archive first, then: cd systemc-2.3.3 mkdir build && cd build cmake .. -G "Visual Studio 17 2022" -A x64 ^ -DCMAKE_INSTALL_PREFIX=C:\systemc-2.3.3 ^ -DCMAKE_BUILD_TYPE=Release cmake --build . --config Release cmake --install . --config Release
Step 3 — Set environment variables
Open System Properties → Environment Variables and add:
| Variable | Value |
|---|---|
| SYSTEMC_HOME | C:\systemc-2.3.3 |
| PATH (append) | C:\systemc-2.3.3\lib |
Step 4 — Compile (Developer Command Prompt)
cl /std:c++17 /EHsc ^ /I"%SYSTEMC_HOME%\include" ^ hello.cpp ^ /link /LIBPATH:"%SYSTEMC_HOME%\lib" systemc.lib hello.exe
CMakeLists.txt — shown in the next section. This works identically on all three platforms.
Hello World — Verify the Installation
Create hello.cpp:
#include <systemc.h> SC_MODULE(Hello) { void say_hello() { cout << "Hello from SystemC @ " << sc_time_stamp() << endl; } SC_CTOR(Hello) { SC_THREAD(say_hello); } }; int sc_main(int argc, char* argv[]) { Hello h("h"); sc_start(); return 0; }
Expected output:
SystemC 2.3.3-Accellera --- Apr 9 2026 10:00:00
Copyright (c) 1996-2022 by all Contributors,
ALL RIGHTS RESERVED
Hello from SystemC @ 0 s
CMake Project Template (All Platforms)
Once SystemC is installed, the cleanest way to build your own projects is with CMake. Create a CMakeLists.txt in your project root:
cmake_minimum_required(VERSION 3.14) project(my_systemc_sim CXX) set(CMAKE_CXX_STANDARD 17) # Point to your SystemC install set(SYSTEMC_HOME "$ENV{SYSTEMC_HOME}") include_directories("${SYSTEMC_HOME}/include") link_directories("${SYSTEMC_HOME}/lib") add_executable(sim main.cpp) target_link_libraries(sim systemc)
Build on any platform:
mkdir build && cd build cmake .. cmake --build .
Common Errors and Fixes
| Error | Cause | Fix |
|---|---|---|
systemc.h: No such file |
Include path not set | Add -I$SYSTEMC_HOME/include to compiler flags |
cannot find -lsystemc |
Library path not set | Add -L$SYSTEMC_HOME/lib and check LD_LIBRARY_PATH |
dyld: Library not loaded (macOS) |
DYLD_LIBRARY_PATH not set |
Run export DYLD_LIBRARY_PATH=$SYSTEMC_HOME/lib |
LNK1104: cannot open 'systemc.lib' (Windows) |
Library path missing in linker | Add /LIBPATH:"%SYSTEMC_HOME%\lib" to linker flags |
Undefined sc_main |
Entry point missing | Rename main() to sc_main() — SystemC requires this |
| Architecture mismatch (M1 Mac) | Rosetta vs native ARM64 | Rebuild SystemC natively: arch -arm64 cmake .. |
Quick Reference
| Platform | Library file | Runtime env var |
|---|---|---|
| Linux | libsystemc.a / .so | LD_LIBRARY_PATH |
| macOS | libsystemc.a / .dylib | DYLD_LIBRARY_PATH |
| Windows | systemc.lib / .dll | PATH |
Summary
- Download SystemC 2.3.3 source from Accellera — no binary packages.
- Build with CMake on all platforms — consistent workflow everywhere.
- Set SYSTEMC_HOME environment variable and the platform runtime path variable.
- Use
sc_main()notmain()— SystemC replaces the standard entry point. - Use a CMakeLists.txt for your projects — portable across Linux, macOS, and Windows.
- Verify with the Hello World module — if
sc_time_stamp()prints0 s, everything works.