Index: BLAS/xTRSV/xTRSV.c
===================================================================
--- BLAS/xTRSV/xTRSV.c	(revision 179)
+++ BLAS/xTRSV/xTRSV.c	(revision 180)
@@ -25,14 +25,15 @@
 #include "fortran_common.h"
 #include "fortran_thunking.h"
 #elif FBLAS
+#include <cblas.h>
 #include <cblas_f77.h>
 #elif GSL
 #include <gsl_cblas.h>
 #elif ACML
 #include <acml.h>
-#include <acml_mv.h>
 #else
 #include <cblas.h>
+#include <blaswrap.h>
 #endif
 
 #ifdef DOUBLE
@@ -41,38 +42,6 @@
 #define LENGTH float
 #endif
 
-#ifdef FBLAS
-
-#ifdef DOUBLE
-
-void dtrsv_( FCHAR, FCHAR, FCHAR, FINT, const double *, FINT, double *, FINT);
-
-void dgemv_(FCHAR, FINT, FINT, const double *, const double *, FINT, 
-	       const double *, FINT, const double *, double *, FINT);
-
-void dswap_( FINT, double *, FINT, double *, FINT);
-
-void daxpy_( FINT, const double *, const double *, FINT, double *, FINT);
-
-void dnrm2_( FINT, const double *, FINT, double *);
-
-#else
-
-void strsv_( FCHAR, FCHAR, FCHAR, FINT, const float *, FINT, float *, FINT);
-
-void sgemv_(FCHAR, FINT, FINT, const float *, const float *, FINT, 
-	       const float *, FINT, const float *, float *, FINT);
-
-void sswap_( FINT, float *, FINT, float *, FINT);
-
-void saxpy_( FINT, const float *, const float *, FINT, float *, FINT);
-
-void snrm2_( FINT, const float *, FINT, float *);
-
-#endif
-
-#endif
-
 /* Matrix with only defined triangular terms */
 /* Even if there are 0 in matrix, must be defined at all ! */
 
