diff --git a/mex/sources/build_matlab_multithread.m b/mex/sources/build_matlab_multithread.m
index fb60b3cf68e4b2eea01f59417edd9448e041af18..b0a6e8468cd2422831662a9a5f8755addd53612d 100644
--- a/mex/sources/build_matlab_multithread.m
+++ b/mex/sources/build_matlab_multithread.m
@@ -54,6 +54,11 @@ if matlab_ver_less_than('7.3')
     COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -DMWTYPES_NOT_DEFINED' ];
 end
 
+% Matlab Lapack expects mwSignedIndex arguments only starting with Matlab 7.8
+if ~matlab_ver_less_than('7.8')
+    COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -DLAPACK_USE_MWSIGNEDINDEX' ];
+end
+
 % Large array dims for 64 bits platforms appeared in Matlab 7.3
 if (strcmpi('GLNXA64', computer) || strcmpi('PCWIN64', computer)) ...
       && ~matlab_ver_less_than('7.3')