Commit c0eb9b3a authored by Ralf Mueller's avatar Ralf Mueller
Browse files

Update to SWIG 2.0.0, part II

Use rpath to non installed libcdi for testing
Ruby binding still throws errors on calling 'getField'
parent 851eee19
......@@ -103,7 +103,6 @@ interfaces/python/CdiLib.py -text
interfaces/python/CdiObj.py -text
interfaces/python/cdilib_wrap.c -text
interfaces/python/cdiobj_wrap.cpp -text
interfaces/python/make.sh -text
interfaces/python/setup.py -text
interfaces/python/setupLib.py -text
interfaces/python/setupObj.py -text
......
......@@ -77,7 +77,7 @@ if WITH_SWIG
endif
pythonObj: pythonObjWrapper
cd python; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="../$(locallibs) $(LDFLAGS)" INCFLAGS="-I../" python setupObj.py build_ext --inplace
cd python; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I../" python setupObj.py build_ext --inplace
pythonObjTest: pythonObj
@cd python; python testObj.py
......
......@@ -631,7 +631,7 @@ uninstall-am: uninstall-binPROGRAMS
@WITH_PYTHON_TRUE@@WITH_SWIG_TRUE@ $(SWIG) -python -c++ -module CdiObj -o python/cdiobj_wrap.cpp $(AM_CPPFLAGS) cdiobj.i
@WITH_PYTHON_TRUE@pythonObj: pythonObjWrapper
@WITH_PYTHON_TRUE@ cd python; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="../$(locallibs) $(LDFLAGS)" INCFLAGS="-I../" python setupObj.py build_ext --inplace
@WITH_PYTHON_TRUE@ cd python; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I../" python setupObj.py build_ext --inplace
@WITH_PYTHON_TRUE@pythonObjTest: pythonObj
@WITH_PYTHON_TRUE@ @cd python; python testObj.py
......
#!/bin/sh
OBJECTS='../../src/.libs/libcdo.so'
swig -python -c++ -o cdiobj_wrap.cpp ../cdiobj.i
g++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -I../ -I/usr/include -I/usr/local/include -I/usr/include/python2.6 -c cdiobj_wrap.cpp -o build/temp.linux-i686-2.6/cdiobj_wrap.o
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-i686-2.6/cdiobj_wrap.o $OBJECTS -L/usr/lib -L/usr/local/lib -lnetcdf -lhdf5_hl -lhdf5 -lsz -lz -lm -o /home/ram/fromHome/cdi/interfaces/python/_CdiObj.so -ldl -lutil -lm -lpython2.6
......@@ -6,9 +6,10 @@ cdiobj_module = Extension('_CdiObj',
sources=['cdiobj_wrap.cpp'],
extra_compile_args = INCFLAGS,
library_dirs = LDFLAGS,
# extra_objects = ['../../src/cdilib.o','../cdi.o'],
extra_objects = ['../cdi.o'],
runtime_library_dirs = ['../../src/.libs'],
extra_link_args = LIBS,
libraries = ['stdc++'],
libraries = ['cdi','stdc++'],
language = 'c++',
)
......
This diff is collapsed.
$INCFLAGS = "#{ENV['INCFLAGS']} #{$INCFLAGS}"
$CFLAGS = "#{ENV['CFLAGS']} #{$CFLAGS}"
$LDFLAGS = "#{ENV['LDFLAGS']} #{$LDFLAGS} ../../src/cdilib.o"
$LDFLAGS = "#{ENV['LDFLAGS']} #{$LDFLAGS} -Wl,-rpath,../../src/.libs -L../../src/.libs -lcdi"
$LIBS = "#{ENV['LIBS']} #{$LIBS}"
require 'CdiObj'
require './CdiObj'
include CdiObj
require "pp"
......@@ -50,10 +50,10 @@ puts cdi.variables.collect {|v| v.units }.join("-")
puts "#========== CDI.VAR ======================================#"
varname = cdi.variables[1].name
#pp cdi.methods.sort
pp cdi.methods.sort
var_ = cdi.variables[1]
val = var_.getField()
i=0; puts "val[#{i}] = #{val[i]}"
#val = var_.getField()
#i=0; puts "val[#{i}] = #{val[i]}"
puts "#=====================================================#"
name ="tsurf"
newvar = cdi.var[name]
......
Supports Markdown
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