]> granicus.if.org Git - liblinear/commitdiff
Using try and catch method to show recommend message of make.m
authorcoha <coha@16e7d947-dcc2-db11-b54a-0017319806e7>
Thu, 1 Sep 2011 15:43:53 +0000 (15:43 +0000)
committercoha <coha@16e7d947-dcc2-db11-b54a-0017319806e7>
Thu, 1 Sep 2011 15:43:53 +0000 (15:43 +0000)
Modify README for new MATLAB make.m

matlab/README
matlab/make.m

index 824244383b766192cc69c72118175a53e43b7184..402a1552a87608187d2a9e93c0bb434aef7f6961 100644 (file)
@@ -26,44 +26,56 @@ of LIBLINEAR.
 Installation
 ============
 
-On Unix systems, we recommend using GNU g++ as your compiler and type
-'make' to build 'train.mexglx' and 'predict.mexglx'.  Note that we
-assume your MATLAB is installed in '/usr/local/matlab', if not, please
-change MATLABDIR in Makefile.
+On Windows systems, pre-built binary files are already in the
+directory '..\windows', so no need to conduct installation. Now we
+provide binary files only for 64bit MATLAB on Windows. If you would
+like to re-build the package, please rely on the following steps.
 
-Example:
-        linux> make
+We recommend using make.m on both MATLAB and OCTAVE. Just type 'make'
+to build 'libsvmread.mex', 'libsvmwrite.mex', 'train.mex', and
+'predict.mex'.
 
-To use Octave, type 'make octave':
+On MATLAB or Octave:
 
-Example:
-        linux> make octave
+        >> make
 
-On Windows systems, pre-built 'train.mexw64' and 'predict.mexw64' are
-included in this package (in ..\windows), so no need to conduct
-installation unless you run 32 bit windows.  If you have modified the
-sources and would like to re-build the package, type 'mex -setup' in
-MATLAB to choose a compiler for mex first. Then type 'make' to start
-the installation.
+If make.m does not work on MATLAB (especially for Windows), try 'mex
+-setup' to choose a suitable compiler for mex. Make sure your compiler
+is accessible and workable. Then type 'make' to start the
+installation.
 
 Example:
-        matlab> mex -setup
+
+        matlab>> mex -setup
         (ps: MATLAB will show the following messages to setup default compiler.)
-        Please choose your compiler for building external interface (MEX) files: 
+        Please choose your compiler for building external interface (MEX) files:
         Would you like mex to locate installed compilers [y]/n? y
-        Select a compiler: 
-        [1] Microsoft Visual C/C++ 2005 in C:\Program Files\Microsoft Visual Studio 8
-        [0] None 
+        Select a compiler:
+        [1] Microsoft Visual C/C++ version 7.1 in C:\Program Files\Microsoft Visual Studio
+        [0] None
         Compiler: 1
-        Please verify your choices: 
-        Compiler: Microsoft Visual C/C++ 2005
-        Location: C:\Program Files\Microsoft Visual Studio 8
+        Please verify your choices:
+        Compiler: Microsoft Visual C/C++ 7.1
+        Location: C:\Program Files\Microsoft Visual Studio
         Are these correct?([y]/n): y
 
-        matlab> make
+        matlab>> make
+
+On Unix systems, if neither make.m nor 'mex -setup' works, please use
+Makefile and type 'make' in a command window. Note that we assume
+your MATLAB is installed in '/usr/local/matlab'. If not, please change
+MATLABDIR in Makefile.
+
+Example:
+        linux> make
+
+To use octave, type 'make octave':
+
+Example:
+        linux> make octave
 
-For list of supported/compatible compilers for MATLAB, please check the
-following page:
+For a list of supported/compatible compilers for MATLAB, please check
+the following page:
 
 http://www.mathworks.com/support/compilers/current_release/
 
index 8823c80fc0661bc989e6da6299d972c7a96123d4..bc7e0aff5bec0b6587293372d9af80b5661a259f 100644 (file)
@@ -1,17 +1,21 @@
 % This make.m is for MATLAB and OCTAVE under Windows, Mac, and Unix\r
 \r
-Type = ver;\r
-% This part is for OCTAVE\r
-if(strcmp(Type(1).Name, 'Octave') == 1)\r
-    mex libsvmread.c\r
-    mex libsvmwrite.c\r
-    mex train.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/*.c\r
-    mex predict.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/*.c\r
-% This part is for MATLAB\r
-% Add -largeArrayDims on 64-bit machines of MATLAB\r
-else\r
-    mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmread.c\r
-    mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmwrite.c\r
-    mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims train.c linear_model_matlab.c ../linear.cpp ../tron.cpp "../blas/*.c"\r
-    mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims predict.c linear_model_matlab.c ../linear.cpp ../tron.cpp "../blas/*.c"\r
+try\r
+       Type = ver;\r
+       % This part is for OCTAVE\r
+       if(strcmp(Type(1).Name, 'Octave') == 1)\r
+               mex libsvmread.c\r
+               mex libsvmwrite.c\r
+               mex train.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/*.c\r
+               mex predict.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/*.c\r
+       % This part is for MATLAB\r
+       % Add -largeArrayDims on 64-bit machines of MATLAB\r
+       else\r
+       mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmread.c\r
+               mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmwrite.c\r
+               mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims train.c linear_model_matlab.c ../linear.cpp ../tron.cpp "../blas/*.c"\r
+               mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims predict.c linear_model_matlab.c ../linear.cpp ../tron.cpp "../blas/*.c"\r
+       end\r
+catch\r
+       fprintf('If make.m failes, please check README about detailed instructions.\n');\r
 end\r