installing ppgplot (using OS X 10.3 / gcc 3.4 / python 2.3b)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dennis Hore

    #1

    installing ppgplot (using OS X 10.3 / gcc 3.4 / python 2.3b)

    I'm trying to install Nick Patavalis' ppgplot package on Mac OS X 10.3
    with python 2.3. I first sent this message to Nick, but he said he
    doesn't have any experience with the Mac platform.

    after installing using python setup.py install (using Numeric; no error
    messages), and then in python trying[color=blue][color=green][color=darkred]
    >>> import ppgplot[/color][/color][/color]

    i get:

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "/sw/lib/python2.3/site-packages/ppgplot/__init__.py", line 1,
    in ?
    from _ppgplot import *
    ImportError: Failure linking new module: : dyld: python Undefined
    symbols:
    ..objc_class_na me_NSBezierPath
    ..objc_class_na me_NSBitmapImag eRep
    ..objc_class_na me_NSColor
    ..objc_class_na me_NSWorkspace
    _NSCalibratedRG BColorSpace

    This looks very familiar, it's the standard error messages that occur
    when an application is compiled without specifying "-framework AppKit"
    on the Mac as an option to the linker.

    Also, I'm using gcc 3.4, so the linker options must now be specified as:
    -Wl,-framework -Wl,AppKit

    I first tried to include these options in setup.py, but gcc ignores all
    linking options when it is told to compile only with -c

    So then I ran:
    make clean
    make

    The compiling phase should be okay. Then I tried to manually do the
    linking with

    gcc -L/usr/X11R6/lib/ -L/sw/lib/ -L/sw/lib/pgplot -bundle
    -flat_namespace -undefined suppress -lcpgplot -lpgplot -lpng -lX11 -lm
    -lg2c -lz -Wl,-framework -Wl,AppKit
    -o build/lib.darwin-7.4.0-PowerMacintosh-2.3/ppgplot/_ppgplot.so
    build/temp.darwin-7.4.0-PowerMacintosh-2.3/src/_ppgplot.o

    no errors, but importing the ppgplot library into python gives the same
    old errors again (looks like missing AppKit). Back to square one! :)

    By the way, I have a working pgplot installation. I can compile my own
    fortran programs which call pgplot subroutines with:

    g77 -o dennis_demo dennis_demo.f -L/sw/lib/pgplot -L/usr/X11R6/lib
    -L/sw/lib -L/usr/lib -lpgplot -lpng -lz -lX11 -Wl,-framework -Wl,AppKit

    Any suggestions?

    Thanks!!!
    best wishes,
    dennis


  • bwani

    #2
    Re: installing ppgplot (using OS X 10.3 / gcc 3.4 / python 2.3b)

    Hi Dennis,
    I'm sorry, but I don't have the answer to your questions, but I have some
    other troubles with installing ppgplot... Hope you can help!

    First, the compilation of pgplot did not work smoothly.
    I found that I had to use the option g77_gcc_aout with makemake, because
    ld does not support the -shared option with OSX. But then, during make, I
    got this error when compiling grquit.f:

    g77 -c -Wall -O ../../tmp/pgplot/src/grquit.f
    /var/tmp//ccSZHXDl.s:25:s ection difference relocatable subtraction
    expression, "LC1" minus "L1$pb" using a symbol at the end of section will
    not produce an assembly time constant
    /var/tmp//ccSZHXDl.s:25:u se a symbol with a constant value created with an
    assignment instead of the expression, L_const_sym = LC1 - L1$pb
    /var/tmp//ccSZHXDl.s:24:s ection difference relocatable subtraction
    expression, "LC1" minus "L1$pb" using a symbol at the end of section will
    not produce an assembly time constant
    /var/tmp//ccSZHXDl.s:24:u se a symbol with a constant value created with !!
    an assignment instead of the expression, L_const_sym = LC1 - L1$pb
    make: *** [grquit.o] Error 1


    I don't know what this means. I could "fix" this by commenting out the
    line with the command "STOP" in grquit.f
    Then I got a similar error with:
    g77 -Wall -O -o pgpack ../../tmp/pgplot/fonts/pgpack.f

    I didn't find any solution for this. But at least, I had a libcpgplot.a
    file, so I can go on. The cpg demo can not be built properly neither.

    Then I tried to install ppgplot, with the usual python setup.py install
    command, and got this error:

    gcc -Wl,-F. -Wl,-F. -bundle -framework Python build/temp.darwin-7.5.0-
    Power_Macintosh-2.3/src/_ppgplot.o -L/usr/X11R6/lib/ -L/Volumes/
    Documents/Astro/APEX/Boa/panther/lib/pgplot -lcpgplot -lpgplot -lX11 -lm
    !! -o build/lib.darwin-7.5.0-Power_Macintosh-2.3/ppgplot/_ppgplot.so
    ld: Undefined symbols:
    _s_copy
    _i_indx
    _s_cat
    _s_cmp
    _do_fio
    _e_wsfi
    _s_wsfi
    _e_wsfe
    _s_wsfe
    _G77_getenv_0
    _e_rsfe
    _s_rsfe
    _f_clos
    _f_inqu
    _f_open
    _do_uio
    _e_rsue
    _s_rsue


    Do you have any idea of what is missing?

    I got this error with a version of g77 I had under jaguar and gcc3.3, and
    with the latest versions g77 3.4 and gcc 3.5 that I downloaded yesterday.
    And I'm running jaguar 10.3.5 (and Python 2.3)

    Then I tried a manual linking, using the command that you give (with
    -Wl,-framework -Wl,AppKit and so on).
    There was no error, and I got a _ppgplot.so file. I copied it to my
    ppgplot dir in the python path, and when I import ppgplot in python, I get
    again this error:
    [color=blue][color=green][color=darkred]
    >>> import ppgplot[/color][/color][/color]
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "ppgplot/__init__.py", line 1, in ?
    ImportError: Failure linking new module: : dyld: python2.3 Undefined
    symbols:
    _G77_getenv_0
    _do_fio
    _do_uio
    _e_rsfe
    _e_rsue
    _e_wsfe
    _e_wsfi
    _f_clos
    _f_inqu
    _f_open
    _i_indx
    _s_cat
    _s_cmp
    _s_copy
    _s_rsfe
    _s_rsue
    _s_wsfe
    _s_wsfi


    It's really a pitty, because last week I finally succeeded in installing
    pgplot and ppgplot with jaguar (10.2.8). Everything runs fine when doing a
    makemake g77_gcc_aout.
    The python setup.py install also works fine. And I had no error when
    importing to python, and I could actually use it and open some windows and
    plot things in them.
    But then, I updated my OS to panther on Monday, and nothing works anymore
    :(

    I also tried to use this previous version of _ppgplot.so file that was
    running with 10.2.8, but when I import this one in python, I now get this
    error :
    [color=blue][color=green][color=darkred]
    >>> import ppgplot[/color][/color][/color]
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File
    "/Volumes/Documents/Astro/APEX/BoA/Packages/Python/lib/python2.3/site-packages/ppgplot/__init__.py",
    line 1, in ?
    ImportError: Failure linking new module: : dyld: python2.3 Undefined
    symbols:
    ppgplot/_ppgplot.so undefined reference to _PyArg_ParseTup le expected to
    be defined in the executable
    ppgplot/_ppgplot.so undefined reference to _PyCObject_AsVo idPtr expected
    to be defined in the executable
    ppgplot/_ppgplot.so undefined reference to _PyCObject_Type expected to be
    defined in the executable
    ppgplot/_ppgplot.so undefined reference to _PyDict_GetItem String expected
    to be defined in the executable
    ppgplot/_ppgplot.so undefined ref


    By the way, the directory that appears at the beginning of this message
    does NOT exist anymore! Very strange...

    Ok, I hope that you can help me with this, and if this works, maybe I can
    also find why you have other kinds of troubles!

    Best wishes,
    Bwani


    Comment

    • bwani

      #3
      Re: installing ppgplot (using OS X 10.3 / gcc 3.4 / python 2.3b)

      Ok, I found my error...
      the one missing was -lg2c
      and all works fine again :)
      But i still don't understand the errors in pgplot compilation

      Here are the 2 commands i typed for ppgplot:

      # Compilation
      gcc -fno-strict-aliasing -mno-fused-madd -fno-common -dynamic -DNDEBUG -g
      -O3 -Wall -Wstrict-prototypes
      -I/System/Library/Frameworks/Python.framewor k/Versions/2.3/include/python2.3/Numeric
      -I/usr/local/pgplot/
      -I/System/Library/Frameworks/Python.framewor k/Versions/2.3/include/python2.3
      -c src/_ppgplot.c -o
      build/temp.darwin-7.5.0-Power_Macintosh-2.3/src/_ppgplot.o

      # Linking !! DON'T FORGET -lg2c !!!!!
      gcc -framework Python -lcpgplot -lpgplot -L/usr/X11R6/lib/
      -L/usr/local/pgplot -L/usr/local/lib -lg2c -lX11 -lm -bundle
      -Wl,-framework -Wl,AppKit
      build/temp.darwin-7.5.0-Power_Macintosh-2.3/src/_ppgplot.o -o
      build/lib.darwin-7.5.0-Power_Macintosh-2.3/ppgplot/_ppgplot.so


      then copy the _ppgplot.so to pythonpath, and use it!

      Fred


      Comment

      Working...