Dear Kunxiu:
It sounds like the compiler can't find certain files. MAX_PATH is defined
in stdlib.h, which is a mingw include file. Make sure you not only have
cygwin, but that you've also installed mingw. I have found in the past that
the mingw distribution from www.mingw.org works best. After obtaining this
make sure you put the mingw binaries ahead of the cygwin binaries in your
cygwin PATH variable. That way cygwin will find gcc and associated files
from the mingw distribution. Edit the spm_make.sh file so that the line
cmex5="mex.bat $deff "
points to where this file is located, like so (or wherever your files are)
cmex5="c:/matlab6p1/bin/win32/mex.bat $deff "
call the spm_make.sh file with the windows switch
./spm_make.sh windows
that should work if everything is installed correctly.
Also, I'd be happy to email you a complete set of compiled binaries but I
don't want to burden the whole list with this.
Darren
At 11:40 AM 8/14/2002 -0400, you wrote:
>HI,
>
>Sorry for the confusion.
>
>The one I used is cygwin. I installed it about a week ago
>and it was the latest version at that time.
>
>I added -v option to mex in spm_MAKE.sh and gave the file the
>full path to mex.bat. Following is the relevant part in
>spm_MAKE.sh:
>windows)
>echo "Windows compile with EGCS gcc/mingw32"
>echo "see http://www.mrc-cbu.cam.ac.uk/Imaging/gnumex20.html"
>echo "for instructions about installing gcc for"
>echo "compiling Mex files."
>echo ""
>deff=-DSPM_WIN32
>CC="gcc -mno-cygwin $deff"
>cmex5="/cygdrive/c/MATLAB6p1/bin/win32/mex.bat -v $deff "
>cmex4="/cygdrive/c/MATLAB6p1/bin/win32/mex.bat -v $deff -V4 "
># Windows added utility files
>$CC -c -o win32mmap.o win32mmap.c
>$cmex5 spm_win32utils.c
>added_objs="win32mmap.o spm_mapping.obj";;
>
>Since I added the -v option, it gave out which option file it
>used and I then copied the mexopts.bat generated by gnumex to
>that directory. The following is an excerpt of the output
>msgs:
>-> Default options filename found in C:\Documents and
>Settings\kgao\Application Data\MathWorks\MATLAB\R12
>
>--------------------------------------------------------------
>--
>-> Options file = C:\Documents and
>Settings\kgao\Application Data\MathWorks\MATLAB\R12
>\mexopts.bat
> MATLAB = C:\MATLAB~1
>-> COMPILER = gcc
>-> Compiler flags:
> COMPFLAGS = -c -DMATLAB_MEX_FILE
> OPTIMFLAGS = -O3 -mcpu=pentium -malign-
>double -fno-exceptions
> DEBUGFLAGS = -g
> arguments = -DSPM_WIN32
> Name switch = -o
>-> Pre-linking commands =
>-> LINKER = C:\MATLAB~1\sys\perl\win32
>\bin\perl.exe c:\gnumex\linkmex.pl
>-> Link directives:
> LINKFLAGS =
> LINKFLAGSPOST =
> Name directive = -o spm_mapping.dll
> File link directive =
> Lib. link directive =
> Rsp file indicator =
>-> Resource Compiler = C:\MATLAB~1\sys\perl\win32
>\bin\perl.exe c:\gnumex\rccompile.pl --unix -o mexversion.res
>-> Resource Linker =
>--------------------------------------------------------------
>--
>--> "gcc -DSPM_WIN32 -c -DMATLAB_MEX_FILE -ospm_mapping.obj -
>IC:\MATLAB~1\extern\include -O3 -mcpu=pentium -malign-
>double -fno-exceptions spm_mapping.c"
>
> C:\MATLAB6P1\BIN\WIN32\MEX.PL: Error: Compile
>of 'spm_mapping.c' failed.
>
>I also tried to compile spm_win32utils.c in matlab with the
>command "mex -v spm_win32utils.c", but it gave the
>error "spm_win32utils.c:66: `_MAX_PATH' undeclared (first use
>in this function)".
>
>Thanks a lot for your help.
>Kunxiu
>
>
>---- Original message ----
> >Date: Wed, 14 Aug 2002 16:16:49 +0100
> >From: Matthew Brett <[log in to unmask]>
> >Subject: Re: Compile spm on Windows2000?
> >To: Kunxiu Gao <[log in to unmask]>
> >Cc: [log in to unmask], [log in to unmask]
> >
> >Hi,
> >
> >> I have Matlab6 Release 12. I checked the list archive and
> >> noticed that Mr. Gitelman has successfully compiled spm on
> >> windows 2000, but with matlab release 11. I tried to
>follow
> >> the instruction on www.mrc-
> >> cbu.cam.ac.uk/Imaging/gnumex20.html, but the compilation
> >> fails when it starts to use mex, specifically,
> >> spm_win32utils.c. Is it possible for somebody to give a
>more
> >> detailed explanation on how to recompile it? A lot of
>thanks.
> >
> >Could you be more specific about what you have tried and
>what the problem was?
> >Were you using Cygwin or Mingw for example? What was the
>error message?
> >Are you sure that mex was picking up your mexopts file
>created for gcc by the
> >Gnumex utilities? Might it need to be moved into the spm
>directory for
> >example?
> >
> >Many thanks,
> >
> >Matthew
> >
|