There is no "=" after "-outdir", just a space. mex COMPFLAGS="$COMPFLAGS -Wall -W" ./mexFisherGradOpt.c -outdir ../../mytoolbox -I../../include -L../../lib/libgsl.a
You may also need CBLAS: mex COMPFLAGS="$COMPFLAGS -Wall -W" ./mexFisherGradOpt.c -outdir ../../mytoolbox -I../../include -L../../lib/libgsl.a -L../../lib/libgslcblas.a On Fri, Jan 21, 2011 at 1:51 PM, X Statistics <[email protected]> wrote: > Hi, > > I work most of the time on GNU/Linux but I have to share my files to people > that works on MS Windows. So, here it is what I tell my co-worker to do. > > Install MinGW and MSYS. > > Compile GSL using MinGW/MSYS (use the default options and flags). Make sure > it will pass all tests. > > Install GNUMEX (I do not want to post the link here. You can easily find > on the web.) Just follow the instructions and choose MinGW C/C++ compiler > to use in place of Matlab's "lcc". > > Organize the project (even the Matlab ones) in a Unix/Linux way, e.g. > > C:/project/bin > C:/project/include > C:/project/mytoolbox > C:/project/lib > C:/project/src > (You can of course organize that in your on way.) > > Copy the compiled GSL to C:/project/lib and the header files to > C:/project/include/gsl (You can just copy and paste them.) > > Place you C/MEX files, for example, in > C:/project/src/cmex/mexFisherGradOpt.c > > Open Matlab, the choose the working directory as C:/project/src/cmex/ and > finally compile your file with > > mex COMPFLAGS="$COMPFLAGS -Wall -W" ./mexFisherGradOpt.c > -outdir=../../mytoolbox -I../../include -L../../lib/libgsl.a > > Your *.mexw32 should be in C:/project/mytoolbox. Thus, do not forget to add > that directory path in Matlab. > > This is probably not the best way of doing that but it sure works. > > Hope that helps you. > > Ralph. > > > > On Thu, Jan 20, 2011 at 2:59 AM, Akbari Vahid <[email protected]> wrote: > >> Hi, >> >> I've been trying to compile a c-file using the MEX interface. My c-file >> contains calls to functions defined in GSL (Gnu Scientific Library for C), >> a pre-existing library which I 've downloaded and installed on my PC. >> >> I have Matlab R2010a, running on Windows XP with a 32-bit processor. The >> version of GSL that I have installed was part of the GnuWin32 project, and >> supports Windows XP (32-bit). Also my C/C++ compiler is MinGW32 which >> already installed on my pc. >> >> Then I use the bellow command in MATLAB to compile the mex file >> "mexFisherGradOpt.c". >> >> Initially when I ran " mex -c mexFisherGradOpt.c -I"C:\GnuWin32\include\" >> -lgsl -lgslcblas -lm. It seems that it is compiled. >> >> Once I run the m-file which calls the c-function, MATLAB crashes. >> >> I have eliminated the possibility of any bug in the c-function that I've >> been compiling, by using a function that compiled and ran perfectly in a >> previous setup on a different PC (Windows XP, Matlab 2010a, MSVC 6.0) -- >> which was itself configured with lots of pain. >> >> To sum up, I have a bug-free c-function which I want to compile with MEX. >> This c-function contains calls to the GSL. What do I need to do in order >> to successfully compile and run my program, given the following >> configuration on my PC: Windows XP (32-bit), Matlab R2010a. >> >> Apologies for the long email. Many thanks in advance, >> >> Vahid Akbari-PhD student >> University of Tromsø >> Tromsø-Norway >> >> > _______________________________________________ Help-gsl mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gsl
