octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49712] Cannot unload oct file from a SWIG gen


From: anonymous
Subject: [Octave-bug-tracker] [bug #49712] Cannot unload oct file from a SWIG generated wrapper
Date: Sat, 26 Nov 2016 22:20:10 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0

URL:
  <http://savannah.gnu.org/bugs/?49712>

                 Summary: Cannot unload oct file from a SWIG generated wrapper
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Sat 26 Nov 2016 10:20:07 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.3
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Hello,

I experimented wrapping a few pieces of C++ code with SWIG (3.0.10).
It works quite nicely: I could compile without issue the code using
_mkoctfile_ and ran it easily from Octave.

When I generate a 'test.oct' file, I can load it by running "test" in the
Octave interpreter. Then some objects are visible in the workspace and I can
play around.

However, when I run a _clear all_ or _clear test_ the *Octave 
workspace is cleared but the oct library remains loaded*. It means for
instance that I need to restart Octave each time I rebuild the oct file.

The issue is straightforward to notice if the underlying C++ code handle some
static variables.
By adding a few debug prints into the Octave sources, I could confirm that
'dlclose' is not called.

I'm running Ubuntu 16.04.4, with g++ 5.4.
I set the --no-gnu-unique flag when invoking mkoctfile to avoid unique symbols
and getting the oct library flagged as NODELETE.

To reproduce, wrapping an empty 'void f()' with SWIG in a 'test' module is
enough.
An attempt to reload the oct library in Octave after a _clear all_ and a
recompilation of the oct library will lead to the following message:
_warning: library test.oct not reloaded due to existing references_

As it goes beyond the description covered in the Octave documentation
<https://www.gnu.org/software/octave/doc/interpreter/Getting-Started-with-Oct_002dFiles.html>,
I'm not sure if I'm missing something or if it's an Octave limitation.

Many thanks








    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49712>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]