forum.vmspython.org Forum Index forum.vmspython.org
Forum system
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GDChart ?

 
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS
View previous topic :: View next topic  
Author Message
jescab



Joined: 28 Jan 2008
Posts: 254

PostPosted: Sun Jan 17, 2010 5:41 pm    Post subject: GDChart ? Reply with quote

About a year ago I did some tests/dev using GD-chart in Python.
Today I have trouble to access the sites that previously had the
support and docs for the GDchart for Python port (GDchart2).
Anyone that knows what happend to this tool ? Is it still "safe"
to use for production development ?
It seems to have been some site called "nullcube"...
Back to top
View user's profile Send private message
jescab



Joined: 28 Jan 2008
Posts: 254

PostPosted: Sun Jan 17, 2010 7:02 pm    Post subject: Reply with quote

Another question not realy Python related... Smile

I guess the libs in DISK$JFPLIB0003:[GDCHART] could also be
used to build plain C based apps (apart from beeing used from
Python), right ?

Is there some simple example on writing and building some
C code using GDchart ? There are some examples on the GDchart
site and the actual GDchart calls are mostly the same I guess. What
I miss is how to build against the VMS shareble image (or the OLB).
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 633

PostPosted: Mon Jan 18, 2010 10:31 am    Post subject: Reply with quote

Quote:
I guess the libs in DISK$JFPLIB0003:[GDCHART] could also be
used to build plain C based apps (apart from beeing used from
Python), right ?

Correct, you can directly use the GDchart, the python module is link against the shareable GDCHART_SHR32 which is a logical defined as GDCHART:gdchartshr32-0_11_4.exe but you can also use the OLB.

You have to include, in your C source the gdchart.h and may some others.
Extract from the Python module:
Code:
#include "gdchart.h"
#include "gdcpie.h"
#include "gdc.h"


The python module is link using the following option file :
Code:
GSMATCH=equal,1,0
case_sensitive=YES
SYMBOL_VECTOR = (init_gdchartc=PROCEDURE)
SYMBOL_VECTOR = (INIT_GDCHARTC/init_gdchartc=PROCEDURE)
case_sensitive=NO
_gdchartc.obj
gdchart_shr32/share
pythonshr/share



I only know the examples on the GDchart site.
You may also take a look at the source of the Python module.

