Dislin compilation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gaubitzer Erwin

    Dislin compilation

    Hi everybody

    I want to recompile the DISLIN graphics module for Python under Linux, because
    I think it is one of the best graphics libraries at present.
    The included module was for version 2.0 and I want it for 2.2 or maybe 2.3.
    The problem is, that I use the small make_py script which only
    calls the gcc compiler

    CC="gcc -fPIC -c -O"
    PYTH_INC="/usr/local/include/python2.0"
    PYTH_CONF="/usr/local/lib/python2.0/config"
    gcc -shared -Wl,-soname,dislinmo dule.so -o dislinmodule.so *.o \
    -L$DISLIN -ldislnc


    but I think many variables arent configured,
    so a long list of errors follows (I copied the first few lines to
    the end)

    I dont have experience with makefiles and so I want to ask what I
    have to do in a short way.

    Thanks in advance

    Erwin

    My system:
    SuSE Linux 8.1 on an AMD-machine


    Here are the first few lines of the gcc output

    dislinmodule.c: 1:20: Python.h: No such file or directory
    dislinmodule.c: 21: parse error before '*' token
    dislinmodule.c: 21: parse error before '*' token
    dislinmodule.c: 21: warning: data definition has no type or storage class
    dislinmodule.c: 22: parse error before '*' token
    dislinmodule.c: 22: parse error before '*' token
    dislinmodule.c: 22: warning: data definition has no type or storage class
    dislinmodule.c: 23: parse error before '*' token
    dislinmodule.c: 23: parse error before '*' token
    dislinmodule.c: 23: warning: data definition has no type or storage class
    dislinmodule.c: 31: parse error before '*' token
    dislinmodule.c: 31: warning: data definition has no type or storage class
    dislinmodule.c: 32: parse error before '*' token
    dislinmodule.c: 32: warning: data definition has no type or storage class
    dislinmodule.c: 34: parse error before '*' token
    dislinmodule.c: In function `getlength':
    dislinmodule.c: 37: `o' undeclared (first use in this function)
    dislinmodule.c: 37: (Each undeclared identifier is reported only once
    dislinmodule.c: 37: for each function it appears in.)
    dislinmodule.c: 38: `PyExc_ValueErr or' undeclared (first use in this function)
    dislinmodule.c: At top level:
    dislinmodule.c: 51: parse error before '*' token
    dislinmodule.c: In function `fltarray':
    dislinmodule.c: 53: `PyObject' undeclared (first use in this function)

  • Helmut Michels

    #2
    Re: Dislin compilation

    Gaubitzer Erwin wrote:
    [color=blue]
    > Hi everybody
    >
    > I want to recompile the DISLIN graphics module for Python under Linux, because
    > I think it is one of the best graphics libraries at present.
    > The included module was for version 2.0 and I want it for 2.2 or maybe 2.3.
    > The problem is, that I use the small make_py script which only
    > calls the gcc compiler
    >
    > CC="gcc -fPIC -c -O"
    > PYTH_INC="/usr/local/include/python2.0"
    > PYTH_CONF="/usr/local/lib/python2.0/config"
    > gcc -shared -Wl,-soname,dislinmo dule.so -o dislinmodule.so *.o \
    > -L$DISLIN -ldislnc
    >
    > but I think many variables arent configured,
    > so a long list of errors follows (I copied the first few lines to
    > the end)
    >
    > I dont have experience with makefiles and so I want to ask what I
    > have to do in a short way.
    >[/color]

    You have to edit the file 'make_py' and define the variables PYTH_INC and
    PYTH_CONF with
    corresponding directories of your Python version (i.e.
    PYTH_INC=/"usr/local/include/python2.3"
    or PYTH_INC="/usr/include/python2.3").
    The environment variable DISLIN is used to locate the DISLIN library. You can
    define it outside
    of the make_py script with the installation directory of DISLIN (i.e. export
    DISLIN=/usr/local/dislin).

    Regards,

    -------------------
    Helmut Michels
    Max-Planck-Institut fuer Aeronomie Phone: +49 5556 979-334
    Max-Planck-Str. 2 Fax : +49 5556 979-240
    D-37191 Katlenburg-Lindau Mail : michels@linmpi. mpg.de
    DISLIN Home Page: http://www.dislin.de


    Comment

    • Gaubitzer Erwin

      #3
      Dislin compilation

      Thanks to all, who have answered
      (per mail or in thread)

      For all others, who also don't know how to do I summarize shortly

      1. The make_py script looks for the Include and the Config directories.
      These are in the Python developers version (python-devel rpm
      for SuSE:
      PYTH_INC="/usr/include/python2.2/" for python version 2.2
      PYTH_CONF="/usr/lib/python2.2/config"
      in the appropriate section (lnx for Linux)
      2. The DISLIN variable has to be defined, for instance in the shell by
      export DISLIN=/usr/local/dislin (default directory)
      3. Calling
      make_py lnx
      for Linux OS
      4. Copying the module to the right directory
      cp dislinmodule.so /usr/local/dislin/python

      Now it should work

      Comment

      Working...