]> https://gitweb.dealii.org/ - dealii.git/commitdiff
document lapack templates a bit better
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 28 Apr 2010 22:52:53 +0000 (22:52 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 28 Apr 2010 22:52:53 +0000 (22:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@21051 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/configure.in
deal.II/contrib/blastemplates/templates.pl
deal.II/lac/include/lac/lapack_templates.h

index 6b4b5b2623a28c69a952f071ef35b1c16cbaa30a..7a5f92335dae7f5c08b9c320c85f969aa654fbd7 100644 (file)
@@ -549,7 +549,9 @@ AC_SUBST(UMFPACK_LIB)
 AC_SUBST(UMFPACK_INCLUDE_DIR)
 AC_SUBST(USE_CONTRIB_UMFPACK)
 
-dnl Check for LAPACK
+dnl -------------------------------------------------------------
+dnl Check for LAPACK and the LAPACK functions being used
+dnl -------------------------------------------------------------
 AC_ARG_WITH(lapack,
   [  --with-lapack=lapacklib Use the lapack library lapacklib. Make sure the
                          path to the libary is searched by ld, since it is
@@ -565,6 +567,11 @@ if test "x$with_blas" != "x" -a "x$with_blas" != "xno" ; then
   AC_CHECK_FUNC(daxpy_,,[AC_MSG_ERROR([BLAS library not installed correctly($with_blas)])])
 fi
 
+dnl Since we might have an incomplete LAPACK installation, check all
+dnl the functions we may want to use. If any of them is missing,
+dnl deal.II will not attempt to call it and rather throw and
+dnl exception.
+
 AC_CHECK_FUNCS([daxpy_ saxpy_ dgemv_ sgemv_ dgeev_ sgeev_ dgeevx_ sgeevx_])
 AC_CHECK_FUNCS([dgesvd_ sgesvd_ dgemm_ sgemm_ dgetrf_ sgetrf_ dgetri_ sgetri_])
 AC_CHECK_FUNCS([dgeqrf_ sgeqrf_ dormqr_ sormqr_ dorgqr_ sorgqr_ dtrtrs_ strtrs_])
index e4d2c908f293d858c01210614eb6694c3be4c96c..2fd0419614f228f73d819fc172a156934c5c104e 100644 (file)
 #
 #---------------------------------------------------------------------------
 
+#---------------------------------------------------------------------------
+# This perl script translates lapack_templates.h.in to lapack_templates.h
+#
+# In the *.in file, every BLAS/LAPACK function which is defined for
+# double precision, i.e. having a name like 'dfoo_', is expanded to
+# itself plus the same function for single precision, namely
+# 'sfoo_'. Additionally, a C++ function 'foo' without the prefix
+# letter and the trailing underscore is generated, such that the
+# fortran functions can easily be called from templates. The
+# implementation of this function is modified due to the configure
+# variables 'HAVE_DFOO_' and 'HAVE_DFOO_': if these are set, then the
+# lapack functions 'dfoo_' and 'sfoo_' will be called, if not, an
+# exception will be thrown.
+#
+# Therefore, in order to be able to call a LAPACK function, the
+# functions have to be tested by configure. Search for the section
+# "Check for LAPACK..." in deal.II/configure.in and add the functions
+# 'dfoo_' and 'sfoo_' to the tests at the end of that section.
+#
+
+
 my $templates;
 my $double;
 
@@ -21,7 +42,7 @@ print << 'EOT'
 //    This file was automatically generated from lapack_templates.h.in
 //    See blastemplates in the deal.II contrib directory
 //
-//    Copyright (C) 2005, 2006, 2007, 2008, 2009 by the deal authors
+//    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 by the deal authors
 //
 //    This file is subject to QPL and may not be distributed
 //    without copyright and license information. Please refer
index 15ed5ecc6907d297f904f7216ff9cb739785d6a7..617e44f93ebd64394fd50ab4bf8c5b30768037ce 100644 (file)
@@ -1,6 +1,4 @@
 //---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
 //
 //    This file was automatically generated from lapack_templates.h.in
 //    See blastemplates in the deal.II contrib directory
@@ -142,7 +140,7 @@ void dsyev_ (const char *jobz, const char *uplo, const int *n,
 void ssyev_ (const char *jobz, const char *uplo, const int *n,
             float *A, const int *lda, float *w,
             float *work, const int *lwork, int *info);
-// General eigenvalues and eigenvectors of 
+// General eigenvalues and eigenvectors of
 // 1: A*x = lambda*B*x; 2: A*B*x = lambda*x; 3: B*A*x = lambda*x
 // A and B are symmetric and B is definite
 void dsygv_ (const int* itype, const char* jobz, const char* uplo,
@@ -180,9 +178,9 @@ void sstev_ (const char* jobz, const int* n,
 
 }
 
-
 DEAL_II_NAMESPACE_OPEN
 
+
 #ifdef HAVE_DAXPY_
 inline void
 axpy (const int* n, const double* alpha, const double* x, const int* incx, double* y, const int* incy)
@@ -577,7 +575,7 @@ syev (const char *, const char *, const int *, float *, const int *, float *, fl
 inline void
 sygv (const int* itype, const char* jobz, const char* uplo, const int* n, double* A, const int* lda, double* B, const int* ldb, double* w, double* work, const int* lwork, int* info)
 {
-  dsygv_(itype, jobz, uplo, n, A, lda, B, ldb, w, work, lwork, info);
+  dsygv_ (itype,jobz,uplo,n,A,lda,B,ldb,w,work,lwork,info);
 }
 #else
 inline void
@@ -592,7 +590,7 @@ sygv (const int*, const char*, const char*, const int*, double*, const int*, dou
 inline void
 sygv (const int* itype, const char* jobz, const char* uplo, const int* n, float* A, const int* lda, float* B, const int* ldb, float* w, float* work, const int* lwork, int* info)
 {
-  ssygv_(itype, jobz, uplo, n, A, lda, B, ldb, w, work, lwork, info);
+  ssygv_ (itype,jobz,uplo,n,A,lda,B,ldb,w,work,lwork,info);
 }
 #else
 inline void
@@ -662,6 +660,7 @@ stev (const char*, const int*, float*, float*, float*, const int*, float*, int*)
 }
 #endif
 
+
 DEAL_II_NAMESPACE_CLOSE
 
 #endif

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.