The link (http://www.nullcube.com/software/pygdchart2 is Dead for unknown reason.

You may have to download the Python for VMS sources.


JFP
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jescab



Joined: 28 Jan 2008
Posts: 254

PostPosted: Mon Jan 18, 2010 11:17 am    Post subject: Reply with quote

OK, thanks !
When I made a few quick tests, I only had the two /share lines.
I got a lot of MULDEF from LINK, I'm not sure if that might have to
do with the other lines in the OPT file. We'll see when I have linked
with your example OPT file... Smile
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 633

PostPosted: Mon Jan 18, 2010 4:08 pm    Post subject: Reply with quote

You probably only need the line "gdchart_shr32/share"
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jescab



Joined: 28 Jan 2008
Posts: 254

PostPosted: Fri Jan 22, 2010 12:00 pm    Post subject: Reply with quote

I think I'll look for some other solution.
It will probably just take to long time to get this going...

Now I have this build script :

Code:
$ cc/list/show=(include,symbols,expansion)/names/cross gd_test.c
$ link/map/cross/full gd_test, sys$input/opt
GDCHART_SHR32/share


I get a lot of (aprox 40, all are GDC... symbols) :

Code:
%LINK-W-MULDEF, symbol GDC_IMAGE_TYPE multiply defined
        in module GD_TEST file DISK$JFPLIB0003:[gdchart]GD_TEST.OBJ;22
%LINK-W-MULDEF, symbol GDC_JPEG_QUALITY multiply defined
        in module GD_TEST file DISK$JFPLIB0003:[gdchart]GD_TEST.OBJ;22
%LINK-W-MULDEF, symbol GDC_GENERATE_IMG multiply defined
        in module GD_TEST file DISK$JFPLIB0003:[gdchart]GD_TEST.OBJ;22


And the EXE crashes :
Code:

$ r gd_test
%SYSTEM-F-HPARITH, high performance arithmetic trap, Imask=00000000, Fmask=00000010, summary=02, PC=00000000000908E4, PS=0000001B
-SYSTEM-F-FLTINV, floating invalid operation, PC=00000000000908E4, PS=0000001B
%TRACE-F-TRACEBACK, symbolic stack dump follows
  image    module    routine             line      rel PC           abs PC     
 GDCHARTSHR32-0_11_4  GDC_PIE  GDC_out_pie
                                         7782 0000000000000C04 00000000000908E4
 GD_TEST  GD_TEST  main                  5482 00000000000001B4 00000000000301B4
 GD_TEST  GD_TEST  __main                5449 0000000000000064 0000000000030064
 PTHREAD$RTL                                0 00000000000576D8 FFFFFFFF80A776D8
 PTHREAD$RTL                                0 0000000000030444 FFFFFFFF80A50444
                                            0 FFFFFFFF8037FCE4 FFFFFFFF8037FCE4
%TRACE-I-END, end of TRACE stack dump




The test code is taken from the GDCHART site :

Code:
$ typ gd_test.c
/* GDCHART 0.94b  PIE CHART SAMPLE  3 Aug '99 */

#include <stdlib.h>
#include <stdio.h>
//#include <values.h>
#include <limits.h>
#include <math.h>

#include "gdchart.h"
#include "gdcpie.h"

main( )
{
    /* set data - can be loaded from anywhere, e.g., a DB */
    float          data[6]  = { 20.0,     40.0,     25.0,       15.0,     9.0,      11.0 };      /* data array */
    char           *lbls[6] = { "Radio",  "Print",  "Internet", "TV",     "Cable",  "other" };   /* label array */
    /* optional data */
    int            expl[6]  = { 0,        0,        18,         0,        0,        21 };        /* explode each slice */
    unsigned long  clrs[6]  = { 0xFF0000, 0x00FF00, 0x0000FF,   0xFF00FF, 0xFFFF00, 0x00FFFF };  /* color for each slice */

/* open FILE* (can be stdout e.g. CGI use) */
    FILE           *fp = fopen( "3dpie.gif", "wb" );


    /* set some options - not required */
    GDCPIE_explode   = expl;            /* default - no explosion */
    GDCPIE_Color     = clrs;            /* default - gray */
    GDCPIE_EdgeColor = 0xFFFFFFL;       /* default - no edging */

    /* call the lib */
    pie_gif( 200,                       /* width             */
             175,                       /* height            */
             fp,                        /* open file pointer */
             GDC_3DPIE,                 /* or GDC_2DPIE      */
             6,                         /* number of slices  */
             lbls,                      /* slice labels      */
             data );                    /* data array        */

    fclose( fp );
    exit( 0 );
}
$
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 633

PostPosted: Sun Jan 24, 2010 1:27 pm    Post subject: Reply with quote

The Python module building procedure look like:
Code:
$ @python_vms:setup
$
$ @python_vms:python_compiler_options
$
$ cnames = f$trnlnm("PYTHON_C_NAMES")
$ cdebug = f$trnlnm("PYTHON_C_DEBUG")
$ coptim = f$trnlnm("PYTHON_C_OPTIM")
$ cfloat = f$trnlnm("PYTHON_C_FLOAT")
$
$ cflags = "''cnames'''cdebug'''coptim'''cfloat'"
$
$ cc 'cflags' - ! /warning=(disable=(PTRMISMATCH,PTRMISMATCH1)) -
  /define=(_POSIX_EXIT=1,"HAVE_JPEG=1", "HAVE_LIBFREETYPE=1", "GDC_VAR_IN_LIB=1") -
  /incl=(sys$disk:[], python_include, gdchart,libgd, libjpeg, libpng, libz) -
  _gdchartc.c
$
$ link/share=_gdchartc.exe _gdchartc.opt/options
$
$ exit

So you need to define GDC_VAR_IN_LIB to 1
Also you need /float=iee/iee=denorm

JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jescab



Joined: 28 Jan 2008
Posts: 254

PostPosted: Sun Jan 24, 2010 2:38 pm    Post subject: Reply with quote

> So you need to define GDC_VAR_IN_LIB to 1
> Also you need /float=iee/iee=denorm

Eh bien...

That made it... Smile

Many thanks !
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group