@@ -217,8 +186,10 @@
       if (j>i)
 	{
 	  /* Normalization is necessary to avoid problems */
+	  /* A[i*dim+j]=(LENGTH)rand()/(RAND_MAX+1.) */
+	  /*   *(LENGTH)(i+1.)/(LENGTH)(j+1.); */
 	  A[i*dim+j]=(LENGTH)rand()/(RAND_MAX+1.)
-	    *(LENGTH)(i+1.)/(LENGTH)(j+1.);
+	    /(LENGTH)(dim-j);
 	}
       else if (j==i)
 	{
@@ -314,7 +285,7 @@
       printVectorGPU(dim,devPtrX,"X","Errors");
 
       /* Estimate the second checker */
-/*       checksA[i]=(double)cublasDnrm2(dim,devPtrX,incx); */
+      checksA[i]=(double)cublasDnrm2(dim,devPtrX,incx);
 
       /* Swap vector X and Y */
       cublasDswap(dim,devPtrX,incx,devPtrY,incx);
@@ -340,7 +311,7 @@
       printVectorGPU(dim,devPtrX,"X","Errors");
 
       /* Estimate the second checker */
-/*       checksA[i]=(double)cublasSnrm2(dim,devPtrX,incx); */
+      checksA[i]=(double)cublasSnrm2(dim,devPtrX,incx);
 
       /* Swap vector X and Y */
       cublasSswap(dim,devPtrX,incx,devPtrY,incx);
@@ -395,7 +366,7 @@
       printVector(dim,X,"X","Errors");
 
       /* Store the checker of errors */
-/*       checksA[i]=(double)CUBLAS_DNRM2(&dim,X,&incx); */
+      checksA[i]=(double)CUBLAS_DNRM2(&dim,X,&incx);
 
       /* Swap vector X and Y */
       CUBLAS_DSWAP(&dim,X,&incx,Y,&incx);
@@ -419,7 +390,7 @@
       printVector(dim,X,"X","Errors");
 
       /* Store the checker of errors */
-/*       checksA[i]=(double)CUBLAS_SNRM2(&dim,X,&incx); */
+      checksA[i]=(double)CUBLAS_SNRM2(&dim,X,&incx);
 
       /* Swap vector X and Y */
       CUBLAS_SSWAP(&dim,X,&incx,Y,&incx);
@@ -443,25 +414,25 @@
     {
 #ifdef DOUBLE
       
-      printVector(dim,X,"X","Roots");
+      printVector(dim,X,"X","Initial roots");
       
       /* Multiply A by X as Y <- A.X */
       dgemv_(&trans,&dim,&dim,&alpha,A,&dim,X,&incx,&beta,Y,&incx);
       
-      printVector(dim,Y,"Y","Results");
+      printVector(dim,Y,"Y<-A.X","Estimated results");
       
       /* Solve linear system */
       dtrsv_(&uplo,&trans,&diag,&dim,A,&dim,Y,&incx);
       
-      printVector(dim,Y,"Y","Solutions");
+      printVector(dim,Y,"X","Solutions from A.X=Y");
       
       /* Compare the roots X and Y */
       daxpy_(&dim,&beta2,Y,&incx,X,&incx);
       
-      printVector(dim,X,"X","Errors");
+      printVector(dim,X,"X","Differences initial and estimated");
       
       /* Store the checker of errors */
-/*       dnrm2_(&dim,X,&incx,&checksA[i]); */
+      dnrm2_(&dim,X,&incx,&checksA[i]);
             
       /* Swap vector X and Y */
       dswap_(&dim,X,&incx,Y,&incx);
@@ -486,7 +457,7 @@
       printVector(dim,X,"X","Errors");
 
       /* Store the checker of errors */
-/*       snrm2_(&dim,X,&incx,&checksA[i]); */
+      snrm2_(&dim,X,&incx,&checksA[i]);
 
       /* Swap vector X and Y */
       sswap_(&dim,X,&incx,Y,&incx);
@@ -524,7 +495,7 @@
       printVector(dim,X,"X","Errors");
       
       /* Store the checker of errors */
-/*       dnrm2_(&dim,X,&incx,&checksA[i]); */
+      dnrm2_(&dim,X,&incx,&checksA[i]);
             
       /* Swap vector X and Y */
       dswap(dim,X,incx,Y,incx);
@@ -549,7 +520,7 @@
       printVector(dim,X,"X","Errors");
 
       /* Store the checker of errors */
-/*       snrm2_(&dim,X,&incx,&checksA[i]); */
+      snrm2_(&dim,X,&incx,&checksA[i]);
 
       /* Swap vector X and Y */
       sswap(dim,X,incx,Y,incx);
@@ -592,7 +563,7 @@
       printVector(dim,X,"X","Errors");
 
       /* Store the checker of errors */
-/*       checksA[i]=(double)cblas_dnrm2(dim,X,incx); */
+      checksA[i]=(double)cblas_dnrm2(dim,X,incx);
 
       cblas_dswap(dim,X,incx,Y,incx);
       
@@ -617,7 +588,7 @@
       printVector(dim,X,"X","Errors");
 
       /* Store the checker of errors */
-/*       checksA[i]=(double)cblas_snrm2(dim,X,incx); */
+      checksA[i]=(double)cblas_snrm2(dim,X,incx);
 
       cblas_sswap(dim,X,incx,Y,incx);
       
@@ -659,7 +630,7 @@
       printVector(dim,X,"X","Errors");
 
       /* Store the checker of errors */
-/*       checksA[i]=(double)cblas_dnrm2(dim,X,incx); */
+      checksA[i]=(double)cblas_dnrm2(dim,X,incx);
 
       cblas_dswap(dim,X,incx,Y,incx);
       
@@ -684,8 +655,8 @@
       printVector(dim,X,"X","Errors");
 
       /* Store the checker of errors */
-/*       checksA[i]=(double)cblas_snrm2(dim,X,incx); */
-
+      checksA[i]=(double)cblas_snrm2(dim,X,incx);
+      
       cblas_sswap(dim,X,incx,Y,incx);
       
 #endif
Index: BLAS/xTRSV/Makefile
===================================================================
--- BLAS/xTRSV/Makefile	(revision 179)
+++ BLAS/xTRSV/Makefile	(revision 180)
@@ -1,21 +1,20 @@
 SOURCE=xTRSV.c
 
-CC=gcc-4.6
-FC=gfortran-4.6
+CC=gcc
+FC=gfortran
 CFLAGS=-Wall -O3
 LDFLAGS=-lm
-CUDADIR=/opt/cuda
-CUDASRC=$(CUDADIR)/src
+CUDASRC=/usr/share/doc/nvidia-cuda-doc/examples/
 THUNKING=fortran_thunking.c
 CUDASRCINC=fortran_common.h
-CUDAINC=$(CUDADIR)/include
-CUDALIB=$(CUDADIR)/lib64
+CUDAINC=/usr/include
+CUDALIB=/usr/lib/x86_64-linux-gnu/
 
 GSLINC=/usr/include/gsl
 
 GOTO2=/opt/GotoBLAS2
 
-OPENBLAS=/usr/lib/openblas-base
+OPENBLAS=/usr/lib
 
 ATLAS=/usr/lib/atlas-base
 
@@ -31,7 +30,8 @@
 
 #DIRECTIVES=-D$(FORMAT) -DPRINT -DUNIT
 #DIRECTIVES=-D$(FORMAT) -DUNIT -DRESULTS -DQUIET
-DIRECTIVES=-DQUIET -DUNIT
+#DIRECTIVES=-DQUIET -DUNIT
+DIRECTIVES=-DRESULTS -DQUIET
 
 all: $(EXECUTABLE)
 
@@ -43,14 +43,6 @@
 	$(CC) $(CFLAGS) $(DIRECTIVES) -DDOUBLE -DCBLAS $(LDFLAGS) \
 		$(SOURCE) $(ATLAS)/libcblas.a $(ATLAS)/libatlas.a -o $(SOURCE:.c=)_DP_$@
 
-gotoblas: $(SOURCE)
-
-	$(CC) $(CFLAGS) $(DIRECTIVES) -DFLOAT -DCBLAS $(LDFLAGS) \
-		$(SOURCE) $(GOTO2)/libgoto2.a -lpthread -o $(SOURCE:.c=)_SP_$@
-
-	$(CC) $(CFLAGS) $(DIRECTIVES) -DDOUBLE -DCBLAS $(LDFLAGS) \
-		$(SOURCE) $(GOTO2)/libgoto2.a -lpthread -o $(SOURCE:.c=)_DP_$@
-
 openblas: $(SOURCE)
 
 	$(CC) $(CFLAGS) $(DIRECTIVES) -DFLOAT -DCBLAS $(LDFLAGS) \
