* python/max-tree.py: Here.
---
swilena/ChangeLog | 6 ++++++
swilena/python/max-tree.py | 14 ++++++++++++--
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/swilena/ChangeLog b/swilena/ChangeLog
index e4e7625..80a3d5f 100644
--- a/swilena/ChangeLog
+++ b/swilena/ChangeLog
@@ -1,5 +1,11 @@
2012-08-28 Roland Levillain <roland(a)lrde.epita.fr>
+ Comment on an issue of Swilena highlighted by max-tree.py.
+
+ * python/max-tree.py: Here.
+
+2012-08-28 Roland Levillain <roland(a)lrde.epita.fr>
+
Update the local (build-time) Swilena Python Shell.
* python/sps-local.in (PYTHONPATH): Add `@abs_builddir@/.libs'.
diff --git a/swilena/python/max-tree.py b/swilena/python/max-tree.py
index 05dd32a..236c75d 100644
--- a/swilena/python/max-tree.py
+++ b/swilena/python/max-tree.py
@@ -1,6 +1,6 @@
#! /usr/bin/env python
-# Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+# Copyright (C) 2010, 2012 EPITA Research and Development Laboratory (LRDE)
#
# This file is part of Olena.
#
@@ -37,8 +37,18 @@ for p, v in itertools.izip(ima.domain(), values):
ima.set(p, int_u8(v))
image.println("ima =", ima)
+# FIXME: The type of the (Python) object returned by this call,
+# <type 'SwigPyObject'>, is wrong. The right type should be
+# <class 'image2d_point2d.image2d_point2d'>, but the fact that the
+# routine and the result object are located in two different
+# (generated) Swilena submodules seems to confuse SWIG. A consequence
+# of this issue is that `max_tree_parent' is not usable at all, hence
+# the failure of the last line of this test. We should perhaps review
+# Swilena's design and minimize or even completely get rid of the
+# modular approach...
max_tree_parent = image.max_tree(ima, c4());
-# FIXME: Why can't we use
+
+# FIXME: Overloading issue: Why can't we use
#
# image2d_point2d.println("max_tree_parent =", max_tree_parent)
#
--
1.7.2.5
* python/ltihooks.py: Remove.
* python/Makefile.am (python_PYTHON): Remove ltihooks.py.
* python/swilena.py: No longer import `ltihooks'.
* run.in: Help Python find actual dynamic modules in directory
`.libs', as suggested by Alexandre Duret-Lutz in
http://stackoverflow.com/a/5125879/1551751.
---
swilena/ChangeLog | 11 ++++++++
swilena/python/Makefile.am | 4 +--
swilena/python/ltihooks.py | 60 --------------------------------------------
swilena/python/swilena.py | 4 +--
swilena/run.in | 46 +++++++++++++++++----------------
5 files changed, 37 insertions(+), 88 deletions(-)
delete mode 100644 swilena/python/ltihooks.py
diff --git a/swilena/ChangeLog b/swilena/ChangeLog
index 9bb6539..6781d78 100644
--- a/swilena/ChangeLog
+++ b/swilena/ChangeLog
@@ -1,3 +1,14 @@
+2012-07-27 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Get rid of `ltihooks' in Swilena.
+
+ * python/ltihooks.py: Remove.
+ * python/Makefile.am (python_PYTHON): Remove ltihooks.py.
+ * python/swilena.py: No longer import `ltihooks'.
+ * run.in: Help Python find actual dynamic modules in directory
+ `.libs', as suggested by Alexandre Duret-Lutz in
+ http://stackoverflow.com/a/5125879/1551751.
+
2010-12-03 Roland Levillain <roland(a)lrde.epita.fr>
Perform install tests in Swilena.
diff --git a/swilena/python/Makefile.am b/swilena/python/Makefile.am
index 9f3c5fb..73ca060 100644
--- a/swilena/python/Makefile.am
+++ b/swilena/python/Makefile.am
@@ -53,10 +53,8 @@ edit = sed \
-e 's|@PYTHON[@]|$(PYTHON)|g'
-# ltihooks.py: Python import hooks that understand Libtool libraries.
-python_PYTHON = ltihooks.py
# swilena.py: The whole Swilena suite.
-python_PYTHON += swilena.py
+python_PYTHON = swilena.py
# data.py: Access to the data of the distribution (images, meshes,
# etc.).
diff --git a/swilena/python/ltihooks.py b/swilena/python/ltihooks.py
deleted file mode 100644
index 7086365..0000000
--- a/swilena/python/ltihooks.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# -*- Mode: Python; py-indent-offset: 4 -*-
-# ltihooks.py: python import hooks that understand libtool libraries.
-# Copyright (C) 2000 James Henstridge.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-import os, ihooks
-
-class LibtoolHooks(ihooks.Hooks):
- def get_suffixes(self):
- """Like normal get_suffixes, but adds .la suffixes to list"""
- ret = ihooks.Hooks.get_suffixes(self)
- ret.insert(0, ('module.la', 'rb', 3))
- ret.insert(0, ('.la', 'rb', 3))
- return ret
-
- def load_dynamic(self, name, filename, file=None):
- """Like normal load_dynamic, but treat .la files specially"""
- if len(filename) > 3 and filename[-3:] == '.la':
- fp = open(filename, 'r')
- dlname = ''
- installed = 1
- line = fp.readline()
- while line:
- if len(line) > 7 and line[:7] == 'dlname=':
- dlname = line[8:-2]
- elif len(line) > 10 and line[:10] == 'installed=':
- installed = line[10:-1] == 'yes'
- line = fp.readline()
- fp.close()
- if dlname:
- if installed:
- filename = os.path.join(os.path.dirname(filename),
- dlname)
- else:
- filename = os.path.join(os.path.dirname(filename),
- '.libs', dlname)
- return ihooks.Hooks.load_dynamic(self, name, filename, file)
-
-importer = ihooks.ModuleImporter()
-importer.set_hooks(LibtoolHooks())
-
-def install():
- importer.install()
-def uninstall():
- importer.uninstall()
-
-install()
diff --git a/swilena/python/swilena.py b/swilena/python/swilena.py
index 260c4ce..969a2a1 100644
--- a/swilena/python/swilena.py
+++ b/swilena/python/swilena.py
@@ -1,6 +1,6 @@
#! /usr/bin/env python
-# Copyright (C) 2008, 2009, 2010, 2013 EPITA Research and Development
+# Copyright (C) 2008, 2009, 2010, 2012, 2013 EPITA Research and Development
# Laboratory (LRDE)
#
# This file is part of Olena.
@@ -20,8 +20,6 @@
# \file swilena.py
# \brief The whole Swilena suite.
-import ltihooks
-
import config
from complex2 import *
diff --git a/swilena/run.in b/swilena/run.in
index 2f01b29..0a76964 100755
--- a/swilena/run.in
+++ b/swilena/run.in
@@ -1,7 +1,8 @@
-#!/bin/sh
-# Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de Paris 6
-# (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
-# Pierre et Marie Curie.
+#! /bin/sh
+
+# Copyright (C) 2003, 2004, 2006, 2012 Laboratoire d'Informatique de
+# Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
+# Université Pierre et Marie Curie.
#
# This file is part of Spot, a model checking library.
#
@@ -30,28 +31,29 @@ test -n "$srcdir" && test -z "$VERBOSE" && exec >/dev/null 2>&1
# path of dependent libraries in each library).
modpath='.libs:@abs_top_builddir@/src/.libs'
+# `@abs_builddir@/python' and `@abs_srcdir@/python' are for the *.py
+# files, and `@abs_builddir@/python/.libs' for the *.so files. We
+# used to rely on a module called `ltihooks' to teach the `import'
+# statement how to load a Libtool library, but it started to cause
+# issues with Python 2.6.
+pypath='@abs_builddir@/python:@abs_builddir@/python/.libs:@abs_srcdir@/python':"$PYTHONPATH"
+
+# Likewise for Ruby: as some of our SWIG interfaces import other SWIG
+# interfaces (with the `%import' keyword), we must add the `.libs'
+# directory to SWILENA_RUBY_PATH so that the Ruby interpreter can load
+# the corresponding dynamic module(s) (SWIG's `%import' statements
+# generate code in dynamic modules that bypass Ruby's `Kernel.require'
+# mechanism).
+rbpath='@abs_builddir@/ruby:@abs_builddir@/ruby/.libs:@abs_srcdir@/ruby'
+
case $1 in
- '' | *.py)
- PYTHONPATH='@abs_builddir@/python:@abs_srcdir@/python':"$PYTHONPATH" \
- DYLD_LIBRARY_PATH=$modpath \
- exec @PYTHON@ "$@"
- ;;
- # What's the point in adding `.libs' to SWILENA_RUBY_PATH?
- #
- # As some of our SWIG interfaces import other SWIG interfaces
- # (with the `%import' keyword), we must add the `.libs' directory
- # to SWILENA_RUBY_PATH so that the Ruby interpreter can load the
- # corresponding dynamic module(s) (SWIG's `%import' statements
- # generate code in dynamic modules that bypass Ruby's
- # `Kernel.require' mechanism).
+ *.py)
+ PYTHONPATH=$pypath DYLD_LIBRARY_PATH=$modpath exec @PYTHON@ "$@";;
*.rb)
- SWILENA_RUBY_PATH='@abs_builddir@/ruby:@abs_srcdir@/ruby:.libs' \
- DYLD_LIBRARY_PATH=$modpath \
- exec @RUBY@ "$@"
- ;;
+ SWILENA_RUBY_PATH=$rbpath DYLD_LIBRARY_PATH=$modpath exec @RUBY@ "$@";;
*.test)
exec sh -x "$@";;
*)
- echo "Unknown extension" 2>&1
+ echo "Unknown extension" >&2
exit 2;;
esac
--
1.7.2.5
* python/Makefile.am (%-wrap.cc %.py): Do not use `$@' in the
action block to represent the first output, as `$@' may stand for
any target of the rule; instead, rely on an explicit pattern based
on `$*'.
---
swilena/ChangeLog | 9 +++++++++
swilena/python/Makefile.am | 6 +++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/swilena/ChangeLog b/swilena/ChangeLog
index f92e739..73d22e0 100644
--- a/swilena/ChangeLog
+++ b/swilena/ChangeLog
@@ -1,5 +1,14 @@
2013-04-09 Roland Levillain <roland(a)lrde.epita.fr>
+ Fix Makefile pattern rules generating several tests outputs.
+
+ * python/Makefile.am (%-wrap.cc %.py): Do not use `$@' in the
+ action block to represent the first output, as `$@' may stand for
+ any target of the rule; instead, rely on an explicit pattern based
+ on `$*'.
+
+2013-04-09 Roland Levillain <roland(a)lrde.epita.fr>
+
Help SWIG 2.0.9 wrap a ctor added as an extension.
* box2d.i: Here.
diff --git a/swilena/python/Makefile.am b/swilena/python/Makefile.am
index 2593ad3..7752bab 100644
--- a/swilena/python/Makefile.am
+++ b/swilena/python/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2009, 2010, 2012 EPITA Research and Development
+# Copyright (C) 2008, 2009, 2010, 2012, 2013 EPITA Research and Development
# Laboratory (LRDE).
#
# This file is part of Olena.
@@ -32,12 +32,12 @@ AM_LDFLAGS = -avoid-version -module -shared
# Run Swig to create the C++ wrapper files, the Python interface
# files, and the dependency Makefile snippets.
%-wrap.cc %.py: $(top_srcdir)/swilena/%.i
-@AMDEP_TRUE@ if $(SWIG) $(AM_SWIGFLAGS) $(SWIGFLAGS) -MD -MF "$(DEPDIR)/$*-wrap.Tcc" -o $@ $<; then \
+@AMDEP_TRUE@ if $(SWIG) $(AM_SWIGFLAGS) $(SWIGFLAGS) -MD -MF "$(DEPDIR)/$*-wrap.Tcc" -o $*-wrap.cc $<; then \
@AMDEP_TRUE@ mv -f "$(DEPDIR)/$*-wrap.Tcc" "$(DEPDIR)/$*-wrap.Pcc";\
@AMDEP_TRUE@ else \
@AMDEP_TRUE@ rm -f "$(DEPDIR)/$*-wrap.Tcc"; exit 1;\
@AMDEP_TRUE@ fi
-@AMDEP_FALSE@ $(SWIG) $(AM_SWIGFLAGS) $(SWIGFLAGS) -o $@ $<
+@AMDEP_FALSE@ $(SWIG) $(AM_SWIGFLAGS) $(SWIGFLAGS) -o $*-wrap.cc $<
# Use Make to generate `data.py' and shell scripts (such as `sps' and
--
1.7.2.5
* box2d.i: Here.
Drop the namespace qualifier before the class name (see
http://sourceforge.net/p/swig/bugs/1291/).
---
swilena/ChangeLog | 8 ++++++++
swilena/box2d.i | 7 ++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/swilena/ChangeLog b/swilena/ChangeLog
index 8d72bf3..f92e739 100644
--- a/swilena/ChangeLog
+++ b/swilena/ChangeLog
@@ -1,3 +1,11 @@
+2013-04-09 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Help SWIG 2.0.9 wrap a ctor added as an extension.
+
+ * box2d.i: Here.
+ Drop the namespace qualifier before the class name (see
+ http://sourceforge.net/p/swig/bugs/1291/).
+
2012-08-28 Roland Levillain <roland(a)lrde.epita.fr>
Aesthetic changes in Swilena.
diff --git a/swilena/box2d.i b/swilena/box2d.i
index f13790e..11bf2c3 100644
--- a/swilena/box2d.i
+++ b/swilena/box2d.i
@@ -1,5 +1,6 @@
// -*- C++ -*-
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -42,8 +43,8 @@
%extend mln::box< mln::point<mln::grid::square, mln::def::coord> >
{
// Provide a ctor creating an `mln::box2d' from two `int's.
- mln::box< mln::point<mln::grid::square, mln::def::coord> > (int nrows,
- int ncols)
+ box< mln::point<mln::grid::square, mln::def::coord> > (int nrows,
+ int ncols)
{
return new mln::box<mln::point2d>(nrows, ncols);
}
--
1.7.2.5