Comment 98 for bug 1835296

Revision history for this message
Holger Vogt (h+vogt) wrote :

When run from KiCad in my setup (double click onto KiCad/kicad.app alias), code model spice2poly.cm is found, simulation is o.k..

When run from Eeschema in my setup (double click onto KiCad/eeschema.app alias), code model spice2poly.cm is not found.

May I suggest that we add another search path "../Plugins/sim/ngspice" to eeschema/sim/ngspice.cpp, line 447:

#ifdef __WXMAC__
        "/Applications/ngspice/lib/ngspice",
        "Contents/Frameworks",
        wxStandardPaths::Get().GetPluginsDir() + "/sim/ngspice",
        wxFileName( wxStandardPaths::Get().GetExecutablePath() ).GetPath() + "/../../../../../Contents/PlugIns/sim/ngspice"
        "../Plugins/sim/ngspice"
#endif /* __WXMAC__ */

This will search for the code model relative to KiCad/kicad.app/contents/Applications/eeschema.app

Btw: I can do this from within Ngspice by adding a text window with

.control
pre_codemodel ../Plugins/sim/ngspice/spice2poly.cm
.endc

to the eeschema circuit diagram. A ngspice command may be preceded by pre_ . Then it is run before the circuit is parsed. The code model is loaded, then the circuit is loaded into the matrix and the simulation runs successfully.

Application: Eeschema
Version: (5.99.0-192-g5933ac3b9), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Platform: Mac OS X (Darwin 18.7.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    Build date: Oct 2 2019 10:19:28
    wxWidgets: 3.0.4 (wchar_t,STL containers,compatible with 2.8)
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.54.0
    Compiler: Clang 9.0.0 with C++ ABI 1002

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
    KICAD_STDLIB_DEBUG=OFF
    KICAD_STDLIB_LIGHT_DEBUG=OFF
    KICAD_SANITIZE=OFF