Browse Source

makefile checks matlab variable

Former-commit-id: 2cafe966010373e11f2c6d6e5d279b751a995886
jalec 13 years ago
parent
commit
e0869218d4
2 changed files with 5 additions and 1 deletions
  1. 4 0
      include/igl/matlab/Makefile
  2. 1 1
      include/igl/matlab/MatlabWorkspace.cpp

+ 4 - 0
include/igl/matlab/Makefile

@@ -19,6 +19,10 @@ EIGEN3_INC=-I/opt/local/include/eigen3 -I/opt/local/include/eigen3/unsupported
 INC+=$(EIGEN3_INC)
 INC+=$(EIGEN3_INC)
 
 
 # Matlab dependency
 # Matlab dependency
+ifndef MATLAB
+  MATLAB=/Applications/MATLAB_R011b.app/
+  $(warning MATLAB undefined. Setting MATLAB=${MATLAB})
+endif
 MATLAB_INC=-I$(MATLAB)/extern/include/
 MATLAB_INC=-I$(MATLAB)/extern/include/
 MATLAB_LIB=-L$(MATLAB)/bin/maci64 -lmx -leng
 MATLAB_LIB=-L$(MATLAB)/bin/maci64 -lmx -leng
 INC+=$(MATLAB_INC)
 INC+=$(MATLAB_INC)

+ 1 - 1
include/igl/matlab/MatlabWorkspace.cpp

@@ -31,7 +31,7 @@ IGL_INLINE bool igl::MatlabWorkspace::write(const std::string & path) const
   MATFile * mat_file = matOpen(path.c_str(), "w");
   MATFile * mat_file = matOpen(path.c_str(), "w");
   assert(names.size() == data.size());
   assert(names.size() == data.size());
   // loop over names and data
   // loop over names and data
-  for(int i = 0;i < names.size(); i++)
+  for(int i = 0;i < (int)names.size(); i++)
   {
   {
     // Put variable as LOCAL variable
     // Put variable as LOCAL variable
     int status = matPutVariable(mat_file,names[i].c_str(), data[i]);
     int status = matPutVariable(mat_file,names[i].c_str(), data[i]);