### Example Download Skip Output (Console) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/clone-build-install.rst Illustrates the console output when the build script skips downloading files because they already exist and have valid SHA-256 digests. This indicates that pre-downloaded or previously built files are being reused. ```console Skip download (file exists, hash valid): /home/fdtd/openEMS-Project/downloads/tinyxml-2.6.2.tar.gz Skip download (file exists, hash valid): /home/fdtd/openEMS-Project/downloads/tinyxml-2.6.2-defineSTL.patch Skip download (file exists, hash valid): /home/fdtd/openEMS-Project/downloads/tinyxml-2.6.1-entity.patch Skip download (file exists, hash valid): /home/fdtd/openEMS-Project/downloads/CVE-2021-42260.patch Skip download (file exists, hash valid): /home/fdtd/openEMS-Project/downloads/CVE-2023-34194.patch Skip download (file exists, hash valid): /home/fdtd/openEMS-Project/downloads/tinyxml_CMakeLists.patch ``` -------------------------------- ### Build and Install QCSXCAD GUI using CMake Source: https://github.com/thliebig/openems-project/blob/master/doc-src/development/cpp.rst This snippet details the steps to build and install the QCSXCAD GUI component. It uses CMake for configuration, specifying the installation prefix. The process involves creating a build directory, configuring, compiling, and installing. ```console cd QCSXCAD mkdir build cd build cmake ../ -DCMAKE_INSTALL_PREFIX=$HOME/opt/openEMS make make install cd .. ``` -------------------------------- ### Build and Install fparser using CMake Source: https://github.com/thliebig/openems-project/blob/master/doc-src/development/cpp.rst This snippet demonstrates the steps to build and install the fparser library using CMake. It involves navigating to the fparser directory, creating a build directory, configuring the build with a specified installation prefix, compiling, and installing. ```console cd fparser mkdir build cd build cmake ../ -DCMAKE_INSTALL_PREFIX=$HOME/opt/openEMS make make install cd .. ``` -------------------------------- ### Build and Install Python Extension with setup.py (Bash) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Builds and installs Python extensions using the legacy setup.py script. The 'install --user' command installs to the user's home directory, while 'install' without '--user' respects the venv path. ```bash python setup.py build_ext python setup.py install --user # python setup.py install ``` -------------------------------- ### Debug pip Installation with Verbose Mode Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Use the '--verbose' flag with pip to get detailed output for debugging installation issues. This can help identify missing dependencies or configuration problems. ```bash pip3 install . --verbose ``` -------------------------------- ### Build and Install AppCSXCAD GUI using CMake Source: https://github.com/thliebig/openems-project/blob/master/doc-src/development/cpp.rst This snippet shows the procedure for building and installing the AppCSXCAD GUI application. Similar to other components, it utilizes CMake for configuration with a specified installation prefix. The steps include creating a build directory, configuring, compiling, and installing. ```console cd AppCSXCAD mkdir build cd build cmake ../ -DCMAKE_INSTALL_PREFIX=$HOME/opt/openEMS make make install cd .. ``` -------------------------------- ### Install Pre-built Wheel File (Batch) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Installs a pre-built Python wheel file using pip. This example shows installation for Python 3.10. ```batch pip install openEMS_win_*.whl ``` -------------------------------- ### Build and Install openEMS using CMake Source: https://github.com/thliebig/openems-project/blob/master/doc-src/development/cpp.rst This snippet outlines the process for building and installing the main openEMS project. It requires CMake configuration with the installation prefix and the root directories for both fparser and CSXCAD. The steps involve creating a build directory, configuring, compiling, and installing. ```console cd openEMS mkdir build cd build cmake ../ -DCMAKE_INSTALL_PREFIX=$HOME/opt/openEMS -DFPARSER_ROOT_DIR=$HOME/opt/openEMS -DCSXCAD_ROOT_DIR=$HOME/opt/openEMS make make install cd .. ``` -------------------------------- ### Build and Install CSXCAD using CMake Source: https://github.com/thliebig/openems-project/blob/master/doc-src/development/cpp.rst This snippet shows how to build and install the CSXCAD library. It requires specifying the installation prefix and the root directory of fparser using CMake variables. The process includes creating a build directory, configuring, compiling, and installing. ```console cd CSXCAD mkdir build cd build cmake ../ -DCMAKE_INSTALL_PREFIX=$HOME/opt/openEMS -DFPARSER_ROOT_DIR=$HOME/opt/openEMS make make install cd .. ``` -------------------------------- ### Configure Proxychains for SOCKS Proxy Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/auto_install.rst This example shows how to configure the 'proxychains.conf' file to use a SOCKS proxy, specifically for 'proxychains-ng'. It involves uncommenting and modifying the proxy settings to match your SOCKS proxy server details. ```bash # If using proxychains-ng, you may have to uncomment the last line # of /etc/proxychains.conf, and replace it with the parameters of the # SOCKS proxy, such as:: # # socks5 127.0.0.1 8080 ``` -------------------------------- ### Build and Install OpenEMS Automatically Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/clone-build-install.rst Builds and installs OpenEMS using the provided update script. It allows specifying an installation directory and enabling optional features like CTB and Python support. ```bash ./update_openEMS.sh ~/opt/openEMS ./update_openEMS.sh ~/opt/openEMS --with-CTB --python ``` -------------------------------- ### Install OpenEMS on FreeBSD using Ports Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/package.rst This snippet shows how to install the OpenEMS package on FreeBSD by syncing the Ports tree and then building and installing the 'science/openems' port. This method is suitable for users who prefer managing packages through the FreeBSD Ports system. ```console cd /usr/ports/science/openems make ``` -------------------------------- ### Create venv with System Site Packages (Bash) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Creates a Python virtual environment named 'venv' in the specified home directory, exposing system-wide packages. This is a one-time setup command. ```bash python3 -m venv --system-site-packages $HOME/opt/openEMS/venv ``` -------------------------------- ### Verify Octave Installation (Bash) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/octave/install.rst This command verifies the installation of Octave by displaying its version. Ensure Octave is installed and accessible in your system's PATH. ```bash octave --version ``` -------------------------------- ### Configure CXXFLAGS and LDFLAGS for OpenEMS (Bash) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst This example shows how to manually configure CXXFLAGS and LDFLAGS for the C++ compiler and linker, respectively. This is an advanced method for managing header include paths (-I), library linking paths (-L), and runtime library paths (-Wl,-rpath,) when automatic path detection is insufficient or needs to be overridden. ```bash export CSXCAD_INSTALL_PATH_IGNORE=1 export OPENEMS_INSTALL_PATH_IGNORE=1 export CXXFLAGS="-I$HOME/opt/openEMS/include -I/usr/local/include $CXXFLAGS" export LDFLAGS="-L$HOME/opt/openEMS/lib -L/usr/local/lib -Wl,-rpath,$HOME/opt/openEMS/lib $LDFLAGS" ``` -------------------------------- ### Install Visualization Dependencies on Void Linux Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Details the process for installing VTK with Qt for AppCSXCAD visualization on Void Linux, noting that direct installation is not possible and requires building from source or disabling the GUI. Also notes ParaView is not available. ```bash # To build a custom VTK, first remove the system package's # development files sudo xkps-remove vtk-dev # Install VTK build-time dependencies, prepare to build it from source! sudo xbps-install -S qt6-base-devel qt6-declarative-devel qt6-qt5compat-devel ``` -------------------------------- ### Update OpenEMS Project (Bash) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/clone-build-install.rst Updates the OpenEMS project to the latest release by pulling changes from the repository and updating submodules. It also includes an option to build Python extensions. Be aware that local changes to tutorials or examples may be overwritten. ```bash cd openEMS-Project git pull --recurse-submodules ./update_openEMS.sh ~/opt/openEMS --python ``` -------------------------------- ### Manual Python Extension Installation using pip Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst This snippet demonstrates the manual installation of CSXCAD and openEMS Python extensions using pip. It involves creating and activating a virtual environment, setting installation paths, and then installing each package separately. Ensure C++ dependencies are pre-installed. ```bash # create an isolated venv in ~/opt/openEMS/venv and activate it python3 -m venv $HOME/opt/openEMS/venv source $HOME/opt/openEMS/venv/bin/activate # CSXCAD_INSTALL_PATH and OPENEMS_INSTALL_PATH must be set! export CSXCAD_INSTALL_PATH=$HOME/opt/openEMS export OPENEMS_INSTALL_PATH=$HOME/opt/openEMS # build and install CSXCAD Python extension cd openEMS-Project/CSXCAD/python pip3 install . # build and install openEMS Python extension cd openEMS-Project/openEMS/python pip3 install . ``` -------------------------------- ### Install ParaView on FreeBSD Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs ParaView, a recommended tool for visualizing simulation results on FreeBSD systems. ```bash sudo pkg install paraview ``` -------------------------------- ### Manual Python Extension Installation for openEMS (Bash) Source: https://context7.com/thliebig/openems-project/llms.txt Installs openEMS Python extensions manually using pip within a created virtual environment. This involves setting specific environment variables and navigating to the extension directories before running pip install. ```bash # Create and activate venv python3 -m venv $HOME/opt/openEMS/venv source $HOME/opt/openEMS/venv/bin/activate # Set required environment variables export CSXCAD_INSTALL_PATH=$HOME/opt/openEMS export OPENEMS_INSTALL_PATH=$HOME/opt/openEMS # Install CSXCAD Python extension cd openEMS-Project/CSXCAD/python pip3 install . # Install openEMS Python extension cd openEMS-Project/openEMS/python pip3 install . ``` -------------------------------- ### Set CSXCAD and OpenEMS Installation Paths Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Configures the necessary environment variables, CSXCAD_INSTALL_PATH and OPENEMS_INSTALL_PATH, which specify the installation prefix for the C++ libraries of CSXCAD and openEMS. These variables are required for the Python extension installation process to locate the compiled C++ components. Both libraries should be installed to the same prefix. ```bash export CSXCAD_INSTALL_PATH="$HOME/opt/openEMS" export OPENEMS_INSTALL_PATH="$HOME/opt/openEMS" ``` -------------------------------- ### Verify Installation Directory Structure Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Checks the contents of the installation directory specified by OPENEMS_INSTALL_PATH to confirm that the necessary include files and libraries have been installed correctly. This includes verifying the presence of the CSXCAD header directory and the shared object files for both CSXCAD and openEMS. ```console $ ls $OPENEMS_INSTALL_PATH bin include lib lib64 share $ ls $OPENEMS_INSTALL_PATH/include CSXCAD fparser.hh openEMS $ ls $OPENEMS_INSTALL_PATH/lib libCSXCAD.so libCSXCAD.so.0.6.3 libfparser.so.4 libnf2ff.so libnf2ff.so.0.1.0 libopenEMS.so.0 libCSXCAD.so.0 libfparser.so libfparser.so.4.5.1 libnf2ff.so.0 libopenEMS.so libopenEMS.so.0.0.36 ``` -------------------------------- ### Install Optional Python Packages on AlmaLinux Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs a set of optional Python packages using the system's package manager. These packages (e.g., setuptools, numpy, matplotlib) can be managed externally if not using the default pip installation within a virtual environment. ```bash sudo dnf install python3-setuptools python3-wheel python3-setuptools_scm \ python3-Cython python3-numpy python3-h5py \ python3-matplotlib ``` -------------------------------- ### Install ParaView on macOS Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs ParaView, a recommended tool for visualizing simulation results, on macOS using Homebrew. ```bash brew install paraview ``` -------------------------------- ### Test Python Extensions with OpenEMS and CSXCAD Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Demonstrates how to import and test the installed CSXCAD and openEMS Python extensions from a neutral directory. This verifies that the extensions are correctly installed and accessible in the Python environment. It also shows how to retrieve the version of each library. ```console $ cd / # Important: always leave "python" first. $ cd / && python3 -c "import CSXCAD; print(CSXCAD.ContinuousStructure())" $ cd / && python3 -c "import CSXCAD; print(CSXCAD.__version__)" 0.6.4.dev76+gccb4c218e $ cd / && python3 -c "import openEMS; print(openEMS.openEMS())" $ cd / && python3 -c "import openEMS; print(openEMS.__version__)" '0.0.36.post1.dev115+gfbb03a107.d20251112' ``` -------------------------------- ### Install AppCSXCAD Visualization Tool on AlmaLinux Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs the vtk-qt package, which is required to use AppCSXCAD for visualizing 3D models. This is a recommended step for enhanced visualization capabilities. ```bash sudo dnf install vtk-qt ``` -------------------------------- ### Verify openEMS Installation (Bash) Source: https://context7.com/thliebig/openems-project/llms.txt Checks if the openEMS executable and the AppCSXCAD graphical user interface are installed and accessible. Running 'openEMS' should display version information, and 'AppCSXCAD' should launch the GUI. ```bash # Check openEMS executable $ openEMS ---------------------------------------------------------------------- | openEMS 64bit -- version v0.0.33 | (C) 2010-2015 Thorsten Liebig GPL license ---------------------------------------------------------------------- # Check AppCSXCAD GUI (should open a window) $ AppCSXCAD ``` -------------------------------- ### Install Minimum openEMS Dependencies on AlmaLinux Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs the essential packages required for the minimum functionality of openEMS, including development tools like git, gcc, and various libraries such as boost-devel and vtk-devel. It's recommended to install git first to prevent dependency conflicts. ```bash # install git first to avoid dependency graph conflicts sudo dnf install git sudo dnf install git gcc gcc-c++ cmake \ boost-devel tinyxml-devel hdf5-devel vtk-devel CGAL-devel ``` -------------------------------- ### Install Octave on macOS Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs Octave, a recommended environment for scripting, on macOS using Homebrew. ```bash brew install octave ``` -------------------------------- ### Install Visualization and Scripting Dependencies on FreeBSD Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs packages for 3D model visualization with AppCSXCAD (Qt5) and Octave/Python scripting on FreeBSD using pkg. ```bash sudo pkg install qt5 ``` ```bash sudo pkg install octave ``` ```bash sudo pkg install python3 ``` -------------------------------- ### Check AppCSXCAD Executable (Linux) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/check.rst Tests if the AppCSXCAD graphical viewer executable is installed and runnable on Linux. Successful execution should open the AppCSXCAD window. ```console $ AppCSXCAD ``` -------------------------------- ### Install Minimum openEMS Dependencies on CentOS 7 Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs the core packages required for openEMS functionality on CentOS 7, including git, gcc, and libraries like gmp-devel and tinyxml-devel. Installing git first is recommended to avoid dependency issues. ```bash # install git first to avoid dependency graph conflicts yum install git yum install gcc gcc-c++ gmp-devel mpfr-devel \ git tinyxml-devel hdf5-devel ``` -------------------------------- ### Install ParaView for Result Visualization on AlmaLinux Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs the 'paraview' package, which is recommended for visualizing simulation results generated by openEMS. This tool provides advanced capabilities for analyzing simulation data. ```bash sudo dnf install paraview ``` -------------------------------- ### Install Visualization Dependencies on Fedora Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs packages for 3D model visualization with AppCSXCAD (VTK-Qt) and simulation result visualization with ParaView on Fedora using dnf. ```bash sudo dnf install vtk-qt ``` ```bash sudo dnf install paraview ``` -------------------------------- ### Check AppCSXCAD Executable (Windows) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/check.rst Verifies the AppCSXCAD graphical viewer executable is installed and accessible on Windows. Running this command should launch the AppCSXCAD application. ```console AppCSXCAD ``` -------------------------------- ### Configure Python venv with System Site Packages Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/auto_install.rst This command configures a Python virtual environment (venv) to include system site packages. This allows access to globally installed packages while still enabling local package installations within the venv. It's useful for ensuring compatibility and managing dependencies efficiently. ```bash ./update_openEMS.sh ~/opt/openEMS --python --python-venv-mode site ``` -------------------------------- ### Install Octave Scripting Support on AlmaLinux Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs the 'octave' package, enabling the use of Octave scripting for openEMS. This is a recommended option for users who prefer or require Octave for their simulations. ```bash sudo dnf install octave ``` -------------------------------- ### Suppress RuntimeError for Install Paths (Bash) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst This command bypasses runtime errors related to missing CSXCAD or OpenEMS installation paths. It's intended for advanced users who have manually configured compiler search paths and know that these variables are not strictly necessary for their setup. ```bash export CSXCAD_INSTALL_PATH_IGNORE=1 export OPENEMS_INSTALL_PATH_IGNORE=1 ``` -------------------------------- ### Build CSXCAD Python Module from Source Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Builds and installs the CSXCAD Python extension from source. It requires cloning the repository, navigating to the CSXCAD Python directory, and running setup scripts with specified include and library paths. ```batch git clone --recursive https://github.com/thliebig/openEMS-Project.git ``` ```batch cd openEMS-Project/CSXCAD/python ``` ```batch python3 setup.py build_ext -IC:\opt\openEMS\include -LC:\opt\openEMS ``` ```batch python3 setup.py install ``` -------------------------------- ### Build openEMS Python Module from Source Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Builds and installs the openEMS Python extension from source. This step follows the CSXCAD build and requires navigating to the openEMS Python directory and running setup scripts with specified include and library paths. ```batch cd ../../openEMS/python ``` ```batch python3 setup.py build_ext -IC:\opt\openEMS\include -LC:\opt\openEMS ``` ```batch python3 setup.py install ``` -------------------------------- ### Install Documentation Dependencies and Build HTML Source: https://github.com/thliebig/openems-project/blob/master/doc-src/development/doc.rst Installs documentation-specific Python dependencies using pip and then builds the HTML documentation using Sphinx. This process requires navigating to the 'doc-src' directory first. ```bash cd openEMS-Project/doc-src # install documentation-specific dependencies pip3 install -r requirements.txt # build documentation make html ``` -------------------------------- ### Add openEMS Interface Paths to Octave/Matlab (Unix/Linux) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/octave/install.rst This code snippet adds the necessary openEMS and CSXCAD MATLAB interface directories to Octave's search path. Replace the example prefix with your actual installation path. This is typically done in the ~/.octaverc file. ```matlab % change the prefix ~/opt/openEMS to the path on your machine addpath('~/opt/openEMS/share/openEMS/matlab'); addpath('~/opt/openEMS/share/CSXCAD/matlab'); ``` -------------------------------- ### Clone and Build openEMS with Python Support (Bash) Source: https://context7.com/thliebig/openems-project/llms.txt Clones the openEMS repository and builds the solver with optional Python extensions. It installs openEMS to a specified directory, typically ~/opt/openEMS. Ensure Git is installed and submodules are cloned recursively. ```bash # Clone the repository with all submodules git clone --recursive https://github.com/thliebig/openEMS-Project.git cd openEMS-Project # Build and install to ~/opt/openEMS ./update_openEMS.sh ~/opt/openEMS # Build with Python extensions enabled ./update_openEMS.sh ~/opt/openEMS --python # Build with additional features ./update_openEMS.sh ~/opt/openEMS --with-CTB --python ``` -------------------------------- ### Download and Extract TinyXML Source Source: https://github.com/thliebig/openems-project/blob/master/doc-src/development/cpp.rst This snippet downloads the specified version of TinyXML from SourceForge, following redirects, and then extracts the archive. It is a prerequisite for patching and building the library. ```console # -L: follow redirect, REQUIRED! curl -L https://sourceforge.net/projects/tinyxml/files/tinyxml/2.6.2/tinyxml_2_6_2.tar.gz -o tinyxml-2.6.2.tar.gz tar -xf tinyxml-2.6.2.tar.gz cd tinyxml ``` -------------------------------- ### Build TinyXML via Curl (macOS) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/clone-build-install.rst Demonstrates how to pre-download TinyXML files using curl, which is utilized by the build script when network access is restricted. This is relevant for macOS users where TinyXML is not supported by Homebrew. ```bash # Example of setting a proxy for curl export http_proxy="http://proxy.example.com:8080" export https_proxy="http://proxy.example.com:8080" ``` -------------------------------- ### Setup.py Path Management for Build Extensions (Bash) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Configures build paths for C++ headers and libraries when building Python extensions using setup.py. It exports variables to ignore existing installations and specifies include, library, and runtime paths. ```bash export CSXCAD_INSTALL_PATH_IGNORE=1 export OPENEMS_INSTALL_PATH_IGNORE=1 python3 setup.py build_ext \ -I "$HOME/opt/openEMS/include:/usr/local/include" \ -L "$HOME/opt/openEMS/lib:/usr/local/lib" \ -R "$HOME/opt/openEMS/lib" ``` -------------------------------- ### Install CSXCAD and OpenEMS Python Extensions Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Installs the Python extensions for CSXCAD and OpenEMS using pip. This assumes the virtual environment is activated and the necessary installation paths are set. The commands navigate to the respective Python directories and then perform the pip installation. ```bash # build and install CSXCAD Python extension cd openEMS-Project/CSXCAD/python pip3 install . # build and install openEMS Python extension cd openEMS-Project/openEMS/python pip3 install . ``` -------------------------------- ### Prepare Python Virtual Environment with SOCKS Proxy Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/auto_install.rst This snippet demonstrates how to create and activate a Python virtual environment, install the 'pysocks' package, and configure SOCKS5 proxy settings for network access during the OpenEMS build process. It's useful for offline systems or environments with restricted internet access. ```bash # create and activate your own venv python3 -m venv ~/venvs/snake/ source ~/venvs/snake/bin/activate # Install pysocks manually while you still have Internet access, # pip3 install pysocks # or if you have an alternative proxy solution without using # Python, such as proxychains. # proxychains pip3 install pysocks # SOCKS5 proxy server (with remote DNS) for HTTP/HTTPS URLs export http_proxy="socks5h://proxy.example.com:8080" export https_proxy="socks5h://proxy.example.com:8080" # build and install openEMS as usual ./update_openEMS.sh ~/opt/openEMS --python ``` -------------------------------- ### Clone OpenEMS Repository Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/clone-build-install.rst Clones the OpenEMS project repository and its submodules. This is the first step in building OpenEMS from source. ```bash git clone --recursive https://github.com/thliebig/openEMS-Project.git cd OpenEMS-Project ``` -------------------------------- ### Install C++ Project and Python Extensions Simultaneously (Bash) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/auto_install.rst Installs the C++ project and its Python extensions concurrently to a specified prefix. This is the primary command for automatic Python extension installation. ```bash ./update_openEMS.sh ~/opt/openEMS --python ``` -------------------------------- ### Write OpenEMS Simulation Setup to XML (MATLAB) Source: https://context7.com/thliebig/openems-project/llms.txt Exports the complete electromagnetic simulation setup, defined by CSX structures and FDTD parameters, into an XML file. This file is then used by the openEMS solver. It includes creating the necessary directory structure. ```matlab % Write simulation to XML file Sim_Path = 'tmp_sim'; Sim_CSX = 'patch_antenna.xml'; [status, message] = mkdir(Sim_Path); WriteOpenEMS([Sim_Path '/' Sim_CSX], FDTD, CSX); ``` -------------------------------- ### Add CMake Support to TinyXML and Build Source: https://github.com/thliebig/openems-project/blob/master/doc-src/development/cpp.rst This snippet adds CMake build system support to TinyXML by applying a patch that includes a CMakeLists.txt file. It also includes a `sed` command to update the minimum CMake version requirement in the patch, followed by the build and installation process using CMake and Make. ```console # The final patch adds a CMakeLists.txt file to build a shared library and provide an install target # submitted upstream as https://sourceforge.net/p/tinyxml/patches/66/ curl -L -O "https://gist.githubusercontent.com/scpeters/6325123/raw/cfb079be67997cb19a1aee60449714a1dedefed5/tinyxml_CMakeLists.patch" # You know something is truly deprecated when the patch itself needs # patching! In CMake 4, 3.10 is deprecated and 3.5 has been removed. # Replace "cmake_minimum_required(VERSION 2.4.6)" in the patch with # "cmake_minimum_required(VERSION 3.0...3.10)". sed -i -e "s/cmake_minimum_required(VERSION 2.4.6)/cmake_minimum_required(VERSION 3.0...3.10)/" \ tinyxml_CMakeLists.patch # -e is not optional in BSD sed patch -p1 < tinyxml_CMakeLists.patch mkdir build && cd build cmake ../ -DCMAKE_INSTALL_PREFIX=$HOME/opt/openEMS make && make install ``` -------------------------------- ### Apply Patches to TinyXML Source: https://github.com/thliebig/openems-project/blob/master/doc-src/development/cpp.rst This section details downloading and applying several patches to the TinyXML source code. These patches address compatibility issues, security vulnerabilities, and enforce the use of STL strings. The patches are sourced from Alpine Linux's package maintainer. ```console # The first patch enforces use of stl strings, rather than a custom string type. # The second patch is a fix for incorrect encoding of elements with special characters # The third and fourth patches are security fixes. # # -L: follow redirect, REQUIRED! # -O: save to disk with an automatic file name. curl -L -O "https://raw.githubusercontent.com/alpinelinux/aports/b1ff376e83eb49c0127b039b3684eccdf9a60694/community/tinyxml/tinyxml-2.6.2-defineSTL.patch" curl -L -O "https://raw.githubusercontent.com/alpinelinux/aports/b1ff376e83eb49c0127b039b3684eccdf9a60694/community/tinyxml/tinyxml-2.6.1-entity.patch" curl -L -O "https://raw.githubusercontent.com/alpinelinux/aports/b1ff376e83eb49c0127b039b3684eccdf9a60694/community/tinyxml/CVE-2021-42260.patch" curl -L -O "https://raw.githubusercontent.com/alpinelinux/aports/b1ff376e83eb49c0127b039b3684eccdf9a60694/community/tinyxml/CVE-2023-34194.patch" patch -p1 < tinyxml-2.6.2-defineSTL.patch patch -p1 < tinyxml-2.6.1-entity.patch patch -p1 < CVE-2021-42260.patch patch -p1 < CVE-2023-34194.patch ``` -------------------------------- ### Disable Python Virtual Environment for OpenEMS Installation Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/auto_install.rst This command disables the use of Python virtual environments during the OpenEMS installation, reverting to legacy behavior by installing Python extensions to default system paths. It's an alternative to using venvs but 'site' mode is recommended. ```bash ./update_openEMS.sh ~/opt/openEMS --python --python-venv-mode disable ``` -------------------------------- ### Check Matlab/Octave openEMS Interface Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/check.rst Tests the `InitFDTD` function, which initializes the openEMS simulation engine within Matlab/Octave. Successful execution confirms the core simulation interface is available. ```matlab >> InitFDTD('NrTS', 0, 'EndCriteria', 0) ans = ATTRIBUTE: [1x1 struct] ``` -------------------------------- ### Install OpenEMS Python Packages (Windows) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Installs the CSXCAD and openEMS Python packages from wheel files using pip3. This is a prerequisite for using openEMS in Python on Windows. ```batch cd C:\opt\openEMS\python ``` ```batch pip3 install CSXCAD-0.6.2-cp310-cp310-win_amd64.whl ``` ```batch pip3 install openEMS-0.0.33-cp310-cp310-win_amd64.whl ``` -------------------------------- ### Install Scripting Dependencies on Fedora Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs Octave and Python (including pip) for scripting capabilities on Fedora using dnf. Optionally installs additional Python packages for external dependency management. ```bash sudo dnf install octave ``` ```bash sudo dnf install python3-pip ``` ```bash sudo dnf install python3-setuptools python3-setuptools_scm \ python3-Cython python3-numpy python3-h5py python3-matplotlib ``` -------------------------------- ### Install Python Scripting Support on AlmaLinux Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs the 'python3-pip' package, which is necessary for using Python scripting with openEMS. Pip is used by the 'update_openEMS.sh' script to install Python packages within a virtual environment. ```bash sudo dnf install python3-pip ``` -------------------------------- ### Troubleshoot pip Installation Errors (CSXCAD_PYSRC_PATH) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Offers an alternative solution for pip installation errors by manually specifying the CSXCAD Python source path using the CSXCAD_PYSRC_PATH environment variable. ```console export CSXCAD_PYSRC_PATH=/home/user/openEMS-Project/CSXCAD/python/ && pip install . ``` -------------------------------- ### Troubleshoot pip Installation Errors (No Build Isolation) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/manual_install.rst Provides a solution for 'FileNotFoundError' during pip installation by rerunning pip with '--no-build-isolation'. This ensures that pre-installed CSXCAD Python extensions are used. ```console pip3 install . --no-build-isolation ``` -------------------------------- ### Check openEMS Executable (Windows) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/check.rst Confirms the openEMS solver executable is functional on Windows by running it from the command prompt. Displays the typical output indicating a successful launch. ```console openEMS -------------------------------------------------------------------- | openEMS 32bit -- version v0.0.23 | (C) 2010 Thorsten Liebig GPL license -------------------------------------------------------------------- [...] ``` -------------------------------- ### Install Scripting Dependencies on Void Linux Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs Octave and Python (including pip) for scripting capabilities on Void Linux using xbps-install. Optionally installs additional Python packages for external dependency management. ```bash sudo xbps-install -S octave ``` ```bash sudo xbps-install -S python3 python3-pip ``` ```bash sudo xbps-install -S python3-setuptools python3-setuptools_scm \ python3-Cython python3-matplotlib python3-h5py ``` -------------------------------- ### Install Python Package within venv (Bash) Source: https://github.com/thliebig/openems-project/blob/master/doc-src/python/auto_install.rst Installs a Python package (e.g., scikit-rf) into the activated virtual environment using pip3. This is used to add third-party libraries for data analysis or other tasks. ```bash source ~/opt/openEMS/venv/bin/activate # if not activated pip3 install scikit-rf ``` -------------------------------- ### Activate Python Virtual Environment Source: https://github.com/thliebig/openems-project/blob/master/doc-src/development/doc.rst Activates the Python virtual environment where project dependencies are installed. This is a prerequisite for building documentation. The command assumes the virtual environment is located in the 'venv' subdirectory of the openEMS installation path. ```bash source ~/opt/openEMS/venv/bin/activate ``` -------------------------------- ### Install Python 3 for Scripting on Alpine Linux Source: https://github.com/thliebig/openems-project/blob/master/doc-src/install/requirements.rst Installs Python 3 development files and pip on Alpine Linux, recommended for Python scripting. The 'update_openEMS.sh' script typically handles Python package installation via a virtual environment. ```bash doas apk add python3-dev py3-pip ```