From: kk KKsingh on
Although I know how to use simple mex functions, But I am not able to figure out how nfft package which consist of matlab interface runs !

Situation

1. I already put the nfft package in matlab path and also its on my linux server i checked it by running C program

2. I have nfftmex.c in the folder and few m files ! When i run example file simple_test it give me error indicating
Error in nfft_init_1d at 23
p = nfftmex('init_1d',N,M);

Error in simple test at 35
plan = nfft_init_1d.m
and
3. When i click this error message it gives open .m file having these two lines

function p = nfft_init_1d(N,M)
p = nfftmex('init_1d',N,M);

When i use nfft libray with gcc it works, but when i use it with matlab it gives me above error! I set the path for nfft libray with matlab using file .> sethpath> included nfft folder with all subfolders so i suppose i have included all header files

But still not working ..NFFT libray is common scientific libray just wondering if any one using out there
From: Walter Roberson on
kk KKsingh wrote:

> 2. I have nfftmex.c in the folder and few m files ! When i run example
> file simple_test it give me error indicating Error in nfft_init_1d at 23
> p = nfftmex('init_1d',N,M);

Just "Error" and the location, and it doesn't say what the error is?
From: kk KKsingh on


Walter Roberson <roberson(a)hushmail.com> wrote in message <DinJn.8844$%u7.8838(a)newsfe14.iad>...
> kk KKsingh wrote:
>
> > 2. I have nfftmex.c in the folder and few m files ! When i run example
> > file simple_test it give me error indicating Error in nfft_init_1d at 23
> > p = nfftmex('init_1d',N,M);
>
> Just "Error" and the location, and it doesn't say what the error is?

oh yes sorry ! Following is the error

Attempt to execute Script nfftmex as a function
/path/..../nfftmex.m

Error in nfft_init_1d at 23
p = nfftmex('init_1d',N,M);
Error in simple test at 35
plan =nfft_init_1d(N,M);

simple_test is the file i am trying to run

kk
From: Walter Roberson on
kk KKsingh wrote:

> oh yes sorry ! Following is the error
>
> Attempt to execute Script nfftmex as a function
> /path/..../nfftmex.m
>
> Error in nfft_init_1d at 23
> p = nfftmex('init_1d',N,M);

That certainly tries to use nfftmex as a function. What are the first
few lines of nfftmex.m ? If it is just the documentation, then the error
you are seeing would be consistent with it not finding the mex object
file in the path. The mex object file should be in the same directory as
the documentation so that the help information is found.

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/f10-60956.html#f10-60987

See "Precedence Rules" and "File Precedence" there.
From: kk KKsingh on
Walter Roberson <roberson(a)hushmail.com> wrote in message <0SpJn.36306$304.11049(a)newsfe12.iad>...
> kk KKsingh wrote:
>
> > oh yes sorry ! Following is the error
> >
> > Attempt to execute Script nfftmex as a function
> > /path/..../nfftmex.m
> >
> > Error in nfft_init_1d at 23
> > p = nfftmex('init_1d',N,M);
>
> That certainly tries to use nfftmex as a function. What are the first
> few lines of nfftmex.m ? If it is just the documentation, then the error
> you are seeing would be consistent with it not finding the mex object
> file in the path. The mex object file should be in the same directory as
> the documentation so that the help information is found.
>
> http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/f10-60956.html#f10-60987
>
> See "Precedence Rules" and "File Precedence" there.


I am sure if i get ur point ! I belive you are saying thats it is using nfftmex as a function ! And you are right nfftmex,m is just a document file.....there is file nfftmex.c in the folder.....

I am running following script as test script...and i am getting error on the third line
% number of nodes
M = 3;
% nodes
x=rand(1,M)-0.5;
% Create plan.
plan = nfft_init_1d(N,M);

nfft_init_1d.m is a another file
function p = nfft_init_1d(N,M)

p = nfftmex('init_1d',N,M);

And nfftmex.c is my file.....

So how should i run this file....all files are in the path.......which i added using set path do i need to compile like
mex nfftmex.c..its also giiving me error that compilation fails when i do that its not able to find few files

nfftmex.c;27;18:imex.h no file or directory
nfftmex.c;30;26:mexversion.c no file or directory

after this 200 lines of syntax error

where are these two header files ..i already put the whole libray in path using

path=(path,'/ram/unixserver/matlab')

and it is at end of search path which i checked using path in command prompt