From: Raymond T. <rt...@us...> - 2012-03-11 17:49:28
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "matlisp". The branch, master has been updated via 14707c10ced9ee08431313323cc1905ac77e2a21 (commit) via 7f45afca17c2501c0b2a777809e1998683e5a17f (commit) via 8708b5e4f149f2ba16b879bfa87aa3085097cb34 (commit) from 4d23b62fbced07e732614e290a08e90a731942ab (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 14707c10ced9ee08431313323cc1905ac77e2a21 Author: Raymond Toy <toy...@gm...> Date: Sun Mar 11 10:49:04 2012 -0700 Just rearranging the code to group related things together. diff --git a/configure.ac b/configure.ac index 41a9f22..fad1307 100644 --- a/configure.ac +++ b/configure.ac @@ -59,7 +59,10 @@ AC_F77_LIBRARY_LDFLAGS # This is only for autoconf 2.49d or later! AC_F77_FUNC(f77_name) -# Setup our environment variables based on the value of f77_name +# Setup our environment variables based on the value of f77_name. For +# the record, F77_EXTRA_UNDERSCORE means that any embedded underscores +# in the Fortran name are converted to two underscores for the C +# equivalent name. F77_LOWER_CASE=t F77_UNDERSCORE=t F77_EXTRA_UNDERSCORE=nil @@ -208,7 +211,8 @@ FLIBS_OPTS=`echo $FLIBS | tr -s ' ' '\n' | $GREP -v gfortranbegin | $GREP -v x86 GIT_VERSION=`git describe --dirty` -# Check that quicklisp exists. We need that currently to get cffi. +# Check that quicklisp exists. We need that currently to get cffi if +# it's not already available. AC_CHECK_FILE($HOME/quicklisp/setup.lisp, HAVE_QL="(and)", HAVE_QL="(or)") # Are we using a 32-bit lisp? If so, define LIB32 so that we compile @@ -291,49 +295,6 @@ EOF AC_MSG_RESULT([$NEED_FF2C]) fi -dnl The following variables will be substituted into the .in files -AC_SUBST(LISPEXEC) -AC_SUBST(BLAS_OBJS) -AC_SUBST(NO_ATLAS_LAPACK_OBJS) -AC_SUBST(ATLAS_DIR) -AC_SUBST(ATLAS_LIBS) -AC_SUBST(ATLAS_P) -AC_SUBST(F77_LOWER_CASE) -AC_SUBST(F77_UNDERSCORE) -AC_SUBST(F77_EXTRA_UNDERSCORE) -AC_SUBST(LISPEXEC) -AC_SUBST(LISPEVAL) -AC_SUBST(srcdir) -AC_SUBST(libdir) -AC_SUBST(FLIBS_LIBS) -AC_SUBST(FLIBS_OPTS) -AC_SUBST(share_ext) -AC_SUBST(GIT_VERSION) -AC_SUBST(HAVE_QL) -AC_SUBST(F2C) - -echo host = $host - -# Set the extension for shared libraries. This is not very robust. -case $host in - *darwin*) share_ext=dylib ;; - *) share_ext=so ;; -esac - -AC_CONFIG_FILES([ - matlisp.mk - Makefile - start.lisp - config.lisp - lib/lazy-loader.lisp - LAPACK/SRC/Makefile - LAPACK/BLAS/SRC/Makefile - dfftpack/Makefile - lib-src/toms715/Makefile - lib-src/odepack/Makefile - src/f77-mangling.lisp -]) - # Allow user to use ATLAS if available. # We assume the standard names for the ATLAS libraries. AC_ARG_WITH([atlas], @@ -355,7 +316,10 @@ AM_CONDITIONAL([ATLAS], [test x$atlas = xtrue]) # Check to see if the ATLAS libraries are compatible with matlisp's # ffi. Basically the same test as above that checks to see if -ff2c -# is needed. +# is needed. We call zdotu which is a Fortran function returning a +# complex number. Matlisp assumes such functions return the result by +# storing the answer at address given by a hidden first parameter to +# the function. if test x"$atlas" = xtrue; then AC_MSG_CHECKING([if ATLAS is compatible with matlisp's FFI]) @@ -421,6 +385,49 @@ EOF fi fi +dnl The following variables will be substituted into the .in files +AC_SUBST(LISPEXEC) +AC_SUBST(BLAS_OBJS) +AC_SUBST(NO_ATLAS_LAPACK_OBJS) +AC_SUBST(ATLAS_DIR) +AC_SUBST(ATLAS_LIBS) +AC_SUBST(ATLAS_P) +AC_SUBST(F77_LOWER_CASE) +AC_SUBST(F77_UNDERSCORE) +AC_SUBST(F77_EXTRA_UNDERSCORE) +AC_SUBST(LISPEXEC) +AC_SUBST(LISPEVAL) +AC_SUBST(srcdir) +AC_SUBST(libdir) +AC_SUBST(FLIBS_LIBS) +AC_SUBST(FLIBS_OPTS) +AC_SUBST(share_ext) +AC_SUBST(GIT_VERSION) +AC_SUBST(HAVE_QL) +AC_SUBST(F2C) + +echo host = $host + +# Set the extension for shared libraries. This is not very robust. +case $host in + *darwin*) share_ext=dylib ;; + *) share_ext=so ;; +esac + +AC_CONFIG_FILES([ + matlisp.mk + Makefile + start.lisp + config.lisp + lib/lazy-loader.lisp + LAPACK/SRC/Makefile + LAPACK/BLAS/SRC/Makefile + dfftpack/Makefile + lib-src/toms715/Makefile + lib-src/odepack/Makefile + src/f77-mangling.lisp +]) + echo FLIBS = $FLIBS echo HAVE_QL = $HAVE_QL AC_OUTPUT commit 7f45afca17c2501c0b2a777809e1998683e5a17f Author: Raymond Toy <toy...@gm...> Date: Sun Mar 11 10:48:29 2012 -0700 Don't use full paths for the library on Darwin (OSX). diff --git a/lib/lazy-loader.lisp.in b/lib/lazy-loader.lisp.in index d160594..7df2449 100644 --- a/lib/lazy-loader.lisp.in +++ b/lib/lazy-loader.lisp.in @@ -115,14 +115,26 @@ ;; Tell cffi where our libraries are. (push "@libdir@/" cffi:*foreign-library-directories*) -;; Define our libraries +;; Define our libraries. + +;; For some reason, on Darwin (OSX), we can't load the libraries if we +;; specify the full path. Loading the library fails because there are +;; undefined symbols (__gfortran_stop_numeric) referenced from the +;; library. However, everything works if the full path is not given. +;; This could be a bug in how automake generates libraries on Darwin. +;; Not really sure. +;; +;; This isn't a problem on linux or sparc. (cffi:define-foreign-library dfftpack + (:darwin "libdfftpack.dylib") (t (:default "@libdir@/libdfftpack"))) (cffi:define-foreign-library toms715 + (:darwin "libtoms715.dylib") (t (:default "@libdir@/libtoms715"))) (cffi:define-foreign-library odepack + (:darwin "libodepack.dylib") (t (:default "@libdir@/libodepack"))) (if @ATLAS_P@ @@ -143,8 +155,10 @@ (progn ;; Use our blas and lapack libraries (cffi:define-foreign-library blas + (:darwin "libblas.dylib") (t (:default "@libdir@/libblas"))) (cffi:define-foreign-library lapack + (:darwin "liblapack.dylib") (t (:default "@libdir@/liblapack"))))) commit 8708b5e4f149f2ba16b879bfa87aa3085097cb34 Author: Raymond Toy <toy...@gm...> Date: Sun Mar 11 10:42:33 2012 -0700 Can't pass arrays of complex doubles to blas routines in general. Use the equivalent arrays of doubles. diff --git a/tests/blas.lisp b/tests/blas.lisp index 5995f24..b584f72 100644 --- a/tests/blas.lisp +++ b/tests/blas.lisp @@ -14,22 +14,22 @@ (list max-error actual expected)))) (rt:deftest blas.zdotu.1.1 - (let ((x (make-array 3 :element-type '(complex double-float) :initial-contents '(#c(1d0 0) #c(2d0 0) #c(3d0 0))))) + (let ((x (matlisp::store [#c(1d0 0) #c(2d0 0) #c(3d0 0)]))) (blas:zdotu 2 x 1 x 1)) #c(5d0 0d0)) (rt:deftest blas.zdotu.1.2 - (let ((x (make-array 3 :element-type '(complex double-float) :initial-contents '(#c(1d0 1d0) #c(2d0 2d0) #c(3d0 3d0))))) + (let ((x (matlisp::store [#c(1d0 1d0) #c(2d0 2d0) #c(3d0 3d0)]))) (blas:zdotu 2 x 1 x 1)) #c(0d0 10d0)) (rt:deftest blas.zdotc.1.1 - (let ((x (make-array 3 :element-type '(complex double-float) :initial-contents '(#c(1d0 0) #c(2d0 0) #c(3d0 0))))) + (let ((x (matlisp::store [#c(1d0 0) #c(2d0 0) #c(3d0 0)]))) (blas:zdotc 2 x 1 x 1)) #c(5d0 0d0)) (rt:deftest blas.zdotc.1.2 - (let ((x (make-array 3 :element-type '(complex double-float) :initial-contents '(#c(1d0 1d0) #c(2d0 2d0) #c(3d0 3d0))))) + (let ((x (matlisp::store [#c(1d0 1d0) #c(2d0 2d0) #c(3d0 3d0)]))) (blas:zdotc 2 x 1 x 1)) #c(10d0 0d0)) ----------------------------------------------------------------------- Summary of changes: configure.ac | 99 +++++++++++++++++++++++++---------------------- lib/lazy-loader.lisp.in | 16 +++++++- tests/blas.lisp | 8 ++-- 3 files changed, 72 insertions(+), 51 deletions(-) hooks/post-receive -- matlisp |