Commits

Barry Schwartz committed 464f17c

Initial commit.

Comments (0)

Files changed (5)

+# Copyright (c) 2011 Barry Schwartz
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+ACLOCAL_AMFLAGS = -I m4
+
+LAPACK_MINUSL = $(filter -l%, $(LAPACK_LIBS))
+LAPACKE_MINUSL = $(filter -l%, $(LAPACKE_LIBS))
+
+dist_pure_lib_DATA = lapacke.pure lapacke_utils.pure
+
+# FIXME: Support these functions if xblas support has been compiled
+# into LAPACKE.
+XBLASFUNCS = "(LAPACKE_sgeqrfp|LAPACKE_dgeqrfp|LAPACKE_cgeqrfp|LAPACKE_zgeqrfp|LAPACKE_sgeqrfp_work|LAPACKE_dgeqrfp_work|LAPACKE_cgeqrfp_work|LAPACKE_zgeqrfp_work|dgerfsx_|sgerfsx_|zgerfsx_|cgerfsx_|dgbrfsx_|sgbrfsx_|zgbrfsx_|cgbrfsx_|dporfsx_|sporfsx_|zporfsx_|cporfsx_|dsyrfsx_|ssyrfsx_|zsyrfsx_|csyrfsx_|zherfsx_|cherfsx_|dgesvxx_|sgesvxx_|zgesvxx_|cgesvxx_|dgbsvxx_|sgbsvxx_|zgbsvxx_|cgbsvxx_|dposvxx_|sposvxx_|zposvxx_|cposvxx_|dsysvxx_|ssysvxx_|zsysvxx_|csysvxx_|zhesvxx_|chesvxx_)"
+
+lapacke.pure: $(LAPACKE_INCLUDEDIR)/lapacke.h
+	$(PUREGEN) -s "$(LAPACKE_INCLUDEDIR)/lapacke.h::"				\
+		-x $(XBLASFUNCS)											\
+		$(filter -I% -D%, $(LAPACKE_CFLAGS) $(CPPFLAGS) $(CFLAGS))	\
+		-o lapacke.pure												\
+		"$(LAPACKE_INCLUDEDIR)/lapacke.h"							\
+		${LAPACK_MINUSL:-l%=-llib%}									\
+		${LAPACKE_MINUSL:-l%=-llib%}
+
+lapacke_utils.pure: $(LAPACKE_INCLUDEDIR)/lapacke_utils.h
+	$(PUREGEN) -s "$(LAPACKE_INCLUDEDIR)/lapacke_utils.h::"			\
+		$(filter -I% -D%, $(LAPACKE_CFLAGS) $(CPPFLAGS) $(CFLAGS))	\
+		-o lapacke_utils.pure										\
+		"$(LAPACKE_INCLUDEDIR)/lapacke_utils.h"						\
+		${LAPACKE_MINUSL:-l%=-llib%}
+
+MOSTLYCLEANFILES = lapacke.pure lapacke_utils.pure
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+dnl Copyright (c) 2011 Barry Schwartz
+dnl 
+dnl Permission is hereby granted, free of charge, to any person obtaining a copy
+dnl of this software and associated documentation files (the "Software"), to deal
+dnl in the Software without restriction, including without limitation the rights
+dnl to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+dnl copies of the Software, and to permit persons to whom the Software is
+dnl furnished to do so, subject to the following conditions:
+dnl 
+dnl The above copyright notice and this permission notice shall be included in
+dnl all copies or substantial portions of the Software.
+dnl 
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+dnl AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+dnl OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+dnl THE SOFTWARE.
+
+AC_PREREQ([2.68])
+AC_INIT([pure-lapacke],[0.1],[https://bitbucket.org/chemoelectric/pure-lapacke])
+AM_INIT_AUTOMAKE([foreign])
+AC_CONFIG_MACRO_DIR([m4])
+CRUDFACT_PUREINCLUDEDIR
+CRUDFACT_PURELIBDIR
+
+# Checks for programs.
+AC_PROG_CC
+CRUDFACT_REQUIRE_PUREGEN
+
+# Checks for libraries.
+PKG_CHECK_MODULES([LAPACK],[lapack])
+PKG_CHECK_MODULES([LAPACKE],[lapacke])
+AC_ARG_VAR([LAPACKE_INCLUDEDIR],[directory containing LAPACKE headers])
+AC_MSG_CHECKING([location of LAPACKE headers])
+if test x"${LAPACKE_INCLUDEDIR}" = x ; then
+   AC_SUBST([LAPACKE_INCLUDEDIR],
+            [`${PKG_CONFIG} --variable=includedir lapacke`])
+fi
+AC_MSG_RESULT([${LAPACKE_INCLUDEDIR}])
+
+# Checks for header files.
+
+# Checks for typedefs, structures, and compiler characteristics.
+
+# Checks for library functions.
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT

m4/crudfact_pure.m4

+# CRUDFACT_REQUIRE_PURE
+# ---------------------
+AC_DEFUN([CRUDFACT_REQUIRE_PURE],
+[
+AC_ARG_VAR([PURE],[Pure interpreter command])
+if test x"${PURE}" = x ; then
+   AC_PATH_PROG([PURE], [pure])
+   test x"${PURE}" = x && AC_MSG_ERROR([could not find pure])
+else
+   AC_MSG_CHECKING([for pure])
+   AC_MSG_RESULT([${PURE}])
+fi
+])

m4/crudfact_puredir.m4

+# CRUDFACT_PUREINCLUDE
+# --------------------
+AC_DEFUN([CRUDFACT_PUREINCLUDEDIR],
+[
+AC_SUBST([pure_includedir], ['${libdir}/pure'])
+AC_ARG_ENABLE([pure-includedir],
+        [AS_HELP_STRING([--enable-pure-includedir=DIR],
+                        [directory for Pure-language included source scripts [DIR=LIBDIR/pure]])],
+        [pure_includedir=${enableval}])
+])
+
+# CRUDFACT_PURELIBRARY
+# --------------------
+AC_DEFUN([CRUDFACT_PURELIBDIR],
+[
+AC_SUBST([pure_libdir], ['${libdir}/pure'])
+AC_ARG_ENABLE([pure-libdir],
+        [AS_HELP_STRING([--enable-pure-libdir=DIR],
+                        [directory for Pure-language dynamic libraries [DIR=LIBDIR/pure]])],
+        [pure_libdir=${enableval}])
+])

m4/crudfact_puregen.m4

+# CRUDFACT_REQUIRE_PUREGEN
+# ------------------------
+AC_DEFUN([CRUDFACT_REQUIRE_PUREGEN],
+[
+AC_ARG_VAR([PUREGEN],[pure-gen command (Pure interface generator)])
+if test x"${PUREGEN}" = x ; then
+   AC_PATH_PROG([PUREGEN],[pure-gen])
+   test x"${PUREGEN}" = x && AC_MSG_ERROR([could not find pure-gen])
+else
+   AC_MSG_CHECKING([for pure-gen])
+   AC_MSG_RESULT([${PUREGEN}])
+fi
+])