← Back to team overview

kicad-developers team mailing list archive

Re: Improving behavior and logic of Findngspice.cmake

 

Hey Carsten,

On 1/17/2018 5:14 AM, Carsten Schoenert wrote:
> Hello Dan,
> 
> Am 16.01.2018 um 21:16 schrieb Dan Weatherill:
>> Hi Carsten,
>> have you tried specifying -DCMAKE_LIBRARY_ARCHITECTURE=x86_64-linux-gnu
>> when calling cmake in the build script?
> 
> no I haven't until now, but this seems not to do anything.
> Even if I definitely have no parts of libngspice installed the cmake
> call works without error out.
> 
>> Relevant documentation here, in roughly the 2nd paragraph:
>> https://cmake.org/cmake/help/v3.0/command/find_library.html
> 
> I've looks several times into the documentation, after years it's still
> not really useful and easy to understand for me.
> 
> I've done some small debugging right now. If I add the following message
> statements into the helper (right after the find_library call) I got
> output to variables that should be empty.
> 
>> message( STATUS "NGSPICE_INCLUDE_DIR=${NGSPICE_INCLUDE_DIR}")
>> message( STATUS "NGSPICE_LIBRARY=${NGSPICE_LIBRARY}")
>> message( STATUS "CMAKE_LIBRARY_ARCHITECTURE=${CMAKE_LIBRARY_ARCHITECTURE}")
>> message( STATUS "NGSPICE_LIBRARY_PATH=${NGSPICE_LIBRARY_PATH}")
>> message( STATUS "NGSPICE_ROOT_DIR=${NGSPICE_ROOT_DIR}")
>> message( STATUS "CMAKE_LIBRARY_PATH=${CMAKE_LIBRARY_PATH}")
> 
>> $ cmake .. -DCMAKE_LIBRARY_ARCHITECTURE=x86_64-linux-gnu -DKICAD_SCRIPTING_ACTION_MENU=ON -DKICAD_SCRIPTING_WXPYTHON=ON -DKICAD_SCRIPTING_MODULES=ON -DKICAD_SPICE=ON -DKICAD_USE_OCE=ON -DCMAKE_INSTALL_PREFIX=/home/carsten/tmp/kicad
>> ...
>> -- NGSPICE_INCLUDE_DIR=/usr/share/ngspice/include
>> -- NGSPICE_LIBRARY=/usr/lib/libngspice.so
>> -- CMAKE_LIBRARY_ARCHITECTURE=x86_64-linux-gnu
>> -- NGSPICE_LIBRARY_PATH=
>> -- NGSPICE_ROOT_DIR=
>> -- CMAKE_LIBRARY_PATH=
>> -- Check for installed Python Interpreter -- found
> 
>> $ LANG= ls /usr/share/ngspice/include
>> ls: cannot access '/usr/share/ngspice/include': No such file or directory
>> $ LANG= ls /usr/lib/libngspice.so
>> ls: cannot access '/usr/lib/libngspice.so': No such file or directory
> 
> I'm quite sure there is something not correct in the cmake helper for
> ngspice.
> 

Is this a clean config or did you run cmake on top of an existing
config?  If it's an existing config, that is your issue.  CMake caches
config values so it's picking up the cached library and header files.

Cheers,

Wayne


Follow ups

References