diff -uN lapack-3.5.0/make.inc.ORG lapack-3.5.0/make.inc
--- lapack-3.5.0/make.inc.ORG	2014-08-12 19:03:59.632515000 +0900
+++ lapack-3.5.0/make.inc	2014-08-18 19:32:39.850682000 +0900
@@ -13,11 +13,11 @@
 #  desired load options for your machine.
 #
 FORTRAN  = gfortran 
-OPTS     = -O2 -frecursive
+OPTS     = -g -O3 -fPIC
 DRVOPTS  = $(OPTS)
-NOOPT    = -O0 -frecursive
+NOOPT    = -g -O0 -fPIC
 LOADER   = gfortran
-LOADOPTS =
+LOADOPTS = -L/usr/local/lib -R/usr/local/lib -fPIC
 #
 # Timer for the SECOND and DSECND routines
 #
@@ -43,14 +43,14 @@
 # CC is the C compiler, normally invoked with options CFLAGS.
 #
 CC = gcc
-CFLAGS = -O3
+CFLAGS = -g -O3 -fPIC
 #
 #  The archiver and the flag(s) to use when building archive (library)
 #  If you system has no ranlib, set RANLIB = echo.
 #
-ARCH     = ar
-ARCHFLAGS= cr
-RANLIB   = ranlib
+ARCH     = gfortran
+ARCHFLAGS= -g -shared -fPIC -R/usr/local/lib -o
+RANLIB   = echo
 #
 #  Location of the extended-precision BLAS (XBLAS) Fortran library
 #  used for building and testing extended-precision routines.  The
@@ -65,7 +65,9 @@
 #  machine-specific, optimized BLAS library should be used whenever
 #  possible.)
 #
-BLASLIB      = ../../librefblas.a
-LAPACKLIB    = liblapack.a
-TMGLIB       = libtmglib.a
-LAPACKELIB   = liblapacke.a
+#BLASLIB      = ../../librefblas.so
+#BLASLIB      = /usr/local/libblas.so
+BLASLIB      = -L/usr/local/lib -R/usr/local/lib -lblas
+LAPACKLIB    = liblapack.so
+TMGLIB       = libtmglib.so
+LAPACKELIB   = liblapacke.so
diff -uN lapack-3.5.0/lapacke/example/Makefile.ORG lapack-3.5.0/lapacke/example/Makefile
--- lapack-3.5.0/lapacke/example/Makefile.ORG	2013-11-17 09:25:52.000000000 +0900
+++ lapack-3.5.0/lapacke/example/Makefile	2014-08-19 21:31:05.162538000 +0900
@@ -5,27 +5,27 @@
      xexample_DGELS_rowmajor \
      xexample_DGELS_colmajor 
 
-LIBRAIRIES= ../../$(LAPACKELIB) ../../$(LAPACKLIB) $(BLASLIB) 
+LIBRAIRIES= ../../$(LAPACKELIB) ../../$(LAPACKLIB) ../../$(TMGLIB)
 
 # Double Precision Examples
 xexample_DGESV_rowmajor: example_DGESV_rowmajor.o lapacke_example_aux.o $(LIBRAIRIES)
-	$(LOADER) $(LOADOPTS)  example_DGESV_rowmajor.o lapacke_example_aux.o \
-	$(LIBRAIRIES) -o $@
+	$(CC) $(LOADOPTS)  example_DGESV_rowmajor.o lapacke_example_aux.o \
+	$(LIBRAIRIES) $(BLASLIB) -o $@
 	./$@
 
 xexample_DGESV_colmajor: example_DGESV_colmajor.o lapacke_example_aux.o $(LIBRAIRIES)
-	$(LOADER) $(LOADOPTS)  example_DGESV_colmajor.o lapacke_example_aux.o \
-	$(LIBRAIRIES) -o $@
+	$(CC) $(LOADOPTS)  example_DGESV_colmajor.o lapacke_example_aux.o \
+	$(LIBRAIRIES) $(BLASLIB) -o $@
 	./$@
 
 xexample_DGELS_rowmajor: example_DGELS_rowmajor.o lapacke_example_aux.o $(LIBRAIRIES)
