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

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

[Octave-bug-tracker] [bug #57872] Priority of mex functions with the sam


From: anonymous
Subject: [Octave-bug-tracker] [bug #57872] Priority of mex functions with the same name
Date: Fri, 21 Feb 2020 00:09:23 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0

URL:
  <https://savannah.gnu.org/bugs/?57872>

                 Summary: Priority of mex functions with the same name
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Fri 21 Feb 2020 05:09:22 AM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 5.2.0
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

In MATLAB, the mexfunction has highest priority. In Octave my code errors out
with a max recursion limit error. Looks like m-file has priority over
mexfunction.

1. Create a directory @testme with the following files.
2. At Octave prompt: >> testme
3. >> testme
g++ -c  -fPIC -I/usr/local/include/octave-5.2.0/octave/..
-I/usr/local/include/octave-5.2.0/octave -I/usr/local/include  -pthread
-fopenmp -flto -s -fomit-frame-pointer -march=native   -I.  -DMEX_DEBUG
/home/work/octave/@testme/testme.cpp -o /tmp/oct-3Gdij3.o
g++ -I/usr/local/include/octave-5.2.0/octave/..
-I/usr/local/include/octave-5.2.0/octave -I/usr/local/include -pthread
-fopenmp -flto -s -fomit-frame-pointer -march=native -shared -Wl,-Bsymbolic  
-o /home/mark/octave/@testme/testme.mex  /tmp/oct-3Gdij3.o   
-L/usr/local/lib
error: max_recursion_depth exceeded
error: called from
    testme at line 10 column 8

4. Incidentally the clickable link in the error message brings up the wrong
file.

++ver
testme.m

function output = testme(varargin)

mexbin = [mfilename('fullpath') '.' mexext];

if ~exist(mexbin,'file')
    mexcpp = [mfilename('fullpath') '.cpp'];
    mex('-v',mexcpp,'-output',mexbin);
end

output = testme(varargin{:});



testme.cpp

#include "mex.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h> 
#include <string.h> 
#include <iostream> 

void mexFunction(int nlhs, mxArray * plhs[], int nrhs, const mxArray *
prhs[])
{
        std::cout << "testme cpp" << std::endl;
}
--




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57872>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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