Changeset 873 for branches


Ignore:
Timestamp:
Mar 19, 2018, 3:53:31 PM (7 years ago)
Author:
djay
Message:

Add support for R language and its documentation.

Location:
branches/prototype-v0/zoo-project
Files:
8 added
9 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/Makefile.in

    r861 r873  
    7878        g++ ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c service_internal_python.c
    7979
     80service_internal_r.o: service_internal_r.c service.h
     81        g++ ${XML2CFLAGS} ${RCFLAGS} ${CFLAGS} -c service_internal_r.c
     82
    8083service_internal_otb.o: service_internal_otb.c service_internal_otb.h service.h
    8184        g++ ${XML2CFLAGS} ${OTBCFLAGS} ${CFLAGS} -c service_internal_otb.c
     
    114117        g++ -c ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} service_loader.c
    115118
    116 zoo_service_loader.o: zoo_service_loader.c service.h version.h ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} ${MONO_FILE} ${HPC_FILES} ${METADB_FILE}
    117         g++ -g -O2 ${JSON_CFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${CFLAGS} ${MONO_CFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${SAGA_ENABLED} ${OTB_ENABLED} ${HPC_ENABLED} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} ${MONO_ENABLED} ${METADB_ENABLED} -c zoo_service_loader.c  -fno-common -DPIC -o zoo_service_loader.o
     119zoo_service_loader.o: zoo_service_loader.c service.h version.h ${MS_FILE} ${R_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} ${MONO_FILE} ${HPC_FILES} ${METADB_FILE}
     120        g++ -g -O2 ${JSON_CFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${CFLAGS} ${MONO_CFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${RCFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${SAGA_ENABLED} ${OTB_ENABLED} ${HPC_ENABLED} ${PYTHON_ENABLED} ${R_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} ${MONO_ENABLED} ${METADB_ENABLED} -c zoo_service_loader.c  -fno-common -DPIC -o zoo_service_loader.o
    118121
    119122libzoo_service.${EXT}: version.h service_internal.o service.o sqlapi.o
    120123        gcc -shared  ${GDAL_CFLAGS} ${DEFAULT_OPTS} -fpic -o libzoo_service.${EXT} ${CFLAGS}  service_internal.o service.o sqlapi.o ${FCGI_LDFLAGS} ${GDAL_LIBS} ${ZOO_LDFLAGS}
    121124
    122 zoo_loader.cgi: version.h libzoo_service.${EXT} zoo_loader.c zoo_service_loader.o  ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o request_parser.o response_print.o server_internal.o caching.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} ${HPC_FILES} ${METADB_FILE} ${JSON_FILE} service_callback.o
     125zoo_loader.cgi: version.h libzoo_service.${EXT} zoo_loader.c zoo_service_loader.o  ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o request_parser.o response_print.o server_internal.o caching.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${R_FILE} ${SAGA_FILE} ${HPC_FILES} ${METADB_FILE} ${JSON_FILE} service_callback.o
    123126        g++ -g -O2 ${JSON_CFLAGS} ${JSCFLAGS} ${PHPCFLAGS}  ${PERLCFLAGS} ${RUBYCFLAGS}  ${JAVACFLAGS} ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c zoo_loader.c  -fno-common -DPIC -o zoo_loader.o
    124         g++  ${JSON_CFLAGS} ${JSCFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o ${MS_FILE} ${PYTHON_FILE}  ${PERL_FILE} ${PHP_FILE}  ${JS_FILE} ${JAVA_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} ${MONO_FILE} ${HPC_FILES} ${METADB_FILE} ${JSON_FILE} service_callback.o response_print.o server_internal.o caching.o request_parser.o ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi -L. ${LDFLAGS}
     127        g++  ${JSON_CFLAGS} ${JSCFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o ${MS_FILE} ${PYTHON_FILE}  ${PERL_FILE} ${PHP_FILE}  ${JS_FILE} ${JAVA_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} ${MONO_FILE} ${HPC_FILES} ${METADB_FILE} ${JSON_FILE} ${R_FILE} service_callback.o response_print.o server_internal.o caching.o request_parser.o ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi -L. ${LDFLAGS}
    125128
    126129zcfg2yaml: zcfg2yaml.c service.h lex.sr.o service_conf.tab.o service_conf.y main_conf_read.tab.o lex.cr.o response_print.o server_internal.o service_internal.o ${MS_FILE} ${YAML_FILE}
  • branches/prototype-v0/zoo-project/zoo-kernel/ZOOMakefile.opts.in

    r854 r873  
    5858PYTHON_FILE=@PYTHON_FILE@
    5959
     60RCFLAGS=@R_CPPFLAGS@
     61RLDFLAGS=@R_LDFLAGS@
     62R_ENABLED=@R_ENABLED@
     63R_FILE=@R_FILE@
     64
    6065RUBYCFLAGS=@RUBY_CPPFLAGS@
    6166RUBYLDFLAGS=@RUBY_LDFLAGS@
     
    115120
    116121CFLAGS=@SSH2_CPPFLAGS@ @GETTEXT_CFLAGS@ @PROJ_CPPFLAGS@ @RELY_ON_DB@ @DEB_DEF@ -fpic @OPENSSL_CFLAGS@ @UUID_CFLAGS@ ${FCGI_CFLAGS} ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
    117 LDFLAGS=-lzoo_service @SSH2_LDFLAGS@ @PROJ_LDFLAGS@ @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS}  ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ @UUID_LDFLAGS@ ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} ${MONO_LDFLAGS} @GETTEXT_LDFLAGS@ @JSON_LDFLAGS@ @XSLT_LDFLAGS@
     122LDFLAGS=-lzoo_service @SSH2_LDFLAGS@ @PROJ_LDFLAGS@ @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS}  ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ @UUID_LDFLAGS@ ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} ${MONO_LDFLAGS} ${RLDFLAGS} @GETTEXT_LDFLAGS@ @JSON_LDFLAGS@ @XSLT_LDFLAGS@
    118123
    119124DATAROOTDIR=@datarootdir@/zoo-project
  • branches/prototype-v0/zoo-project/zoo-kernel/configure.ac

    r867 r873  
    523523AC_SUBST([MS_FILE])
    524524AC_SUBST([MS_VERSION])
     525
     526# ===========================================================================
     527# Detect if R is installed
     528# ===========================================================================
     529
     530AC_ARG_WITH([r],
     531        [AS_HELP_STRING([--with-r=PATH], [To enable python support or Specifies an alternative directory for R installation,  disabled by default])],
     532        [R_PATH="$withval"; R_ENABLED="-DUSE_R"], [R_ENABLED=""])
     533
     534if test -z "$R_ENABLED"
     535then
     536        R_FILE=""
     537else
     538        R_FILE="service_internal_r.o"
     539        # Extract the linker and include flags
     540        R_LDFLAGS="-L$R_PATH/lib/ -lR"
     541        R_CPPFLAGS="-I$R_PATH/include/"
     542
     543        # Check headers file
     544        CPPFLAGS_SAVE="$CPPFLAGS"
     545        CPPFLAGS="$R_CPPFLAGS"
     546        AC_CHECK_HEADERS([RInternals.h],
     547                 [], [AC_MSG_ERROR([could not find headers include related to R])])
     548
     549        # Ensure we can link against libphp
     550        #LIBS_SAVE="$LIBS"
     551        #LIBS="$R_LDFLAGS"
     552        #AC_CHECK_LIB([$LIBS], [R_tryEval], [], [AC_MSG_ERROR([could not find libR])], [])
     553        #LIBS="$LIBS_SAVE"
     554fi
     555
     556AC_SUBST([R_CPPFLAGS])
     557AC_SUBST([R_LDFLAGS])
     558AC_SUBST([R_ENABLED])
     559AC_SUBST([R_FILE])
     560
    525561
    526562# ===========================================================================
  • branches/prototype-v0/zoo-project/zoo-kernel/service.c

    r871 r873  
    190190 * Count number of map in a map
    191191 *
    192  * @param m the maps to count
     192 * @param m the map to count
    193193 * @return number of map in a map
    194194 */
    195195int count(map* m){
    196196  map* tmp=m;
     197  int c=0;
     198  while(tmp!=NULL){
     199    c++;
     200    tmp=tmp->next;
     201  }
     202  return c;
     203}
     204
     205/**
     206 * Count number of maps in a maps
     207 *
     208 * @param m the maps to count
     209 * @return number of maps in a maps
     210 */
     211int maps_length(maps* m){
     212  maps* tmp=m;
    197213  int c=0;
    198214  while(tmp!=NULL){
  • branches/prototype-v0/zoo-project/zoo-kernel/service_json.c

    r845 r873  
    8989  }
    9090
     91  json_object* elementsToJson(elements* myElements){
     92    json_object *res=json_object_new_object();
     93    elements* cur=myElements;
     94    while(cur!=NULL){
     95      json_object *cres=json_object_new_object();
     96      json_object_object_add(cres,"content",mapToJson(cur->content));
     97      json_object_object_add(cres,"metadata",mapToJson(cur->metadata));
     98      json_object_object_add(cres,"additional_parameters",mapToJson(cur->additional_parameters));
     99      if(cur->format!=NULL){
     100        json_object_object_add(cres,"format",json_object_new_string(cur->format));
     101      }
     102      if(cur->child==NULL){
     103        if(cur->defaults!=NULL)
     104          json_object_object_add(cres,"defaults",mapToJson(cur->defaults->content));
     105        else
     106          json_object_object_add(cres,"defaults",mapToJson(NULL));
     107        iotype* scur=cur->supported;
     108        json_object *resi=json_object_new_array();
     109        while(scur!=NULL){
     110          json_object_array_add(resi,mapToJson(scur->content));
     111          scur=scur->next;
     112        }
     113        json_object_object_add(cres,"supported",resi);
     114        fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
     115        fflush(stderr);
     116      }
     117     
     118      dumpElements(cur->child);
     119      json_object_object_add(cres,"child",elementsToJson(cur->child));
     120      fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
     121      fflush(stderr);
     122
     123      json_object_object_add(res,cur->name,cres);
     124      cur=cur->next;
     125    }
     126    return res;
     127  }
     128 
     129  json_object* serviceToJson(service* myService){
     130    json_object *res=json_object_new_object();
     131    json_object_object_add(res,"name",json_object_new_string(myService->name));
     132    json_object_object_add(res,"content",mapToJson(myService->content));
     133    json_object_object_add(res,"metadata",mapToJson(myService->metadata));
     134    json_object_object_add(res,"additional_parameters",mapToJson(myService->additional_parameters));
     135    json_object_object_add(res,"inputs",elementsToJson(myService->inputs));
     136    json_object_object_add(res,"outputs",elementsToJson(myService->outputs));
     137    return res;
     138  }
     139 
     140 
    91141#ifdef __cplusplus
    92142}
  • branches/prototype-v0/zoo-project/zoo-kernel/service_json.h

    r845 r873  
    3838  json_object* mapToJson(map*);
    3939  json_object* mapsToJson(maps*);
     40  json_object* serviceToJson(service*);
    4041#ifdef __cplusplus
    4142}
  • branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c

    r865 r873  
    3535#ifdef USE_OTB
    3636#include "service_internal_otb.h"
     37#endif
     38
     39#ifdef USE_R
     40#include "service_internal_r.h"
    3741#endif
    3842
     
    706710#endif
    707711
     712#ifdef USE_R
     713  if (strncasecmp (r_inputs->value, "R", 6) == 0)
     714    {     
     715      *eres =
     716        zoo_r_support (&m, request_inputs, s1,
     717                            &request_input_real_format,
     718                            &request_output_real_format);
     719    }
     720  else
     721#endif
     722
    708723#ifdef USE_JAVA
    709724  if (strncasecmp (r_inputs->value, "JAVA", 4) == 0)
     
    17111726                                  addNestedOutputs(&s1);
    17121727#endif
     1728                                  json_object* jobj=serviceToJson(s1);
     1729                                  const char* jsonStr=json_object_to_json_string_ext(jobj,JSON_C_TO_STRING_PLAIN);
     1730                                  fprintf(stderr,"*** %s %d %s \n",__FILE__,__LINE__,jsonStr);
     1731
    17131732                                  printDescribeProcessForProcess (zooRegistry,m, doc, n, s1);
    17141733                                  freeService (&s1);
     
    25482567  rewind(stdout);
    25492568
     2569  fprintf(stderr,"%s %d %d\n",__FILE__,__LINE__,eres);
     2570
    25502571  if (eres != -1)
    25512572    outputResponse (s1, request_input_real_format,
  • branches/prototype-v0/zoo-project/zoo-services/cgal/voronoi.c

    r862 r873  
    197197    int ns = 0;
    198198    int nr = 0;
     199    int nf = 0;
     200    Face_iterator fit =T.faces_begin();
     201    FILE* f=fopen("/tmp/toto.log","w+");
     202    for ( ; fit !=T.faces_end(); ++fit) {
     203      fprintf(stderr," *** %s %d %d %d\n",__FILE__,__LINE__,nf,fit.info());
     204      fflush(stderr);
     205     
     206      nf++;
     207    }
     208    fclose(f);
    199209    Edge_iterator eit =T.edges_begin();
    200210    for ( ; eit !=T.edges_end(); ++eit) {
     
    203213        const Pointz p1=tmp->source();
    204214        const Pointz p2=tmp->target();
     215        fprintf(stderr,"P1 %d %d | P2 %d %d\n",p1.x(),p1.y(),p2.x(),p2.y());
    205216#ifdef DEBUG
    206217        fprintf(stderr,"P1 %d %d | P2 %d %d\n",p1.x(),p1.y(),p2.x(),p2.y());
  • branches/prototype-v0/zoo-project/zoo-services/utils/status/Makefile

    r854 r873  
    11ZRPATH=../../..
    22include ${ZRPATH}/zoo-kernel/ZOOMakefile.opts
    3 CFLAGS=-I${INST_INCLUDE} ${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} -DLINUX_FREE_ISSUE #-DDEBUG
     3CFLAGS1=${CFLAGS} -I${INST_INCLUDE} ${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} -DLINUX_FREE_ISSUE #-DDEBUG
    44
    55cgi-env/wps_status.zo: service.c
    6         g++ -rdynamic ${CFLAGS} -shared -fpic -o cgi-env/wps_status.zo ./service.c ${GDAL_LIBS} ${XML2LDFLAGS} ${MACOS_LD_FLAGS} ${ZOO_LDFLAGS} ${MACOS_LD_NET_FLAGS} ${XSLT_LDFLAGS} ${FCGI_LDFLAGS} -L${ZRPATH}/zoo-kernel/ -lzoo_service
     6        g++ ${CFLAGS1} -shared -fpic -o cgi-env/wps_status.zo ./service.c ${GDAL_LIBS} ${XML2LDFLAGS} ${MACOS_LD_FLAGS} ${ZOO_LDFLAGS} ${MACOS_LD_NET_FLAGS} ${XSLT_LDFLAGS} ${FCGI_LDFLAGS} -L${ZRPATH}/zoo-kernel/ -lzoo_service
    77
    88install:
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png