[Top][All Lists]

[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: Rik
Subject: [Octave-bug-tracker] [bug #57872] Priority of mex functions with the same name
Date: Fri, 21 Feb 2020 10:46:22 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Update of bug #57872 (project octave):

                  Status:                    None => Works For Me           


Follow-up Comment #2:

This works for me.  First, don't use '@' as the first character in the name of
a directory.  That creates a Matlab class using their first attempt at
introducing object oriented programming to the language.  The new way to
create classes is to use the classdef keywoard, but the old syntax still
remains (confusing many people).

I made a test case which is attached as tst_precedence.zip.

It is a directory with two files in it


The file testme.cpp is

#include "mex.h"

mexFunction (int nlhs, mxArray *plhs[],
             int nrhs, const mxArray *prhs[])
  mexPrintf ("Executing mex file testme.cpp.\n");

The second file is testme.m

function testme ()
  disp ('Executing m-file testme.m.');

A sample run of Octave shows that the m-file is picked up, unless there is a
mex file which overrides it.

octave:1> testme
Executing m-file testme.m.
octave:2> mex -v testme.cpp
g++ -c  -fPIC -I/home/rik/local/include/octave-7.0.0/octave/..
-I/home/rik/local/include/octave-7.0.0/octave -I/home/rik/local/include 
-pthread -fopenmp -O2 -pipe   -I.  testme.cpp -o /tmp/oct-gym0u6.o
g++ -I/home/rik/local/include/octave-7.0.0/octave/..
-I/home/rik/local/include/octave-7.0.0/octave -I/home/rik/local/include 
-pthread -fopenmp -O2 -pipe -shared -Wl,-Bsymbolic   -o testme.mex 
/tmp/oct-gym0u6.o    -L/home/rik/local/lib   
octave:3> testme
Executing mex file testme.cpp.

(file #48462)

Additional Item Attachment:

File name: tst_precedence.zip             Size:0 KB


Reply to this item at:


  Message sent via Savannah

reply via email to

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