-	$(LOADER) $(LOADOPTS)  example_DGELS_rowmajor.o lapacke_example_aux.o \
-	$(LIBRAIRIES) -o $@
+	$(CC) $(LOADOPTS)  example_DGELS_rowmajor.o lapacke_example_aux.o \
+	$(LIBRAIRIES) $(BLASLIB) -o $@
 	./$@
 
 xexample_DGELS_colmajor: example_DGELS_colmajor.o lapacke_example_aux.o $(LIBRAIRIES)
-	$(LOADER) $(LOADOPTS)  example_DGELS_colmajor.o lapacke_example_aux.o \
-	$(LIBRAIRIES) -o $@
+	$(CC) $(LOADOPTS)  example_DGELS_colmajor.o lapacke_example_aux.o \
+	$(LIBRAIRIES) $(BLASLIB) -o $@
 	./$@
 
 .c.o:
diff -uN lapack-3.5.0/lapacke/src/Makefile.ORG lapack-3.5.0/lapacke/src/Makefile
--- lapack-3.5.0/lapacke/src/Makefile.ORG	2013-01-10 13:26:11.000000000 +0900
+++ lapack-3.5.0/lapacke/src/Makefile	2014-08-19 19:08:34.317401000 +0900
@@ -2061,7 +2061,157 @@
 lapacke_zlagsy.o \
 lapacke_zlagsy_work.o
 
