From: James Tursa on
"Chaopeng " <shakeham(a)gmail.com> wrote in message <i3rt2k$498$1(a)fred.mathworks.com>...
> it appears when using %VAL in general, the type is the same between actual and dummy argument. However, in this case actual argument is mwPointer (an integer) while dummy is real*8. However, we don't really care since we are merely concerned with the memory address. the mex compiler must somehow ignored the error message. We haven't been able to locate what that option is

I use %VAL with ifort all the time and have not had a problem with %VAL. I did have a problem with the Compaq compiler, but that is not what you are using. I have used it in mex routines as well as engine programs. I will take a look at my code and get back to you on that. How are you doing the compiling? i.e., are you doing the compiling with the mex command at the MATLAB prompt? If so, what specific commands & options are you using?

James Tursa
From: Chaopeng on
Thanks for the reply. I am using ifort itself to compile. More specifically, I am using Ifort with Microsoft visual studio linker, where the include directory and libmat.lib etc have been included in the project properties. The program I've given above should be simple enough. Would it be possible at all to compile that on your system, if we boldly ask? Here are our compiler commands:

Again, thank you very much.

Compiler:
/nologo /Zi /Od /fpp /include:"C:\Program Files\MATLAB\R2009a\extern\include" /gen-interfaces /warn:interfaces /module:"Debug\\" /object:"Debug\\" /traceback /check:bounds /libs:static /threads /dbglibs /c

Linker:
/OUT:"Debug\readMat.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Program Files\MATLAB\R2009a\extern\lib\win32\microsoft" /MANIFEST /MANIFESTFILE:"C:\Work\Fortran\readMat\readMat\debug\readmat.exe.intermediate.manifest" /DEBUG /PDB:"C:\Work\Fortran\readMat\readMat\debug\readmat.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"C:\Work\Fortran\readMat\readMat\debug\readmat.lib" libmx.lib libmat.lib
From: Chaopeng on
Hello friend,

do you have any small piece of 'stand-alone' Fortran code with %VAL and MAT-file reading subroutines that compiles and runs? How are you compiling it? We deeply appreciate it.


"James Tursa" <aclassyguy_with_a_k_not_a_c(a)hotmail.com> wrote in message <i3rvu0$b7k$1(a)fred.mathworks.com>...
> "Chaopeng " <shakeham(a)gmail.com> wrote in message <i3rt2k$498$1(a)fred.mathworks.com>...
> > it appears when using %VAL in general, the type is the same between actual and dummy argument. However, in this case actual argument is mwPointer (an integer) while dummy is real*8. However, we don't really care since we are merely concerned with the memory address. the mex compiler must somehow ignored the error message. We haven't been able to locate what that option is
>
> I use %VAL with ifort all the time and have not had a problem with %VAL. I did have a problem with the Compaq compiler, but that is not what you are using. I have used it in mex routines as well as engine programs. I will take a look at my code and get back to you on that. How are you doing the compiling? i.e., are you doing the compiling with the mex command at the MATLAB prompt? If so, what specific commands & options are you using?
>
> James Tursa
From: James Tursa on
"Chaopeng " <shakeham(a)gmail.com> wrote in message <i3ujva$jdv$1(a)fred.mathworks.com>...
> Hello friend,
>
> do you have any small piece of 'stand-alone' Fortran code with %VAL and MAT-file reading subroutines that compiles and runs? How are you compiling it? We deeply appreciate it.

Sorry it's taken so long to get back to you. I haven't had much spare time lately for newsgroup stuff. I will look into getting a short example to run and post the results.

James Tursa
From: James Tursa on
"James Tursa" <aclassyguy_with_a_k_not_a_c(a)hotmail.com> wrote in message <i41g60$sl7$1(a)fred.mathworks.com>...
> "Chaopeng " <shakeham(a)gmail.com> wrote in message <i3ujva$jdv$1(a)fred.mathworks.com>...
> > Hello friend,
> >
> > do you have any small piece of 'stand-alone' Fortran code with %VAL and MAT-file reading subroutines that compiles and runs? How are you compiling it? We deeply appreciate it.
>
> Sorry it's taken so long to get back to you. I haven't had much spare time lately for newsgroup stuff. I will look into getting a short example to run and post the results.
>
> James Tursa

Just tried a short %VAL() example program and it still works. I compiled at the MATLAB command prompt using the following short function (input arguments are the source files & object files):

function compile_ifort(varargin)
options = [matlabroot '\bin\win32\mexopts\intelf91msvs2005engmatopts.bat'];
mex('-f',options,'-v',varargin{:});
return
end

James Tursa