diff -Naur fl-core.orig/src/fl_compose.cc fl-core/src/fl_compose.cc
--- fl-core.orig/src/fl_compose.cc	2011-02-06 20:09:03.000000001 +0100
+++ fl-core/src/fl_compose.cc	2015-11-12 17:20:14.000000001 +0100
@@ -22,6 +22,10 @@
 #include <octave/parse.h>
 #include <pthread.h>    
 
+#ifndef WIN32
+#include <unistd.h>
+#endif
+
 #define HELP \
 "-*- texinfo -*-\n\
  @deftypefn{Loadable Function} {@var{res} = } fl_compose(@var{A}, @var{B}) \n\
@@ -63,19 +67,19 @@
 // Structure for thread arguments. Each thread will perform the computation between the start_index and end_index row.
 struct threadArg
 {
-	int start_index;
-	int end_index;
+	octave_idx_type start_index;
+	octave_idx_type end_index;
 };
 
 
 // Functions prototype declaration
-float get_elem(float vec[], int row, int col,int numCols);
-void set_elem(float vec[], int row, int col, int numCols, float elem);
-int is_valid_function(octave_function *func);
+float get_elem(float vec[], octave_idx_type row, octave_idx_type col,octave_idx_type numCols);
+void set_elem(float vec[], octave_idx_type row, octave_idx_type col, octave_idx_type numCols, float elem);
+octave_idx_type is_valid_function(octave_function *func);
 void *thread_function(void *arg);
-int get_available_cpus();
-int assign_default_func(octave_value arg, int tnorm);
-int optimal_sparse(octave_value mat_a,octave_value mat_b);
+octave_idx_type get_available_cpus();
+octave_idx_type assign_default_func(octave_value arg, octave_idx_type tnorm);
+octave_idx_type optimal_sparse(octave_value mat_a,octave_value mat_b);
 
 void (*compose)(octave_value_list);
 void full_compose(octave_value_list args);
@@ -110,37 +114,37 @@
 SparseMatrix sparseC;
 
 // Matrices dimensions
-long int rowsA,rowsB,colsA,colsB,rowsC,colsC;
+octave_idx_type rowsA,rowsB,colsA,colsB,rowsC,colsC;
 
 // Lock option. 1 = calculation executed only for the diagonal of the matrix
-int lock_option;
+octave_idx_type lock_option;
 
 // The increment 
-int col_index_increment;
+octave_idx_type col_index_increment;
 
 // Number of threads that will be created
-int num_threads;
+octave_idx_type num_threads;
 
 
 // 0 = the input matrices are both full. A full output matrix will be produced.
 // 1 = the input matrices are both sparse. A sparse output matrix will be produced.
-int sparse_res;
+octave_idx_type sparse_res;
 
 
 // 0 = A full composition is performed. 1 = a sparse composition is performed
-int sparse_composition;
+octave_idx_type sparse_composition;
 
 
 // Indicate that a standard T-Norm (prod or min) and a S-Norm was specified (probabilistic sum or max)