-ALLOBJ = $(SRC_OBJ) $(MATGEN_OBJ) 
+UTILSOBJ = \
+      ../utils/lapacke_cgb_nancheck.o \
+      ../utils/lapacke_cgb_trans.o \
+      ../utils/lapacke_cge_nancheck.o \
+      ../utils/lapacke_cge_trans.o \
+      ../utils/lapacke_cgg_nancheck.o \
+      ../utils/lapacke_cgg_trans.o \
+      ../utils/lapacke_cgt_nancheck.o \
+      ../utils/lapacke_chb_nancheck.o \
+      ../utils/lapacke_chb_trans.o \
+      ../utils/lapacke_che_nancheck.o \
+      ../utils/lapacke_che_trans.o \
+      ../utils/lapacke_chp_nancheck.o \
+      ../utils/lapacke_chp_trans.o \
+      ../utils/lapacke_chs_nancheck.o \
+      ../utils/lapacke_chs_trans.o \
+      ../utils/lapacke_c_nancheck.o \
+      ../utils/lapacke_cpb_nancheck.o \
+      ../utils/lapacke_cpb_trans.o \
+      ../utils/lapacke_cpf_nancheck.o \
+      ../utils/lapacke_cpf_trans.o \
+      ../utils/lapacke_cpo_nancheck.o \
+      ../utils/lapacke_cpo_trans.o \
+      ../utils/lapacke_cpp_nancheck.o \
+      ../utils/lapacke_cpp_trans.o \
+      ../utils/lapacke_cpt_nancheck.o \
+      ../utils/lapacke_csp_nancheck.o \
+      ../utils/lapacke_csp_trans.o \
+      ../utils/lapacke_cst_nancheck.o \
+      ../utils/lapacke_csy_nancheck.o \
+      ../utils/lapacke_csy_trans.o \
+      ../utils/lapacke_ctb_nancheck.o \
+      ../utils/lapacke_ctb_trans.o \
+      ../utils/lapacke_ctf_nancheck.o \
+      ../utils/lapacke_ctf_trans.o \
+      ../utils/lapacke_ctp_nancheck.o \
+      ../utils/lapacke_ctp_trans.o \
+      ../utils/lapacke_ctr_nancheck.o \
+      ../utils/lapacke_ctr_trans.o \
+      ../utils/lapacke_dgb_nancheck.o \
+      ../utils/lapacke_dgb_trans.o \
+      ../utils/lapacke_dge_nancheck.o \
+      ../utils/lapacke_dge_trans.o \
+      ../utils/lapacke_dgg_nancheck.o \
+      ../utils/lapacke_dgg_trans.o \
+      ../utils/lapacke_dgt_nancheck.o \
+      ../utils/lapacke_dhs_nancheck.o \
+      ../utils/lapacke_dhs_trans.o \
+      ../utils/lapacke_d_nancheck.o \
+      ../utils/lapacke_dpb_nancheck.o \
+      ../utils/lapacke_dpb_trans.o \
+      ../utils/lapacke_dpf_nancheck.o \
+      ../utils/lapacke_dpf_trans.o \
+      ../utils/lapacke_dpo_nancheck.o \
+      ../utils/lapacke_dpo_trans.o \
+      ../utils/lapacke_dpp_nancheck.o \
+      ../utils/lapacke_dpp_trans.o \
+      ../utils/lapacke_dpt_nancheck.o \
+      ../utils/lapacke_dsb_nancheck.o \
+      ../utils/lapacke_dsb_trans.o \
+      ../utils/lapacke_dsp_nancheck.o \
+      ../utils/lapacke_dsp_trans.o \
+      ../utils/lapacke_dst_nancheck.o \
+      ../utils/lapacke_dsy_nancheck.o \
+      ../utils/lapacke_dsy_trans.o \
+      ../utils/lapacke_dtb_nancheck.o \
+      ../utils/lapacke_dtb_trans.o \
+      ../utils/lapacke_dtf_nancheck.o \
+      ../utils/lapacke_dtf_trans.o \
+      ../utils/lapacke_dtp_nancheck.o \
+      ../utils/lapacke_dtp_trans.o \
+      ../utils/lapacke_dtr_nancheck.o \
+      ../utils/lapacke_dtr_trans.o \
+      ../utils/lapacke_lsame.o \
+      ../utils/lapacke_sgb_nancheck.o \
+      ../utils/lapacke_sgb_trans.o \
+      ../utils/lapacke_sge_nancheck.o \
+      ../utils/lapacke_sge_trans.o \
+      ../utils/lapacke_sgg_nancheck.o \
+      ../utils/lapacke_sgg_trans.o \
+      ../utils/lapacke_sgt_nancheck.o \
+      ../utils/lapacke_shs_nancheck.o \
+      ../utils/lapacke_shs_trans.o \
+      ../utils/lapacke_s_nancheck.o \
+      ../utils/lapacke_spb_nancheck.o \
+      ../utils/lapacke_spb_trans.o \
+      ../utils/lapacke_spf_nancheck.o \
+      ../utils/lapacke_spf_trans.o \
+      ../utils/lapacke_spo_nancheck.o \
+      ../utils/lapacke_spo_trans.o \
+      ../utils/lapacke_spp_nancheck.o \
+      ../utils/lapacke_spp_trans.o \
+      ../utils/lapacke_spt_nancheck.o \
+      ../utils/lapacke_ssb_nancheck.o \
+      ../utils/lapacke_ssb_trans.o \
+      ../utils/lapacke_ssp_nancheck.o \
+      ../utils/lapacke_ssp_trans.o \
+      ../utils/lapacke_sst_nancheck.o \
+      ../utils/lapacke_ssy_nancheck.o \
+      ../utils/lapacke_ssy_trans.o \
+      ../utils/lapacke_stb_nancheck.o \
+      ../utils/lapacke_stb_trans.o \
+      ../utils/lapacke_stf_nancheck.o \
+      ../utils/lapacke_stf_trans.o \
+      ../utils/lapacke_stp_nancheck.o \
+      ../utils/lapacke_stp_trans.o \
+      ../utils/lapacke_str_nancheck.o \
+      ../utils/lapacke_str_trans.o \
+      ../utils/lapacke_xerbla.o \
+      ../utils/lapacke_zgb_nancheck.o \
+      ../utils/lapacke_zgb_trans.o \
+      ../utils/lapacke_zge_nancheck.o \
+      ../utils/lapacke_zge_trans.o \
+      ../utils/lapacke_zgg_nancheck.o \
+      ../utils/lapacke_zgg_trans.o \
+      ../utils/lapacke_zgt_nancheck.o \
+      ../utils/lapacke_zhb_nancheck.o \
+      ../utils/lapacke_zhb_trans.o \
+      ../utils/lapacke_zhe_nancheck.o \
+      ../utils/lapacke_zhe_trans.o \
+      ../utils/lapacke_zhp_nancheck.o \
+      ../utils/lapacke_zhp_trans.o \
+      ../utils/lapacke_zhs_nancheck.o \
+      ../utils/lapacke_zhs_trans.o \
+      ../utils/lapacke_z_nancheck.o \
+      ../utils/lapacke_zpb_nancheck.o \
+      ../utils/lapacke_zpb_trans.o \
+      ../utils/lapacke_zpf_nancheck.o \
+      ../utils/lapacke_zpf_trans.o \
+      ../utils/lapacke_zpo_nancheck.o \
+      ../utils/lapacke_zpo_trans.o \
+      ../utils/lapacke_zpp_nancheck.o \
+      ../utils/lapacke_zpp_trans.o \
+      ../utils/lapacke_zpt_nancheck.o \
+      ../utils/lapacke_zsp_nancheck.o \
+      ../utils/lapacke_zsp_trans.o \
+      ../utils/lapacke_zst_nancheck.o \
+      ../utils/lapacke_zsy_nancheck.o \
+      ../utils/lapacke_zsy_trans.o \
+      ../utils/lapacke_ztb_nancheck.o \
+      ../utils/lapacke_ztb_trans.o \
+      ../utils/lapacke_ztf_nancheck.o \
+      ../utils/lapacke_ztf_trans.o \
+      ../utils/lapacke_ztp_nancheck.o \
+      ../utils/lapacke_ztp_trans.o \
+      ../utils/lapacke_ztr_nancheck.o \
+      ../utils/lapacke_ztr_trans.o \
+      ../utils/lapacke_make_complex_float.o \
+      ../utils/lapacke_make_complex_double.o
+
+ALLOBJ = $(SRC_OBJ) $(MATGEN_OBJ) $(UTILSOBJ)
 
 ifdef USEXBLAS
 ALLXOBJ = $(SXLASRC) $(DXLASRC) $(CXLASRC) $(ZXLASRC)
@@ -2073,7 +2223,7 @@
 all: ../../$(LAPACKELIB)
 
 ../../$(LAPACKELIB): $(ALLOBJ) $(ALLXOBJ)
-	$(ARCH) $(ARCHFLAGS) ../../$(LAPACKELIB) $(ALLOBJ) $(ALLXOBJ)
+	$(CC) $(ARCHFLAGS) ../../$(LAPACKELIB) $(ALLOBJ) $(ALLXOBJ)
 	$(RANLIB) ../../$(LAPACKELIB)
 
 .c.o:
diff -uN lapack-3.5.0/lapacke/utils/Makefile.ORG lapack-3.5.0/lapacke/utils/Makefile
--- lapack-3.5.0/lapacke/utils/Makefile.ORG	2011-12-03 14:37:44.000000000 +0900
+++ lapack-3.5.0/lapacke/utils/Makefile	2014-08-19 19:10:42.998270000 +0900
@@ -186,7 +186,6 @@
 all: lib
 
 lib: $(OBJ)
-	$(ARCH) $(ARCHFLAGS) ../../$(LAPACKELIB) $(OBJ)
 	$(RANLIB) ../../$(LAPACKELIB)
 
 .c.o:
