Commit 58a97788 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added changes to distribute cdi.hpp

parent 81beea69
......@@ -1345,8 +1345,9 @@ Optional Features:
of F2003 [default=no].
--enable-swig use swig to create extra bindings [default=no]
--enable-ruby ruby language bindings [default=no]
--enable-python python language bindings [default=no]
(EXPERIMENTAL)
--enable-ruby ruby language bindings [default=no] (EXPERIMENTAL)
--enable-python python language bindings [default=no] (EXPERIMENTAL)
--enable-dap Build OPeNDAP/DODS-enabled clients if possible
[default=no]
--enable-mpi Compile with MPI compiler [default=no]
......
......@@ -210,7 +210,7 @@ ACX_SL_FC_MOD_SUFFIX(,[FCMODEXT=mod])
# -----------------------------------
# Check for SWIG - Generator for script-language bindings
AC_ARG_ENABLE(swig,
[AS_HELP_STRING([--enable-swig],[use swig to create extra bindings [default=no]])],
[AS_HELP_STRING([--enable-swig],[use swig to create extra bindings [default=no] (EXPERIMENTAL)])],
[],[enable_swig=no])
if test "x$enable_swig" != "xyes"; then
......@@ -229,7 +229,7 @@ AM_CONDITIONAL(WITH_SWIG, [test "x$SWIG" != "x"])
# Create the Ruby Interface via swig
#
AC_ARG_ENABLE(ruby,
[AS_HELP_STRING([--enable-ruby],[ruby language bindings [default=no]])],
[AS_HELP_STRING([--enable-ruby],[ruby language bindings [default=no] (EXPERIMENTAL)])],
[], [enable_ruby=no])
if test "x$enable_ruby" != "xyes"; then
......@@ -263,7 +263,7 @@ AM_CONDITIONAL(WITH_RUBY, [test "x$use_ruby" = "xYes"])
# Create the Ruby Interface via swig
#
AC_ARG_ENABLE(python,
[AS_HELP_STRING([--enable-python],[python language bindings [default=no]])],
[AS_HELP_STRING([--enable-python],[python language bindings [default=no] (EXPERIMENTAL)])],
[], [enable_python=no])
if test "x$enable_python" != "xyes"; then
......
......@@ -2,7 +2,10 @@
#
SWIGCDILIB = cdilib.i
SWIGCDIOBJ = cdiobj.i
BINDINGS =
BINDINGS =
EXTRA_DIST = $(SWIGCDIOBJ) $(SWIGCDILIB)
EXTRA_DIST += ruby/cdilib_wrap.c ruby/cdiobj_wrap.cpp ruby/testLib.rb ruby/testObj.rb
EXTRA_DIST += python/cdilib_wrap.c python/cdiobj_wrap.cpp python/testLib.py python/testObj.py
if CREATE_INTERFACES
BINDINGS += help
endif
......@@ -14,7 +17,7 @@ if CREATE_INTERFACES
noinst_PROGRAMS += CdiInfo
endif
#
CdiInfo_SOURCES = CdiInfo.cpp cdi.cpp
CdiInfo_SOURCES = CdiInfo.cpp cdi.cpp cdi.hpp
#
CdiInfo_LDADD = ../src/cdilib.o $(LDFLAGS) $(LIBS)
#
......@@ -83,6 +86,8 @@ pythonObjInstall: pythonObj
endif
# =========================================================
help:
@echo "#=====================================================#"
@echo "# EXPERIMENTAL FEATURE ===============================#"
@echo "#=====================================================#"
@echo "Bindings for: python ruby"
@echo "(please exchange <lang> with the corresponding language)"
......
......@@ -68,6 +68,10 @@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(CdiInfo_SOURCES)
DIST_SOURCES = $(CdiInfo_SOURCES)
ETAGS = etags
......@@ -192,8 +196,12 @@ top_srcdir = @top_srcdir@
SWIGCDILIB = cdilib.i
SWIGCDIOBJ = cdiobj.i
BINDINGS = $(am__append_1) $(am__append_3) $(am__append_4)
EXTRA_DIST = $(SWIGCDIOBJ) $(SWIGCDILIB) ruby/cdilib_wrap.c \
ruby/cdiobj_wrap.cpp ruby/testLib.rb ruby/testObj.rb \
python/cdilib_wrap.c python/cdiobj_wrap.cpp python/testLib.py \
python/testObj.py
#
CdiInfo_SOURCES = CdiInfo.cpp cdi.cpp
CdiInfo_SOURCES = CdiInfo.cpp cdi.cpp cdi.hpp
#
CdiInfo_LDADD = ../src/cdilib.o $(LDFLAGS) $(LIBS)
#
......@@ -515,6 +523,8 @@ uninstall-am: uninstall-binPROGRAMS
@WITH_PYTHON_TRUE@ @cd python; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="$(LDFLAGS)" INCFLAGS="-I../" python setupObj.py install
# =========================================================
help:
@echo "#=====================================================#"
@echo "# EXPERIMENTAL FEATURE ===============================#"
@echo "#=====================================================#"
@echo "Bindings for: python ruby"
@echo "(please exchange <lang> with the corresponding language)"
......
import CdiObj
ifile = "../testdata/mulval.nc"
ifile = "../testdata/mulval.grb"
cdi = CdiObj.Cdi(ifile)
......@@ -28,7 +28,7 @@ for k in range(cdi.variables.size()):
print cdi.variables[k].longname,' ',cdi.variables[k].units
print "#========== VAR ======================================#"
var = cdi.variables[9]
var = cdi.variables[1]
var.readField()
val = var.getField()
i=0; print 'val[',i,'] = ',val[i]
......
......@@ -2,8 +2,9 @@ require 'CdiObj'
include CdiObj
require "pp"
ifile = ARGV[0].nil? ? "../testdata/mulval.nc" : ARGV[0]
ifile = ARGV[0].nil? ? "../testdata/mulval.grb" : ARGV[0]
puts "Reading file: #{ifile}"
cdi = Cdi.new(ifile);
puts "Stream: #{cdi.streamID} vlistID:#{cdi.vlistID} nvars:#{cdi.nvars}"
......@@ -48,9 +49,9 @@ puts cdi.variables.collect {|v| v.longname }.join("-")
puts cdi.variables.collect {|v| v.units }.join("-")
puts "#========== CDI.VAR ======================================#"
varname = cdi.variables[12].name
pp cdi.methods.sort
var_ = cdi.variables[12]
varname = cdi.variables[1].name
#pp cdi.methods.sort
var_ = cdi.variables[1]
val = var_.getField()
i=0; puts "val[#{i}] = #{val[i]}"
puts "#=====================================================#"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment