help-octave
[Top][All Lists]
Advanced

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

macosx mex error: failed to install .mex file function `myhello'


From: Thomas Treichl
Subject: macosx mex error: failed to install .mex file function `myhello'
Date: Tue, 02 Jan 2007 19:44:58 +0100
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)

Hi,

first of all: A happy new year everybody!

Second: I need to correct myself in my first email. Not the hmug.org binary-version of octave has the same problem (ie. failed to install .mex file function `myhello') but the hpc.sourceforge.net binary-version of octave has (I never tried the hmug.org version - there are too many dependencies).

I've got some more information about my problem. I found out that the function NSLookupSymbolInModule in liboctave/oct-shlib.cc maybe doesn't work. I changed the codelines in liboctave/oct-shlib.cc to print some messages:

  void *octave_dyld_shlib::search (const std::string& name,
    octave_shlib::name_mangler mangler) {
    void *function = 0;
    if (is_open ())
      {
        std::string sym_name = name;
        if (mangler)
          sym_name = mangler (name);
        NSSymbol symbol = NSLookupSymbolInModule (Handle, sym_name.c_str ());
        std::cout << "I'm in function octave_dyld_shlib::search, handle is: "
          << handle << "\n";
        std::cout << "I'm in function octave_dyld_shlib::search,
          sym_name.c_str() is: " << sym_name.c_str() << "\n";
        std::cout << "I'm in function octave_dyld_shlib::search, symbol is: "
           << symbol << "\n";
      if (symbol) {...

and I did the same with the open-functio in the same file:

  void octave_dyld_shlib::open (const std::string& f) {
    int returnCode;
    if (! is_open ()) {
      file = f;
      returnCode = NSCreateObjectFileImageFromFile (file.c_str (), &img);
      if (NSObjectFileImageSuccess == returnCode) {
          handle = NSLinkModule (img, file.c_str (),
            (NSLINKMODULE_OPTION_RETURN_ON_ERROR |
             NSLINKMODULE_OPTION_PRIVATE));
          std::cout << "I'm in function octave_dyld_shlib::open,
            file.c_str() is: " << file.c_str () << "\n";
          std::cout << "I'm in function octave_dyld_shlib::open,
            returnCode is: " << returnCode << "\n";
          std::cout << "I'm in function octave_dyld_shlib::open,
            handle is: " << handle << "\n";
          if (handle) {...

Then I compile myhello.c (cf. my last email) and enter octave.

  octave:1> myhello
    I'm in function octave_dyld_shlib::open, file.c_str() is:
      /Users/Thomas/Developement/octave/examples/myhello.mex
    I'm in function octave_dyld_shlib::open, returnCode is: 1
    I'm in function octave_dyld_shlib::open, handle is: 0x102d70
    I'm in function octave_dyld_shlib::open, isOpen is: 1
    I'm in function octave_dyld_shlib::search, handle is: 0x102d70
    I'm in function octave_dyld_shlib::search, sym_name.c_str() is: mexFunction
    I'm in function octave_dyld_shlib::search, symbol is: 0
    I'm in function octave_dyld_shlib::search, handle is: 0x102d70
    I'm in function octave_dyld_shlib::search, sym_name.c_str() is: mexfunction_
    I'm in function octave_dyld_shlib::search, symbol is: 0
    error: failed to install .mex file function `myhello'
  octave:1>

So it seems to me as function NSLookupSymbolInModule always returns a NULL pointer - no problem from octave, but a problem from the macosx-libs?

Regards, Thomas


reply via email to

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