Adding more C source files in ngspice.

yashdosi
2013-03-31
2013-06-12
  • yashdosi
    yashdosi
    2013-03-31

    Hey folks.!

    As a part of my project I am trying to modify the DCtran Analysis using threads.

    My approach is to create a duplicate instance of CKTcircuit structure then use the clone for parallel programming!
    I have the CKTcopy almost ready but till now I was keeing the entire extra source in the dctran.c file.

    Now I am thinking for creating a seperate file containing the CKTclone function.

    So, exactly what are the steps I need to follow to be able to put the CKTclone function in the new file..?

    This is what I did initially.
    1. Declared the function in cktdefs.h
    2. included cktdefs.h in cktclone.c which already contains the CKTclone function code.
    3. Made a call to CKTclone in DCtran function.
    4. Included the name of cktclone.c in the Makefile containing the list of names of C files at the bottom.

    But I get 'undefined reference of CKTclone in function DCtran' error.
    Can you please tell me what else I need to do?

    This might seems like a bit silly problem.. but i m a bit new to ngspice so please bear with me…..
    Thank You

     
  • Holger Vogt
    Holger Vogt
    2013-04-01

    Yash,

    if you add cktclone.c
    to makefile.am in src/spicelib/analysis
    and then run
    ./autogen.sh
    to generate makefile.in and
    ./configure <options>
    to generate makefile and then
    make
    make install
    this should include the new file. If this fails, please give a more detaled description of your command sequence.

    Holger

     
  • yashdosi
    yashdosi
    2013-04-05

    Thanks!

    That was exactly what I wanted! :)