Re: Recompilation of mex-files fails



hello james,
I don't know how this ever worked, since it is not
correct. Maybe
mexFunction used to be a function in earlier MATLAB
versions, but it
is a subroutine according to current documentation:

I used 'function' as the fortran code to be called is a
function, not a subroutine, i.e. its return value is the
same as the name of the function.
okay, changing 'function' to 'subroutine' avoids this warning.
But the errors remain - most interesting of them:
/tmp/ccBplqha.s:34: Error: 8-byte relocation cannot be
applied to 4-byte field
/tmp/ccBplqha.s:43: Error: 8-byte relocation cannot be
applied to 4-byte field
/tmp/ccBplqha.s:102: Error: 8-byte relocation cannot be
applied to 4-byte field
/tmp/ccBplqha.s:113: Error: 8-byte relocation cannot be
applied to 4-byte field
At this point I have to mention that my Linux architecture
is x86_64 so maybe that's the point (my old Fedora-version
was X86_64, too)? That is the reason why I've declared the
pointers as integer*8, see the main part of the code:

C The gateway routine
subroutine mexFunction(nlhs, plhs, nrhs, prhs)

integer*8 mxGetM, mxGetN, mxGetPr
integer*8 mxIsNumeric, mxCreateDoubleMatrix
integer*8 plhs(*), prhs(*)
integer*8 PIN_pr, S_pr, H_pr
integer nlhs, nrhs
integer*8 m, n, size, size2
real*8 PIN, S, H

Any Ideas?



.



Relevant Pages

  • Re: Fortran Compling problem
    ... >> I got a Fortran code called APEX1310.f and two codes called ... or write your own GETDAT and GETTIM wrapper functions. ... subroutine GetDat ...
    (comp.lang.fortran)
  • Re: computing Bernoulli numbers
    ... Fortran code for evaluating a sequence of Bernoulli numbers and other special functions: ... -| subroutine bernoulli_series ... -|whether an extra term should be added or not is ...
    (comp.lang.fortran)
  • Re: matlab mex file (fortran)
    ... > I send you my hypothetical fortran code too. ... Program Celsius Table: Prints simple Fahrenheit-Celsius table ... >>Subroutine mexFunction(nlhs, plhs, nrhs, prhs) ...
    (comp.soft-sys.matlab)
  • Calling a fortran subroutine from Visual C++
    ... the fortran code as a subroutine. ... The specifications for this project have ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Recompilation of mex-files fails
    ... changing 'function' to 'subroutine' avoids this warning. ... subroutine mexFunction(nlhs, plhs, nrhs, prhs) ... mexFunction is not a function that returns a value to the caller. ... when you declare nlhs and nrhs as integer ... ...
    (comp.soft-sys.matlab)

Loading