// ============================================================================= // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab // Copyright (C) 2006-2008 - INRIA - Serge STEER // // This file is distributed under the same license as the Scilab package. // ============================================================================= // <-- Non-regression test for bug 614 --> // // <-- Bugzilla URL --> // http://bugzilla.scilab.org/show_bug.cgi?id=614 // // <-- Short Description --> // mxGetDimensions() from mex.h and mexlib.c do not work // properly. The reason is that it returns a pointer to int // like Matlab, but in fact, the dimensions in scilab are in // double format. // // Also occur in other OS's. my_current_directory = pwd(); cd(TMPDIR); cd('..'); TMP_directory = pwd(); mputl('ilib_mex_build(''libmex'',[''mexf16'',''mexfunction16'',''cmex''],[],[],''Makelib'','''','''','''')','builder.sce'); mputl([ '#include ""mex.h""' 'void mexFunction(nlhs, plhs, nrhs, prhs)' ' int nlhs, nrhs;' ' mxArray *plhs[]; mxArray *prhs[];' '{' ' int *dims = mxGetDimensions(prhs[0]);' ' sciprint(""%d %d %d\n"",dims[0],dims[1],dims[2]);' '}' ],'mexfunction16.c'); Generate a gateway file Generate a loader file Generate a Makefile: Makelib Running the makefile Building shared library (be patient) Shared archive loaded. Link done. diary('bug614.dia')