From: Akshay S. <ak...@us...> - 2012-08-04 10:12:23
|
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, tensor has been updated via 7424dca3c956b58d494e938ed7acf90abc79d086 (commit) via ccfaa98ec85543e56211e9781267becf93ac4b9e (commit) via 8740b36ec8cfd52498f7a47d96eb0d65277e5b7a (commit) via 8bd622f7d1ff8f64cc977e17a35e8e6bc29183a8 (commit) via 3fbeec55d702bde591b5d06abe6dbe2334d4735d (commit) from f27e7165a4d1127a21c7cdb9148b986d92b401d7 (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 7424dca3c956b58d494e938ed7acf90abc79d086 Author: Akshay Srinivasan <aks...@gm...> Date: Sat Aug 4 15:34:55 2012 +0530 o Removed "commented" code, CCL checks for lisp-syntax within code starting with #+nil reader-conditional. diff --git a/src/ffi/f77-ffi.lisp b/src/ffi/f77-ffi.lisp index 602eba0..177f431 100644 --- a/src/ffi/f77-ffi.lisp +++ b/src/ffi/f77-ffi.lisp @@ -449,131 +449,6 @@ `(,retvar)) ,@(mapcar #'second return-vars))))))))) -#+nil -(defun def-fortran-interface-func (name return-type body hidden-var-name) - (multiple-value-bind (doc pars) - (parse-doc-&-parameters body) - (let ((ffi-fn (make-fortran-ffi-name name)) - (return-vars nil) - (array-vars nil) - (ref-vars nil) - (callback-code nil) - ;; - (defun-args nil) - (defun-keyword-args nil) - ;; - (aux-args nil) - ;; - (ffi-args nil) - (aux-ffi-args nil)) - (dolist (decl pars) - (destructuring-bind (var type &optional style) decl - (let ((ffi-var nil) - (aux-var nil)) - (cond - ;; Callbacks are tricky. - ((%f77.callback-type-p type) - (let* ((callback-name (gensym (symbol-name var))) - (c-callback-code (def-fortran-callback var callback-name (second type) (cddr type)))) - (nconsc callback-code c-callback-code) - (setq ffi-var `(cffi:callback ,callback-name)))) - ;; Can't really enforce "style" when given an array. - ;; Complex numbers do not latch onto this case, they - ;; are passed by value. - ((%f77.array-p type) - (setq ffi-var (scat "ADDR-" var)) - (nconsc array-vars `((,ffi-var ,var))) - ;; - (when-let (arg (getf type :inc)) - (nconsc defun-keyword-args - `((,arg 0))) - (nconc (car (last array-vars)) `(:inc-type ,(cadr type) :inc ,arg)))) - ;; Strings - ((%f77.string-p type) - (setq ffi-var var) - (setq aux-var (scat "LEN-" var)) - (nconsc aux-args `((,aux-var (length (the string ,var)))))) - ;; Pass-by-value variables - ((eq style :input-value) - (setq ffi-var var)) - ;; Pass-by-reference variables - (t - (cond - ;; Makes more sense to copy complex numbers into - ;; arrays, rather than twiddling around with lisp - ;; memory internals. - ((member type '(:complex-single-float :complex-double-float)) - (setq ffi-var (scat "ADDR-REAL-CAST-" var)) - (nconsc ref-vars - `((,ffi-var ,(second (%f77.cffi-type type)) :count 2 :initial-contents (list (realpart ,var) (imagpart ,var)))))) - (t - (setq ffi-var (scat "REF-" var)) - (nconsc ref-vars - `((,ffi-var ,@(%f77.cffi-type type) :initial-element ,var))))))) - ;; Output variables - (when (and (output-p style) (not (eq type :string))) - (nconsc return-vars - `((,ffi-var ,var ,type)))) - ;; Arguments for the lisp wrapper - (unless (eq var hidden-var-name) - (nconsc defun-args - `(,var))) - ;; Arguments for the FFI function - (nconsc ffi-args - `(,ffi-var)) - ;; Auxillary arguments for FFI - (unless (null aux-var) - (nconsc aux-ffi-args - `(,aux-var)))))) - ;;Complex returns through hidden variable. - (unless (null hidden-var-name) - (nconsc aux-args `((,hidden-var-name ,(ecase (second (first pars)) - (:complex-single-float #c(0e0 0e0)) - (:complex-double-float #c(0d0 0d0))))))) - ;;Keyword argument list - (unless (null defun-keyword-args) - (setq defun-keyword-args (cons '&optional defun-keyword-args))) - ;;Return the function definition - (let ((retvar (gensym))) - `( - ,(recursive-append - `(defun ,name ,(append defun-args (mapcar #'(lambda (decl) - ()) - defun-keyword-args) - ,@doc) - ;; - (unless (null aux-args) - `(let (,@aux-args))) - ;;Don't use with-foreign.. if ref-vars is nil - (unless (null ref-vars) - `(with-foreign-objects-stacked (,@ref-vars))) - ;;Don't use with-vector-dat.. if array-vars is nil - (unless (null array-vars) - `(with-vector-data-addresses (,@array-vars))) - ;;Declare callbacks - callback-code - ;;Call the foreign-function - `(let ((,retvar (,ffi-fn ,@ffi-args ,@aux-ffi-args))) - ;;Ignore return if type is :void - ,@(when (eq return-type :void) - `((declare (ignore ,retvar)))) - ;; Copy values in reference pointers back to local - ;; variables. Lisp has local scope; its safe to - ;; modify variables in parameter lists. - ,@(mapcar #'(lambda (decl) - (destructuring-bind (ffi-var var type) decl - (if (member type '(:complex-single-float :complex-double-float)) - `(setq ,var (complex (cffi:mem-aref ,ffi-var ,(second (%f77.cffi-type type)) 0) - (cffi:mem-aref ,ffi-var ,(second (%f77.cffi-type type)) 1))) - `(setq ,var (cffi:mem-aref ,ffi-var ,@(%f77.cffi-type type)))))) - (remove-if-not #'(lambda (x) - (member (first x) ref-vars :key #'car)) - return-vars)) - (values - ,@(unless (eq return-type :void) - `(,retvar)) - ,@(mapcar #'second return-vars)))))))))) - ;;TODO: Outputs are messed up inside the callback (defun %f77.def-fortran-callback (func callback-name return-type parm) (let* ((hack-return-type `,return-type) commit ccfaa98ec85543e56211e9781267becf93ac4b9e Author: Akshay Srinivasan <aks...@gm...> Date: Sat Aug 4 15:23:47 2012 +0530 o Removed -I m4 from AC_LOCAL_AMFLAGS, build complains about missing folder. diff --git a/Makefile.am b/Makefile.am index 92a7a18..bc5d88f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ if !EXT_BLAPACK SUBDIRS += lib/blas lib/lapack endif -ACLOCAL_AMFLAGS = -I m4 +#ACLOCAL_AMFLAGS = -I m4 #AM_FFLAGS= commit 8740b36ec8cfd52498f7a47d96eb0d65277e5b7a Author: Akshay Srinivasan <aks...@gm...> Date: Sat Aug 4 15:18:36 2012 +0530 o Changed order, compile BLAS before LAPACK diff --git a/Makefile.am b/Makefile.am index 2302f7e..92a7a18 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = lib/matlisp lib/dfftpack lib/toms715 lib/odepack lib/colnew if !EXT_BLAPACK -SUBDIRS += lib/lapack lib/blas +SUBDIRS += lib/blas lib/lapack endif ACLOCAL_AMFLAGS = -I m4 commit 8bd622f7d1ff8f64cc977e17a35e8e6bc29183a8 Author: Akshay Srinivasan <aks...@gm...> Date: Sat Aug 4 15:06:44 2012 +0530 o Moved all the fortran files(including BLAS LAPACK) into lib/ Changed the --with-atlas switch into the more general --with-blas-lapack diff --git a/Makefile.am b/Makefile.am index 7a58318..2302f7e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,9 +1,9 @@ -SUBDIRS = dfftpack lib-src/toms715 lib-src/odepack -if !ATLAS -SUBDIRS += LAPACK/BLAS/SRC LAPACK/SRC +SUBDIRS = lib/matlisp lib/dfftpack lib/toms715 lib/odepack lib/colnew +if !EXT_BLAPACK +SUBDIRS += lib/lapack lib/blas endif -#ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 #AM_FFLAGS= @@ -12,15 +12,14 @@ F2C = @F2C@ # This should build all the libraries we need. Then we need to # install them before we can build the lisp code. all : - (cd dfftpack; $(MAKE) install) - (cd lib-src/toms715; $(MAKE) install) - (cd lib-src/odepack; $(MAKE) install) - (cd lib-src/compat; $(MAKE) install) - (cd lib-src/colnew; $(MAKE) install) - (cd lib-src/scaldiv; $(MAKE) install) -if !ATLAS - (cd LAPACK/BLAS/SRC; $(MAKE) install) - (cd LAPACK/SRC; $(MAKE) install) + (cd lib/matlisp; $(MAKE) install) + (cd lib/dfftpack; $(MAKE) install) + (cd lib/toms715; $(MAKE) install) + (cd lib/odepack; $(MAKE) install) + (cd lib/colnew; $(MAKE) install) +if !EXT_BLAPACK + (cd lib/blas; $(MAKE) install) + (cd lib/lapack; $(MAKE) install) endif $(MAKE) lisp diff --git a/config.lisp b/config.lisp deleted file mode 100644 index fafbfec..0000000 --- a/config.lisp +++ /dev/null @@ -1,41 +0,0 @@ -;;; -*- Mode: lisp; Syntax: ansi-common-lisp; Package: cl-user; Base: 10 -*- -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; Copyright (c) 2000 The Regents of the University of California. -;;; All rights reserved. -;;; -;;; Permission is hereby granted, without written agreement and without -;;; license or royalty fees, to use, copy, modify, and distribute this -;;; software and its documentation for any purpose, provided that the -;;; above copyright notice and the following two paragraphs appear in all -;;; copies of this software. -;;; -;;; IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY -;;; FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -;;; ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF -;;; THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF -;;; SUCH DAMAGE. -;;; -;;; THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, -;;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE -;;; PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF -;;; CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, -;;; ENHANCEMENTS, OR MODIFICATIONS. -;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; This is the configuration file for the MATLISP workspace. -;;; -;;; Matlisp is a package and should really not set any environment -;;; configuration. Eventually, this file should disappear. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; $Id: config.lisp,v 1.4 2003/06/27 03:41:39 rtoy Exp $ -;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(in-package "COMMON-LISP-USER") - -#+:allegro (setq comp:*cltl1-compile-file-toplevel-compatibility-p* t) -#+:allegro (setq excl:*enable-package-locked-errors* nil) - diff --git a/configure b/configure index 61b86e8..42c2db1 100755 --- a/configure +++ b/configure @@ -646,14 +646,12 @@ LISPEVAL F77_EXTRA_UNDERSCORE F77_UNDERSCORE F77_LOWER_CASE -ATLAS_P -ATLAS_LIBS -ATLAS_DIR -NO_ATLAS_LAPACK_OBJS +BLAS_LAPACK_DIR +EXTERNAL_BLAS_LAPACK_P BLAS_OBJS LISPEXEC -ATLAS_FALSE -ATLAS_TRUE +EXT_BLAPACK_FALSE +EXT_BLAPACK_TRUE LIB32_FALSE LIB32_TRUE CPP @@ -791,7 +789,7 @@ enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock -with_atlas +with_blas_lapack ' ac_precious_vars='build_alias host_alias @@ -1446,7 +1444,8 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). - --with-atlas=libpath Location of the ATLAS libraries + --with-blas-lapack=libpath + Location of the BLAS/LAPACK libraries Some influential environment variables: CC C compiler command @@ -8908,6 +8907,10 @@ _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= @@ -15281,46 +15284,45 @@ $as_echo "no" >&6; } fi -# Allow user to use ATLAS if available. -# We assume the standard names for the ATLAS libraries. +# Allow user to use external BLAS/LAPACK library if available. +# We assume the standard names for the libraries: lib{blas, lapack} -# Check whether --with-atlas was given. -if test "${with_atlas+set}" = set; then : - withval=$with_atlas; - # Building with ATLAS - ATLAS_DIR="$withval/" - ATLAS_LIBS="libatlas libcblas libf77blas liblapack" - atlas=true - ATLAS_P=t +# Check whether --with-blas-lapack was given. +if test "${with_blas_lapack+set}" = set; then : + withval=$with_blas_lapack; + # Building with external BLAS + ext_blapack=true + BLAS_LAPACK_DIR="$withval/" + EXTERNAL_BLAS_LAPACK_P=t else - # Building without ATLAS. Need these objects from our own copy of + # Building without external BLAS. Need these objects from our own copy of # LAPACK. - atlas=false - ATLAS_P=nil + ext_blapack=false + EXTERNAL_BLAS_LAPACK_P=nil fi - if test x$atlas = xtrue; then - ATLAS_TRUE= - ATLAS_FALSE='#' + if test x$ext_blapack = xtrue; then + EXT_BLAPACK_TRUE= + EXT_BLAPACK_FALSE='#' else - ATLAS_TRUE='#' - ATLAS_FALSE= + EXT_BLAPACK_TRUE='#' + EXT_BLAPACK_FALSE= fi -# Check to see if the ATLAS libraries are compatible with matlisp's +# Check to see if the BLAS library is compatible with matlisp's # ffi. Basically the same test as above that checks to see if -ff2c # 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 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ATLAS is compatible with f2c calling conventions" >&5 -$as_echo_n "checking if ATLAS is compatible with f2c calling conventions... " >&6; } +if test x"$ext_blapack" = xtrue; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if BLAS is compatible with f2c calling conventions" >&5 +$as_echo_n "checking if BLAS is compatible with f2c calling conventions... " >&6; } # From the value of f77_name, figure out the actual name for # Fortran's zdotu. case $f77_name in @@ -15374,7 +15376,7 @@ int main() EOF $CC $CFLAGS -c conftest.c - $F77 $FFLAGS -o a.out conftest.o -L${ATLAS_DIR} -latlas -lcblas -lf77blas -llapack + $F77 $FFLAGS -o a.out conftest.o -L${BLAS_LAPACK_DIR} -lblas -llapack if a.out; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -15405,8 +15407,6 @@ fi - - echo host = $host # Set the extension for shared libraries. This is not very robust. @@ -15415,7 +15415,7 @@ case $host in *) share_ext=so ;; esac -ac_config_files="$ac_config_files matlisp.mk Makefile start.lisp config.lisp lib/lazy-loader.lisp src/ffi/f77-mangling.lisp LAPACK/SRC/Makefile LAPACK/BLAS/SRC/Makefile dfftpack/Makefile lib-src/toms715/Makefile lib-src/compat/Makefile lib-src/odepack/Makefile lib-src/colnew/Makefile lib-src/scaldiv/Makefile" +ac_config_files="$ac_config_files Makefile start.lisp config.lisp lib/lazy-loader.lisp src/ffi/f77-mangling.lisp lib/blas/Makefile lib/lapack/Makefile lib/dfftpack/Makefile lib/toms715/Makefile lib/matlisp/Makefile lib/odepack/Makefile lib/colnew/Makefile" echo FLIBS = $FLIBS @@ -15605,8 +15605,8 @@ if test -z "${LIB32_TRUE}" && test -z "${LIB32_FALSE}"; then as_fn_error $? "conditional \"LIB32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ATLAS_TRUE}" && test -z "${ATLAS_FALSE}"; then - as_fn_error $? "conditional \"ATLAS\" was never defined. +if test -z "${EXT_BLAPACK_TRUE}" && test -z "${EXT_BLAPACK_FALSE}"; then + as_fn_error $? "conditional \"EXT_BLAPACK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi @@ -16535,20 +16535,18 @@ do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "matlisp.mk") CONFIG_FILES="$CONFIG_FILES matlisp.mk" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "start.lisp") CONFIG_FILES="$CONFIG_FILES start.lisp" ;; "config.lisp") CONFIG_FILES="$CONFIG_FILES config.lisp" ;; "lib/lazy-loader.lisp") CONFIG_FILES="$CONFIG_FILES lib/lazy-loader.lisp" ;; "src/ffi/f77-mangling.lisp") CONFIG_FILES="$CONFIG_FILES src/ffi/f77-mangling.lisp" ;; - "LAPACK/SRC/Makefile") CONFIG_FILES="$CONFIG_FILES LAPACK/SRC/Makefile" ;; - "LAPACK/BLAS/SRC/Makefile") CONFIG_FILES="$CONFIG_FILES LAPACK/BLAS/SRC/Makefile" ;; - "dfftpack/Makefile") CONFIG_FILES="$CONFIG_FILES dfftpack/Makefile" ;; - "lib-src/toms715/Makefile") CONFIG_FILES="$CONFIG_FILES lib-src/toms715/Makefile" ;; - "lib-src/compat/Makefile") CONFIG_FILES="$CONFIG_FILES lib-src/compat/Makefile" ;; - "lib-src/odepack/Makefile") CONFIG_FILES="$CONFIG_FILES lib-src/odepack/Makefile" ;; - "lib-src/colnew/Makefile") CONFIG_FILES="$CONFIG_FILES lib-src/colnew/Makefile" ;; - "lib-src/scaldiv/Makefile") CONFIG_FILES="$CONFIG_FILES lib-src/scaldiv/Makefile" ;; + "lib/blas/Makefile") CONFIG_FILES="$CONFIG_FILES lib/blas/Makefile" ;; + "lib/lapack/Makefile") CONFIG_FILES="$CONFIG_FILES lib/lapack/Makefile" ;; + "lib/dfftpack/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dfftpack/Makefile" ;; + "lib/toms715/Makefile") CONFIG_FILES="$CONFIG_FILES lib/toms715/Makefile" ;; + "lib/matlisp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/matlisp/Makefile" ;; + "lib/odepack/Makefile") CONFIG_FILES="$CONFIG_FILES lib/odepack/Makefile" ;; + "lib/colnew/Makefile") CONFIG_FILES="$CONFIG_FILES lib/colnew/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/configure.ac b/configure.ac index a687e41..330e6ba 100644 --- a/configure.ac +++ b/configure.ac @@ -295,34 +295,33 @@ dnl rm -f ctest.c a.out dnl AC_MSG_RESULT([$NEED_FF2C]) dnl fi dnl -# Allow user to use ATLAS if available. -# We assume the standard names for the ATLAS libraries. -AC_ARG_WITH([atlas], -AC_HELP_STRING([--with-atlas=libpath], [Location of the ATLAS libraries]), +# Allow user to use external BLAS/LAPACK library if available. +# We assume the standard names for the libraries: lib{blas, lapack} +AC_ARG_WITH([blas-lapack], +AC_HELP_STRING([--with-blas-lapack=libpath], [Location of the BLAS/LAPACK libraries]), [ - # Building with ATLAS - ATLAS_DIR="$withval/" - ATLAS_LIBS="libatlas libcblas libf77blas liblapack" - atlas=true - ATLAS_P=t + # Building with external BLAS + ext_blapack=true + BLAS_LAPACK_DIR="$withval/" + EXTERNAL_BLAS_LAPACK_P=t ], [ - # Building without ATLAS. Need these objects from our own copy of + # Building without external BLAS. Need these objects from our own copy of # LAPACK. - atlas=false - ATLAS_P=nil + ext_blapack=false + EXTERNAL_BLAS_LAPACK_P=nil ]) -AM_CONDITIONAL([ATLAS], [test x$atlas = xtrue]) +AM_CONDITIONAL([EXT_BLAPACK], [test x$ext_blapack = xtrue]) -# Check to see if the ATLAS libraries are compatible with matlisp's +# Check to see if the BLAS library is compatible with matlisp's # ffi. Basi |