How to install this extension in Octave (pcbmodelgen for openEMS)

Solution 1:

First of all: cool tool! But also, leaving only about two lines for Windows users is almost malevolent. The steps below led me to success:

  1. activate the "Windows Subsystem for Linux" feature (control panel\all control panel items\programs and features) and install (f.e.) the Ubuntu app from the microsoft store.

The following steps are to be performed from the ubuntu command line.

  1. install updates: sudo apt-get update && sudo apt-get dist-upgrade
  2. install dependencies: sudo apt-get install libtinyxml2-dev libtclap-dev
  3. install cmake: sudo apt install cmake
  4. install CMAKE_CXX_COMPILER: sudo apt-get install build-essential
  5. install pcbmodelgen:
  • mkdir build
  • cd build
  • cmake /mnt/... (path to the pcbmodelgen-master folder, slash as separator, drive letter without colon)
  • make
  • sudo make install

And that's it. For running pcbmodelgen you just have to go to the folder that contains the .kicad_pcb cd /mnt/... and start it from there. When you try out the examples in the master folder you will see that there is always a "Makefile" for the commands, a "pcbmodelgen.json" for the configs and a "simulation_script.m". For me it turned out to be useful, to copy, paste and adjust these files for my own pcbs. In the Makefile you will find a simulation command as well, that logically won't work if octave and openEMS are installed on Windows. So you may delete or uncomment it. Running the program from the script (make) generates one "kicad_pcb_model.m" and one "kicad_pcb_mesh.m" file. From now on you can continue using the "simulation_script.m" under Windows.

Greetings