Fully automated installation scripts for openEMS (open Electromagnetic Magnetic Simulator) — a free, open-source FDTD (Finite-Difference Time-Domain) electromagnetic field solver.
These scripts build CSXCAD + openEMS from source (Linux/macOS) or install the official pre-built Windows package, including all dependencies (compiler, VTK, CGAL, Boost, HDF5, TinyXML, Qt, Python/Octave interfaces) and optionally easyMesh4openEMS (automated mesher) and scikit-rf (RF library).
- Supported Systems
- Quick Start
- Linux / macOS (Source Build)
- Windows (PowerShell, Pre-built Package)
- Options
- What the Script Does
- Verify Installation
- scikit-rf
- easyMesh4openEMS
- Update
- Log File
- Troubleshooting
- External Sources & References
- License
| OS / Distro | Package Manager | Status |
|---|---|---|
| Debian / Ubuntu | apt | ✅ |
| Fedora / RHEL / AlmaLinux / Rocky | dnf | ✅ |
| Arch Linux | pacman | ✅ |
| Alpine | apk | ✅ |
| Void Linux | xbps | ✅ |
| openSUSE | zypper | ✅ |
| macOS | Homebrew | ✅ |
| FreeBSD | pkg | ✅ |
| Windows 10/11 (64-bit) | PowerShell | ✅ (pre-built package) |
git clone https://github.com/istra711/OpenEMS-Installation-Script.git
cd OpenEMS-Installation-Script
chmod +x install_openems.sh
sudo ./install_openems.shActivate PATH afterwards:
source ~/.bashrcgit clone https://github.com/istra711/OpenEMS-Installation-Script.git
cd OpenEMS-Installation-Script
# Run in PowerShell (right-click → "Run with PowerShell" or in terminal):
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\install_openems.ps1Optional:
.\install_openems.ps1 -InstallDir D:\Tools\openEMS # Custom install directory
.\install_openems.ps1 -NoOctave # Skip Octave interface
.\install_openems.ps1 -NoPython # Skip Python extensions
.\install_openems.ps1 -DryRun # Preview onlyThe shell script (install_openems.sh) compiles openEMS from source using the official update_openEMS.sh build system from thliebig/openEMS-Project.
- OS Detection — package manager is auto-detected
- Bootstrap — installs git, cmake, compiler toolchain
- Clone — recursively clones
thliebig/openEMS-Project(including submodules) - Dependencies — via official
scripts/install_deps.sh --auto(fallback: manual package lists) - Octave — installed (unless
--no-octave) - Build — via
update_openEMS.sh(official build system) - easyMesh —
easyMesh4openEMSinstalled viapip installinto the openEMS venv (unless--no-easymesh; requires Python extensions) - scikit-rf — installed via
pip install scikit-rfinto the openEMS venv (unless--no-skrf) - Environment — PATH + OCTAVE_PATH written to
~/.bashrc/~/.zshrc - Verification — tests for openEMS binary, AppCSXCAD, Python extensions, Octave, easyMesh, scikit-rf
The PowerShell script (install_openems.ps1) uses the official pre-built Windows package (no source build needed, as recommended by the official docs).
- Determines the latest release via the GitHub API
- Downloads
openEMS_win*.zip - Extracts to
C:\openEMS(or-InstallDir) - Installs Python extensions (CSXCAD + openEMS wheels, matching your Python version)
- Sets
PATH+CSXCAD_INSTALL_PATH(user environment variables) - Installs scikit-rf via pip
- Clones + installs easyMesh4openEMS via pip
- Sets up
OCTAVE_PATH(if Octave is present) - Verifies everything
| Parameter | Description |
|---|---|
-InstallDir |
Target directory (default: C:\openEMS) |
-Python |
Python interpreter (default: python3/python/py -3) |
-NoPython |
Skip Python extensions |
-NoSkrf |
Skip scikit-rf installation |
-NoEasyMesh |
Skip easyMesh installation |
-NoOctave |
Skip Octave interface setup |
-DryRun |
Preview only |
- Windows 10/11 (64-bit)
- Python 3 (for Python extensions, optional)
- Git (for easyMesh, optional)
--prefix DIR Install directory (default: ~/opt/openEMS)
--src-dir DIR Source code clone directory (default: ~/openEMS-Project)
--no-python Skip Python extensions
--no-ctb Skip Circuit Toolbox (CTB)
--no-gui Disable AppCSXCAD GUI (headless, e.g. servers)
--no-octave Skip Octave installation
--no-easymesh Skip easyMesh4openEMS (auto-mesher)
--no-skrf Skip scikit-rf (RF library)
--with-hyp2mat Enable hyp2mat (HyperLynx PCB import, deprecated)
--with-MPI Enable MPI support
--njobs N Number of parallel build jobs (default: CPU cores)
--update Update existing installation (git pull + rebuild)
--skip-dep-check Skip automatic dependency check
--dry-run Preview only, don't execute
-h, --help Show help
# Full installation to ~/opt/openEMS (with Octave)
sudo ./install_openems.sh
# To /opt/openEMS, headless (no GUI), 4 build jobs
sudo ./install_openems.sh --prefix /opt/openEMS --no-gui --njobs 4
# Without Octave
sudo ./install_openems.sh --no-octave
# Without easyMesh
sudo ./install_openems.sh --no-easymesh
# Without scikit-rf
sudo ./install_openems.sh --no-skrf
# Update existing installation
sudo ./install_openems.sh --update
# C++ engine only, no Python
sudo ./install_openems.sh --no-python| Dependency | Purpose | Source |
|---|---|---|
| git | Source code cloning | git-scm.com |
| cmake | Build system | cmake.org |
| GCC / Clang | C++ compiler | gcc.gnu.org / clang.llvm.org |
| VTK | 3D visualization (AppCSXCAD) | vtk.org |
| CGAL | Computational geometry | cgal.org |
| Boost | C++ utility libraries | boost.org |
| HDF5 | Hierarchical data format (field dumps) | hdfgroup.org |
| TinyXML | XML parsing | tinyxml.sourceforge.io |
| Qt5 | GUI framework (AppCSXCAD) | qt.io |
| Octave | Matlab-compatible scripting interface | octave.org |
| Python 3 | Scripting + extensions | python.org |
# Test binary
openEMS # Should print version banner
# Test Python extensions (activate venv first if present)
source ~/opt/openEMS/venv/bin/activate
cd / && python3 -c "import CSXCAD, openEMS; print(openEMS.__version__)"
# Test Octave interface
octave --eval "InitCSX"
# Test easyMesh
source ~/opt/openEMS/venv/bin/activate
cd / && python3 -c "import easyMesh; print('easyMesh OK')"
# Test scikit-rf
source ~/opt/openEMS/venv/bin/activate
cd / && python3 -c "import skrf; print('scikit-rf', skrf.__version__)"# Test binary
openEMS.exe # Should print version banner
# Test Python extensions
python -c "import CSXCAD, openEMS; print('CSXCAD', CSXCAD.__version__); print('openEMS', openEMS.__version__)"
# Test AppCSXCAD
AppCSXCAD.exescikit-rf (skrf) is a Python library for RF/microwave network analysis — S-parameters, network analysis, plotting, and more. Used for post-processing openEMS simulation results (e.g., from UI_data / S-parameter exports).
Installation is automatic via pip install scikit-rf into the openEMS venv.
import skrf as rf
# Load S-parameters from a Touchstone file (e.g., openEMS export)
ntwk = rf.Network('my_simulation.s2p')
# Analyze
print(ntwk.s_db) # S-parameters in dB
ntwk.plot_s_db() # Plot
# Time domain / impedance
t = ntwk.s_timeDocumentation: https://scikit-rf.readthedocs.io/
easyMesh4openEMS is an automated mesher for the Python bindings of openEMS/CSXCAD. It auto-detects geometries and generates an optimized FDTD grid.
Requirement: CSXCAD/openEMS Python extensions (the script builds these by default with --python).
from openEMS import openEMS
from CSXCAD import ContinuousStructure
from easyMesh import GenerateMesh, enhance_csx_for_auto_mesh, enhance_FDTD_for_auto_mesh
FDTD = openEMS()
CSX = ContinuousStructure()
FDTD.SetCSX(CSX)
# Wrap CSX/FDTD BEFORE adding geometry/ports/boundary
primitives_mesh_setup = {}
properties_mesh_setup = {}
CSX = enhance_csx_for_auto_mesh(CSX, primitives_mesh_setup)
FDTD = enhance_FDTD_for_auto_mesh(FDTD, primitives_mesh_setup)
# Set boundary AFTER wrapping (PML detection)
FDTD.SetBoundaryCond(['PML_8', 'PML_8', 'PML_8', 'PML_8', 'PML_8', 'PML_8'])
global_mesh_setup = {
'start_frequency': 1e9,
'stop_frequency': 3e9,
'drawing_unit': 1e-6,
'mesh_resolution': 'medium',
'boundary_distance': ['auto', 'auto', 'auto', 'auto', 'auto', 'auto'],
}
# Define geometry (AddBox, AddMaterial etc.) ...
# Generate mesh
GenerateMesh(CSX, global_mesh_setup, primitives_mesh_setup, properties_mesh_setup)More details & tutorials: https://github.com/MustafaAlchalabi/easyMesh4openEMS
sudo ./install_openems.sh --updateThis performs a git pull --recurse-submodules and rebuilds.
All installation output is written to ~/openems_install.log.
| Problem | Solution |
|---|---|
openEMS: command not found |
Run source ~/.bashrc or open a new terminal |
| Python extensions not importable | Activate venv: source ~/opt/openEMS/venv/bin/activate |
CSXCAD_INSTALL_PATH not set (Windows) |
Re-run installer or set manually: [Environment]::SetEnvironmentVariable("CSXCAD_INSTALL_PATH", "C:\openEMS", "User") |
| Build fails on missing VTK/CGAL | Install manually: sudo apt install libvtk9-dev libcgal-dev (Debian/Ubuntu) |
Octave InitCSX not found |
Set OCTAVE_PATH: export OCTAVE_PATH="$OCTAVE_PATH:~/opt/openEMS/share/openEMS/octave" |
| easyMesh import fails | Ensure CSXCAD/openEMS Python extensions are installed first |
| Permission denied | Use sudo for dependency installation; build runs as user |
This project depends on and references the following open-source projects:
| Project | License | Source | Description |
|---|---|---|---|
| openEMS | GPLv3 | openems.de · github.com/thliebig/openEMS | FDTD time-domain electromagnetic field solver |
| openEMS-Project | GPLv3 | github.com/thliebig/openEMS-Project | Main repository (CSXCAD + openEMS + tools) |
| CSXCAD | LGPLv3 | github.com/thliebig/CSXCAD | Continuous Structure library for openEMS |
| Project | License | Source | Description |
|---|---|---|---|
| easyMesh4openEMS | GPL-3.0 | github.com/MustafaAlchalabi/easyMesh4openEMS | Automated FDTD mesh generation for openEMS/CSXCAD Python bindings |
| Project | License | Source | Description |
|---|---|---|---|
| scikit-rf | BSD-3-Clause | scikit-rf.org · github.com/scikit-rf/scikit-rf | Python library for RF/microwave network analysis (S-parameters, Touchstone) |
| Project | License | Source | Description |
|---|---|---|---|
| VTK | BSD-3-Clause | vtk.org · github.com/Kitware/VTK | 3D visualization and computer graphics (AppCSXCAD) |
| CGAL | GPL-3.0 / LGPL-3.0 | cgal.org · github.com/CGAL/cgal | Computational Geometry Algorithms Library |
| Boost | BSL-1.0 | boost.org · github.com/boostorg/boost | C++ utility libraries |
| HDF5 | BSD-3-Clause | hdfgroup.org · github.com/HDFGroup/hdf5 | Hierarchical Data Format (field dump storage) |
| TinyXML | zlib | sourceforge.net/projects/tinyxml | XML parsing library |
| Qt5 | LGPL-3.0 | qt.io · github.com/qt/qtbase | Cross-platform GUI framework (AppCSXCAD) |
| CMake | BSD-3-Clause | cmake.org · github.com/Kitware/CMake | Build system generator |
| GCC | GPL-3.0 | gcc.gnu.org | GNU Compiler Collection |
| Clang/LLVM | Apache-2.0 | clang.llvm.org · github.com/llvm/llvm-project | C/C++ compiler |
| GNU Octave | GPL-3.0 | octave.org · github.com/gnu-octave/octave | Matlab-compatible scripting language |
| Python | PSF | python.org · github.com/python/cpython | Scripting language + extensions |
| Format | Specification | Description |
|---|---|---|
| Touchstone | IBIS Open | S-parameter file exchange (.s1p, .s2p, …) |
| HDF5 | hdfgroup.org | openEMS field dump storage |
| Document | URL |
|---|---|
| openEMS Homepage | https://www.openems.de/ |
| openEMS Documentation | https://docs.openems.de/ |
| openEMS Tutorials | https://openems.de/index.php/Tutorials.html |
| Windows Package Install | https://docs.openems.de/en/latest/install/package.html |
| Source Install (Linux) | https://docs.openems.de/en/latest/install/source.html |
| CSXCAD Reference | https://docs.openems.de/en/latest/python_interface/csxcad.html |
| openEMS Python Interface | https://docs.openems.de/en/latest/python_interface/openEMS.html |
| Component | License |
|---|---|
| This installation script | See repository license |
| openEMS | GPLv3 |
| CSXCAD | LGPLv3 |
| easyMesh4openEMS | GPL-3.0 |
| scikit-rf | BSD-3-Clause |
Note: openEMS and easyMesh4openEMS are GPL-3.0 licensed. If you distribute a combined work, the GPL-3.0 terms apply to the whole.
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit changes:
git commit -am 'Add my feature' - Push to the branch:
git push origin feature/my-feature - Create a Pull Request
- Thorsten Liebig — creator of openEMS and CSXCAD
- Mustafa Alchalabi — easyMesh4openEMS
- openEMS community — openems.de · GitHub Discussions