Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
f9d511cf
Commit
f9d511cf
authored
Aug 14, 2019
by
Ralf Mueller
🎣
Browse files
rename rb/py class/module to Cdi
parent
0f7fb911
Changes
5
Hide whitespace changes
Inline
Side-by-side
interfaces/Makefile.am
View file @
f9d511cf
## Process this file with automake to produce Makefile.in
#
SWIGCDILIB
=
cdilib.i
SWIGCDIOBJ
=
cdiobj.i
BINDINGS
=
SWIG_FILE
=
$(abs_top_srcdir)
/interfaces/cdi.i
BINDINGS
=
INTERFACES_FILES
=
\
$(abs_top_srcdir)
/interfaces/ruby/test.rb
\
$(abs_top_srcdir)
/interfaces/ruby/setup.rb
\
$(abs_top_srcdir)
/interfaces/python/test.py
\
$(abs_top_srcdir)
/interfaces/python/setup.py
\
$(abs_top_srcdir)
/interfaces/python/table.py
\
$(abs_top_srcdir)
/interfaces/python/Cdi.py
\
$(abs_top_srcdir)
/interfaces/CdiInfo.cpp
\
$(abs_top_srcdir)
/interfaces/f2003/bindGen.rb
EXTRA_DIST
=
$(SWIG_FILE)
$(INTERFACES_FILES)
MODULE_NAME
=
Cdi
RUBY_WRAPPER_FILE
=
$(abs_top_builddir)
/interfaces/ruby/cdi_wrapper.cpp
RUBY_SHARED_LIB
=
$(abs_top_builddir)
/interfaces/ruby/
$(MODULE_NAME)
.so
RUBY_MAKEFILE
=
$(abs_top_builddir)
/interfaces/ruby/Makefile
PYTHON_WRAPPER_FILE
=
$(abs_top_builddir)
/interfaces/python/cdi_wrapper.cpp
PYTHON_SHARED_LIB
=
$(abs_top_builddir)
/interfaces/python/
$(MODULE_NAME)
.so
PYTHON_MAKEFILE
=
$(abs_top_builddir)
/interfaces/python/Makefile
INTERFACES_FILES
=
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 python/setupObj.py python/setupLib.py
\
python/setup.py python/table.py python/CdiLib.py
\
python/CdiObj.py
\
\
CdiInfo.cpp
\
\
f2003/bindGen.rb
EXTRA_DIST
=
$(SWIGCDIOBJ)
$(SWIGCDILIB)
$(INTERFACES_FILES)
if
CREATE_INTERFACES
BINDINGS
+=
help
endif
#
bin_PROGRAMS
=
noinst_PROGRAMS
=
...
...
@@ -42,88 +44,50 @@ CdiInfo_LDFLAGS = @NETCDF_LIBS@ @SZLIB_LIBS@ $(LDFLAGS)
#
#
if
ENABLE_RUBY
BINDINGS
+=
ruby
Obj
BINDINGS
+=
ruby
-binding
# Ruby ====================================================
rubyLibMakefile
:
cd
ruby
;
CFLAGS
=
"
$(CFLAGS)
"
LIBS
=
"
$(LIBS)
"
LDFLAGS
=
"
$(locallibs)
$(LDFLAGS)
"
INCFLAGS
=
"-I../../src"
ruby extconfLib.rb
rubyLibWrapper
:
cdilib.i
if
ENABLE_SWIG
$(SWIG)
-ruby
-module
CdiLib
-o
ruby/cdilib_wrap.c
$(AM_CPPFLAGS)
cdilib.i
endif
rubyLib
:
rubyLibWrapper rubyLibMakefile
@
cd
ruby
;
make
$(RUBY_WRAPPER_FILE)
:
$(SWIG_FILE)
mkdir
-p
$(
dir
$@
)
$(SWIG)
-ruby
-c
++
-globalmodule
-debug-classes
-o
$@
$(AM_CPPFLAGS)
$<
rubyLibTest
:
rubyLib
@
cd
ruby
;
ruby testLib.rb
# =========================================================
rubyObjMakefile
:
cd
ruby
;
CFLAGS
=
"
$(CFLAGS)
"
LIBS
=
"
$(LIBS)
"
LDFLAGS
=
"
$(LDFLAGS)
"
INCFLAGS
=
"-I../"
ruby extconfObj.rb
$(RUBY_MAKEFILE)
:
$(abs_top_srcdir)/interfaces/ruby/setup.rb
mkdir
-p
$(
dir
$@
)
cd
ruby
&&
CFLAGS
=
"
$(CFLAGS)
"
LIBS
=
"
$(LIBS)
"
LDFLAGS
=
"
$(LDFLAGS)
"
INCFLAGS
=
"-I
$(abs_top_srcdir)
/interfaces"
ruby
$<
rubyObjWrapper
:
cdiobj.i
if
ENABLE_SWIG
$(SWIG)
-ruby
-c++
-module
CdiObj
-o
ruby/cdiobj_wrap.cpp
$(AM_CPPFLAGS)
cdiobj.i
endif
$(RUBY_SHARED_LIB)
:
$(RUBY_WRAPPER_FILE) $(RUBY_MAKEFILE)
cd
ruby
&&
make
rubyObj
:
rubyObjWrapper rubyObjMakefile
@
cd
ruby
;
make
ruby-binding
:
$(RUBY_SHARED_LIB)
ruby
Obj
Test
:
rubyObj
@
cd
ruby
;
ruby test
Obj
.rb
rubyTest
:
$(RUBY_SHARED_LIB)
cd
ruby
&&
ruby
$(abs_top_srcdir)
/interfaces/ruby/
test.rb
rubyObjI
nstall
:
ruby
Obj
@
cd
ruby
;
make
install
i
nstall
-
ruby
:
$(RUBY_SHARED_LIB)
cd
ruby
&&
make
install
endif
# =========================================================
if
ENABLE_PYTHON
BINDINGS
+=
python
Obj
BINDINGS
+=
python
-binding
# Python ==================================================
pythonLibWrapper
:
cdilib.i
if
ENABLE_SWIG
$(SWIG)
-python
-module
CdiLib
-o
python/cdilib_wrap.c
$(AM_CPPFLAGS)
cdilib.i
endif
$(PYTHON_WRAPPER_FILE)
:
$(SWIG_FILE)
mkdir
-p
$(
dir
$@
)
$(SWIG)
-python
-c
++
-debug-classes
-o
$(PYTHON_WRAPPER_FILE)
$(AM_CPPFLAGS)
$<
pythonLib
:
pythonLibWrapper
@
cd
python
;
CFLAGS
=
"
$(CFLAGS)
"
LIBS
=
"
$(LIBS)
"
LDFLAGS
=
"
$(LDFLAGS)
"
INCFLAGS
=
"-I../../src"
python setupLib.py build_ext
--inplace
$(PYTHON_SHARED_LIB)
:
$(PYTHON_WRAPPER_FILE) $(abs_top_srcdir)/interfaces/python/setup.py
mkdir
-p
$(
dir
$@
)
cd
python
;
CC
=
"
$(CC)
"
CXX
=
"
$(CXX)
"
BUILDLIBDIR
=
"
$(top_builddir)
/src/.libs"
LIBDIR
=
$(libdir)
CFLAGS
=
"
$(CFLAGS)
"
LIBS
=
"
$(LIBS)
"
LDFLAGS
=
"-L../../src/.libs
$(LDFLAGS)
"
INCFLAGS
=
"-I
$(abs_top_srcdir)
/interfaces"
python
$(abs_top_srcdir)
/interfaces/python/setup.py build_ext
--inplace
pythonLibTest
:
pythonLib
@
cd
python
;
python testLib.py
# =========================================================
python/cdiobj_wrap.cpp
:
cdiobj.i
if
ENABLE_SWIG
$(SWIG)
-python
-c++
-module
CdiObj
-o
python/cdiobj_wrap.cpp
$(AM_CPPFLAGS)
cdiobj.i
endif
pythonObj
:
python/cdiobj_wrap.cpp
cd
python
;
CC
=
"
$(CC)
"
CXX
=
"
$(CXX)
"
BUILDLIBDIR
=
"
$(top_builddir)
/src/.libs"
LIBDIR
=
$(libdir)
CFLAGS
=
"
$(CFLAGS)
"
LIBS
=
"
$(LIBS)
"
LDFLAGS
=
"-L../../src/.libs
$(LDFLAGS)
"
INCFLAGS
=
"-I../"
python setupObj.py build_ext
--inplace
python-binding
:
$(PYTHON_SHARED_LIB)
python
Obj
Test
:
pythonObj
@
cd
python
;
python
testObj.py
pythonTest
:
$(abs_top_srcdir)/interfaces/python/test.py
@
cd
python
;
python
$<
pythonObjI
nstall
:
python
Obj
cd
python
;
CC
=
"
$(CC)
"
CXX
=
"
$(CXX)
"
BUILDLIBDIR
=
"
$(top_builddir)
/src/.libs"
LIBDIR
=
$(libdir)
CFLAGS
=
"
$(CFLAGS)
"
LIBS
=
"
$(LIBS)
"
LDFLAGS
=
"-L../../src/.libs
$(LDFLAGS)
"
INCFLAGS
=
"-I
../
"
python setup
Obj
.py
install
--prefix
=
$(prefix)
i
nstall
-
python
:
$(PYTHON_SHARED_LIB)
cd
python
;
CC
=
"
$(CC)
"
CXX
=
"
$(CXX)
"
BUILDLIBDIR
=
"
$(top_builddir)
/src/.libs"
LIBDIR
=
$(libdir)
CFLAGS
=
"
$(CFLAGS)
"
LIBS
=
"
$(LIBS)
"
LDFLAGS
=
"-L../../src/.libs
$(LDFLAGS)
"
INCFLAGS
=
"-I
$(abs_top_srcdir)
/interfaces
"
python setup.py
install
--prefix
=
$(prefix)
endif
# =========================================================
help
:
@
echo
"#=====================================================#"
@
echo
"# EXPERIMENTAL FEATURE ===============================#"
@
echo
"#=====================================================#"
@
echo
"Bindings for: python ruby"
@
echo
"(please exchange <lang> with the corresponding language)"
@
echo
"#=====================================================#"
@
echo
" help - this message"
@
echo
" <lang>Obj - create object interface for Ruby"
@
echo
" <lang>Lib - create function interface for Ruby"
@
echo
" <lang>ObjWrapper - create the wrapper files using swig (object interface)"
@
echo
" <lang>LibWrapper - create the wrapper files using swig (function interface)"
@
echo
" <lang>ObjTest - run object interface test (./<lang>/testObj.rb). Accepts input file argument."
@
echo
" <lang>LibTest - run function library test (./<lang>/testLib.rb). Accepts input file argument."
@
echo
" <lang>ObjInstall - install shared libraries and optional language files for <lang>"
@
echo
" <lang>LibInstall - see <lang>ObjInstall"
#
AM_CPPFLAGS
=
-I
$(top_srcdir)
/src
#
#
all-local: $(BINDINGS)
all-local
:
$(BINDINGS)
#
CLEANFILES
=
`
ls
*
~
`
CLEANFILES
=
`
ls
*
~
*
.o
*
.so
*
/
*
.o
*
/
*
.so
`
interfaces/cdi.i
View file @
f9d511cf
%
module
Cdi
Obj
%
module
Cdi
%
{
#
define
SWIG_FILE_WITH_INIT
#
include
"cdi.hpp"
...
...
interfaces/python/setup.py
View file @
f9d511cf
#!/usr/bin/env python
import
os
,
string
INCFLAGS
=
[]
...
...
@@ -15,3 +16,26 @@ if 'LDFLAGS' in os.environ:
if
'LIBS'
in
os
.
environ
:
LIBS
=
os
.
environ
[
'LIBS'
].
split
()
from
distutils.core
import
setup
,
Extension
from
setup
import
*
cdiobj_module
=
Extension
(
'_Cdi'
,
sources
=
[
'cdi_wrapper.cpp'
],
extra_compile_args
=
INCFLAGS
,
library_dirs
=
LDFLAGS
,
extra_objects
=
[
'../cdi.o'
],
runtime_library_dirs
=
[
os
.
environ
[
'BUILDLIBDIR'
],
os
.
environ
[
'LIBDIR'
]],
extra_link_args
=
LIBS
,
libraries
=
[
'cdi'
,
'stdc++'
],
language
=
'c++'
,
)
setup
(
name
=
'Cdi'
,
version
=
'0.1'
,
author
=
"Ralf Mueller"
,
description
=
"""pyhton bindings to CDI class library"""
,
ext_modules
=
[
cdiobj_module
],
py_modules
=
[
"Cdi"
],
)
interfaces/ruby/conf.rb
deleted
100644 → 0
View file @
0f7fb911
$INCFLAGS
=
"
#{
ENV
[
'INCFLAGS'
]
}
#{
$INCFLAGS
}
"
$CFLAGS
=
"
#{
ENV
[
'CFLAGS'
]
}
#{
$CFLAGS
}
"
$LDFLAGS
=
"
#{
ENV
[
'LDFLAGS'
]
}
#{
$LDFLAGS
}
"
$LIBS
=
"
#{
ENV
[
'LIBS'
]
}
#{
$LIBS
}
"
interfaces/ruby/setup.rb
View file @
f9d511cf
require
'mkmf'
load
"extconf.rb"
$INCFLAGS
=
"
#{
ENV
[
'INCFLAGS'
]
}
#{
$INCFLAGS
}
"
$CFLAGS
=
"
#{
ENV
[
'CFLAGS'
]
}
#{
$CFLAGS
}
"
$LDFLAGS
=
"
#{
ENV
[
'LDFLAGS'
]
}
#{
$LDFLAGS
}
"
$LIBS
=
"
#{
ENV
[
'LIBS'
]
}
#{
$LIBS
}
"
$libs
=
append_library
(
$libs
,
"stdc++"
)
$LDFLAGS
+=
" ../.libs/libcdipp.a ../../src/.libs/libcdi.a"
$srcs
=
%w[cdi
obj
_wrap.cpp]
$objs
=
%w[cdi
obj
_wrap.o]
create_makefile
(
'Cdi
Obj
'
)
$srcs
=
%w[cdi_wrap
per
.cpp]
$objs
=
%w[cdi_wrap
per
.o]
create_makefile
(
'Cdi'
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment