diff --git a/m4/.svn/entries b/m4/.svn/entries deleted file mode 100644 index 7d149e6fb6a39b957fecdca57547eecf70c4a914..0000000000000000000000000000000000000000 --- a/m4/.svn/entries +++ /dev/null @@ -1,470 +0,0 @@ -10 - -dir -936 -svn://ibird.ath.cx/svn/repo/rhmc/trunk/rhmc_20_07_2010/m4 -svn://ibird.ath.cx/svn/repo/rhmc - - - -2012-01-18T23:10:09.412529Z -608 -ibird - - - - - - - - - - - - - - -05885b04-6644-4e05-9b08-5043e251875b - -acx_mpi.m4 -file - - - - -2012-02-27T09:44:46.656966Z -64b9623c0f01aeabbc07c1c14e31e474 -2011-05-01T16:40:35.209298Z -118 -ibird - - - - - - - - - - - - - - - - - - - - - -3902 - -ax_boost_program_options.m4 -file - - - - -2012-02-27T09:44:46.657966Z -df549125ea719d25a168766b45ff8321 -2011-02-18T01:07:35.655725Z -1 -i-bird - - - - - - - - - - - - - - - - - - - - - -4809 - -acx_pthread.m4 -file - - - - -2012-02-27T09:44:46.657966Z -c77c1b458009722a892e9c848d491d9c -2011-02-18T01:07:35.655725Z -1 -i-bird - - - - - - - - - - - - - - - - - - - - - -9512 - -ax_lib_mysql.m4 -file - - - - -2012-02-27T09:44:46.657966Z -2324a6f7e740da3ae198c00126dacb22 -2011-02-18T01:07:35.655725Z -1 -i-bird - - - - - - - - - - - - - - - - - - - - - -4506 - -ax_boost_thread.m4 -file - - - - -2012-02-27T09:44:46.658966Z -f6c41db1f191380670192b1416ec144e -2011-03-30T23:32:49.807437Z -48 -ibird - - - - - - - - - - - - - - - - - - - - - -5396 - -ax_openmp.m4 -file - - - - -2012-02-27T09:44:46.658966Z -8a00cbce21bf0ed1e8272064f679c111 -2012-01-18T23:02:08.895776Z -605 -ibird - - - - - - - - - - - - - - - - - - - - - -4284 - -ax_boost_base.m4 -file - - - - -2012-02-27T09:44:46.659966Z -1c3d3941a1d2a34b5093df43f4eff3f9 -2011-02-18T01:07:35.655725Z -1 -i-bird - - - - - - - - - - - - - - - - - - - - - -10265 - -ax_opencl.m4 -file - - - - -2012-02-27T09:44:46.659966Z -fd297403b44095eff6045a2f75d7b000 -2011-02-18T01:07:35.655725Z -1 -i-bird - - - - - - - - - - - - - - - - - - - - - -4043 - -ax_gcc_version.m4 -file - - - - -2012-02-27T09:44:46.659966Z -4472b41f4b48be2a792a34cb059caa31 -2012-01-18T23:07:46.147457Z -607 -ibird - - - - - - - - - - - - - - - - - - - - - -2512 - -programs.m4 -file - - - - -2012-02-27T09:44:46.660966Z -62c9967f8e83f3376724ebd9518c535f -2011-02-18T01:07:35.655725Z -1 -i-bird - - - - - - - - - - - - - - - - - - - - - -30907 - -ax_check_compiler_flags.m4 -file - - - - -2012-02-27T09:44:46.660966Z -ce1509a8b02892e0a4aa61a01ce2d3b0 -2011-02-18T01:07:35.655725Z -1 -i-bird - - - - - - - - - - - - - - - - - - - - - -3297 - -ax_gcc_archflag.m4 -file - - - - -2012-02-27T09:44:46.661966Z -9f182cd30107f224f43bc103c18dc36c -2012-01-18T23:10:09.412529Z -608 -ibird - - - - - - - - - - - - - - - - - - - - - -9475 - -ax_gcc_x86_cpuid.m4 -file - - - - -2012-02-27T09:44:46.661966Z -ab8de3a5954a15ed48f6998f205f4e26 -2012-01-18T23:07:03.291507Z -606 -ibird - - - - - - - - - - - - - - - - - - - - - -3313 - diff --git a/m4/.svn/text-base/acx_mpi.m4.svn-base b/m4/.svn/text-base/acx_mpi.m4.svn-base deleted file mode 100644 index 2f7e487e55497f42c547dc295f18d845322be32c..0000000000000000000000000000000000000000 --- a/m4/.svn/text-base/acx_mpi.m4.svn-base +++ /dev/null @@ -1,108 +0,0 @@ -dnl @synopsis ACX_MPI([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl This macro tries to find out how to compile programs that use MPI -dnl (Message Passing Interface), a standard API for parallel process -dnl communication (see http://www-unix.mcs.anl.gov/mpi/) -dnl -dnl On success, it sets the MPICC, MPICXX, or MPIF77 output variable to -dnl the name of the MPI compiler, depending upon the current language. -dnl (This may just be $CC/$CXX/$F77, but is more often something like -dnl mpicc/mpiCC/mpif77.) It also sets MPILIBS to any libraries that are -dnl needed for linking MPI (e.g. -lmpi, if a special -dnl MPICC/MPICXX/MPIF77 was not found). -dnl -dnl If you want to compile everything with MPI, you should set: -dnl -dnl CC="$MPICC" #OR# CXX="$MPICXX" #OR# F77="$MPIF77" -dnl LIBS="$MPILIBS $LIBS" -dnl -dnl The user can force a particular library/compiler by setting the -dnl MPICC/MPICXX/MPIF77 and/or MPILIBS environment variables. -dnl -dnl ACTION-IF-FOUND is a list of shell commands to run if an MPI -dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to -dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the -dnl default action will define HAVE_MPI. -dnl -dnl @category InstalledPackages -dnl @author Steven G. Johnson <stevenj@alum.mit.edu> -dnl @version 2004-11-05 -dnl @license GPLWithACException - -AC_DEFUN([ACX_MPI], [ -AC_PREREQ(2.50) dnl for AC_LANG_CASE - -AC_LANG_CASE([C], [ - AC_REQUIRE([AC_PROG_CC]) - AC_ARG_VAR(MPICC,[MPI C compiler command]) - AC_CHECK_PROGS(MPICC, mpicc hcc mpcc mpcc_r mpxlc cmpicc, $CC) - acx_mpi_save_CC="$CC" - LAMMPICC="$CC" - CC="$MPICC" - AC_SUBST(MPICC) -], -[C++], [ - AC_REQUIRE([AC_PROG_CXX]) - AC_ARG_VAR(MPICXX,[MPI C++ compiler command]) - AC_CHECK_PROGS(MPICXX, mpic++ mpicxx mpiCC mpCC hcp mpxlC mpxlC_r cmpic++, $CXX) - acx_mpi_save_CXX="$CXX" - LAMMPICXX="$CXX" - CXX="$MPICXX" - AC_SUBST(MPICXX) -], -[Fortran 77], [ - AC_REQUIRE([AC_PROG_F77]) - AC_ARG_VAR(MPIF77,[MPI Fortran compiler command]) - AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf mpf77 mpif90 mpf90 mpxlf90 mpxlf95 mpxlf_r cmpifc cmpif90c, $F77) - acx_mpi_save_F77="$F77" - LAMMPIF77="$F77" - F77="$MPIF77" - AC_SUBST(MPIF77) -]) - -if test x = x"$MPILIBS"; then - AC_LANG_CASE([C], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])], - [C++], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])], - [Fortran 77], [AC_MSG_CHECKING([for MPI_Init]) - AC_TRY_LINK([],[ call MPI_Init], [MPILIBS=" " - AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])]) -fi -if test x = x"$MPILIBS"; then - AC_CHECK_LIB(mpi, MPI_Init, [MPILIBS="-lmpi"]) -fi -if test x = x"$MPILIBS"; then - AC_CHECK_LIB(mpich, MPI_Init, [MPILIBS="-lmpich"]) -fi - -dnl We have to use AC_TRY_COMPILE and not AC_CHECK_HEADER because the -dnl latter uses $CPP, not $CC (which may be mpicc). -AC_LANG_CASE([C], [if test x != x"$MPILIBS"; then - AC_MSG_CHECKING([for mpi.h]) - export LAMMPICC="$acx_mpi_save_CC" - AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS="" - AC_MSG_RESULT(no)]) - unset LAMMPICC -fi], -[C++], [if test x != x"$MPILIBS"; then - AC_MSG_CHECKING([for mpi.h]) - export LAMMPICXX="$acx_mpi_save_CXX" - AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS="" - AC_MSG_RESULT(no)]) - unset LAMMPICXX -fi]) - -AC_LANG_CASE([C], [CC="$acx_mpi_save_CC"], - [C++], [CXX="$acx_mpi_save_CXX"], - [Fortran 77], [F77="$acx_mpi_save_F77"]) - -AC_SUBST(MPILIBS) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x = x"$MPILIBS"; then - $2 - : -else - ifelse([$1],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$1]) - : -fi -])dnl ACX_MPI diff --git a/m4/.svn/text-base/acx_pthread.m4.svn-base b/m4/.svn/text-base/acx_pthread.m4.svn-base deleted file mode 100644 index 508df866b5c619f7a09632919f6502bcdb722134..0000000000000000000000000000000000000000 --- a/m4/.svn/text-base/acx_pthread.m4.svn-base +++ /dev/null @@ -1,242 +0,0 @@ -dnl -dnl ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl Description -dnl -dnl This macro figures out how to build C programs using POSIX threads. It -dnl sets the PTHREAD_LIBS output variable to the threads library and linker -dnl flags, and the PTHREAD_CFLAGS output variable to any special C compiler -dnl flags that are needed. (The user can also force certain compiler -dnl flags/libs to be tested by setting these environment variables.) -dnl -dnl Also sets PTHREAD_CC to any special C compiler that is needed for -dnl multi-threaded programs (defaults to the value of CC otherwise). (This is -dnl necessary on AIX to use the special cc_r compiler alias.) -dnl -dnl NOTE: You are assumed to not only compile your program with these flags, -dnl but also link it with them as well. e.g. you should link with $PTHREAD_CC -dnl $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -dnl -dnl If you are only building threads programs, you may wish to use these -dnl variables in your default LIBS, CFLAGS, and CC: -dnl -dnl LIBS="$PTHREAD_LIBS $LIBS" -dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -dnl CC="$PTHREAD_CC" -dnl -dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -dnl has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name -dnl (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -dnl -dnl ACTION-IF-FOUND is a list of shell commands to run if a threads library -dnl is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it -dnl is not found. If ACTION-IF-FOUND is not specified, the default action -dnl will define HAVE_PTHREAD. -dnl -dnl Please let the authors know if this macro fails on any platform, or if -dnl you have any other suggestions or comments. This macro was based on work -dnl by SGJ on autoconf scripts for FFTW (www.fftw.org) (with help from M. -dnl Frigo), as well as ac_pthread and hb_pthread macros posted by AFC to the -dnl autoconf macro repository. We are also grateful for the helpful feedback -dnl of numerous users. -dnl -dnl Version: 1.8 (last modified: 2003-05-21) -dnl Author: Steven G. Johnson <stevenj@alum.mit.edu> and -dnl Alejandro Forero Cuervo <bachue@bachue.com> -dnl -dnl from http://www.gnu.org/software/ac-archive/htmldoc/index.html -dnl -dnl License: -dnl GNU General Public License -dnl [http://www.gnu.org/software/ac-archive/htmldoc/COPYING.html] -dnl with this special exception -dnl [http://www.gnu.org/software/ac-archive/htmldoc/COPYING-Exception.html]. -dnl - -AC_DEFUN([ACX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_HOST]) -AC_LANG_SAVE -AC_LANG_C -acx_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on True64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) - AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) - AC_MSG_RESULT($acx_pthread_ok) - if test x"$acx_pthread_ok" = xno; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all. - -acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# pthread: Linux, etcetera -# --thread-safe: KAI C++ - -case "${host_cpu}-${host_os}" in - *solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthread or - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: - - acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" - ;; -esac - -if test x"$acx_pthread_ok" = xno; then -for flag in $acx_pthread_flags; do - - case $flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $flag]) - PTHREAD_CFLAGS="$flag" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$flag]) - PTHREAD_LIBS="-l$flag" - ;; - esac - - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - AC_TRY_LINK([#include <pthread.h>], - [pthread_t th; pthread_join(th, 0); - pthread_attr_init(0); pthread_cleanup_push(0, 0); - pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], - [acx_pthread_ok=yes]) - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - AC_MSG_RESULT($acx_pthread_ok) - if test "x$acx_pthread_ok" = xyes; then - break; - fi - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - -# Various other checks: -if test "x$acx_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Detect AIX lossage: threads are created detached by default - # and the JOINABLE attribute has a nonstandard name (UNDETACHED). - AC_MSG_CHECKING([for joinable pthread attribute]) - AC_TRY_LINK([#include <pthread.h>], - [int attr=PTHREAD_CREATE_JOINABLE;], - ok=PTHREAD_CREATE_JOINABLE, ok=unknown) - if test x"$ok" = xunknown; then - AC_TRY_LINK([#include <pthread.h>], - [int attr=PTHREAD_CREATE_UNDETACHED;], - ok=PTHREAD_CREATE_UNDETACHED, ok=unknown) - fi - if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then - AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok, - [Define to the necessary symbol if this constant - uses a non-standard name on your system.]) - fi - AC_MSG_RESULT(${ok}) - if test x"$ok" = xunknown; then - AC_MSG_WARN([we do not know how to create joinable pthreads]) - fi - - AC_MSG_CHECKING([if more special flags are required for pthreads]) - flag=no - case "${host_cpu}-${host_os}" in - *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; - *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; - esac - AC_MSG_RESULT(${flag}) - if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" - fi - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - # More AIX lossage: must compile with cc_r - AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) -else - PTHREAD_CC="$CC" -fi - -AC_SUBST(PTHREAD_LIBS) -AC_SUBST(PTHREAD_CFLAGS) -AC_SUBST(PTHREAD_CC) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_pthread_ok" = xyes; then - ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) - : -else - acx_pthread_ok=no - $2 -fi -AC_LANG_RESTORE -])dnl ACX_PTHREAD \ No newline at end of file diff --git a/m4/.svn/text-base/ax_boost_base.m4.svn-base b/m4/.svn/text-base/ax_boost_base.m4.svn-base deleted file mode 100644 index ec23a0abb70f7ed4e20e5dcc607056832986574a..0000000000000000000000000000000000000000 --- a/m4/.svn/text-base/ax_boost_base.m4.svn-base +++ /dev/null @@ -1,257 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_boost_base.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# DESCRIPTION -# -# Test for the Boost C++ libraries of a particular version (or newer) -# -# If no path to the installed boost library is given the macro searchs -# under /usr, /usr/local, /opt and /opt/local and evaluates the -# $BOOST_ROOT environment variable. Further documentation is available at -# <http://randspringer.de/boost/index.html>. -# -# This macro calls: -# -# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS) -# -# And sets: -# -# HAVE_BOOST -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> -# Copyright (c) 2009 Peter Adolphs -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 18 - -AC_DEFUN([AX_BOOST_BASE], -[ -AC_ARG_WITH([boost], - [AS_HELP_STRING([--with-boost@<:@=ARG@:>@], - [use Boost library from a standard location (ARG=yes), - from the specified location (ARG=<path>), - or disable it (ARG=no) - @<:@ARG=yes@:>@ ])], - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ac_boost_path="" - else - want_boost="yes" - ac_boost_path="$withval" - fi - ], - [want_boost="yes"]) - - -AC_ARG_WITH([boost-libdir], - AS_HELP_STRING([--with-boost-libdir=LIB_DIR], - [Force given directory for boost libraries. Note that this will overwrite library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]), - [ - if test -d "$withval" - then - ac_boost_lib_path="$withval" - else - AC_MSG_ERROR(--with-boost-libdir expected directory name) - fi - ], - [ac_boost_lib_path=""] -) - -if test "x$want_boost" = "xyes"; then - boost_lib_version_req=ifelse([$1], ,1.20.0,$1) - boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` - boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'` - boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$boost_lib_version_req_sub_minor" = "x" ; then - boost_lib_version_req_sub_minor="0" - fi - WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` - AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req) - succeeded=no - - dnl On x86_64 systems check for system libraries in both lib64 and lib. - dnl The former is specified by FHS, but e.g. Debian does not adhere to - dnl this (as it rises problems for generic multi-arch support). - dnl The last entry in the list is chosen by default when no libraries - dnl are found, e.g. when only header-only libraries are installed! - libsubdirs="lib" - if test `uname -m` = x86_64; then - libsubdirs="lib64 lib lib64" - fi - - dnl first we check the system location for boost libraries - dnl this location ist chosen if boost libraries are installed with the --layout=system option - dnl or if you install boost with RPM - if test "$ac_boost_path" != ""; then - BOOST_CPPFLAGS="-I$ac_boost_path/include" - for ac_boost_path_tmp in $libsubdirs; do - if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then - BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp" - break - fi - done - elif test "$cross_compiling" != yes; then - for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do - if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then - for libsubdir in $libsubdirs ; do - if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir" - BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include" - break; - fi - done - fi - - dnl overwrite ld flags if we have required special directory with - dnl --with-boost-libdir parameter - if test "$ac_boost_lib_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_lib_path" - fi - - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_REQUIRE([AC_PROG_CXX]) - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include <boost/version.hpp> - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - - - - dnl if we found no boost with system layout we search for boost libraries - dnl built and installed without the --layout=system option or for a staged(not installed) version - if test "x$succeeded" != "xyes"; then - _version=0 - if test "$ac_boost_path" != ""; then - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - fi - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE" - done - fi - else - if test "$cross_compiling" != yes; then - for ac_boost_path in /usr /usr/local /opt /opt/local ; do - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - best_path=$ac_boost_path - fi - done - fi - done - - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" - if test "$ac_boost_lib_path" = ""; then - for libsubdir in $libsubdirs ; do - if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - BOOST_LDFLAGS="-L$best_path/$libsubdir" - fi - fi - - if test "x$BOOST_ROOT" != "x"; then - for libsubdir in $libsubdirs ; do - if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then - version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` - stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` - stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` - V_CHECK=`expr $stage_version_shorten \>\= $_version` - if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then - AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) - BOOST_CPPFLAGS="-I$BOOST_ROOT" - BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir" - fi - fi - fi - fi - - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include <boost/version.hpp> - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - fi - - if test "$succeeded" != "yes" ; then - if test "$_version" = "0" ; then - AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]]) - else - AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).]) - fi - # execute ACTION-IF-NOT-FOUND (if present): - ifelse([$3], , :, [$3]) - else - AC_SUBST(BOOST_CPPFLAGS) - AC_SUBST(BOOST_LDFLAGS) - AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) - # execute ACTION-IF-FOUND (if present): - ifelse([$2], , :, [$2]) - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" -fi - -]) diff --git a/m4/.svn/text-base/ax_boost_program_options.m4.svn-base b/m4/.svn/text-base/ax_boost_program_options.m4.svn-base deleted file mode 100644 index d612f91da36a2d55f8676f958cb46397c4509135..0000000000000000000000000000000000000000 --- a/m4/.svn/text-base/ax_boost_program_options.m4.svn-base +++ /dev/null @@ -1,108 +0,0 @@ -# ============================================================================ -# http://www.gnu.org/software/autoconf-archive/ax_boost_program_options.html -# ============================================================================ -# -# SYNOPSIS -# -# AX_BOOST_PROGRAM_OPTIONS -# -# DESCRIPTION -# -# Test for program options library from the Boost C++ libraries. The macro -# requires a preceding call to AX_BOOST_BASE. Further documentation is -# available at <http://randspringer.de/boost/index.html>. -# -# This macro calls: -# -# AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) -# -# And sets: -# -# HAVE_BOOST_PROGRAM_OPTIONS -# -# LICENSE -# -# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de> -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 20 - -AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS], -[ - AC_ARG_WITH([boost-program-options], - AS_HELP_STRING([--with-boost-program-options@<:@=special-lib@:>@], - [use the program options library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-program-options=boost_program_options-gcc-mt-1_33_1 ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_program_options_lib="" - else - want_boost="yes" - ax_boost_user_program_options_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - export want_boost - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - AC_CACHE_CHECK([whether the Boost::Program_Options library is available], - ax_cv_boost_program_options, - [AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/program_options.hpp> - ]], - [[boost::program_options::options_description generic("Generic options"); - return 0;]])], - ax_cv_boost_program_options=yes, ax_cv_boost_program_options=no) - AC_LANG_POP([C++]) - ]) - if test "$ax_cv_boost_program_options" = yes; then - AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - if test "x$ax_boost_user_program_options_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break], - [link_program_options="no"]) - done - if test "x$link_program_options" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.a*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break], - [link_program_options="no"]) - done - fi - else - for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do - AC_CHECK_LIB($ax_lib, main, - [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break], - [link_program_options="no"]) - done - fi - if test "x$ax_lib" = "x"; then - AC_MSG_ERROR(Could not find a version of the library!) - fi - if test "x$link_program_options" != "xyes"; then - AC_MSG_ERROR([Could not link against [$ax_lib] !]) - fi - fi - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/m4/.svn/text-base/ax_boost_thread.m4.svn-base b/m4/.svn/text-base/ax_boost_thread.m4.svn-base deleted file mode 100644 index 2c073b56658b881583f404d761d2cf86e3d85ee9..0000000000000000000000000000000000000000 --- a/m4/.svn/text-base/ax_boost_thread.m4.svn-base +++ /dev/null @@ -1,149 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_boost_thread.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_THREAD -# -# DESCRIPTION -# -# Test for Thread library from the Boost C++ libraries. The macro requires -# a preceding call to AX_BOOST_BASE. Further documentation is available at -# <http://randspringer.de/boost/index.html>. -# -# This macro calls: -# -# AC_SUBST(BOOST_THREAD_LIB) -# -# And sets: -# -# HAVE_BOOST_THREAD -# -# LICENSE -# -# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de> -# Copyright (c) 2009 Michael Tindal -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 22 - -AC_DEFUN([AX_BOOST_THREAD], -[ - AC_ARG_WITH([boost-thread], - AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@], - [use the Thread library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-thread=boost_thread-gcc-mt ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_thread_lib="" - else - want_boost="yes" - ax_boost_user_thread_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_BUILD]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::Thread library is available, - ax_cv_boost_thread, - [AC_LANG_PUSH([C++]) - CXXFLAGS_SAVE=$CXXFLAGS - - if test "x$build_os" = "xsolaris" ; then - CXXFLAGS="-pthreads $CXXFLAGS" - elif test "x$build_os" = "xming32" ; then - CXXFLAGS="-mthreads $CXXFLAGS" - else - CXXFLAGS="-pthread $CXXFLAGS" - fi - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/thread/thread.hpp>]], - [[boost::thread_group thrds; - return 0;]])], - ax_cv_boost_thread=yes, ax_cv_boost_thread=no) - CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_thread" = "xyes"; then - if test "x$build_os" = "xsolaris" ; then - BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS" - elif test "x$build_os" = "xming32" ; then - BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS" - else - BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS" - fi - - AC_SUBST(BOOST_CPPFLAGS) - - AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - - LDFLAGS_SAVE=$LDFLAGS - case "x$build_os" in - *bsd* ) - LDFLAGS="-pthread $LDFLAGS" - break; - ;; - esac - if test "x$ax_boost_user_thread_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_thread*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.a*$;\1;'`; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], - [link_thread="no"]) - done - if test "x$link_thread" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_thread*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.a*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], - [link_thread="no"]) - done - fi - - else - for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], - [link_thread="no"]) - done - - fi - if test "x$ax_lib" = "x"; then - AC_MSG_ERROR(Could not find a version of the library!) - fi - if test "x$link_thread" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - else - case "x$build_os" in - *bsd* ) - BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS" - break; - ;; - esac - - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/m4/.svn/text-base/ax_check_compiler_flags.m4.svn-base b/m4/.svn/text-base/ax_check_compiler_flags.m4.svn-base deleted file mode 100644 index 35bfd2a5a27405d140712bc060a6a5e6d57469c7..0000000000000000000000000000000000000000 --- a/m4/.svn/text-base/ax_check_compiler_flags.m4.svn-base +++ /dev/null @@ -1,76 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_check_compiler_flags.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_COMPILER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE]) -# -# DESCRIPTION -# -# Check whether the given compiler FLAGS work with the current language's -# compiler, or whether they give an error. (Warnings, however, are -# ignored.) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# LICENSE -# -# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> -# Copyright (c) 2009 Matteo Frigo -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 9 - -AC_DEFUN([AX_CHECK_COMPILER_FLAGS], -[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX -AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1]) -dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: -AS_LITERAL_IF([$1], - [AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]), [ - ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS - _AC_LANG_PREFIX[]FLAGS="$1" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], - AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes, - AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no) - _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])], - [ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS - _AC_LANG_PREFIX[]FLAGS="$1" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], - eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes, - eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no) - _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS]) -eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]) -AC_MSG_RESULT($ax_check_compiler_flags) -if test "x$ax_check_compiler_flags" = xyes; then - m4_default([$2], :) -else - m4_default([$3], :) -fi -])dnl AX_CHECK_COMPILER_FLAGS diff --git a/m4/.svn/text-base/ax_gcc_archflag.m4.svn-base b/m4/.svn/text-base/ax_gcc_archflag.m4.svn-base deleted file mode 100644 index e918ece1759f977d4703711bde58fdc548b0833b..0000000000000000000000000000000000000000 --- a/m4/.svn/text-base/ax_gcc_archflag.m4.svn-base +++ /dev/null @@ -1,220 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_gcc_archflag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE]) -# -# DESCRIPTION -# -# This macro tries to guess the "native" arch corresponding to the target -# architecture for use with gcc's -march=arch or -mtune=arch flags. If -# found, the cache variable $ax_cv_gcc_archflag is set to this flag and -# ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is is set to -# "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is -# to add $ax_cv_gcc_archflag to the end of $CFLAGS. -# -# PORTABLE? should be either [yes] (default) or [no]. In the former case, -# the flag is set to -mtune (or equivalent) so that the architecture is -# only used for tuning, but the instruction set used is still portable. In -# the latter case, the flag is set to -march (or equivalent) so that -# architecture-specific instructions are enabled. -# -# The user can specify --with-gcc-arch=<arch> in order to override the -# macro's choice of architecture, or --without-gcc-arch to disable this. -# -# When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is -# called unless the user specified --with-gcc-arch manually. -# -# Requires macros: AX_CHECK_COMPILER_FLAGS, AX_GCC_X86_CPUID -# -# (The main emphasis here is on recent CPUs, on the principle that doing -# high-performance computing on old hardware is uncommon.) -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> -# Copyright (c) 2008 Matteo Frigo -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 8 - -AC_DEFUN([AX_GCC_ARCHFLAG], -[AC_REQUIRE([AC_PROG_CC]) -AC_REQUIRE([AC_CANONICAL_HOST]) - -AC_ARG_WITH(gcc-arch, [AS_HELP_STRING([--with-gcc-arch=<arch>], [use architecture <arch> for gcc -march/-mtune, instead of guessing])], - ax_gcc_arch=$withval, ax_gcc_arch=yes) - -AC_MSG_CHECKING([for gcc architecture flag]) -AC_MSG_RESULT([]) -AC_CACHE_VAL(ax_cv_gcc_archflag, -[ -ax_cv_gcc_archflag="unknown" - -if test "$GCC" = yes; then - -if test "x$ax_gcc_arch" = xyes; then -ax_gcc_arch="" -if test "$cross_compiling" = no; then -case $host_cpu in - i[[3456]]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones - AX_GCC_X86_CPUID(0) - AX_GCC_X86_CPUID(1) - case $ax_cv_gcc_x86_cpuid_0 in - *:756e6547:*:*) # Intel - case $ax_cv_gcc_x86_cpuid_1 in - *5[[48]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;; - *5??:*:*:*) ax_gcc_arch=pentium ;; - 206??:*:*:*) ax_gcc_arch="corei7 native nocona core2 prescott pentium4 pentiumpro";break;; - 106a?:*:*:*) ax_gcc_arch="corei7 native nocona core2 prescott pentium4 pentiumpro";break;; - 106e?:*:*:*) ax_gcc_arch="corei7 native nocona core2 prescott pentium4 pentiumpro";break;; - *6[[520]]?:*:*:*) ax_gcc_arch="i7core nocona core2 prescott pentium4 pentiumpro" ;; - *6[[3456]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; - *6a?:*[[01]]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; - *6a?:*[[234]]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; - *6[[9d]]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;; - *6[[78b]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; - *6f?:*:*:*) ax_gcc_arch="core2 native pentium-m pentium3 pentiumpro" ;; - *6??:*:*:*) ax_gcc_arch=pentiumpro ;; - *f3[[347]]:*:*:*|*f4[1347]:*:*:*) - case $host_cpu in - x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;; - *) ax_gcc_arch="prescott pentium4 pentiumpro" ;; - esac ;; - *f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";; - esac ;; - *:68747541:*:*) # AMD - case $ax_cv_gcc_x86_cpuid_1 in - *5[[67]]?:*:*:*) ax_gcc_arch=k6 ;; - *5[[8d]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;; - *5[[9]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;; - *60?:*:*:*) ax_gcc_arch=k7 ;; - *6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;; - *6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;; - *67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;; - *6[[68a]]?:*:*:*) - AX_GCC_X86_CPUID(0x80000006) # L2 cache size - case $ax_cv_gcc_x86_cpuid_0x80000006 in - *:*:*[[1-9a-f]]??????:*) # (L2 = ecx >> 16) >= 256 - ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;; - *) ax_gcc_arch="athlon-4 athlon k7" ;; - esac ;; - *f[[4cef8b]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;; - *f5?:*:*:*) ax_gcc_arch="opteron k8" ;; - *f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;; - *f??:*:*:*) ax_gcc_arch="k8" ;; - esac ;; - *:746e6543:*:*) # IDT - case $ax_cv_gcc_x86_cpuid_1 in - *54?:*:*:*) ax_gcc_arch=winchip-c6 ;; - *58?:*:*:*) ax_gcc_arch=winchip2 ;; - *6[[78]]?:*:*:*) ax_gcc_arch=c3 ;; - *69?:*:*:*) ax_gcc_arch="c3-2 c3" ;; - esac ;; - esac - if test x"$ax_gcc_arch" = x; then # fallback - case $host_cpu in - i586*) ax_gcc_arch=pentium ;; - i686*) ax_gcc_arch=pentiumpro ;; - esac - fi - ;; - - sparc*) - AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/]) - cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` - cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters` - case $cputype in - *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; - *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; - *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;; - *supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;; - *hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;; - *cypress*) ax_gcc_arch=cypress ;; - esac ;; - - alphaev5) ax_gcc_arch=ev5 ;; - alphaev56) ax_gcc_arch=ev56 ;; - alphapca56) ax_gcc_arch="pca56 ev56" ;; - alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;; - alphaev6) ax_gcc_arch=ev6 ;; - alphaev67) ax_gcc_arch=ev67 ;; - alphaev68) ax_gcc_arch="ev68 ev67" ;; - alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;; - alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;; - alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;; - - powerpc*) - cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null` - cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'` - case $cputype in - *750*) ax_gcc_arch="750 G3" ;; - *740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;; - *74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;; - *74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;; - *970*) ax_gcc_arch="970 G5 power4";; - *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; - *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; - 603ev|8240) ax_gcc_arch="$cputype 603e 603";; - *) ax_gcc_arch=$cputype ;; - esac - ax_gcc_arch="$ax_gcc_arch powerpc" - ;; -esac -fi # not cross-compiling -fi # guess arch - -if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then -for arch in $ax_gcc_arch; do - if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code - flags="-mtune=$arch" - # -mcpu=$arch and m$arch generate nonportable code on every arch except - # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr. - case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac - else - flags="-march=$arch -mcpu=$arch -m$arch" - fi - for flag in $flags; do - AX_CHECK_COMPILER_FLAGS($flag, [ax_cv_gcc_archflag=$flag; break]) - done - test "x$ax_cv_gcc_archflag" = xunknown || break -done -fi - -fi # $GCC=yes -]) -AC_MSG_CHECKING([for gcc architecture flag]) -AC_MSG_RESULT($ax_cv_gcc_archflag) -if test "x$ax_cv_gcc_archflag" = xunknown; then - m4_default([$3],:) -else - m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"]) -fi -]) diff --git a/m4/.svn/text-base/ax_gcc_version.m4.svn-base b/m4/.svn/text-base/ax_gcc_version.m4.svn-base deleted file mode 100644 index 0d924741f4acf74613d80eb98c32de37727a0278..0000000000000000000000000000000000000000 --- a/m4/.svn/text-base/ax_gcc_version.m4.svn-base +++ /dev/null @@ -1,65 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_gcc_version.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_GCC_VERSION -# -# DESCRIPTION -# -# This macro retrieves the gcc version and returns it in the GCC_VERSION -# variable if available, an empty string otherwise. -# -# LICENSE -# -# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net> -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 8 - -AC_DEFUN([AX_GCC_VERSION], [ - GCC_VERSION="" - AX_GCC_OPTION([-dumpversion],[],[],[ - ax_gcc_version_option=yes - ],[ - ax_gcc_version_option=no - ]) - AS_IF([test "x$GCC" = "xyes"],[ - AS_IF([test "x$ax_gcc_version_option" != "xno"],[ - AC_CACHE_CHECK([gcc version],[ax_cv_gcc_version],[ - ax_cv_gcc_version="`$CC -dumpversion`" - AS_IF([test "x$ax_cv_gcc_version" = "x"],[ - ax_cv_gcc_version="" - ]) - ]) - GCC_VERSION=$ax_cv_gcc_version - ]) - ]) - AC_SUBST([GCC_VERSION]) -]) diff --git a/m4/.svn/text-base/ax_gcc_x86_cpuid.m4.svn-base b/m4/.svn/text-base/ax_gcc_x86_cpuid.m4.svn-base deleted file mode 100644 index 7d46fee0219e970f98e960a5b0717a9ec061ee95..0000000000000000000000000000000000000000 --- a/m4/.svn/text-base/ax_gcc_x86_cpuid.m4.svn-base +++ /dev/null @@ -1,79 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_GCC_X86_CPUID(OP) -# -# DESCRIPTION -# -# On Pentium and later x86 processors, with gcc or a compiler that has a -# compatible syntax for inline assembly instructions, run a small program -# that executes the cpuid instruction with input OP. This can be used to -# detect the CPU type. -# -# On output, the values of the eax, ebx, ecx, and edx registers are stored -# as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable -# ax_cv_gcc_x86_cpuid_OP. -# -# If the cpuid instruction fails (because you are running a -# cross-compiler, or because you are not using gcc, or because you are on -# a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP -# is set to the string "unknown". -# -# This macro mainly exists to be used in AX_GCC_ARCHFLAG. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> -# Copyright (c) 2008 Matteo Frigo -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 7 - -AC_DEFUN([AX_GCC_X86_CPUID], -[AC_REQUIRE([AC_PROG_CC]) -AC_LANG_PUSH([C]) -AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1, - [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [ - int op = $1, eax, ebx, ecx, edx; - FILE *f; - __asm__("cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (op)); - f = fopen("conftest_cpuid", "w"); if (!f) return 1; - fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); - fclose(f); - return 0; -])], - [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid], - [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid], - [ax_cv_gcc_x86_cpuid_$1=unknown])]) -AC_LANG_POP([C]) -]) diff --git a/m4/.svn/text-base/ax_lib_mysql.m4.svn-base b/m4/.svn/text-base/ax_lib_mysql.m4.svn-base deleted file mode 100644 index b4d19120e8f8c4e0cd32746decc961d4bf19e7d9..0000000000000000000000000000000000000000 --- a/m4/.svn/text-base/ax_lib_mysql.m4.svn-base +++ /dev/null @@ -1,145 +0,0 @@ -# =========================================================================== -# http://www.nongnu.org/autoconf-archive/ax_lib_mysql.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_LIB_MYSQL([MINIMUM-VERSION]) -# -# DESCRIPTION -# -# This macro provides tests of availability of MySQL client library of -# particular version or newer. -# -# AX_LIB_MYSQL macro takes only one argument which is optional. If there -# is no required version passed, then macro does not run version test. -# -# The --with-mysql option takes one of three possible values: -# -# no - do not check for MySQL client library -# -# yes - do check for MySQL library in standard locations (mysql_config -# should be in the PATH) -# -# path - complete path to mysql_config utility, use this option if -# mysql_config can't be found in the PATH -# -# This macro calls: -# -# AC_SUBST(MYSQL_CFLAGS) -# AC_SUBST(MYSQL_LDFLAGS) -# AC_SUBST(MYSQL_VERSION) -# -# And sets: -# -# HAVE_MYSQL -# -# LICENSE -# -# Copyright (c) 2008 Mateusz Loskot <mateusz@loskot.net> -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. - -AC_DEFUN([AX_LIB_MYSQL], -[ - AC_ARG_WITH([mysql], - AC_HELP_STRING([--with-mysql=@<:@ARG@:>@], - [use MySQL client library @<:@default=yes@:>@, optionally specify path to mysql_config] - ), - [ - if test "$withval" = "no"; then - want_mysql="no" - elif test "$withval" = "yes"; then - want_mysql="yes" - else - want_mysql="yes" - MYSQL_CONFIG="$withval" - fi - ], - [want_mysql="yes"] - ) - - MYSQL_CFLAGS="" - MYSQL_LDFLAGS="" - MYSQL_VERSION="" - - dnl - dnl Check MySQL libraries (libpq) - dnl - - if test "$want_mysql" = "yes"; then - - if test -z "$MYSQL_CONFIG" -o test; then - AC_PATH_PROG([MYSQL_CONFIG], [mysql_config], [no]) - fi - - if test "$MYSQL_CONFIG" != "no"; then - AC_MSG_CHECKING([for MySQL libraries]) - - MYSQL_CFLAGS="`$MYSQL_CONFIG --cflags`" - MYSQL_LDFLAGS="`$MYSQL_CONFIG --libs`" - - MYSQL_VERSION=`$MYSQL_CONFIG --version` - - AC_DEFINE([HAVE_MYSQL], [1], - [Define to 1 if MySQL libraries are available]) - - found_mysql="yes" - AC_MSG_RESULT([yes]) - else - found_mysql="no" -# AC_MSG_RESULT([no]) - fi - fi - - dnl - dnl Check if required version of MySQL is available - dnl - - - mysql_version_req=ifelse([$1], [], [], [$1]) - - if test "$found_mysql" = "yes" -a -n "$mysql_version_req"; then - - AC_MSG_CHECKING([if MySQL version is >= $mysql_version_req]) - - dnl Decompose required version string of MySQL - dnl and calculate its number representation - mysql_version_req_major=`expr $mysql_version_req : '\([[0-9]]*\)'` - mysql_version_req_minor=`expr $mysql_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - mysql_version_req_micro=`expr $mysql_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$mysql_version_req_micro" = "x"; then - mysql_version_req_micro="0" - fi - - mysql_version_req_number=`expr $mysql_version_req_major \* 1000000 \ - \+ $mysql_version_req_minor \* 1000 \ - \+ $mysql_version_req_micro` - - dnl Decompose version string of installed MySQL - dnl and calculate its number representation - mysql_version_major=`expr $MYSQL_VERSION : '\([[0-9]]*\)'` - mysql_version_minor=`expr $MYSQL_VERSION : '[[0-9]]*\.\([[0-9]]*\)'` - mysql_version_micro=`expr $MYSQL_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$mysql_version_micro" = "x"; then - mysql_version_micro="0" - fi - - mysql_version_number=`expr $mysql_version_major \* 1000000 \ - \+ $mysql_version_minor \* 1000 \ - \+ $mysql_version_micro` - - mysql_version_check=`expr $mysql_version_number \>\= $mysql_version_req_number` - if test "$mysql_version_check" = "1"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi - - AC_SUBST([MYSQL_VERSION]) - AC_SUBST([MYSQL_CFLAGS]) - AC_SUBST([MYSQL_LDFLAGS]) -]) diff --git a/m4/.svn/text-base/ax_opencl.m4.svn-base b/m4/.svn/text-base/ax_opencl.m4.svn-base deleted file mode 100644 index 9ed1d963bcd1e486283fb5b81401f272de855b63..0000000000000000000000000000000000000000 --- a/m4/.svn/text-base/ax_opencl.m4.svn-base +++ /dev/null @@ -1,119 +0,0 @@ -# -*- mode: autoconf -*- -# -# AX_OPENCL -# -# Check for an OpenCL implementation. If CL is found, _OPENCL is defined and -# the required compiler and linker flags are included in the output variables -# "CL_CFLAGS" and "CL_LIBS", respectively. If no usable CL implementation is -# found, "no_cl" is set to "yes". -# -# If the header "CL/OpenCL.h" is found, "HAVE_CL_OPENCL_H" is defined. If the -# header "OpenCL/OpenCL.h" is found, HAVE_OPENCL_OPENCL_H is defined. These -# preprocessor definitions may not be mutually exclusive. -# -# Based on AX_CHECK_GL, version: 2.4 author: Braden McDaniel -# <braden@endoframe.com> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception, the you may copy, distribute and modify the -# configure scripts that are the output of Autoconf when processing -# the Macro. You need not follow the terms of the GNU General Public -# License when using or distributing such scripts. -# -AC_DEFUN([AX_OPENCL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_SED])dnl -AC_REQUIRE([ACX_PTHREAD])dnl - -AC_ARG_ENABLE([opencl], -[AC_HELP_STRING([--disable-opencl], -[do not use OpenCL])], -[disable_opencl=$enableval], -[disable_opencl='yes']) - -if test "$disable_opencl" = 'yes'; then -AC_LANG_PUSH([$1]) -AX_LANG_COMPILER_MS -AS_IF([test X$ax_compiler_ms = Xno], -[CL_CFLAGS="${PTHREAD_CFLAGS}"; CL_LIBS="${PTHREAD_LIBS} -lm"]) - -ax_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CL_CFLAGS $CPPFLAGS" -AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h]) -CPPFLAGS=$ax_save_CPPFLAGS - -AC_CHECK_HEADERS([windows.h]) - -m4_define([AX_OPENCL_PROGRAM], -[AC_LANG_PROGRAM([[ -# if defined(HAVE_WINDOWS_H) && defined(_WIN32) -# include <windows.h> -# endif -# ifdef HAVE_CL_CL_H -# include <CL/cl.h> -# elif defined(HAVE_OPENCL_CL_H) -# include <OpenCL/cl.h> -# else -# error no CL.h -# endif]], -[[clCreateContextFromType(0,0,0,0,0)]])]) - -AC_CACHE_CHECK([for OpenCL library], [ax_cv_check_cl_libcl], -[ax_cv_check_cl_libcl=no -case $host_cpu in -x86_64) ax_check_cl_libdir=lib64 ;; -*) ax_check_cl_libdir=lib ;; -esac -ax_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CL_CFLAGS $CPPFLAGS" -ax_save_LIBS=$LIBS -LIBS="" -ax_check_libs="-lOpenCL -lCL -lclparser" -for ax_lib in $ax_check_libs; do -AS_IF([test X$ax_compiler_ms = Xyes], -[ax_try_lib=`echo $ax_lib | $SED -e 's/^-l//' -e 's/$/.lib/'`], -[ax_try_lib=$ax_lib]) -LIBS="$ax_try_lib $CL_LIBS $ax_save_LIBS" -AC_LINK_IFELSE([AX_OPENCL_PROGRAM], -[ax_cv_check_cl_libcl=$ax_try_lib; break], -[ax_check_cl_nvidia_flags="-L/usr/$ax_check_cl_libdir/nvidia" LIBS="$ax_try_lib $ax_check_cl_nvidia_flags $CL_LIBS $ax_save_LIBS" -AC_LINK_IFELSE([AX_OPENCL_PROGRAM], -[ax_cv_check_cl_libcl="$ax_try_lib $ax_check_cl_nvidia_flags"; break], -[ax_check_cl_dylib_flag='-framework OpenCL -L/System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries' LIBS="$ax_try_lib $ax_check_cl_dylib_flag $CL_LIBS $ax_save_LIBS" -AC_LINK_IFELSE([AX_OPENCL_PROGRAM], -[ax_cv_check_cl_libcl="$ax_try_lib $ax_check_cl_dylib_flag"; break])])]) -done - -AS_IF([test "X$ax_cv_check_cl_libcl" = Xno -a X$no_x = Xyes], -[LIBS='-framework OpenCL' -AC_LINK_IFELSE([AX_OPENCL_PROGRAM], -[ax_cv_check_cl_libcl=$LIBS])]) - -LIBS=$ax_save_LIBS -CPPFLAGS=$ax_save_CPPFLAGS]) - -AS_IF([test "X$ax_cv_check_cl_libcl" = Xno], -[no_cl=yes; CL_CFLAGS=""; CL_LIBS=""], -[CL_LIBS="$ax_cv_check_cl_libcl $CL_LIBS"; AC_DEFINE([_OPENCL], [1], -[Define this for the OpenCL Accelerator])]) -AC_LANG_POP([$1]) -fi - -AC_SUBST([CL_CFLAGS]) -AC_SUBST([CL_LIBS]) -])dnl - diff --git a/m4/.svn/text-base/ax_openmp.m4.svn-base b/m4/.svn/text-base/ax_openmp.m4.svn-base deleted file mode 100644 index 7ea794be03aa265f8fcaa3a0abf4df27095a8ab5..0000000000000000000000000000000000000000 --- a/m4/.svn/text-base/ax_openmp.m4.svn-base +++ /dev/null @@ -1,99 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_openmp.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_OPENMP([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro tries to find out how to compile programs that use OpenMP a -# standard API and set of compiler directives for parallel programming -# (see http://www-unix.mcs/) -# -# On success, it sets the OPENMP_CFLAGS/OPENMP_CXXFLAGS/OPENMP_F77FLAGS -# output variable to the flag (e.g. -omp) used both to compile *and* link -# OpenMP programs in the current language. -# -# NOTE: You are assumed to not only compile your program with these flags, -# but also link it with them as well. -# -# If you want to compile everything with OpenMP, you should set: -# -# CFLAGS="$CFLAGS $OPENMP_CFLAGS" -# #OR# CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" -# #OR# FFLAGS="$FFLAGS $OPENMP_FFLAGS" -# -# (depending on the selected language). -# -# The user can override the default choice by setting the corresponding -# environment variable (e.g. OPENMP_CFLAGS). -# -# ACTION-IF-FOUND is a list of shell commands to run if an OpenMP flag is -# found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is -# not found. If ACTION-IF-FOUND is not specified, the default action will -# define HAVE_OPENMP. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 8 - -AC_DEFUN([AX_OPENMP], [ -AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX - -AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS -ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown -# Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI), -# -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none -ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none" -if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then - ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags" -fi -for ax_openmp_flag in $ax_openmp_flags; do - case $ax_openmp_flag in - none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;; - *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;; - esac - AC_TRY_LINK_FUNC(omp_set_num_threads, - [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break]) -done -[]_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS -]) -if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then - m4_default([$2],:) -else - if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" != "xnone"; then - OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ax_cv_[]_AC_LANG_ABBREV[]_openmp - fi - m4_default([$1], [AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])]) -fi -])dnl AX_OPENMP diff --git a/m4/.svn/text-base/programs.m4.svn-base b/m4/.svn/text-base/programs.m4.svn-base deleted file mode 100644 index 8e0e6a9d79f90bc66a930f042c526f39e73f5223..0000000000000000000000000000000000000000 --- a/m4/.svn/text-base/programs.m4.svn-base +++ /dev/null @@ -1,923 +0,0 @@ -# This file is part of Autoconf. -*- Autoconf -*- -# Checking for programs. - -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - -# As a special exception, the Free Software Foundation gives unlimited -# permission to copy, distribute and modify the configure scripts that -# are the output of Autoconf. You need not follow the terms of the GNU -# General Public License when using or distributing such scripts, even -# though portions of the text of Autoconf appear in them. The GNU -# General Public License (GPL) does govern all other use of the material -# that constitutes the Autoconf program. -# -# Certain portions of the Autoconf source text are designed to be copied -# (in certain cases, depending on the input) into the output of -# Autoconf. We call these the "data" portions. The rest of the Autoconf -# source text consists of comments plus executable code that decides which -# of the data portions to output in any given case. We call these -# comments and executable code the "non-data" portions. Autoconf never -# copies any of the non-data portions into its output. -# -# This special exception to the GPL applies to versions of Autoconf -# released by the Free Software Foundation. When you make and -# distribute a modified version of Autoconf, you may extend this special -# exception to the GPL to apply to your modified version as well, *unless* -# your modified version has the potential to copy into its output some -# of the text that was the non-data portion of the version that you started -# with. (In other words, unless your change moves or copies text from -# the non-data portions to the data portions.) If your modification has -# such potential, you must delete any notice of this special exception -# to the GPL from your modified version. -# -# Written by David MacKenzie, with help from -# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, -# Roland McGrath, Noah Friedman, david d zuhn, and many others. - - -## ----------------------------- ## -## Generic checks for programs. ## -## ----------------------------- ## - - -# _AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, -# [VALUE-IF-FOUND], [VALUE-IF-NOT-FOUND], -# [PATH], [REJECT]) -# ----------------------------------------------------- -AC_DEFUN([_AC_CHECK_PROG], -[# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=$[2] -AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL(ac_cv_prog_$1, -[if test -n "$$1"; then - ac_cv_prog_$1="$$1" # Let the user override the test. -else -m4_ifvaln([$6], -[ ac_prog_rejected=no])dnl -_AS_PATH_WALK([$5], -[for ac_exec_ext in '' $ac_executable_extensions; do - if AS_EXECUTABLE_P(["$as_dir/$ac_word$ac_exec_ext"]); then -m4_ifvaln([$6], -[ if test "$as_dir/$ac_word$ac_exec_ext" = "$6"; then - ac_prog_rejected=yes - continue - fi])dnl - ac_cv_prog_$1="$3" -# _AS_ECHO_LOG([found $as_dir/$ac_word$ac_exec_ext]) - break 2 - fi -done]) -m4_ifvaln([$6], -[if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_$1 - shift - if test $[@%:@] != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set $1 to just the basename; use the full file name. - shift - ac_cv_prog_$1="$as_dir/$ac_word${1+' '}$[@]" -m4_if([$2], [$4], -[ else - # Default is a loser. - AC_MSG_ERROR([$1=$6 unacceptable, but no other $4 found in dnl -m4_default([$5], [\$PATH])]) -])dnl - fi -fi])dnl -dnl If no 4th arg is given, leave the cache variable unset, -dnl so AC_CHECK_PROGS will keep looking. -m4_ifvaln([$4], -[ test -z "$ac_cv_prog_$1" && ac_cv_prog_$1="$4"])dnl -fi])dnl -$1=$ac_cv_prog_$1 -if test -n "$$1"; then - AC_MSG_RESULT([$$1]) -else - AC_MSG_RESULT([no]) -fi -])# _AC_CHECK_PROG - - -# AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, -# [VALUE-IF-FOUND], [VALUE-IF-NOT-FOUND], -# [PATH], [REJECT]) -# ----------------------------------------------------- -AC_DEFUN([AC_CHECK_PROG], -[_AC_CHECK_PROG($@) -AC_SUBST([$1])dnl -]) - - -# AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], -# [PATH]) -# ------------------------------------------------------------------ -AC_DEFUN([AC_CHECK_PROGS], -[for ac_prog in $2 -do - AC_CHECK_PROG([$1], [$ac_prog], [$ac_prog], , [$4]) - test -n "$$1" && break -done -m4_ifvaln([$3], [test -n "$$1" || $1="$3"])]) - - -# _AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH]) -# ------------------------------------------------------------------------ -AC_DEFUN([_AC_PATH_PROG], -[# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=$[2] -AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL([ac_cv_path_$1], -[case $$1 in - [[\\/]]* | ?:[[\\/]]*) - ac_cv_path_$1="$$1" # Let the user override the test with a path. - ;; - *) - _AS_PATH_WALK([$4], -[for ac_exec_ext in '' $ac_executable_extensions; do - if AS_EXECUTABLE_P(["$as_dir/$ac_word$ac_exec_ext"]); then - ac_cv_path_$1="$as_dir/$ac_word$ac_exec_ext" -# _AS_ECHO_LOG([found $as_dir/$ac_word$ac_exec_ext]) - break 2 - fi -done]) -dnl If no 3rd arg is given, leave the cache variable unset, -dnl so AC_PATH_PROGS will keep looking. -m4_ifvaln([$3], -[ test -z "$ac_cv_path_$1" && ac_cv_path_$1="$3"])dnl - ;; -esac])dnl -$1=$ac_cv_path_$1 -if test -n "$$1"; then - AC_MSG_RESULT([$$1]) -else - AC_MSG_RESULT([no]) -fi -])# _AC_PATH_PROG - - -# AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH]) -# ----------------------------------------------------------------------- -AC_DEFUN([AC_PATH_PROG], -[_AC_PATH_PROG($@) -AC_SUBST([$1])dnl -]) - - -# AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], -# [PATH]) -# ----------------------------------------------------------------- -AC_DEFUN([AC_PATH_PROGS], -[for ac_prog in $2 -do - AC_PATH_PROG([$1], [$ac_prog], , [$4]) - test -n "$$1" && break -done -m4_ifvaln([$3], [test -n "$$1" || $1="$3"])dnl -]) - - - - -## -------------------------- ## -## Generic checks for tools. ## -## -------------------------- ## - - -# AC_CHECK_TOOL_PREFIX -# -------------------- -AU_DEFUN([AC_CHECK_TOOL_PREFIX]) - - -# _AC_TOOL_WARN -# ------------- -AC_DEFUN([_AC_TOOL_WARN], -[case $cross_compiling:$ac_tool_warned in -yes:) -AC_MSG_WARN([using cross tools not prefixed with host triplet]) -ac_tool_warned=yes ;; -esac]) - -# AC_PATH_TOOL(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH]) -# ----------------------------------------------------------------------- -# (Use different variables $1 and ac_pt_$1 so that cache vars don't conflict.) -AC_DEFUN([AC_PATH_TOOL], -[if test -n "$ac_tool_prefix"; then - AC_PATH_PROG([$1], [${ac_tool_prefix}$2], , [$4]) -fi -if test -z "$ac_cv_path_$1"; then - ac_pt_$1=$$1 - _AC_PATH_PROG([ac_pt_$1], [$2], [], [$4]) - if test "x$ac_pt_$1" = x; then - $1="$3" - else - _AC_TOOL_WARN - $1=$ac_pt_$1 - fi -else - $1="$ac_cv_path_$1" -fi -])# AC_PATH_TOOL - - -# AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH]) -# ------------------------------------------------------------------------ -# (Use different variables $1 and ac_ct_$1 so that cache vars don't conflict.) -AC_DEFUN([AC_CHECK_TOOL], -[if test -n "$ac_tool_prefix"; then - AC_CHECK_PROG([$1], [${ac_tool_prefix}$2], [${ac_tool_prefix}$2], , [$4]) -fi -if test -z "$ac_cv_prog_$1"; then - ac_ct_$1=$$1 - _AC_CHECK_PROG([ac_ct_$1], [$2], [$2], [], [$4]) - if test "x$ac_ct_$1" = x; then - $1="$3" - else - _AC_TOOL_WARN - $1=$ac_ct_$1 - fi -else - $1="$ac_cv_prog_$1" -fi -])# AC_CHECK_TOOL - - -# AC_CHECK_TOOLS(VARIABLE, PROGS-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], -# [PATH]) -# ------------------------------------------------------------------ -# Check for each tool in PROGS-TO-CHECK-FOR with the cross prefix. If -# none can be found with a cross prefix, then use the first one that -# was found without the cross prefix. -AC_DEFUN([AC_CHECK_TOOLS], -[if test -n "$ac_tool_prefix"; then - for ac_prog in $2 - do - AC_CHECK_PROG([$1], - [$ac_tool_prefix$ac_prog], [$ac_tool_prefix$ac_prog],, - [$4]) - test -n "$$1" && break - done -fi -if test -z "$$1"; then - ac_ct_$1=$$1 - AC_CHECK_PROGS([ac_ct_$1], [$2], [], [$4]) - if test "x$ac_ct_$1" = x; then - $1="$3" - else - _AC_TOOL_WARN - $1=$ac_ct_$1 - fi -fi -])# AC_CHECK_TOOLS - - -# AC_PATH_TARGET_TOOL(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH]) -# ------------------------------------------------------------------------------ -# (Use different variables $1 and ac_pt_$1 so that cache vars don't conflict.) -AC_DEFUN([AC_PATH_TARGET_TOOL], -[AC_REQUIRE([AC_CANONICAL_TARGET])dnl -AC_PATH_PROG([$1], [$target_alias-$2], , [$4]) -if test -z "$ac_cv_path_$1"; then - if test "$build" = "$target"; then - ac_pt_$1=$$1 - _AC_PATH_PROG([ac_pt_$1], [$2], [$3], [$4]) - $1=$ac_pt_$1 - else - $1="$3" - fi -else - $1="$ac_cv_path_$1" -fi -])# AC_PATH_TARGET_TOOL - - -# AC_CHECK_TARGET_TOOL(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH]) -# ------------------------------------------------------------------------------- -# (Use different variables $1 and ac_ct_$1 so that cache vars don't conflict.) -AC_DEFUN([AC_CHECK_TARGET_TOOL], -[AC_REQUIRE([AC_CANONICAL_TARGET])dnl -AC_CHECK_PROG([$1], [$target_alias-$2], [$target_alias-$2], , [$4]) -if test -z "$ac_cv_prog_$1"; then - if test "$build" = "$target"; then - ac_ct_$1=$$1 - _AC_CHECK_PROG([ac_ct_$1], [$2], [$2], [$3], [$4]) - $1=$ac_ct_$1 - else - $1="$3" - fi -else - $1="$ac_cv_prog_$1" -fi -])# AC_CHECK_TARGET_TOOL - - -# AC_CHECK_TARGET_TOOLS(VARIABLE, PROGS-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], -# [PATH]) -# ------------------------------------------------------------------------- -# Check for each tool in PROGS-TO-CHECK-FOR with the cross prefix. If -# none can be found with a cross prefix, then use the first one that -# was found without the cross prefix. -AC_DEFUN([AC_CHECK_TARGET_TOOLS], -[AC_REQUIRE([AC_CANONICAL_TARGET])dnl -for ac_prog in $2 -do - AC_CHECK_PROG([$1], - [$target_alias-$ac_prog], [$target_alias-$ac_prog],, - [$4]) - test -n "$$1" && break -done -if test -z "$$1"; then - if test "$build" = "$target"; then - ac_ct_$1=$$1 - AC_CHECK_PROGS([ac_ct_$1], [$2], [$3], [$4]) - $1=$ac_ct_$1 - else - $1="$3" - fi -fi -])# AC_CHECK_TARGET_TOOLS - - - -## ---------------- ## -## Specific tests. ## -## ---------------- ## - -# Please, keep this section sorted. -# (But of course when keeping related things together). - -# Check for gawk first since it's generally better. -AN_MAKEVAR([AWK], [AC_PROG_AWK]) -AN_PROGRAM([awk], [AC_PROG_AWK]) -AN_PROGRAM([gawk], [AC_PROG_AWK]) -AN_PROGRAM([mawk], [AC_PROG_AWK]) -AN_PROGRAM([nawk], [AC_PROG_AWK]) -AC_DEFUN([AC_PROG_AWK], -[AC_CHECK_PROGS(AWK, gawk mawk nawk awk, )]) - - -# AC_PROG_EGREP -# ------------- -AC_DEFUN([AC_PROG_EGREP], -[AC_REQUIRE([AC_PROG_GREP])dnl -AC_CACHE_CHECK([for egrep], ac_cv_path_EGREP, - [if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - _AC_PROG_GREP(EGREP, egrep, ['EGREP$']) - fi]) - EGREP="$ac_cv_path_EGREP" - AC_SUBST([EGREP]) -])# AC_PROG_EGREP - - -# AC_PROG_FGREP -# ------------- -AC_DEFUN([AC_PROG_FGREP], -[AC_REQUIRE([AC_PROG_GREP])dnl -AC_CACHE_CHECK([for fgrep], ac_cv_path_FGREP, - [if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - _AC_PROG_GREP(FGREP, fgrep, [FGREP]) - fi]) - FGREP="$ac_cv_path_FGREP" - AC_SUBST([FGREP]) -])# AC_PROG_FGREP - - -# AC_PROG_GREP -# ------------ -# Check for a fully functional grep program that handles -# the longest lines possible and which respects multiple -e options. -# Prefer GNU grep if found. -AC_DEFUN([AC_PROG_GREP], -[AC_CACHE_CHECK([for grep that handles long lines and -e], ac_cv_path_GREP, - [_$0(GREP, [grep ggrep], [-e 'GREP$' -e '-(cannot match)-'])]) - GREP="$ac_cv_path_GREP" - AC_SUBST([GREP]) -]) - - -# _AC_PROG_GREP(VARIABLE, PROGNAME-LIST, PROG-ARGUMENTS) -# ------------------------------------------------------ -# Solaris 9 /usr/xpg4/bin/*grep is suitable, but /usr/bin/*grep lacks -e. -# AIX silently truncates long lines before matching. -# NeXT understands only one -e and truncates long lines. -m4_define([_AC_PROG_GREP], -[_AC_PATH_PROGS_FEATURE_CHECK([$1], [$2], - [_AC_FEATURE_CHECK_LENGTH([ac_path_$1], [ac_cv_path_$1], - ["$ac_path_$1" $3], [$1])], [], - [$PATH$PATH_SEPARATOR/usr/xpg4/bin])dnl -]) - - -# _AC_PATH_PROGS_FEATURE_CHECK(VARIABLE, PROGNAME-LIST, FEATURE-TEST, -# [ACTION-IF-NOT-FOUND], [PATH=$PATH]) -# ------------------------------------------------------------------- -# FEATURE-TEST is called repeatedly with $ac_path_VARIABLE set to the -# name of a program in PROGNAME-LIST found in PATH. FEATURE-TEST must set -# $ac_cv_path_VARIABLE to the path of an acceptable program, or else -# ACTION-IF-NOT-FOUND is executed; the default action (for internal use -# only) issues a fatal error message. If a suitable $ac_path_VARIABLE is -# found in the FEATURE-TEST macro, it can set $ac_path_VARIABLE_found=':' -# to accept that value without any further checks. -m4_define([_AC_PATH_PROGS_FEATURE_CHECK], -[if test -z "$$1"; then - ac_path_$1_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - _AS_PATH_WALK([$5], - [for ac_prog in $2; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_$1="$as_dir/$ac_prog$ac_exec_ext" - AS_EXECUTABLE_P(["$ac_path_$1"]) || continue -$3 - $ac_path_$1_found && break 3 - done - done])dnl - if test -z "$ac_cv_path_$1"; then - m4_default([$4], - [AC_MSG_ERROR([no acceptable m4_bpatsubst([$2], [ .*]) could be dnl -found in m4_default([$5], [\$PATH])])]) - fi -else - ac_cv_path_$1=$$1 -fi -]) - - -# AC_PATH_PROGS_FEATURE_CHECK(VARIABLE, PROGNAME-LIST, -# FEATURE-TEST, [ACTION-IF-NOT-FOUND=:], -# [PATH=$PATH]) -# ---------------------------------------------------------------- -# Designed to be used inside AC_CACHE_VAL. It is recommended, -# but not required, that the user also use AC_ARG_VAR([VARIABLE]). -# If VARIABLE is not empty, set the cache variable -# $ac_cv_path_VARIABLE to VARIABLE without any further tests. -# Otherwise, call FEATURE_TEST repeatedly with $ac_path_VARIABLE -# set to the name of a program in PROGNAME-LIST found in PATH. If -# no invocation of FEATURE-TEST sets $ac_cv_path_VARIABLE to the -# path of an acceptable program, ACTION-IF-NOT-FOUND is executed. -# FEATURE-TEST is invoked even when $ac_cv_path_VARIABLE is set, -# in case a better candidate occurs later in PATH; to accept the -# current setting and bypass further checks, FEATURE-TEST can set -# $ac_path_VARIABLE_found=':'. Note that, unlike AC_CHECK_PROGS, -# this macro does not have any side effect on the current value -# of VARIABLE. -m4_define([AC_PATH_PROGS_FEATURE_CHECK], -[_$0([$1], [$2], [$3], m4_default([$4], [:]), [$5])dnl -]) - - -# _AC_FEATURE_CHECK_LENGTH(PROGPATH, CACHE-VAR, CHECK-CMD, [MATCH-STRING]) -# ------------------------------------------------------------------------ -# For use as the FEATURE-TEST argument to _AC_PATH_PROGS_FEATURE_TEST. -# On each iteration run CHECK-CMD on an input file, storing the value -# of PROGPATH in CACHE-VAR if the CHECK-CMD succeeds. The input file -# is always one line, starting with only 10 characters, and doubling -# in length at each iteration until approx 10000 characters or the -# feature check succeeds. The feature check is called at each -# iteration by appending (optionally, MATCH-STRING and) a newline -# to the file, and using the result as input to CHECK-CMD. -m4_define([_AC_FEATURE_CHECK_LENGTH], -[# Check for GNU $1 and select it if it is found. - _AC_PATH_PROG_FLAVOR_GNU([$$1], - [$2="$$1" $1_found=:], - [ac_count=0 -# AS_ECHO_N([0123456789]) >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" -# AS_ECHO(['$4']) >> "conftest.nl" - $3 < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${$1_max-0}; then - # Best one so far, save it but keep looking for a better one - $2="$$1" -dnl # Using $1_max so that each tool feature checked gets its -dnl # own variable. Don't reset it otherwise the implied search -dnl # for best performing tool in a list breaks down. - $1_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out])dnl -]) - - -# _AC_PATH_PROG_FLAVOR_GNU(PROGRAM-PATH, IF-SUCCESS, [IF-FAILURE]) -# ---------------------------------------------------------------- -m4_define([_AC_PATH_PROG_FLAVOR_GNU], -[# Check for GNU $1 -case `"$1" --version 2>&1` in -*GNU*) - $2;; -m4_ifval([$3], -[*) - $3;; -])esac -])# _AC_PATH_PROG_FLAVOR_GNU - - -# AC_PROG_INSTALL -# --------------- -AN_MAKEVAR([INSTALL], [AC_PROG_INSTALL]) -AN_PROGRAM([install], [AC_PROG_INSTALL]) -AC_DEFUN([AC_PROG_INSTALL], -[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -AC_REQUIRE_AUX_FILE([install-sh])dnl -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -AC_MSG_CHECKING([for a BSD-compatible install]) -if test -z "$INSTALL"; then -AC_CACHE_VAL(ac_cv_path_install, -[_AS_PATH_WALK([$PATH], -[# Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]); then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac -]) -rm -rf conftest.one conftest.two conftest.dir -])dnl - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -dnl Do special magic for INSTALL instead of AC_SUBST, to get -dnl relative names right. -AC_MSG_RESULT([$INSTALL]) - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -AC_SUBST(INSTALL_PROGRAM)dnl - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' -AC_SUBST(INSTALL_SCRIPT)dnl - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -AC_SUBST(INSTALL_DATA)dnl -])# AC_PROG_INSTALL - - -# AC_PROG_MKDIR_P -# --------------- -# Check whether `mkdir -p' is known to be thread-safe, and fall back to -# install-sh -d otherwise. -# -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are vulnerable to race conditions: -# if a parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to known race-free implementations. -# -# Automake used to define mkdir_p as `mkdir -p .', in order to -# allow $(mkdir_p) to be used without argument. As in -# $(mkdir_p) $(somedir) -# where $(somedir) is conditionally defined. However we don't do -# that for MKDIR_P. -# 1. before we restricted the check to GNU mkdir, `mkdir -p .' was -# reported to fail in read-only directories. The system where this -# happened has been forgotten. -# 2. in practice we call $(MKDIR_P) on directories such as -# $(MKDIR_P) "$(DESTDIR)$(somedir)" -# and we don't want to create $(DESTDIR) if $(somedir) is empty. -# To support the latter case, we have to write -# test -z "$(somedir)" || $(MKDIR_P) "$(DESTDIR)$(somedir)" -# so $(MKDIR_P) always has an argument. -# We will have better chances of detecting a missing test if -# $(MKDIR_P) complains about missing arguments. -# 3. $(MKDIR_P) is named after `mkdir -p' and we don't expect this -# to accept no argument. -# 4. having something like `mkdir .' in the output is unsightly. -# -# On NextStep and OpenStep, the `mkdir' command does not -# recognize any option. It will interpret all options as -# directories to create. -AN_MAKEVAR([MKDIR_P], [AC_PROG_MKDIR_P]) -AC_DEFUN([AC_PROG_MKDIR_P], -[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -AC_REQUIRE_AUX_FILE([install-sh])dnl -AC_MSG_CHECKING([for a thread-safe mkdir -p]) -if test -z "$MKDIR_P"; then - AC_CACHE_VAL([ac_cv_path_mkdir], - [_AS_PATH_WALK([$PATH$PATH_SEPARATOR/opt/sfw/bin], - [for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]) || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done])]) - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" - fi -fi -dnl status.m4 does special magic for MKDIR_P instead of AC_SUBST, -dnl to get relative names right. However, also AC_SUBST here so -dnl that Automake versions before 1.10 will pick it up (they do not -dnl trace AC_SUBST_TRACE). -dnl FIXME: Remove this once we drop support for Automake < 1.10. -AC_SUBST([MKDIR_P])dnl -AC_MSG_RESULT([$MKDIR_P]) -])# AC_PROG_MKDIR_P - - -# AC_PROG_LEX -# ----------- -# Look for flex or lex. Set its associated library to LEXLIB. -# Check if lex declares yytext as a char * by default, not a char[]. -AN_MAKEVAR([LEX], [AC_PROG_LEX]) -AN_PROGRAM([lex], [AC_PROG_LEX]) -AN_PROGRAM([flex], [AC_PROG_LEX]) -AC_DEFUN_ONCE([AC_PROG_LEX], -[AC_CHECK_PROGS(LEX, flex lex, :) -if test "x$LEX" != "x:"; then - _AC_PROG_LEX_YYTEXT_DECL -fi]) - - -# _AC_PROG_LEX_YYTEXT_DECL -# ------------------------ -# Check for the Lex output root, the Lex library, and whether Lex -# declares yytext as a char * by default. -m4_define([_AC_PROG_LEX_YYTEXT_DECL], -[cat >conftest.l <<_ACEOF[ -%% -a { ECHO; } -b { REJECT; } -c { yymore (); } -d { yyless (1); } -e { yyless (input () != 0); } -f { unput (yytext[0]); } -. { BEGIN INITIAL; } -%% -#ifdef YYTEXT_POINTER -extern char *yytext; -#endif -int -main (void) -{ - return ! yylex () + ! yywrap (); -} -]_ACEOF -_AC_DO_VAR(LEX conftest.l) -AC_CACHE_CHECK([lex output file root], [ac_cv_prog_lex_root], [ -if test -f lex.yy.c; then - ac_cv_prog_lex_root=lex.yy -elif test -f lexyy.c; then - ac_cv_prog_lex_root=lexyy -else - AC_MSG_ERROR([cannot find output from $LEX; giving up]) -fi]) -AC_SUBST([LEX_OUTPUT_ROOT], [$ac_cv_prog_lex_root])dnl - -if test -z "${LEXLIB+set}"; then - AC_CACHE_CHECK([lex library], [ac_cv_lib_lex], [ - ac_save_LIBS=$LIBS - ac_cv_lib_lex='none needed' - for ac_lib in '' -lfl -ll; do - LIBS="$ac_lib $ac_save_LIBS" - AC_LINK_IFELSE([`cat $LEX_OUTPUT_ROOT.c`], [ac_cv_lib_lex=$ac_lib]) - test "$ac_cv_lib_lex" != 'none needed' && break - done - LIBS=$ac_save_LIBS - ]) - test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex -fi -AC_SUBST(LEXLIB) - -AC_CACHE_CHECK(whether yytext is a pointer, ac_cv_prog_lex_yytext_pointer, -[# POSIX says lex can declare yytext either as a pointer or an array; the -# default is implementation-dependent. Figure out which it is, since -# not all implementations provide the %pointer and %array declarations. -ac_cv_prog_lex_yytext_pointer=no -ac_save_LIBS=$LIBS -LIBS="$LEXLIB $ac_save_LIBS" -AC_LINK_IFELSE( - [#define YYTEXT_POINTER 1 -`cat $LEX_OUTPUT_ROOT.c`], - [ac_cv_prog_lex_yytext_pointer=yes]) -LIBS=$ac_save_LIBS -]) -dnl -if test $ac_cv_prog_lex_yytext_pointer = yes; then - AC_DEFINE(YYTEXT_POINTER, 1, - [Define to 1 if `lex' declares `yytext' as a `char *' by default, - not a `char[]'.]) -fi -rm -f conftest.l $LEX_OUTPUT_ROOT.c -])# _AC_PROG_LEX_YYTEXT_DECL - - -# Require AC_PROG_LEX in case some people were just calling this macro. -AU_DEFUN([AC_DECL_YYTEXT], [AC_PROG_LEX]) - - -# AC_PROG_LN_S -# ------------ -AN_MAKEVAR([LN], [AC_PROG_LN_S]) -AN_PROGRAM([ln], [AC_PROG_LN_S]) -AC_DEFUN([AC_PROG_LN_S], -[AC_MSG_CHECKING([whether ln -s works]) -AC_SUBST([LN_S], [$as_ln_s])dnl -if test "$LN_S" = "ln -s"; then - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no, using $LN_S]) -fi -])# AC_PROG_LN_S - - -# AC_PROG_MAKE_SET -# ---------------- -# Define SET_MAKE to set ${MAKE} if Make does not do so automatically. If Make -# does not run the test Makefile, we assume that the Make program the user will -# invoke does set $(MAKE). This is typical, and emitting `MAKE=foomake' is -# always wrong if `foomake' is not available or does not work. -AN_MAKEVAR([MAKE], [AC_PROG_MAKE_SET]) -AN_PROGRAM([make], [AC_PROG_MAKE_SET]) -AC_DEFUN([AC_PROG_MAKE_SET], -[AC_MSG_CHECKING([whether ${MAKE-make} sets \$(MAKE)]) -set x ${MAKE-make} -ac_make=`AS_ECHO(["$[2]"]) | sed 's/+/p/g; s/[[^a-zA-Z0-9_]]/_/g'` -AC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set, -[cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make])dnl -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - AC_MSG_RESULT([yes]) - SET_MAKE= -else - AC_MSG_RESULT([no]) - SET_MAKE="MAKE=${MAKE-make}" -fi -AC_SUBST([SET_MAKE])dnl -])# AC_PROG_MAKE_SET - - -# AC_PROG_RANLIB -# -------------- -AN_MAKEVAR([RANLIB], [AC_PROG_RANLIB]) -AN_PROGRAM([ranlib], [AC_PROG_RANLIB]) -AC_DEFUN([AC_PROG_RANLIB], -[AC_CHECK_TOOL(RANLIB, ranlib, :)]) - - -# AC_RSH -# ------ -# I don't know what it used to do, but it no longer does. -AU_DEFUN([AC_RSH], [], -[$0 is no longer supported. Remove this warning when you -adjust the code.]) - - -# AC_PROG_SED -# ----------- -# Check for a fully functional sed program that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([AC_PROG_SED], -[AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED, - [dnl ac_script should not contain more than 99 commands (for HP-UX sed), - dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed. - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - $as_unset ac_script || ac_script= - _AC_PATH_PROGS_FEATURE_CHECK(SED, [sed gsed], - [_AC_FEATURE_CHECK_LENGTH([ac_path_SED], [ac_cv_path_SED], - ["$ac_path_SED" -f conftest.sed])])]) - SED="$ac_cv_path_SED" - AC_SUBST([SED])dnl - rm -f conftest.sed -])# AC_PROG_SED - - -# AC_PROG_YACC -# ------------ -AN_MAKEVAR([BISON], [AC_PROG_YACC]) -AN_MAKEVAR([YACC], [AC_PROG_YACC]) -AN_MAKEVAR([YFLAGS], [AC_PROG_YACC]) -AN_PROGRAM([yacc], [AC_PROG_YACC]) -AN_PROGRAM([byacc], [AC_PROG_YACC]) -AN_PROGRAM([bison], [AC_PROG_YACC]) -AC_DEFUN([AC_PROG_YACC], -[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)dnl -AC_ARG_VAR(YACC, -[The `Yet Another C Compiler' implementation to use. Defaults to the first -program found out of: `bison -y', `byacc', `yacc'.])dnl -AC_ARG_VAR(YFLAGS, -[The list of arguments that will be passed by default to $YACC. This script -will default YFLAGS to the empty string to avoid a default value of `-d' given -by some make applications.])]) diff --git a/openfpm_data b/openfpm_data index 778bdb9c9b59b81b193152c7284687a98afb7503..2e36a553e379e6712b62abeffce479b005774c91 160000 --- a/openfpm_data +++ b/openfpm_data @@ -1 +1 @@ -Subproject commit 778bdb9c9b59b81b193152c7284687a98afb7503 +Subproject commit 2e36a553e379e6712b62abeffce479b005774c91 diff --git a/openfpm_io b/openfpm_io index df3448039f9197b2df3d0415b218142b08e223fa..935c25aaa275530ef1dafb86b7a9074e649a1d1f 160000 --- a/openfpm_io +++ b/openfpm_io @@ -1 +1 @@ -Subproject commit df3448039f9197b2df3d0415b218142b08e223fa +Subproject commit 935c25aaa275530ef1dafb86b7a9074e649a1d1f diff --git a/openfpm_numerics b/openfpm_numerics index b4d8373acf148fcfb868fc3edff3eb2aed78c881..0c51112a6a0808e7209329de9d4639c1e440a815 160000 --- a/openfpm_numerics +++ b/openfpm_numerics @@ -1 +1 @@ -Subproject commit b4d8373acf148fcfb868fc3edff3eb2aed78c881 +Subproject commit 0c51112a6a0808e7209329de9d4639c1e440a815 diff --git a/openfpm_vcluster b/openfpm_vcluster index 3e846786367e20cf01e7658af9c1ec4c277c6ce3..b07008bc675acf5718d8b9f396a274af8e9621c1 160000 --- a/openfpm_vcluster +++ b/openfpm_vcluster @@ -1 +1 @@ -Subproject commit 3e846786367e20cf01e7658af9c1ec4c277c6ce3 +Subproject commit b07008bc675acf5718d8b9f396a274af8e9621c1 diff --git a/src/Decomposition/BasicDecomposition.hpp b/src/Decomposition/BasicDecomposition.hpp old mode 100644 new mode 100755 index 462751f210122ac6137c6e0d5af2a9663ddd8149..0a7020636ea9e6428a74843752a46f1c34675ab5 --- a/src/Decomposition/BasicDecomposition.hpp +++ b/src/Decomposition/BasicDecomposition.hpp @@ -82,8 +82,10 @@ * */ -template<unsigned int dim, typename T, typename Memory = HeapMemory, template<unsigned int, typename > class Domain = Box> -class BasicDecomposition: public ie_loc_ghost<dim, T>, public nn_prcs<dim, T>, public ie_ghost<dim, T> { +template<unsigned int dim, typename T, typename Memory = HeapMemory, + template<unsigned int, typename > class Domain = Box> +class BasicDecomposition: public ie_loc_ghost<dim, T>, public nn_prcs<dim, T>, public ie_ghost<dim, T> +{ public: @@ -131,37 +133,59 @@ private: //! Convert the graph to parmetis format Parmetis<Graph_CSR<nm_v, nm_e>> parmetis_graph; - + //! Processor sub-sub-domain graph Graph_CSR<nm_v, nm_e> sub_g; - + //! Global sub-sub-domain graph Graph_CSR<nm_v, nm_e> gp; - + //! Init vtxdist needed for Parmetis openfpm::vector<idx_t> vtxdist; //! partitions openfpm::vector<openfpm::vector<idx_t>> partitions; - + //! Init data structure to keep trace of new vertices distribution in processors (needed to update main graph) openfpm::vector<openfpm::vector<size_t>> v_per_proc; - - static void * message_receive(size_t msg_i ,size_t total_msg, size_t total_p, size_t i, size_t ri, void * ptr) + + //! Number of moved vertices in all iterations + size_t g_moved = 0; + + //! Max number of moved vertices in all iterations + size_t m_moved = 0; + + //! Wn for SAR heuristic + float w_n = 0; + + //! Computation cost for SAR heuristic + float c_c = 5; + + //! Number of time-steps since the previous DLB + size_t n_ts = 1; + + //! Idle time accumulated so far, needed for SAR heuristic + openfpm::vector<float> i_times; + + // Vector to collect all timings + openfpm::vector<long> times; + + static void * message_receive(size_t msg_i, size_t total_msg, size_t total_p, size_t i, size_t ri, void * ptr) { - openfpm::vector<openfpm::vector<idx_t>> * v = static_cast<openfpm::vector<openfpm::vector<idx_t>> *>(ptr); + openfpm::vector < openfpm::vector < idx_t >> *v = static_cast<openfpm::vector<openfpm::vector<idx_t>> *>(ptr); + + v->get(i).resize(msg_i / sizeof(idx_t)); - v->get(i).resize(msg_i/sizeof(idx_t)); - return &(v->get(i).get(0)); } - + /*! \brief Constructor, it decompose and distribute the sub-domains across the processors * * \param v_cl Virtual cluster, used internally for communications * */ - void CreateDecomposition(Vcluster & v_cl) { + void CreateDecomposition(Vcluster & v_cl) + { #ifdef SE_CLASS1 if (&v_cl == NULL) { @@ -174,7 +198,8 @@ private: // Get the box containing the domain SpaceBox<dim, T> bs = domain.getBox(); - for (unsigned int i = 0; i < dim; i++) { + for (unsigned int i = 0; i < dim; i++) + { // Calculate the spacing spacing[i] = (bs.getHigh(i) - bs.getLow(i)) / gr.size(i); } @@ -182,29 +207,16 @@ private: //! Get the processor id size_t p_id = v_cl.getProcessUnitID(); - // Here we use PARMETIS - // Create a cartesian grid graph - CartesianGraphFactory<dim, Graph_CSR<nm_v, nm_e>> g_factory_part; - - // Processor graph - gp = g_factory_part.template construct<NO_EDGE, nm_v::id, T, dim - 1, 0, 1, 2>(gr.getSize(), domain); - - //! Add computation information to each vertex (shape can change) - addWeights(gp, HYPERBOLOID); - - //! Init ids vector - gp.init_map_ids(); - - // Get the number of processing units + //! Get the number of processing units size_t Np = v_cl.getProcessingUnits(); - // Division of vertices in Np graphs - // Put (div+1) vertices in mod graphs - // Put div vertices in the rest of the graphs + //! Division of vertices in Np graphs + //! Put (div+1) vertices in mod graphs + //! Put div vertices in the rest of the graphs size_t mod_v = gp.getNVertex() % Np; size_t div_v = gp.getNVertex() / Np; - for (int i = 0; i <= Np; i++) + for (int i = 0; i <= Np; i++) { if (i < mod_v) vtxdist.get(i) = (div_v + 1) * (i); @@ -212,80 +224,46 @@ private: vtxdist.get(i) = (div_v) * (i) + mod_v; } - // Just for output purpose - if (p_id == 0) { - VTKWriter<Graph_CSR<nm_v, nm_e>, GRAPH> gv2(gp); - gv2.write("test_graph_0.vtk"); - } - //TODO transform in factory - //! Put vertices into processor graph (different for each processor) - fillSubGraph(sub_g, gp, vtxdist, p_id, Np); + fillSubGraph(); parmetis_graph.initSubGraph(sub_g); - - // Decompose - parmetis_graph.decompose<nm_v::proc_id>(vtxdist,sub_g); - // Get result partition for this processors + //! Decompose + parmetis_graph.decompose<nm_v::proc_id>(vtxdist, sub_g); + + //! Get result partition for this processors idx_t *partition = parmetis_graph.getPartition(); - // Prepare vector of arrays to contain all partitions - + //! Prepare vector of arrays to contain all partitions partitions.get(p_id).resize(sub_g.getNVertex()); - std::copy(partition,partition+sub_g.getNVertex(),&partitions.get(p_id).get(0)); - - openfpm::vector<size_t> prc; - openfpm::vector<size_t> sz; + std::copy(partition, partition + sub_g.getNVertex(), &partitions.get(p_id).get(0)); + + openfpm::vector < size_t > prc; + openfpm::vector < size_t > sz; openfpm::vector<void *> ptr; - - for (size_t i = 0 ; i < Np ; i++) + + for (size_t i = 0; i < Np; i++) { if (i != v_cl.getProcessUnitID()) { - prc.add(i); - sz.add(sub_g.getNVertex() * sizeof(idx_t)); - ptr.add(partitions.get(p_id).getPointer()); + prc.add(i); + sz.add(sub_g.getNVertex() * sizeof(idx_t)); + ptr.add(partitions.get(p_id).getPointer()); } } - - v_cl.sendrecvMultipleMessagesNBX(prc.size(),&sz.get(0),&prc.get(0),&ptr.get(0),message_receive,&partitions,NONE); - - // Update graphs with the new distributions - updateGraphs(partitions, gp, sub_g, v_per_proc, vtxdist, p_id, Np); - - if (p_id == 0) { - VTKWriter<Graph_CSR<nm_v, nm_e>, GRAPH> gv2(gp); - gv2.write("test_graph_2.vtk"); - } - // Renumbering subgraph - sub_g.reset_map_ids(); - for (size_t j = vtxdist.get(p_id), i = 0; j < vtxdist.get(p_id + 1); j++, i++) { - sub_g.set_map_ids(j, sub_g.vertex(i).template get<nm_v::id>()); - sub_g.vertex(i).template get<nm_v::id>() = j; - } + v_cl.sendrecvMultipleMessagesNBX(prc.size(), &sz.get(0), &prc.get(0), &ptr.get(0), message_receive, &partitions, + NONE); - gp.reset_map_ids(); - // Renumbering main graph - for (size_t p = 0; p < Np; p++) - { - for (size_t j = vtxdist.get(p), i = 0; j < vtxdist.get(p + 1); j++, i++) - { - gp.set_map_ids(j, gp.vertex(v_per_proc.get(p).get(i)).template get<nm_v::id>()); - gp.vertex(v_per_proc.get(p).get(i)).template get<nm_v::id>() = j; - } - } + // Update graphs with the new distributions + updateGraphs(); - if (p_id == 0) - { - VTKWriter<Graph_CSR<nm_v, nm_e>, GRAPH> gv2(gp); - gv2.write("test_graph_3.vtk"); - } - - refine(); + // reset statistical variables, we only need it in refinement + g_moved = 0; + m_moved = 0; /* // fill the structure that store the processor id for each sub-domain @@ -407,68 +385,11 @@ private: // Save the ghost boundaries Ghost<dim, T> ghost; - void refine() - { - size_t Np = v_cl.getProcessingUnits(); - size_t p_id = v_cl.getProcessUnitID(); - - // Reset parmetis graph and reconstruct it - parmetis_graph.reset(gp,sub_g); - - // Refine - parmetis_graph.refine<nm_v::proc_id>(vtxdist,sub_g); - - // Get result partition for this processor - idx_t * partition = parmetis_graph.getPartition(); - - partitions.get(p_id).resize(sub_g.getNVertex()); - std::copy(partition,partition+sub_g.getNVertex(),&partitions.get(p_id).get(0)); - - // Reset data structure to keep trace of new vertices distribution in processors (needed to update main graph) - for (int i = 0; i < Np; ++i) - { - v_per_proc.get(i).clear(); - } - - - openfpm::vector<size_t> prc; - openfpm::vector<size_t> sz; - openfpm::vector<void *> ptr; - - for (size_t i = 0 ; i < Np ; i++) - { - if (i != v_cl.getProcessUnitID()) - { - partitions.get(i).clear(); - prc.add(i); - sz.add(sub_g.getNVertex() * sizeof(idx_t)); - -// std::cout << "sub_g: " << sub_g.getNVertex() * sizeof(idx_t) << "\n"; - - ptr.add(partitions.get(p_id).getPointer()); - } - } - - v_cl.sendrecvMultipleMessagesNBX(prc.size(),&sz.get(0),&prc.get(0),&ptr.get(0),message_receive,&partitions,NONE); - - // Update graphs with the new distributions - updateGraphs(partitions, gp, sub_g, v_per_proc, vtxdist, p_id, Np); - - // - - if (p_id == 1) - { - VTKWriter<Graph_CSR<nm_v, nm_e>, GRAPH> gv2(gp); - gv2.write("test_graph_4.vtk"); - bool test = compare("test_graph_4.vtk","test_graph_test.vtk"); - BOOST_REQUIRE_EQUAL(test,true); - } - } - /*! \brief Create the subspaces that decompose your domain * */ - void CreateSubspaces() { + void CreateSubspaces() + { // Create a grid where each point is a space grid_sm<dim, void> g(div); @@ -476,7 +397,8 @@ private: grid_key_dx_iterator < dim > gk_it(g); // Divide the space into subspaces - while (gk_it.isNext()) { + while (gk_it.isNext()) + { //! iterate through all subspaces grid_key_dx < dim > key = gk_it.get(); @@ -484,7 +406,8 @@ private: SpaceBox<dim, T> tmp; //! fill with the Margin of the box - for (int i = 0; i < dim; i++) { + for (int i = 0; i < dim; i++) + { tmp.setHigh(i, (key.get(i) + 1) * spacing[i]); tmp.setLow(i, key.get(i) * spacing[i]); } @@ -497,89 +420,7 @@ private: } } - /* /brief types of weights distributions - * - */ - enum weightShape { - UNIFORM, SPHERE, HYPERBOLOID - }; - - /* \brief add vertex weights to the main domain, follow a shape - * - ** 0 - weights are all 1 on all vertices - ** 1 - weights are distributed as a sphere - * - * \param i id of the shape - * - */ - void addWeights(Graph_CSR<nm_v, nm_e> & gp, int i) - { - float c_x = 0, c_y = 0, c_z = 0 , radius2, eq; - float x = 0, y = 0, z = 0; - - switch (i) { - case UNIFORM: - - // Add computation information to each vertex - for (int i = 0; i < gp.getNVertex(); i++) { - gp.vertex(i).template get<nm_v::computation>() = 1; - } - break; - case SPHERE: - - // Fill vertices weights with a sphere (if dim=2 is a circle) - radius2 = pow(4, 2); - c_x = 2; - c_y = 2; - - if(dim == 3) - c_z = 2; - - for (int i = 0; i < gp.getNVertex(); i++) { - x = gp.vertex(i).template get<nm_v::x>() * 10; - y = gp.vertex(i).template get<nm_v::y>() * 10; - - if(dim == 3) - z = gp.vertex(i).template get<nm_v::z>() * 10; - - eq = pow((x - c_x), 2) + pow((y - c_y), 2) + pow((z - c_z), 2); - - if (eq <= radius2) { - gp.vertex(i).template get<nm_v::computation>() = 5; - } else { - gp.vertex(i).template get<nm_v::computation>() = 1; - } - } - break; - case HYPERBOLOID: - - // Fill vertices weights with a elliptic hyperboloid (if dim=2 is an hyperbole) - c_x = 5; - c_y = 5; - - if(dim == 3) - c_z = 5; - for (int i = 0; i < gp.getNVertex(); i++) { - x = gp.vertex(i).template get<nm_v::x>() * 10; - y = gp.vertex(i).template get<nm_v::y>() * 10; - - if(dim == 3) - z = gp.vertex(i).template get<nm_v::z>() * 10; - - eq = - pow((x - c_x), 2)/3 - pow((y - c_y), 2)/3 + pow((z - c_z), 2)/2; - - if (eq >= 1) { - gp.vertex(i).template get<nm_v::computation>() = 5; - } else { - gp.vertex(i).template get<nm_v::computation>() = 1; - } - } - break; - } - } - /* \brief fill the graph of the processor with the first decomposition (linear) - * * Put vertices into processor graph (different for each processor) * * \param sub_g sub graph to fill @@ -588,116 +429,104 @@ private: * \param proc_id rank of the processor * \param Np total number of processors */ - void fillSubGraph(Graph_CSR<nm_v, nm_e> &sub_g, Graph_CSR<nm_v, nm_e> &gp, openfpm::vector<idx_t> &vtxdist, int proc_id, int Np) + void fillSubGraph() { - for (size_t j = vtxdist.get(proc_id), local_j = 0; j < vtxdist.get(proc_id + 1); j++, local_j++) { + int Np = v_cl.getProcessingUnits(); + int p_id = v_cl.getProcessUnitID(); + for (size_t j = vtxdist.get(p_id), local_j = 0; j < vtxdist.get(p_id + 1); j++, local_j++) + { // Add vertex nm_v pv = gp.vertexById(j); sub_g.addVertex(pv); // Add edges of vertex - for (size_t s = 0; s < gp.getNChilds(j); s++) { - sub_g.template addEdge<NoCheck>(local_j, gp.getChildByVertexId(j, s)); + for (size_t s = 0; s < gp.getNChilds(j); s++) + { + nm_e pe = gp.edge(j + s); + sub_g.template addEdge<NoCheck>(local_j, gp.getChild(j, s), pe); } } // Just for output purpose - if (proc_id == 0) { - for (int i = 0; i < Np; i++) { - for (size_t j = vtxdist.get(i); j < vtxdist.get(i + 1); j++) { + if (p_id == 0) + { + for (int i = 0; i < Np; i++) + { + for (size_t j = vtxdist.get(i); j < vtxdist.get(i + 1); j++) + { gp.vertexById(j).template get<nm_v::proc_id>() = i; } } - VTKWriter<Graph_CSR<nm_v, nm_e>, GRAPH> gv2(gp); - gv2.write("test_graph_1.vtk"); } } - /* \brief exchange partitions with other processors + /* \brief Update main graph ad subgraph with the partition in partitions param and renumber graphs * - * \param partitions array to store all the partitions - * \param gp_nv number of vertices on main graph - * \param sub_g_nv number of vertices on sub graph - * \param requests_recv array of requests - * \param requests_send array of requests + * \param partitions array storing all the partitions + * \param gp main graph + * \param sub_g sub graph + * \param v_per_proc array needed to recontruct the main graph + * \param vtxdist array with the distribution of vertices through processors * \param statuses array of statsu objects * \param proc_id current processors rank * \param Np total umber of processors */ - void exchangePartitions(int** &partitions, int gp_nv, int sub_g_nv, MPI_Request* &requests_recv, MPI_Request* &requests_send, - MPI_Status* &statuses, int proc_id, int Np) + void updateGraphs() { - // Receive other partitions, each partition can contain max NVertex of main graph - for (int i = 0; i < Np; i++) { - if (i != proc_id) - MPI_Irecv(partitions[i], gp_nv, MPI_INT, i, 0, MPI_COMM_WORLD, &requests_recv[i]); - } - - // Send processor partition to other processors - for (int i = 0; i < Np; i++) { - if (i != proc_id) - MPI_Isend(partitions[proc_id], sub_g_nv, MPI_INT, i, 0, MPI_COMM_WORLD, &requests_send[i]); - } + int Np = v_cl.getProcessingUnits(); + int p_id = v_cl.getProcessUnitID(); - // Wait for all partitions from other processors - for (int i = 0; i < Np; i++) { - if (i != proc_id) - MPI_Wait(&requests_recv[i], &statuses[i]); - } - } + //stats info + size_t moved = 0; - /* \brief update main graph ad subgraph with the partition in partitions param - * - * \param partitions array storing all the partitions - * \param gp main graph - * \param sub_g sub graph - * \param v_per_proc array needed to recontruct the main graph - * \param vtxdist array with the distribution of vertices through processors - * \param statuses array of statsu objects - * \param proc_id current processors rank - * \param Np total umber of processors - */ - void updateGraphs(openfpm::vector<openfpm::vector<idx_t>> &partitions,Graph_CSR<nm_v, nm_e> &gp, Graph_CSR<nm_v, nm_e> &sub_g, openfpm::vector<openfpm::vector<size_t>> & v_per_proc, openfpm::vector<idx_t> & vtxdist, int proc_id, int Np) - { + // reset sub graph and local subgroph index int local_j = 0; sub_g.clear(); // Init n_vtxdist to gather informations about the new decomposition -/* idx_t *n_vtxdist = new idx_t[Np + 1];*/ - - openfpm::vector<idx_t> n_vtxdist(Np+1); + openfpm::vector < idx_t > n_vtxdist(Np + 1); for (int i = 0; i <= Np; i++) n_vtxdist.get(i) = 0; - + // Update main graph with other partitions made by Parmetis in other processors and the local partition - for (int i = 0; i < Np; i++) { + for (int i = 0; i < Np; i++) + { int ndata = partitions.get(i).size(); // Update the main graph with received informations - for (int k = 0, l = vtxdist.get(i); k < ndata && l < vtxdist.get(i + 1); k++, l++) { + for (int k = 0, l = vtxdist.get(i); k < ndata && l < vtxdist.get(i + 1); k++, l++) + { // Create new n_vtxdist (1) (just count processors vertices) n_vtxdist.get(partitions.get(i).get(k) + 1)++; + if +( gp.vertexById(l).template get<nm_v::proc_id>() != partitions.get(i).get(k)) + moved++; + // Update proc id in the vertex gp.vertexById(l).template get<nm_v::proc_id>() = partitions.get(i).get(k); + gp.vertex(l).template get<nm_v::global_id>() = l; // Add vertex to temporary structure of distribution (needed to update main graph) - v_per_proc.get(partitions.get(i).get(k)).add(gp.vertexById(l).template get<nm_v::id>()); + v_per_proc.get(partitions.get(i).get(k)).add(gp.getVertexOldId(l)); // Add vertices belonging to this processor in sub graph - if (partitions.get(i).get(k) == proc_id) { + if (partitions.get(i).get(k) == p_id) + { nm_v pv = gp.vertexById(l); sub_g.addVertex(pv); // Add edges of vertex - for (size_t s = 0; s < gp.getNChildsByVertexId(l); s++) { - sub_g.template addEdge<NoCheck>(local_j, gp.getChildByVertexId(l, s)); + for (size_t s = 0; s < gp.getNChildsByVertexId(l); s++) + { + nm_e pe = gp.edge(l + s); + sub_g.template addEdge<NoCheck>(local_j, gp.getChildByVertexId(l, s), pe); } local_j++; @@ -706,16 +535,79 @@ private: } // Create new n_vtxdist (2) (write boundaries) - for (int i = 2; i <= Np; i++) + for (int i = 2; i <= Np; i++) { n_vtxdist.get(i) += n_vtxdist.get(i - 1); } // Copy the new decomposition in the main vtxdist - for (int i = 0; i <= Np ; i++) + for (int i = 0; i <= Np; i++) { vtxdist.get(i) = n_vtxdist.get(i); } + + // Renumbering subgraph + sub_g.reset_map_ids(); + for (size_t j = vtxdist.get(p_id), i = 0; j < vtxdist.get(p_id + 1); j++, i++) + { + sub_g.set_map_ids(j, sub_g.vertex(i).template get<nm_v::global_id>()); + sub_g.vertex(i).template get<nm_v::id>() = j; + } + + // Renumbering main graph + for (size_t p = 0; p < Np; p++) + { + for (size_t j = vtxdist.get(p), i = 0; j < vtxdist.get(p + 1); j++, i++) + { + gp.set_map_ids(j, v_per_proc.get(p).get(i)); + gp.vertex(v_per_proc.get(p).get(i)).template get<nm_v::id>() = j; + } + } + + g_moved += moved; + + if (moved > m_moved) + m_moved = moved; + + } + + /* ! \brief Calculate communication and migration costs + * + * \param gh_s ghost thickness + * \param ts how many timesteps have passed since last calculation, used to approximate the cost + */ + void computeCommunicationAndMigrationCosts(float gh_s, size_t ts) + { + + size_t p_id = v_cl.getProcessUnitID(); + float migration; + + SpaceBox<dim, T> cellBox = cd.getCellBox(); + float b_s = (cellBox.getHigh(0) - cellBox.getLow(0)); + + // compute the gh_area for 2 dim case + float gh_v = (gh_s * b_s); + + // multiply for sub-sub-domain side for each domain + for(int i = 2 ; i < dim; i++) + gh_v *= b_s; + + size_t norm = (size_t) (1.0 / gh_v); + + migration = pow(b_s, dim); + + size_t prev = 0; + + for (size_t i = 0; i < gp.getNVertex(); i++) + { + gp.vertex(i).template get<nm_v::migration>() = norm * migration * gp.vertex(i).template get<nm_v::computation>(); + + for (size_t s = 0; s < gp.getNChilds(i); s++) + { + gp.edge(prev + s).template get<nm_e::communication>() = 1 * gp.vertex(i).template get<nm_v::computation>() * ts; + } + prev += gp.getNChilds(i); + } } // Heap memory receiver @@ -735,14 +627,19 @@ public: * */ BasicDecomposition(Vcluster & v_cl) : - nn_prcs<dim, T>(v_cl), v_cl(v_cl),parmetis_graph(v_cl, v_cl.getProcessingUnits()),vtxdist(v_cl.getProcessingUnits() + 1),partitions(v_cl.getProcessingUnits()),v_per_proc(v_cl.getProcessingUnits()) + nn_prcs<dim, T>(v_cl), v_cl(v_cl), parmetis_graph(v_cl, v_cl.getProcessingUnits()), vtxdist( + v_cl.getProcessingUnits() + 1), partitions(v_cl.getProcessingUnits()), v_per_proc( + v_cl.getProcessingUnits()) { + // Reset the box to zero bbox.zero(); + } //! Basic decomposition destructor - ~BasicDecomposition() { + ~BasicDecomposition() + { } // openfpm::vector<size_t> ids; @@ -750,7 +647,8 @@ public: /*! \brief class to select the returned id by ghost_processorID * */ - class box_id { + class box_id + { public: /*! \brief Return the box id * @@ -760,7 +658,8 @@ public: * \return box id * */ - inline static size_t id(p_box<dim, T> & p, size_t b_id) { + inline static size_t id(p_box<dim, T> & p, size_t b_id) + { return b_id; } }; @@ -768,7 +667,8 @@ public: /*! \brief class to select the returned id by ghost_processorID * */ - class processor_id { + class processor_id + { public: /*! \brief Return the processor id * @@ -778,7 +678,8 @@ public: * \return processor id * */ - inline static size_t id(p_box<dim, T> & p, size_t b_id) { + inline static size_t id(p_box<dim, T> & p, size_t b_id) + { return p.proc; } }; @@ -786,7 +687,8 @@ public: /*! \brief class to select the returned id by ghost_processorID * */ - class lc_processor_id { + class lc_processor_id + { public: /*! \brief Return the near processor id * @@ -796,7 +698,8 @@ public: * \return local processor id * */ - inline static size_t id(p_box<dim, T> & p, size_t b_id) { + inline static size_t id(p_box<dim, T> & p, size_t b_id) + { return p.lc_proc; } }; @@ -895,14 +798,17 @@ public: * * */ - void calculateGhostBoxes() { + void calculateGhostBoxes() + { #ifdef DEBUG // the ghost margins are assumed to be smaller // than one sub-domain - for (size_t i = 0; i < dim; i++) { + for (size_t i = 0; i < dim; i++) + { if (ghost.template getLow(i) >= domain.template getHigh(i) / gr.size(i) - || ghost.template getHigh(i) >= domain.template getHigh(i) / gr.size(i)) { + || ghost.template getHigh(i) >= domain.template getHigh(i) / gr.size(i)) + { std::cerr << "Error " << __FILE__ << ":" << __LINE__ << " : Ghost are bigger than one domain" << "\n"; } } @@ -920,8 +826,11 @@ public: ie_loc_ghost<dim, T>::create_loc_ghost_ebox(ghost, sub_domains); // get the smallest sub-domain dimension on each direction - for (size_t i = 0; i < dim; i++) { - if (ghost.template getLow(i) >= ss_box.getHigh(i) || ghost.template getHigh(i) >= domain.template getHigh(i) / gr.size(i)) { + for (size_t i = 0; i < dim; i++) + { + if (ghost.template getLow(i) >= ss_box.getHigh(i) + || ghost.template getHigh(i) >= domain.template getHigh(i) / gr.size(i)) + { std::cerr << "Error " << __FILE__ << ":" << __LINE__ << " : Ghost are bigger than one domain" << "\n"; } } @@ -934,7 +843,8 @@ public: * number of sub-domain * */ - static size_t getDefaultGrid(size_t n_sub) { + static size_t getDefaultGrid(size_t n_sub) + { // Calculate the number of sub-sub-domain on // each dimension return openfpm::math::round_big_2(pow(n_sub, 1.0 / dim)); @@ -945,7 +855,8 @@ public: * \return processorID * */ - template<typename Mem> size_t inline processorID(encapc<1, Point<dim, T>, Mem> p) { + template<typename Mem> size_t inline processorID(encapc<1, Point<dim, T>, Mem> p) + { return fine_s.get(cd.getCell(p)); } @@ -957,7 +868,8 @@ public: * \return a box p1 is set to zero * */ - const ::Box<dim, T> & getSmallestSubdivision() { + const ::Box<dim, T> & getSmallestSubdivision() + { return ss_box; } @@ -967,7 +879,8 @@ public: * */ - size_t inline processorID(const T (&p)[dim]) const { + size_t inline processorID(const T (&p)[dim]) const + { return fine_s.get(cd.getCell(p)); } @@ -977,26 +890,138 @@ public: * \param domain_ domain to decompose * */ - void setParameters(const size_t (&div_)[dim], Domain<dim, T> domain_, Ghost<dim, T> ghost = Ghost<dim, T>()) { + void setParameters(const size_t (&div_)[dim], Domain<dim, T> domain_, Ghost<dim, T> ghost = Ghost<dim, T>()) + { // set the ghost this->ghost = ghost; - // Set the decomposition parameters + // Set the decomposition parameters gr.setDimensions(div_); domain = domain_; cd.setDimensions(domain, div_, 0); - //! Create the decomposition + // Create a cartesian grid graph + CartesianGraphFactory<dim, Graph_CSR<nm_v, nm_e>> g_factory_part; + gp = g_factory_part.template construct<NO_EDGE, nm_v::id, T, dim - 1, 0, 1, 2>(gr.getSize(), domain); + gp.init_map_ids(); + + // Init to 0.0 axis z (to fix in graphFactory) + if(dim < 3){ + for(size_t i = 0; i< gp.getNVertex(); i++) + gp.vertex(i).template get<nm_v::z>() = 0.0; + } + + } + /*! \brief Start decomposition + * + */ + void decompose() + { + computeCommunicationAndMigrationCosts(0.01, 1); CreateDecomposition(v_cl); } + /* ! \brief Refine current decomposition + * + * It makes a refinement of the current decomposition using Parmetis function RefineKWay + * After that it also does the remapping of the graph + * + */ + void refine() + { + size_t Np = v_cl.getProcessingUnits(); + size_t p_id = v_cl.getProcessUnitID(); + + //0.01 and 1 must be given TODO + computeCommunicationAndMigrationCosts(0.01, n_ts); + + // Reset parmetis graph and reconstruct it + parmetis_graph.reset(gp, sub_g); + + // Refine + parmetis_graph.refine<nm_v::proc_id>(vtxdist, sub_g); + + // Get result partition for this processor + idx_t * partition = parmetis_graph.getPartition(); + + partitions.get(p_id).resize(sub_g.getNVertex()); + std::copy(partition, partition + sub_g.getNVertex(), &partitions.get(p_id).get(0)); + + // Reset data structure to keep trace of new vertices distribution in processors (needed to update main graph) + for (int i = 0; i < Np; ++i) + { + v_per_proc.get(i).clear(); + } + + openfpm::vector < size_t > prc; + openfpm::vector < size_t > sz; + openfpm::vector<void *> ptr; + + for (size_t i = 0; i < Np; i++) + { + if (i != v_cl.getProcessUnitID()) + { + partitions.get(i).clear(); + prc.add(i); + sz.add(sub_g.getNVertex() * sizeof(idx_t)); + ptr.add(partitions.get(p_id).getPointer()); + } + } + + // Exchange informations through processors + v_cl.sendrecvMultipleMessagesNBX(prc.size(), &sz.get(0), &prc.get(0), &ptr.get(0), message_receive, &partitions, + NONE); + + // Update graphs with the new distributions + updateGraphs(); + } + + /*! Function that gather times informations and decides if a rebalance is needed + * it uses the SAR heuristic + * + */ + bool balanceNeeded(long t){ + + float t_max = 0, t_avg = 0; + + // Exchange time informations through processors + v_cl.allGather(t, times); + v_cl.execute(); + + t_max = *(std::max_element(std::begin(times), std::end(times))); + //if(v_cl.getProcessUnitID()) + //std::cout << "tmax: " << t_max << "\n"; + + t_avg = std::accumulate(times.begin(), times.end(), 0) / v_cl.getProcessingUnits(); + //std::cout << "tavg: " << t_avg << "\n"; + + // add idle time to vector + i_times.add(t_max - t_avg); + + // Compute Wn + double it_sum = *(std::max_element(std::begin(i_times), std::end(i_times))); + float nw_n = (it_sum + c_c) / n_ts; + + if(nw_n > w_n){ + i_times.clear(); + n_ts = 1; + w_n = nw_n; + return true; + }else{ + ++n_ts; + w_n = nw_n; + return false; + } + } + /*! \brief Get the number of local sub-domains * * \return the number of sub-domains * */ - size_t getNLocalHyperCube() { + size_t getNLocalHyperCube() + { return sub_domains.size(); } @@ -1006,13 +1031,15 @@ public: * \return the sub-domain * */ - SpaceBox<dim, T> getLocalHyperCube(size_t lc) { + SpaceBox<dim, T> getLocalHyperCube(size_t lc) + { // Create a space box SpaceBox<dim, T> sp; // fill the space box - for (size_t k = 0; k < dim; k++) { + for (size_t k = 0; k < dim; k++) + { // create the SpaceBox Low and High sp.setLow(k, sub_domains.template get < Box::p1 > (lc)[k]); sp.setHigh(k, sub_domains.template get < Box::p2 > (lc)[k]); @@ -1027,7 +1054,8 @@ public: * \return the sub-domain * */ - SpaceBox<dim, T> getSubDomainWithGhost(size_t lc) { + SpaceBox<dim, T> getSubDomainWithGhost(size_t lc) + { // Create a space box SpaceBox<dim, T> sp = sub_domains.get(lc); @@ -1042,7 +1070,8 @@ public: * \return The physical domain * */ - Domain<dim, T> & getDomain() { + Domain<dim, T> & getDomain() + { return domain; } @@ -1053,7 +1082,8 @@ public: * \return true if it is local * */ - template<typename Mem> bool isLocal(const encapc<1, Point<dim, T>, Mem> p) const { + template<typename Mem> bool isLocal(const encapc<1, Point<dim, T>, Mem> p) const + { return processorID<Mem>(p) == v_cl.getProcessUnitID(); } @@ -1064,7 +1094,8 @@ public: * \return true if it is local * */ - bool isLocal(const T (&pos)[dim]) const { + bool isLocal(const T (&pos)[dim]) const + { return processorID(pos) == v_cl.getProcessUnitID(); } @@ -1075,7 +1106,8 @@ public: * \return The bounding box * */ - ::Box<dim, T> & getProcessorBounds() { + ::Box<dim, T> & getProcessorBounds() + { return bbox; } @@ -1097,11 +1129,13 @@ public: * \param output directory where to write the files * */ - bool write(std::string output) const { + bool write(std::string output) const + { //! subdomains_X.vtk domain for the local processor (X) as union of sub-domain VTKWriter<openfpm::vector<::SpaceBox<dim, T>>, VECTOR_BOX> vtk_box1; vtk_box1.add(sub_domains); - vtk_box1.write(output + std::string("subdomains_") + std::to_string(v_cl.getProcessUnitID()) + std::string(".vtk")); + vtk_box1.write( + output + std::string("subdomains_") + std::to_string(v_cl.getProcessUnitID()) + std::string(".vtk")); nn_prcs<dim, T>::write(output); ie_ghost<dim, T>::write(output, v_cl.getProcessUnitID()); @@ -1115,38 +1149,117 @@ public: * \return false if is inconsistent * */ - bool check_consistency() { + bool check_consistency() + { if (ie_loc_ghost<dim, T>::check_consistency(getNLocalHyperCube()) == false) return false; return true; } - void debugPrint() { + /* ! \brief function that return the position of the vertex in the space + * + * \param id vertex id + * \param pos vector tha t will contain x, y, z + * + */ + void getVertexPosition(size_t id, openfpm::vector<real_t> &pos) + { + pos.get(0) = gp.vertex(id).template get<nm_v::x>(); + pos.get(1) = gp.vertex(id).template get<nm_v::y>(); + + if (dim == 3) + pos.get(2) = gp.vertex(id).template get<nm_v::z>(); + } + + /* ! \brief function that set the weight of the vertex + * + * \param id vertex id + * + * \return vector with x, y, z + * + */ + void setVertexWeight(size_t id, size_t weight) + { + gp.vertex(id).template get<nm_v::computation>() = weight; + } + + /* ! \brief return number of moved vertices in all iterations so far + * + * \param id vertex id + * + * \return vector with x, y, z + * + */ + size_t getTotalMovedV() + { + + return g_moved; + + } + + /* ! \brief return number of moved vertices in all iterations so far + * + * \param id vertex id + * + * \return vector with x, y, z + * + */ + size_t getMaxMovedV() + { + + return m_moved; + + } + + void debugPrint() + { std::cout << "Subdomains\n"; - for (size_t p = 0; p < sub_domains.size(); p++) { + for (size_t p = 0; p < sub_domains.size(); p++) + { std::cout << ::SpaceBox<dim, T>(sub_domains.get(p)).toString() << "\n"; } std::cout << "External ghost box\n"; - for (size_t p = 0; p<nn_prcs < dim, T>::getNNProcessors(); p++) { - for (size_t i = 0; i<ie_ghost < dim, T>::getProcessorNEGhost(p); i++) { - std::cout << ie_ghost<dim, T>::getProcessorEGhostBox(p, i).toString() << " prc=" << nn_prcs<dim, T>::IDtoProc(p) - << " id=" << ie_ghost<dim, T>::getProcessorEGhostId(p, i) << "\n"; + for (size_t p = 0; p<nn_prcs < dim, T>::getNNProcessors(); p++) + { + for (size_t i = 0; i<ie_ghost < dim, T>::getProcessorNEGhost(p); i++) + { + std::cout << ie_ghost<dim, T>::getProcessorEGhostBox(p, i).toString() << " prc=" + << nn_prcs<dim, T>::IDtoProc(p) << " id=" << ie_ghost<dim, T>::getProcessorEGhostId(p, i) + << "\n"; } } std::cout << "Internal ghost box\n"; - for (size_t p = 0; p<nn_prcs < dim, T>::getNNProcessors(); p++) { - for (size_t i = 0; i<ie_ghost < dim, T>::getProcessorNIGhost(p); i++) { - std::cout << ie_ghost<dim, T>::getProcessorIGhostBox(p, i).toString() << " prc=" << nn_prcs<dim, T>::IDtoProc(p) - << " id=" << ie_ghost<dim, T>::getProcessorIGhostId(p, i) << "\n"; + for (size_t p = 0; p<nn_prcs < dim, T>::getNNProcessors(); p++) + { + for (size_t i = 0; i<ie_ghost < dim, T>::getProcessorNIGhost(p); i++) + { + std::cout << ie_ghost<dim, T>::getProcessorIGhostBox(p, i).toString() << " prc=" + << nn_prcs<dim, T>::IDtoProc(p) << " id=" << ie_ghost<dim, T>::getProcessorIGhostId(p, i) + << "\n"; } } } + /* \brief Print current graph and save it to file with name test_graph_[id] + * + * \param id to attach to the filename + * + */ + void printCurrentGraph(int id) + { + if (v_cl.getProcessUnitID() == 1) + { + VTKWriter<Graph_CSR<nm_v, nm_e>, GRAPH> gv2(gp); + gv2.write("test_graph_" + std::to_string(id) + ".vtk"); + } + + } + }; #endif diff --git a/src/Decomposition/BasicDecomposition_unit_test.hpp b/src/Decomposition/BasicDecomposition_unit_test.hpp old mode 100644 new mode 100755 index 9ae1a7d94c682cf2a2e1f0c2dda7aa7e2d816509..942e31854287a09c3391bdfb9efb188df61be3fa --- a/src/Decomposition/BasicDecomposition_unit_test.hpp +++ b/src/Decomposition/BasicDecomposition_unit_test.hpp @@ -3,10 +3,12 @@ #include "BasicDecomposition.hpp" #include "util/mathutil.hpp" +#include <boost/algorithm/string.hpp> -BOOST_AUTO_TEST_SUITE( BasicDecomposition_test ) +BOOST_AUTO_TEST_SUITE (BasicDecomposition_test) -#define SUB_UNIT_FACTOR 1024 +#define SUB_UNIT_FACTOR 128 +#define DIM 2 BOOST_AUTO_TEST_CASE( BasicDecomposition_test_use) { @@ -17,11 +19,11 @@ BOOST_AUTO_TEST_CASE( BasicDecomposition_test_use) init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv); //! [Create CartDecomposition] - BasicDecomposition<3,float> dec(vcl); + BasicDecomposition<DIM, float> dec(vcl); // Physical domain - Box<3,float> box({0.0,0.0,0.0},{1.0,1.0,1.0}); - size_t div[3]; + Box<DIM, float> box( { 0.0, 0.0, 0.0 }, { 1.0, 1.0, 1.0 }); + size_t div[DIM]; // Get the number of processor and calculate the number of sub-domain // for each processor (SUB_UNIT_FACTOR=64) @@ -29,43 +31,149 @@ BOOST_AUTO_TEST_CASE( BasicDecomposition_test_use) size_t n_sub = n_proc * SUB_UNIT_FACTOR; // Set the number of sub-domains on each dimension (in a scalable way) - for (int i = 0 ; i < 3 ; i++) - {div[i] = openfpm::math::round_big_2(pow(n_sub,1.0/3));} + for (int i = 0; i < DIM; i++) + { + div[i] = openfpm::math::round_big_2(pow(n_sub,1.0/DIM)); + } // Define ghost - Ghost<3,float> g(0.01); + Ghost<DIM, float> g(0.01); // Decompose - dec.setParameters(div,box,g); + dec.setParameters(div, box, g); + + //Add weights + float c_x = 0, c_y = 0, c_z = 0, radius2, eq; + float x = 0, y = 0, z = 0; + float thickness = 2; + int weight = 5; + + size_t n_v = pow(div[0], DIM); + + // Set center and radius of the distribution shape (Sphere) + radius2 = pow(2,2); + c_x = 2; + c_y = 2; + + if (DIM == 3) + c_z = 2; + + openfpm::vector<real_t> pos(DIM); + for (int i = 0; i < n_v; i++) + { + dec.getVertexPosition(i, pos); + x = pos.get(0) * 10; + y = pos.get(1) * 10; + + if (DIM == 3) + z = pos.get(2) * 10; + + eq = pow((x - c_x), 2) + pow((y - c_y), 2) + pow((z - c_z), 2); + + if (eq <= radius2) + { + dec.setVertexWeight(i, weight); + } else + { + dec.setVertexWeight(i, 1); + } + } + + dec.decompose(); + + dec.printCurrentGraph(0); + + float stime = 0.1, etime = 5, tstep = 0.1; + + for(real_t t = stime, i = 1, t_sim = 1; + t < etime; + t = t + tstep, i++, t_sim++) + { + clock_t start = clock(); + + if(t < etime/2){ + c_x += tstep; + c_y += tstep; + }else{ + c_x -= tstep; + c_y -= tstep; + } + + + if (DIM == 3) + c_z += tstep; + + openfpm::vector<real_t> pos(DIM); + for (int i = 0; i < n_v; i++) + { + dec.getVertexPosition(i, pos); + x = pos.get(0) * 10; + y = pos.get(1) * 10; + + if (DIM == 3) + z = pos.get(2) * 10; + + eq = pow((x - c_x), 2) + pow((y - c_y), 2) + pow((z - c_z), 2); + + if (eq <= radius2) + { + dec.setVertexWeight(i, weight); + } else + { + dec.setVertexWeight(i, 1); + } + } + + usleep(1000*t_sim); + + clock_t end = clock(); + long time = end - start; + + bool needed = dec.balanceNeeded(time); + + if(needed){ + dec.refine(); + t_sim = 1; + } + + dec.printCurrentGraph(i); + } + + //print statistics + if(vcl.getProcessUnitID() == 0) + { + float avg = dec.getTotalMovedV()/((etime-stime)/tstep); + + std::cout << "Moved vertices average: " << avg << "\n"; + std::cout << "Max number of moved vertices: " << dec.getMaxMovedV() << "\n"; + } // create a ghost border dec.calculateGhostBoxes(); - //! [Create BasicDecomposition] - // For each calculated ghost box - for (size_t i = 0 ; i < dec.getNIGhostBox() ; i++) + for (size_t i = 0; i < dec.getNIGhostBox(); i++) { - SpaceBox<3,float> b = dec.getIGhostBox(i); + SpaceBox<DIM,float> b = dec.getIGhostBox(i); size_t proc = dec.getIGhostBoxProcessor(i); // sample one point inside the box - Point<3,float> p = b.rnd(); + Point<DIM,float> p = b.rnd(); // Check that ghost_processorsID return that processor number - const openfpm::vector<size_t> & pr = dec.template ghost_processorID<BasicDecomposition<3,float>::processor_id>(p); + const openfpm::vector<size_t> & pr = dec.template ghost_processorID<BasicDecomposition<DIM,float>::processor_id>(p); bool found = false; - for (size_t j = 0; j < pr.size() ; j++) + for (size_t j = 0; j < pr.size(); j++) { if (pr.get(j) == proc) - {found = true; break;} + { found = true; break;} } if (found == false) { - const openfpm::vector<size_t> pr3 = dec.template ghost_processorID<BasicDecomposition<3,float>::processor_id>(p); + const openfpm::vector<size_t> pr2 = dec.template ghost_processorID<BasicDecomposition<DIM,float>::processor_id>(p); } BOOST_REQUIRE_EQUAL(found,true); @@ -79,5 +187,4 @@ BOOST_AUTO_TEST_CASE( BasicDecomposition_test_use) BOOST_AUTO_TEST_SUITE_END() - #endif diff --git a/src/Decomposition/CartDecomposition.hpp b/src/Decomposition/CartDecomposition.hpp old mode 100644 new mode 100755 diff --git a/src/Decomposition/CartDecomposition_unit_test.hpp b/src/Decomposition/CartDecomposition_unit_test.hpp old mode 100644 new mode 100755 diff --git a/src/Decomposition/Decomposition.hpp b/src/Decomposition/Decomposition.hpp old mode 100644 new mode 100755 diff --git a/src/Decomposition/ORB.hpp b/src/Decomposition/ORB.hpp old mode 100644 new mode 100755 diff --git a/src/Decomposition/ORB_unit_test.hpp b/src/Decomposition/ORB_unit_test.hpp old mode 100644 new mode 100755 diff --git a/src/Decomposition/common.hpp b/src/Decomposition/common.hpp old mode 100644 new mode 100755 diff --git a/src/Decomposition/ie_ghost.hpp b/src/Decomposition/ie_ghost.hpp old mode 100644 new mode 100755 diff --git a/src/Decomposition/ie_loc_ghost.hpp b/src/Decomposition/ie_loc_ghost.hpp old mode 100644 new mode 100755 diff --git a/src/Decomposition/nn_processor.hpp b/src/Decomposition/nn_processor.hpp old mode 100644 new mode 100755 diff --git a/src/Graph/CartesianGraphFactory.hpp b/src/Graph/CartesianGraphFactory.hpp old mode 100644 new mode 100755 diff --git a/src/Makefile.am b/src/Makefile.am index c5ed683ec201b649139516dc78daa2b97dfb68ef..24bdf6db5ef294866fe3b94336bf1c625cadea71 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,12 +1,12 @@ -LINKLIBS = $(METIS_LIB) $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_IOSTREAMS_LIB) $(CUDA_LIBS) $(PARMETIS_LIB) +LINKLIBS = $(METIS_LIB) $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_IOSTREAMS_LIB) $(CUDA_LIBS) noinst_PROGRAMS = pdata pdata_SOURCES = main.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster.cpp ../openfpm_data/src/Memleak_check.cpp -pdata_CXXFLAGS = $(CUDA_CFLAGS) $(INCLUDES_PATH) $(METIS_INCLUDE) $(PARMETIS_INCLUDE) $(BOOST_CPPFLAGS) -Wno-unused-function +pdata_CXXFLAGS = $(CUDA_CFLAGS) $(INCLUDES_PATH) $(METIS_INCLUDE) $(BOOST_CPPFLAGS) -Wno-unused-function pdata_CFLAGS = $(CUDA_CFLAGS) -pdata_LDADD = $(LINKLIBS) -L/usr/lib/x86_64-linux-gnu/ -lmetis -lboost_iostreams -lboost_program_options -lparmetis -nobase_include_HEADERS = Decomposition/BasicDecomposition.hpp Decomposition/CartDecomposition.hpp Decomposition/common.hpp Decomposition/Decomposition.hpp Decomposition/ie_ghost.hpp \ - Decomposition/nn_processor.hpp Decomposition/ie_loc_ghost.hpp Decomposition/ORB.hpp \ +pdata_LDADD = $(LINKLIBS) -lmetis -lparmetis +nobase_include_HEADERS = Decomposition/CartDecomposition.hpp Decomposition/common.hpp Decomposition/Decomposition.hpp Decomposition/ie_ghost.hpp \ + Decomposition/nn_processor.hpp Decomposition/DistModel.hpp Decomposition/ie_loc_ghost.hpp Decomposition/ORB.hpp \ Graph/CartesianGraphFactory.hpp \ Grid/grid_dist_id.hpp Grid/grid_dist_id_iterator.hpp Grid/grid_dist_key.hpp \ Vector/vector_dist.hpp Vector/vector_dist_iterator.hpp Vector/vector_dist_key.hpp \ diff --git a/src/SubdomainGraphNodes.hpp b/src/SubdomainGraphNodes.hpp old mode 100644 new mode 100755 index d993792f23076538a6476f97ec55a11116ecd3d5..fc893972479a548b70bfa6a8dfef455adba60bd1 --- a/src/SubdomainGraphNodes.hpp +++ b/src/SubdomainGraphNodes.hpp @@ -30,7 +30,7 @@ struct nm_v { //! The node contain 3 unsigned long integer for communication computation memory and id - typedef boost::fusion::vector<float,float,float,size_t,size_t,size_t,size_t,size_t,long int> type; + typedef boost::fusion::vector<float, float, float, size_t, size_t, size_t, size_t, size_t, size_t> type; typedef typename memory_traits_inte<type>::type memory_int; typedef typename memory_traits_lin<type>::type memory_lin; @@ -54,43 +54,44 @@ struct nm_v //! memory property id in boost::fusion::vector static const unsigned int z = 2; //! computation property id in boost::fusion::vector - static const unsigned int communication = 3; + static const unsigned int migration = 3; //! computation property id in boost::fusion::vector static const unsigned int computation = 4; //! memory property id in boost::fusion::vector - static const unsigned int memory = 5; + static const unsigned int global_id = 5; //! memory property id in boost::fusion::vector static const unsigned int id = 6; //! memory property sub_id in boost::fusion::vector static const unsigned int sub_id = 7; - //! memory property proc_id in boost::fusion::vector - static const unsigned int proc_id = 8; + //! memory property proc_id in boost::fusion::vector + static const unsigned int proc_id = 8; //! total number of properties boost::fusion::vector static const unsigned int max_prop = 9; - - //! default constructor - nm_v(){ - - } - - template <unsigned int dim, typename Mem> inline nm_v(const encapc<dim,nm_v,Mem> & p) - { - boost::fusion::at_c<0>(data) = p.template get<0>(); - boost::fusion::at_c<1>(data) = p.template get<1>(); - boost::fusion::at_c<2>(data) = p.template get<2>(); - boost::fusion::at_c<3>(data) = p.template get<3>(); - boost::fusion::at_c<4>(data) = p.template get<4>(); - boost::fusion::at_c<5>(data) = p.template get<5>(); - boost::fusion::at_c<6>(data) = p.template get<6>(); - boost::fusion::at_c<7>(data) = p.template get<7>(); - boost::fusion::at_c<8>(data) = p.template get<8>(); - } - - + + //! default constructor + nm_v() + { + + } + + template<unsigned int dim, typename Mem> inline nm_v(const encapc<dim, nm_v, Mem> & p) + { + boost::fusion::at_c < 0 > (data) = p.template get<0>(); + boost::fusion::at_c < 1 > (data) = p.template get<1>(); + boost::fusion::at_c < 2 > (data) = p.template get<2>(); + boost::fusion::at_c < 3 > (data) = p.template get<3>(); + boost::fusion::at_c < 4 > (data) = p.template get<4>(); + boost::fusion::at_c < 5 > (data) = p.template get<5>(); + boost::fusion::at_c < 6 > (data) = p.template get<6>(); + boost::fusion::at_c < 7 > (data) = p.template get<7>(); + boost::fusion::at_c < 8 > (data) = p.template get<8>(); + } + }; -const std::string nm_v::attributes::name[] = {"x","y","z","communication","computation","memory","id","sub_id","proc_id"}; +const std::string nm_v::attributes::name[] = { "x", "y", "z", "migration", "computation", "global_id", "id", + "sub_id", "proc_id" }; /*! \brief sub-domain edge graph node * @@ -117,9 +118,20 @@ struct nm_e static const unsigned int communication = 0; //! total number of properties boost::fusion::vector static const unsigned int max_prop = 1; + + nm_e() + { + + } + + template<unsigned int dim, typename Mem> inline nm_e(const encapc<dim, nm_e, Mem> & p) + { + boost::fusion::at_c < 0 > (data) = p.template get<0>(); + + } }; -const std::string nm_e::attributes::name[] = {"communication"}; +const std::string nm_e::attributes::name[] = { "communication" }; /*! \brief Reduced sub-domain vertex graph node * @@ -130,7 +142,7 @@ const std::string nm_e::attributes::name[] = {"communication"}; struct nm_part_v { //! The node contain 3 unsigned long integer for comunication computation and memory - typedef boost::fusion::vector<size_t,size_t> type; + typedef boost::fusion::vector<size_t, size_t> type; typedef typename memory_traits_inte<type>::type memory_int; typedef typename memory_traits_lin<type>::type memory_lin; @@ -154,23 +166,22 @@ struct nm_part_v //! total number of properties static const unsigned int max_prop = 2; - - //! default constructor - nm_part_v(){ - - } - - template <unsigned int dim, typename Mem> inline nm_part_v(const encapc<dim,nm_part_v,Mem> & p) - { - boost::fusion::at_c<0>(data) = p.template get<0>(); - boost::fusion::at_c<1>(data) = p.template get<1>(); - } - -}; + //! default constructor + nm_part_v() + { + + } + template<unsigned int dim, typename Mem> inline nm_part_v(const encapc<dim, nm_part_v, Mem> & p) + { + boost::fusion::at_c < 0 > (data) = p.template get<0>(); + boost::fusion::at_c < 1 > (data) = p.template get<1>(); + } + +}; -const std::string nm_part_v::attributes::name[] = {"id","sub_id"}; +const std::string nm_part_v::attributes::name[] = { "id", "sub_id" }; /*! \brief Reduced edge graph node * @@ -192,14 +203,14 @@ struct nm_part_e //! total number of properties static const unsigned int max_prop = 0; - - //! Attributes name - struct attributes - { - static const std::string name[]; - }; + + //! Attributes name + struct attributes + { + static const std::string name[]; + }; }; -const std::string nm_part_e::attributes::name[] = {"id"}; +const std::string nm_part_e::attributes::name[] = { "id" }; #endif diff --git a/src/parmetis_util.hpp b/src/parmetis_util.hpp old mode 100644 new mode 100755 index d37b309e892e468d442f6fed2f069ee41f95eabd..5829638e438f8a246359fabe12f7a472cbd8260a --- a/src/parmetis_util.hpp +++ b/src/parmetis_util.hpp @@ -18,7 +18,8 @@ * Metis graph structure * */ -struct Parmetis_graph { +struct Parmetis_graph +{ //! The number of vertices in the graph idx_t * nvtxs; @@ -88,41 +89,52 @@ struct Parmetis_graph { /*! \brief Helper class to define Metis graph * * TODO Transform pointer to openfpm vector - * + * * \tparam graph structure that store the graph * */ template<typename Graph> -class Parmetis { +class Parmetis +{ // Graph in metis reppresentation Parmetis_graph Mg; // Original graph -// Graph & g; + // Graph & g; // Communticator for OpenMPI MPI_Comm comm = NULL; // VCluster Vcluster & v_cl; - + // Process rank information int p_id = 0; // nc Number of partition size_t nc = 0; - + /*! \brief Construct Adjacency list * * \param g Reference graph to get informations * */ - void constructAdjList(Graph &refGraph, Graph & g) + void constructAdjList(Graph &refGraph, Graph & sub_g) { - // create xadj and adjlist - Mg.vwgt = new idx_t[g.getNVertex()]; - Mg.xadj = new idx_t[g.getNVertex() + 1]; - Mg.adjncy = new idx_t[g.getNEdge()]; + // init basic graph informations and part vector + // Put the total communication size to NULL + + Mg.nvtxs[0] = sub_g.getNVertex(); + Mg.part = new idx_t[sub_g.getNVertex()]; + for (int i = 0; i < sub_g.getNVertex(); i++) + Mg.part[i] = p_id; + + // create xadj, adjlist, vwgt, adjwgt and vsize + Mg.xadj = new idx_t[sub_g.getNVertex() + 1]; + Mg.adjncy = new idx_t[sub_g.getNEdge()]; + Mg.vwgt = new idx_t[sub_g.getNVertex()]; + Mg.adjwgt = new idx_t[sub_g.getNEdge()]; + Mg.vsize = new idx_t[sub_g.getNVertex()]; //! starting point in the adjacency list size_t prev = 0; @@ -134,29 +146,41 @@ class Parmetis { size_t real_id; // boolan to check if ref is the main graph - bool main = refGraph.getNVertex() != g.getNVertex(); + bool main = refGraph.getNVertex() != sub_g.getNVertex(); // for each vertex calculate the position of the starting point in the adjacency list - for (size_t i = 0; i < g.getNVertex(); i++) { - // Add weight to vertex - Mg.vwgt[i] = g.vertex(i).template get<nm_v::computation>(); + for (size_t i = 0; i < sub_g.getNVertex(); i++) + { + + // Add weight to vertex and migration cost + Mg.vwgt[i] = sub_g.vertex(i).template get<nm_v::computation>(); + Mg.vsize[i] = sub_g.vertex(i).template get<nm_v::migration>();; // Calculate the starting point in the adjacency list Mg.xadj[id] = prev; if (main) - real_id = g.get_real_id(g.vertex(i).template get<nm_v::id>()); + real_id = sub_g.get_real_id(sub_g.vertex(i).template get<nm_v::id>()); else real_id = i; // Create the adjacency list and the weights for edges - for (size_t s = 0; s < refGraph.getNChilds(real_id); s++) { + for (size_t s = 0; s < refGraph.getNChilds(real_id); s++) + { + size_t child = refGraph.getChild(real_id, s); if (main) + { Mg.adjncy[prev + s] = refGraph.vertex(child).template get<nm_v::id>(); + } else + { Mg.adjncy[prev + s] = child; + } + + Mg.adjwgt[prev + s] = refGraph.edge(prev+s).template get<nm_e::communication>(); + } // update the position for the next vertex @@ -168,17 +192,27 @@ class Parmetis { // Fill the last point Mg.xadj[id] = prev; - -/* std::cout << p_id << "\n"; - for(int i=0; i<= g.getNVertex();i++){ + /* + std::cout << p_id << " ------------"; + for (int i = 0; i <= sub_g.getNVertex(); i++) { + std::cout << Mg.vwgt[i] << " "; + } + std::cout << "\n"; + + + if (p_id == 0) { + std::cout << p_id << "\n"; + for (int i = 0; i <= sub_g.getNVertex(); i++) { std::cout << Mg.xadj[i] << " "; } std::cout << "\n\n"; - for(int i=0; i< g.getNEdge();i++){ - std::cout << Mg.adjncy[i] << " "; + + for (int i = 0; i < sub_g.getNEdge(); i++) { + std::cout << Mg.adjwgt[i] << " "; } - std::cout << "\n\n";*/ - + std::cout << "\n\n"; + */ + } @@ -188,61 +222,61 @@ class Parmetis { * */ /* - void constructAdjList(Graph &refGraph, idx_t* &old_vtxdist ) { - // create xadj and adjlist - Mg.vwgt = new idx_t[g.getNVertex()]; - Mg.xadj = new idx_t[g.getNVertex() + 1]; - Mg.adjncy = new idx_t[g.getNEdge()]; + void constructAdjList(Graph &refGraph, idx_t* &old_vtxdist ) { + // create xadj and adjlist + Mg.vwgt = new idx_t[g.getNVertex()]; + Mg.xadj = new idx_t[g.getNVertex() + 1]; + Mg.adjncy = new idx_t[g.getNEdge()]; - //! starting point in the adjacency list - size_t prev = 0; + //! starting point in the adjacency list + size_t prev = 0; - // actual position - size_t id = 0; + // actual position + size_t id = 0; - // for each vertex calculate the position of the starting point in the adjacency list - for (size_t i = 0; i < g.getNVertex(); i++) { + // for each vertex calculate the position of the starting point in the adjacency list + for (size_t i = 0; i < g.getNVertex(); i++) { - // Add weight to vertex - Mg.vwgt[i] = g.vertex(i).template get<nm_v::computation>(); + // Add weight to vertex + Mg.vwgt[i] = g.vertex(i).template get<nm_v::computation>(); - // Calculate the starting point in the adjacency list - Mg.xadj[id] = prev; + // Calculate the starting point in the adjacency list + Mg.xadj[id] = prev; - // Create the adjacency list and the weights for edges - for (size_t s = 0; s < refGraph.getNChilds(i); s++) { + // Create the adjacency list and the weights for edges + for (size_t s = 0; s < refGraph.getNChilds(i); s++) { - size_t child = refGraph.getChild(i, s); + size_t child = refGraph.getChild(i, s); - // Check if child is not in this processor - if(child > old_vtxdist[p_id+1] || child < old_vtxdist[p_id]) + // Check if child is not in this processor + if(child > old_vtxdist[p_id+1] || child < old_vtxdist[p_id]) - Mg.adjncy[prev + s] = child; - } + Mg.adjncy[prev + s] = child; + } - // update the position for the next vertex - prev += refGraph.getNChilds(i); + // update the position for the next vertex + prev += refGraph.getNChilds(i); - id++; - } + id++; + } - // Fill the last point - Mg.xadj[id] = prev; + // Fill the last point + Mg.xadj[id] = prev; - std::cout << p_id << "\n"; - for(int i=0; i<= g.getNVertex();i++){ - std::cout << Mg.xadj[i] << " "; - } - std::cout << "\n\n"; - for(int i=0; i< g.getNEdge();i++){ - std::cout << Mg.adjncy[i] << " "; - } - std::cout << "\n\n"; + std::cout << p_id << "\n"; + for(int i=0; i<= g.getNVertex();i++){ + std::cout << Mg.xadj[i] << " "; + } + std::cout << "\n\n"; + for(int i=0; i< g.getNEdge();i++){ + std::cout << Mg.adjncy[i] << " "; + } + std::cout << "\n\n"; - } - */ + } + */ public: /*! \brief Constructor @@ -253,82 +287,97 @@ public: * \param nc number of partitions * */ - Parmetis(Vcluster & v_cl, size_t nc) - :v_cl(v_cl),nc(nc) + Parmetis(Vcluster & v_cl, size_t nc) : + v_cl(v_cl), nc(nc) { // TODO Move into VCluster MPI_Comm_dup(MPI_COMM_WORLD, &comm); } - + //TODO deconstruct new variables /*! \brief destructor * * Destructor, It destroy all the memory allocated * */ - ~Parmetis() { + ~Parmetis() + { // Deallocate the Mg structure - if (Mg.nvtxs != NULL) { + if (Mg.nvtxs != NULL) + { delete[] Mg.nvtxs; } - if (Mg.ncon != NULL) { + if (Mg.ncon != NULL) + { delete[] Mg.ncon; } - if (Mg.xadj != NULL) { + if (Mg.xadj != NULL) + { delete[] Mg.xadj; } - if (Mg.adjncy != NULL) { + if (Mg.adjncy != NULL) + { delete[] Mg.adjncy; } - if (Mg.vwgt != NULL) { + if (Mg.vwgt != NULL) + { delete[] Mg.vwgt; } - if (Mg.adjwgt != NULL) { + if (Mg.adjwgt != NULL) + { delete[] Mg.adjwgt; } - if (Mg.nparts != NULL) { + if (Mg.nparts != NULL) + { delete[] Mg.nparts; } - if (Mg.tpwgts != NULL) { + if (Mg.tpwgts != NULL) + { delete[] Mg.tpwgts; } - if (Mg.ubvec != NULL) { + if (Mg.ubvec != NULL) + { delete[] Mg.ubvec; } - if (Mg.options != NULL) { + if (Mg.options != NULL) + { delete[] Mg.options; } - if (Mg.part != NULL) { + if (Mg.part != NULL) + { delete[] Mg.part; } - if (Mg.edgecut != NULL) { + if (Mg.edgecut != NULL) + { delete[] Mg.edgecut; } - if (Mg.numflag != NULL) { + if (Mg.numflag != NULL) + { delete[] Mg.numflag; } - if (Mg.wgtflag != NULL) { + if (Mg.wgtflag != NULL) + { delete[] Mg.wgtflag; } } /*! \brief Set the Sub-graph - * + * * \param sub_g Sub-graph to set - * + * */ void initSubGraph(Graph & sub_g) { @@ -344,21 +393,17 @@ public: Mg.ncon = new idx_t[1]; Mg.ncon[0] = 1; - // Set to null the weight of the vertex + // Set to null the weight of the vertex (init after in constructAdjList) (can be removed) Mg.vwgt = NULL; - // construct the adjacency list - - constructAdjList(sub_g,sub_g); - - // Put the total communication size to NULL + // Set to null the weight of the edge (init after in constructAdjList) (can be removed) - Mg.vsize = NULL; + Mg.adjwgt = NULL; - // Set to null the weight of the edge + // construct the adjacency list - Mg.adjwgt = NULL; + constructAdjList(sub_g, sub_g); // Set the total number of partitions @@ -368,8 +413,8 @@ public: //! Set option for the graph partitioning (set as default) Mg.options = new idx_t[4]; - Mg.options[0] = 1; - Mg.options[1] = 3; + Mg.options[0] = 0; + Mg.options[1] = 0; Mg.options[2] = 0; Mg.options[3] = 0; @@ -388,7 +433,8 @@ public: Mg.tpwgts = new real_t[Mg.nparts[0]]; Mg.ubvec = new real_t[Mg.nparts[0]]; - for (int s = 0; s < Mg.nparts[0]; s++) { + for (int s = 0; s < Mg.nparts[0]; s++) + { Mg.tpwgts[s] = 1.0 / Mg.nparts[0]; Mg.ubvec[s] = 1.05; } @@ -402,31 +448,33 @@ public: //! This is used to indicate if the graph is weighted. wgtflag can take one of four values: Mg.wgtflag = new idx_t[1]; - Mg.wgtflag[0] = 2; + Mg.wgtflag[0] = 3; } - + /*! \brief Decompose the graph * * \tparam i which property store the decomposition * - * - * + * + * */ template<unsigned int i> - void decompose(openfpm::vector<idx_t> & vtxdist, Graph & sub_g) + void decompose(openfpm::vector<idx_t> & vtxdist, Graph & sub_g) { // Decompose - ParMETIS_V3_PartKway((idx_t *)vtxdist.getPointer(), Mg.xadj, Mg.adjncy, Mg.vwgt, Mg.adjwgt, Mg.wgtflag, Mg.numflag, Mg.ncon, Mg.nparts, Mg.tpwgts, - Mg.ubvec, Mg.options, Mg.edgecut, Mg.part, &comm); /* - ParMETIS_V3_AdaptiveRepart( vtxdist, Mg.xadj,Mg.adjncy,Mg.vwgt,Mg.vsize,Mg.adjwgt, &(Mg.wgtflag), &(Mg.numflag), - Mg.ncon, Mg.nparts, Mg.tpwgts, Mg.ubvec, &(Mg.itr), Mg.options, &(Mg.edgecut), + ParMETIS_V3_PartKway((idx_t *) vtxdist.getPointer(), Mg.xadj, Mg.adjncy, Mg.vwgt, Mg.adjwgt, Mg.wgtflag, + Mg.numflag, Mg.ncon, Mg.nparts, Mg.tpwgts, Mg.ubvec, Mg.options, Mg.edgecut, Mg.part, &comm); + */ + ParMETIS_V3_AdaptiveRepart( (idx_t *) vtxdist.getPointer(), Mg.xadj,Mg.adjncy,Mg.vwgt,Mg.vsize,Mg.adjwgt, Mg.wgtflag, Mg.numflag, + Mg.ncon, Mg.nparts, Mg.tpwgts, Mg.ubvec, Mg.itr, Mg.options, Mg.edgecut, Mg.part, &comm ); - */ + // For each vertex store the processor that contain the data - for (size_t j = 0, id = 0; j < sub_g.getNVertex() ; j++, id++) { + for (size_t j = 0, id = 0; j < sub_g.getNVertex(); j++, id++) + { sub_g.vertex(j).template get<i>() = Mg.part[id]; @@ -441,16 +489,18 @@ public: */ template<unsigned int i> - void refine(openfpm::vector<idx_t> & vtxdist, Graph & sub_g) + void refine(openfpm::vector<idx_t> & vtxdist, Graph & sub_g) { // Refine - - ParMETIS_V3_RefineKway((idx_t *)vtxdist.getPointer(), Mg.xadj, Mg.adjncy, Mg.vwgt, Mg.adjwgt, Mg.wgtflag, Mg.numflag, Mg.ncon, Mg.nparts, Mg.tpwgts, - Mg.ubvec, Mg.options, Mg.edgecut, Mg.part, &comm); + + ParMETIS_V3_AdaptiveRepart((idx_t *) vtxdist.getPointer(), Mg.xadj, Mg.adjncy, Mg.vwgt, Mg.vsize, Mg.adjwgt, + Mg.wgtflag, Mg.numflag, Mg.ncon, Mg.nparts, Mg.tpwgts, Mg.ubvec, Mg.itr, Mg.options, Mg.edgecut, + Mg.part, &comm); // For each vertex store the processor that contain the data - for (size_t j = 0, id = 0; j < sub_g.getNVertex(); j++, id++) { + for (size_t j = 0, id = 0; j < sub_g.getNVertex(); j++, id++) + { sub_g.vertex(j).template get<i>() = Mg.part[id]; @@ -460,46 +510,45 @@ public: /*! \brief Get graph partition vector * */ - idx_t* getPartition() { + idx_t* getPartition() + { return Mg.part; } /*! \brief Reset graph and reconstruct it * */ - void reset(Graph & mainGraph, Graph & sub_g) + void reset(Graph & mainGraph, Graph & sub_g) { // Deallocate the graph structures - if (Mg.xadj != NULL) { + if (Mg.xadj != NULL) + { delete[] Mg.xadj; } - if (Mg.adjncy != NULL) { + if (Mg.adjncy != NULL) + { delete[] Mg.adjncy; } - if (Mg.vwgt != NULL) { + if (Mg.vwgt != NULL) + { delete[] Mg.vwgt; } - if (Mg.adjwgt != NULL) { + if (Mg.adjwgt != NULL) + { delete[] Mg.adjwgt; } - if (Mg.part != NULL) { + if (Mg.part != NULL) + { delete[] Mg.part; } - Mg.nvtxs[0] = sub_g.getNVertex(); - - Mg.part = new idx_t[sub_g.getNVertex()]; - - for (int i = 0; i < sub_g.getNVertex(); i++) - Mg.part[i] = p_id; - // construct the adjacency list - constructAdjList(mainGraph,sub_g); + constructAdjList(mainGraph, sub_g); } }; diff --git a/vtk/Metis_gen_vtk.cpp b/vtk/Metis_gen_vtk.cpp index 2da27e29df2a84f18b59a09f7f8714ec9343a26e..08101d9eedf8c294b0df1ccaad399a18f45f6e97 100644 --- a/vtk/Metis_gen_vtk.cpp +++ b/vtk/Metis_gen_vtk.cpp @@ -8,6 +8,7 @@ #ifndef VTK_METIS_GEN_VTK_CPP_ #define VTK_METIS_GEN_VTK_CPP_ +#include <iostream> #include "Graph/CartesianGraphFactory.hpp" #include "Graph/map_graph.hpp" #include "metis_util.hpp" diff --git a/vtk/domain_gen_vtk.cpp b/vtk/domain_gen_vtk.cpp index 7a5e6fc06187ee9b78492668832e793130f54107..8d4bbcd9f8e8ddc5d987ef54cd7272e2d5b52655 100644 --- a/vtk/domain_gen_vtk.cpp +++ b/vtk/domain_gen_vtk.cpp @@ -5,6 +5,7 @@ * Author: Pietro Incardona */ +#include <iostream> #include "Space/Shape/Box.hpp" #include "Vector/map_vector.hpp" #include "VTKWriter.hpp"