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: Sat, 30 Dec 2006 14:46:31 +0100
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)

Hi,

I've the problem to install a mex function with octave-2.9.9.+. I can't see this
problem using the dld-function. But I can see this problem using the hmug.org
binary version of octave-2.9.9 also. Please test this with the
octave-macosx-version from the fink Project. I use the most newest macosx
version 10.4.8.

Details about what I did (I have used the examples given in octave/examples):

  mkoctfile -v -Wall -Wshadow -W oregonator.cc
  g++ -c -I/usr/local/include/octave-2.9.9+
  -I/usr/local/include/octave-2.9.9+/octave -I/usr/local/include -mieee-fp -g
  -O2 -Wall -Wshadow -W oregonator.cc -o oregonator.o
  g++ -bundle -bundle_loader /usr/local/bin/octave-2.9.9+ -Wall -Wshadow -W -o
  oregonator.oct oregonator.o -L/usr/local/lib/octave-2.9.9+ -loctinterp
  -loctave -lcruft -L/usr/local/lib -framework vecLib -lreadline -lncurses -lz
  -lm -L/usr/local/lib -L/usr/local/lib/gcc/i386-apple-darwin8.8.1/4.2.0
  -L/usr/local/lib/gcc/i386-apple-darwin8.8.1/4.2.0/../../.. -lz -lm
  -lgfortranbegin -lgfortran -lgcc_s.10.4 -lSystem


compiles fine without any warning or errors and then I enter octave

  octave:1> oregonator (1,2,3)
  ans =
      7.7269e+01
     -1.4398e-310
      1.6100e-01
  octave:2>

so far. Now I try the same with the mex function

  mkoctfile --mex -v -Wall -Wshadow -W myhello.c
  gcc -c -I/usr/local/include/octave-2.9.9+
  -I/usr/local/include/octave-2.9.9+/octave -I/usr/local/include -mieee-fp
  -I/usr/local/include -Wall -Wshadow -W -I. myhello.c -o myhello.o
  myhello.c:4: warning: unused parameter 'nlhs'
  myhello.c:4: warning: unused parameter 'nrhs'
  myhello.c:4: warning: unused parameter 'prhs'
  g++ -bundle -bundle_loader /usr/local/bin/octave-2.9.9+ -Wall -Wshadow -W -o
  myhello.mex myhello.o -L/usr/local/lib/octave-2.9.9+ -loctinterp -loctave
  -lcruft -L/usr/local/lib -framework vecLib -lreadline -lncurses -lz -lm
  -L/usr/local/lib -L/usr/local/lib/gcc/i386-apple-darwin8.8.1/4.2.0
  -L/usr/local/lib/gcc/i386-apple-darwin8.8.1/4.2.0/../../.. -lz -lm
  -lgfortranbegin -lgfortran -lgcc_s.10.4 -lSystem

(three warning but no error) I get into octave and do

  octave:1> myhello
  error: failed to install .mex file function `myhello'
  octave:1>

I did this with all mex-functions installed in octave/examples and I got the same results. I changed the code in src/dynamic-ld.cc in function ::do_load_mex to the following (for printing some messages):

  if (! mex_file_name.empty ())
    {
      mex_file.open (mex_file_name);
      std::cout << "I am here -1-, filename is: " << mex_file_name << "\n";
      if (! error_state)
        {
          std::cout << "I am here -2-, error_state is: " << error_state << "\n";
          if (mex_file)
            {
              octave_mex_file_list::append (mex_file);
              function = mex_file.search ("mexFunction");
              std::cout << "I am here -3-, function is: " << function << "\n";
              if (! function)
                {
                  function = mex_file.search (STRINGIFY (F77_FUNC (mexfunction, 
MEXFUNCTION)));
                  std::cout << "I am here -4-, function is: " << function << 
"\n";
                  if (function) {
                    have_fmex = true;
                    std::cout << "I am here -5-, have_fmex is: " << have_fmex << 
"\n";
                  }
                }
            }
          else
            ::error ("%s is not a valid shared library",
                     mex_file_name.c_str ());
        }
    }

Compiling and running octave again brings me:

  octave:1> myhello
  I am here -1-, filename is:
  /Users/Thomas/Developement/octave/examples/myhello.mex
  I am here -2-, error_state is: 0
  I am here -3-, function is: 0
  I am here -4-, function is: 0
  error: failed to install .mex file function `myhello'
  octave:1>

Where to continue looking for what is happing now?
Thanks, Thomas



reply via email to

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