-int standard_norm;
+octave_idx_type standard_norm;
 
 
 
 /* Main function - Check the arguments and call the compose method */
 DEFUN_DLD (fl_compose, args, nargout, HELP)
 {
-	int numargs = args.length();		// Arguments number
-	int specified_lockoption = 0;		// 1 = the lock_option was specified in the arguments
+	octave_idx_type numargs = args.length();		// Arguments number
+	octave_idx_type specified_lockoption = 0;		// 1 = the lock_option was specified in the arguments
 
 	// Set the default values
 	lock_option = 0;
@@ -357,8 +361,8 @@
 	else
 	{	
 		Matrix outMatrix(rowsC,colsC);
-		for(int i=0;i<rowsC;i++)
-			for(int j=0;j<colsC;j++)
+		for(octave_idx_type i=0;i<rowsC;i++)
+			for(octave_idx_type j=0;j<colsC;j++)
 				outMatrix(i,j) = get_elem(c,i,j,colsC);
 		
 		if(sparse_res)
@@ -390,15 +394,15 @@
 	// Initialize the first matrix
 	Matrix tempMatrix = args(0).matrix_value();
 	a = new float[rowsA*colsA];
-	for (int i=0; i<rowsA; i++)
-		for(int j=0; j<colsA;j++)
+	for (octave_idx_type i=0; i<rowsA; i++)
+		for(octave_idx_type j=0; j<colsA;j++)
 			a[i*colsA+j] = tempMatrix(i,j);
 
 	// Initialize the second matrix
 	tempMatrix = args(1).matrix_value();
 	b = new float[rowsB*colsB];
-	for (int i=0; i<rowsB; i++)
-		for(int j=0; j<colsB;j++)
+	for (octave_idx_type i=0; i<rowsB; i++)
+		for(octave_idx_type j=0; j<colsB;j++)
 			b[i*colsB+j] = tempMatrix(i,j);
 	
 
@@ -418,9 +422,9 @@
 	}
 
 	// Define the number interval of rows for each thread		
-	int interval = rowsA / num_threads;	
+	octave_idx_type interval = rowsA / num_threads;	
 			
-	int i;
+	octave_idx_type i;
 	// Define the threads
 	for (i=0; i<num_threads; i++)
 	{	
@@ -465,22 +469,22 @@
 	float tnorm_val;	
 
 	// Initialize the result sparse matrix
-	sparseC = SparseMatrix((int)colsB, (int)rowsA, (int)(colsB*rowsA));
+	sparseC = SparseMatrix(colsB, rowsA, (colsB*rowsA));
 
         // Initialize the number of nonzero elements in the sparse matrix c
-        int nel = 0;
+        octave_idx_type nel = 0;
         sparseC.xcidx(0) = 0;
 
 	// Calculate the composition for each element
-        for (int i = 0; i < rowsC; i++)
+        for (octave_idx_type i = 0; i < rowsC; i++)
         {
-            for(int j = 0; j < colsC; j++)
+            for(octave_idx_type j = 0; j < colsC; j++)
             {
                 
 		// Get the index of the first element of the i-th column of a transpose (i-th row of a)
 		// and the index of the first element of the j-th column of b
-		int ka = a.cidx(i);
-		int kb = b.cidx(j);
+		octave_idx_type ka = a.cidx(i);
+		octave_idx_type kb = b.cidx(j);
 		snorm_val = 0;
 	
 		// Check if the values of the matrix are really not 0 (it happens if the column of a or b hasn't any value)
@@ -549,18 +553,18 @@
 	float tnorm_val;	
 	
 	// Get the row start_index and end_index 
-	int start_index = thread_args->start_index;
-	int end_index = thread_args->end_index;
+	octave_idx_type start_index = thread_args->start_index;
+	octave_idx_type end_index = thread_args->end_index;
 	
 
 	// Calculate the composition for the specified rows (between start_index and end_index)
-	for (int i=start_index; i<end_index; i++)
+	for (octave_idx_type i=start_index; i<end_index; i++)
 	{		
-		for(int j=lock_option*i; j<colsB; j=j+col_index_increment)
+		for(octave_idx_type j=lock_option*i; j<colsB; j=j+col_index_increment)
 		{
 			snorm_val = calc_tnorm(get_elem(a,i,0,colsA),get_elem(b,0,j,colsB));
 
-			for(int k=1; k<colsA; k++)
+			for(octave_idx_type k=1; k<colsA; k++)
 			{					
 				tnorm_val = calc_tnorm(get_elem(a,i,k,colsA),get_elem(b,k,j,colsB)); 
 				snorm_val = calc_snorm(snorm_val,tnorm_val);
@@ -579,7 +583,7 @@
 
 
 // Check if the application of the sparse algorithm is optimal
-int optimal_sparse(octave_value mat_a,octave_value mat_b)
+octave_idx_type optimal_sparse(octave_value mat_a,octave_value mat_b)
 {
 	// Parameters for execution time of each algorithm (may be changed if the algorithms change)	
 	const float sparse_norm_cost = 0.0000115;
@@ -588,21 +592,21 @@
 
 	// Get the non-zero elements number of each matrix
 	SparseMatrix tempMatrix = mat_a.sparse_matrix_value();
-	long int nnzA = tempMatrix.nnz();
+	octave_idx_type nnzA = tempMatrix.nnz();
 	tempMatrix = mat_b.sparse_matrix_value();	
-	long int nnzB = tempMatrix.nnz();
+	octave_idx_type nnzB = tempMatrix.nnz();
 
 	// Calculate the time for full calculation
-	long int full_time = full_norm_cost*rowsC*colsC*colsA/num_threads;
+	octave_idx_type full_time = full_norm_cost*rowsC*colsC*colsA/num_threads;
 
 	// Calculate the approximate number of calculated T-Norm/S-Norm in the sparse algorithm
-	long int estimated_norm_number = nnzA*(nnzB/rowsB);
+	octave_idx_type estimated_norm_number = nnzA*(nnzB/rowsB);
 
 	// Calculate the approximate number of skip operations in the sparse algorithm
-	long int estimated_skip_number = nnzA*colsB + nnzB*rowsA - 2*estimated_norm_number;
+	octave_idx_type estimated_skip_number = nnzA*colsB + nnzB*rowsA - 2*estimated_norm_number;
 
 	// Calculate the time for full calculation
-	long int sparse_time = sparse_norm_cost*estimated_norm_number + sparse_skip_cost * estimated_skip_number;
+	octave_idx_type sparse_time = sparse_norm_cost*estimated_norm_number + sparse_skip_cost * estimated_skip_number;
 
 	if(sparse_time < full_time)
 		return 1;
@@ -615,7 +619,7 @@
 
 
 /* Returns 1 if an octave_function FUNC has at most 2 arguments. */
-int is_valid_function(octave_function *func)
+octave_idx_type is_valid_function(octave_function *func)
 {
 	octave_value_list testArgs;
 	testArgs(0) = 1;
@@ -632,9 +636,9 @@
 /* Assign a default function or T-Norm or S-Norm. 
 If tnorm = 0 the function will be assigned as S-Norm, else the function will be assigned as T-Norm.
 Returns 0 if it fails*/
-int assign_default_func(octave_value arg, int tnorm)
+octave_idx_type assign_default_func(octave_value arg, octave_idx_type tnorm)
 {
-	int res = 1;	
+	octave_idx_type res = 1;	
 	if(arg.string_value() == STR_PRONORM)
 		if(tnorm)
 			calc_tnorm = func_prod;
@@ -747,7 +751,7 @@
 
 
 /* Get the current cpu cores number */
-int get_available_cpus()
+octave_idx_type get_available_cpus()
 {
 	#ifdef WIN32	
 		SYSTEM_INFO sysinfo;
@@ -767,7 +771,7 @@
 
 
 /* Get the (i,j)-th element from the vector vec. The column number of the original matrix (numCols) is required */
-float get_elem(float vec[], int row, int col,int numCols)
+float get_elem(float vec[], octave_idx_type row, octave_idx_type col,octave_idx_type numCols)
 {
 	return vec[row*numCols+col];
 }
@@ -775,7 +779,7 @@
 
 
 /* Set the (i,j)-th element from the vector vec. The column number of the original matrix (numCols) is required */
-void set_elem(float vec[], int row, int col, int numCols, float elem)
+void set_elem(float vec[], octave_idx_type row, octave_idx_type col, octave_idx_type numCols, float elem)
 {
 	vec[row*numCols+col] = elem;
 	return;
