From: <den...@us...> - 2009-12-30 14:34:37
|
Revision: 38 http://dsim.svn.sourceforge.net/dsim/?rev=38&view=rev Author: denis_arnaud Date: 2009-12-30 14:34:30 +0000 (Wed, 30 Dec 2009) Log Message: ----------- [Test] Added missing dependencies for the delivery (as a tar-ball) of tests. Modified Paths: -------------- trunk/dsim/test/boost/Makefile.am trunk/dsim/test/boost/mpi/Makefile.am Modified: trunk/dsim/test/boost/Makefile.am =================================================================== --- trunk/dsim/test/boost/Makefile.am 2009-12-30 14:25:05 UTC (rev 37) +++ trunk/dsim/test/boost/Makefile.am 2009-12-30 14:34:30 UTC (rev 38) @@ -1,9 +1,10 @@ ## test/boost sub-directory include $(top_srcdir)/Makefile.common +# +MAINTAINERCLEANFILES = Makefile.in + ## SUBDIRS = accumulators asio mpi mpl serialization signals spirit -MAINTAINERCLEANFILES = Makefile.in - EXTRA_DIST = Modified: trunk/dsim/test/boost/mpi/Makefile.am =================================================================== --- trunk/dsim/test/boost/mpi/Makefile.am 2009-12-30 14:25:05 UTC (rev 37) +++ trunk/dsim/test/boost/mpi/Makefile.am 2009-12-30 14:34:30 UTC (rev 38) @@ -1,17 +1,26 @@ -## test/mpi sub-directory +## test/boost/mpi sub-directory include $(top_srcdir)/Makefile.common MAINTAINERCLEANFILES = Makefile.in +# +SUBDIRS = + +EXTRA_DIST = pympi.py + +# check_PROGRAMS = mpi_c mpi mpi_p2p + # mpi_c must be compiled with mpic++ # Note: mpic++/mpiCC is a wrapper around the MPI C++ compiler, and knows # where MPI is installed. So, there is no need to specify any other # CFLAGS or LDFLAGS at that stage. -mpi_c: mpi_c.cpp +mpi_c_SOURCES = mpi_c.cpp +mpi_c: $(mpi_c_SOURCES) mpic++ -o $@ $< +# mpi_SOURCES = mpi.cpp mpi_CXXFLAGS = $(BOOST_CFLAGS) $(MPICH2_CFLAGS) mpi_LDFLAGS = $(BOOST_LIBS) $(BOOST_MPI_LIB) @@ -22,4 +31,3 @@ mpi_p2p_LDFLAGS = $(BOOST_LIBS) $(BOOST_MPI_LIB) mpi_p2p_LDADD = -EXTRA_DIST = This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-06-10 09:49:53
|
Revision: 83 http://dsim.svn.sourceforge.net/dsim/?rev=83&view=rev Author: denis_arnaud Date: 2010-06-10 09:49:46 +0000 (Thu, 10 Jun 2010) Log Message: ----------- [Config] Added the MPI C library to the dependencies. Modified Paths: -------------- trunk/dsim/test/boost/filesystem/Makefile.am trunk/dsim/test/boost/mpi/alo_example Removed Paths: ------------- trunk/dsim/test/boost/mpi/Makefile trunk/dsim/test/boost/mpi/Makefile.in Property Changed: ---------------- trunk/dsim/test/boost/mpi/ Modified: trunk/dsim/test/boost/filesystem/Makefile.am =================================================================== --- trunk/dsim/test/boost/filesystem/Makefile.am 2010-05-25 11:14:30 UTC (rev 82) +++ trunk/dsim/test/boost/filesystem/Makefile.am 2010-06-10 09:49:46 UTC (rev 83) @@ -17,41 +17,44 @@ simple_ls_SOURCES = simple_ls.cpp simple_ls_CXXFLAGS = $(BOOST_CFLAGS) simple_ls_LDADD = -simple_ls_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB) +simple_ls_LDFLAGS = $(BOOST_LIBS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) # file_size_SOURCES = file_size.cpp file_size_CXXFLAGS = $(BOOST_CFLAGS) file_size_LDADD = -file_size_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB) +file_size_LDFLAGS = $(BOOST_LIBS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) # process_jam_log_SOURCES = tiny_xml.hpp tiny_xml.cpp process_jam_log.cpp process_jam_log_CXXFLAGS = $(BOOST_CFLAGS) process_jam_log_LDADD = -process_jam_log_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB) +process_jam_log_LDFLAGS = \ + $(BOOST_LIBS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) # path_test_SOURCES = path_test.cpp path_test_CXXFLAGS = $(BOOST_CFLAGS) path_test_LDADD = -path_test_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB) +path_test_LDFLAGS = $(BOOST_LIBS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) # wide_test_SOURCES = wide_test.cpp wide_test_CXXFLAGS = $(BOOST_CFLAGS) wide_test_LDADD = -wide_test_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB) +wide_test_LDFLAGS = $(BOOST_LIBS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) # operations_test_SOURCES = operations_test.cpp operations_test_CXXFLAGS = $(BOOST_CFLAGS) operations_test_LDADD = -operations_test_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB) +operations_test_LDFLAGS = \ + $(BOOST_LIBS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) # fstream_test_SOURCES = fstream_test.cpp fstream_test_CXXFLAGS = $(BOOST_CFLAGS) fstream_test_LDADD = -fstream_test_LDFLAGS = $(BOOST_LIBS) $(BOOST_FILESYSTEM_LIB) +fstream_test_LDFLAGS = \ + $(BOOST_LIBS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) Property changes on: trunk/dsim/test/boost/mpi ___________________________________________________________________ Modified: svn:ignore - .deps .libs Makefile.in Makefile mpi_c mpi mpi_p2p mpi_p2p_nb + .deps .libs Makefile.in Makefile mpi_c mpi mpi_p2p mpi_p2p_nb alo_example Deleted: trunk/dsim/test/boost/mpi/Makefile =================================================================== --- trunk/dsim/test/boost/mpi/Makefile 2010-05-25 11:14:30 UTC (rev 82) +++ trunk/dsim/test/boost/mpi/Makefile 2010-06-10 09:49:46 UTC (rev 83) @@ -1,826 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# test/boost/mpi/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - - -pkgdatadir = $(datadir)/dsim -pkgincludedir = $(includedir)/dsim -pkglibdir = $(libdir)/dsim -pkglibexecdir = $(libexecdir)/dsim -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = i686-pc-linux-gnu -host_triplet = i686-pc-linux-gnu -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/Makefile.common -check_PROGRAMS = mpi_c$(EXEEXT) mpi$(EXEEXT) mpi_p2p$(EXEEXT) \ - mpi_p2p_nb$(EXEEXT) alo_example$(EXEEXT) -subdir = test/boost/mpi -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/config/ax_boost.m4 \ - $(top_srcdir)/config/ax_mysql.m4 \ - $(top_srcdir)/config/cppunit.m4 $(top_srcdir)/config/gsl.m4 \ - $(top_srcdir)/config/librt.m4 $(top_srcdir)/config/libtool.m4 \ - $(top_srcdir)/config/ltoptions.m4 \ - $(top_srcdir)/config/ltsugar.m4 \ - $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/openmpi.m4 $(top_srcdir)/config/python.m4 \ - $(top_srcdir)/config/soci.m4 $(top_srcdir)/config/xerces.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/stdair/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am_alo_example_OBJECTS = alo_example-alo_example.$(OBJEXT) -alo_example_OBJECTS = $(am_alo_example_OBJECTS) -alo_example_DEPENDENCIES = -alo_example_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(alo_example_CXXFLAGS) \ - $(CXXFLAGS) $(alo_example_LDFLAGS) $(LDFLAGS) -o $@ -am_mpi_OBJECTS = mpi-mpi.$(OBJEXT) -mpi_OBJECTS = $(am_mpi_OBJECTS) -mpi_DEPENDENCIES = -mpi_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(mpi_CXXFLAGS) $(CXXFLAGS) \ - $(mpi_LDFLAGS) $(LDFLAGS) -o $@ -am_mpi_c_OBJECTS = mpi_c.$(OBJEXT) -mpi_c_OBJECTS = $(am_mpi_c_OBJECTS) -mpi_c_LDADD = $(LDADD) -am_mpi_p2p_OBJECTS = mpi_p2p-mpi_p2p.$(OBJEXT) -mpi_p2p_OBJECTS = $(am_mpi_p2p_OBJECTS) -mpi_p2p_DEPENDENCIES = -mpi_p2p_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(mpi_p2p_CXXFLAGS) $(CXXFLAGS) \ - $(mpi_p2p_LDFLAGS) $(LDFLAGS) -o $@ -am_mpi_p2p_nb_OBJECTS = mpi_p2p_nb-mpi_p2p_nb.$(OBJEXT) -mpi_p2p_nb_OBJECTS = $(am_mpi_p2p_nb_OBJECTS) -mpi_p2p_nb_DEPENDENCIES = -mpi_p2p_nb_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(mpi_p2p_nb_CXXFLAGS) \ - $(CXXFLAGS) $(mpi_p2p_nb_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I. -I$(top_builddir)/stdair -depcomp = $(SHELL) $(top_srcdir)/config/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(alo_example_SOURCES) $(mpi_SOURCES) $(mpi_c_SOURCES) \ - $(mpi_p2p_SOURCES) $(mpi_p2p_nb_SOURCES) -DIST_SOURCES = $(alo_example_SOURCES) $(mpi_SOURCES) $(mpi_c_SOURCES) \ - $(mpi_p2p_SOURCES) $(mpi_p2p_nb_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = ${SHELL} /home/localoriuser/dev/dsimsvn/config/missing --run aclocal-1.11 -AMTAR = ${SHELL} /home/localoriuser/dev/dsimsvn/config/missing --run tar -AR = ar -AUTOCONF = ${SHELL} /home/localoriuser/dev/dsimsvn/config/missing --run autoconf -AUTOHEADER = ${SHELL} /home/localoriuser/dev/dsimsvn/config/missing --run autoheader -AUTOMAKE = ${SHELL} /home/localoriuser/dev/dsimsvn/config/missing --run automake-1.11 -AWK = gawk -BOOST_ASIO_LIB = -lboost_system -lboost_thread-mt -lboost_date_time -lboost_regex -lboost_serialization -BOOST_CFLAGS = -pthread -I/usr/include -BOOST_DATE_TIME_LIB = -lboost_date_time -BOOST_FILESYSTEM_LIB = -lboost_filesystem -BOOST_IOSTREAMS_LIB = -lboost_iostreams -BOOST_LIBS = -L/usr/lib -BOOST_MPI_LIB = -lboost_mpi -lboost_serialization -L/usr/lib/openmpi/lib -lmpi_cxx -BOOST_MPI_PYTHON_LIB = -lboost_mpi_python -lboost_serialization -lboost_python -L/usr/lib -lpython2.6 -lpthread -ldl -lutil -lm -lboost_mpi -lboost_serialization -L/usr/lib/openmpi/lib -lmpi_cxx -L/usr/lib/openmpi/lib -lmpi_cxx -BOOST_PROGRAM_OPTIONS_LIB = -lboost_program_options -BOOST_PYTHON_LIB = -lboost_python -L/usr/lib -lpython2.6 -lpthread -ldl -lutil -lm -BOOST_REGEX_LIB = -lboost_regex -BOOST_SERIALIZATION_LIB = -lboost_serialization -BOOST_SIGNALS_LIB = -lboost_signals -BOOST_SYSTEM_LIB = -lboost_system -BOOST_THREAD_LIB = -lboost_thread-mt -BOOST_UNIT_TEST_FRAMEWORK_LIB = -lboost_unit_test_framework -BOOST_VERSION = 1_41 -BOOST_WSERIALIZATION_LIB = -lboost_wserialization -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CPP = gcc -E -CPPFLAGS = -CPPUNIT_CFLAGS = -CPPUNIT_CONFIG = /usr/bin/cppunit-config -CPPUNIT_LIBS = -lcppunit -ldl -CPPUNIT_VERSION = 1.12.1 -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -CXXFLAGS_DEBUG = -CXXFLAGS_OPT = -DASSERT_LEVEL=1 -O2 -Wall -pipe -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -DSYMUTIL = -DUMPBIN = -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = /bin/grep -E -EXEEXT = -FGREP = /bin/grep -F -GENERIC_LIBRARY_VERSION = 99:99:99 -GREP = /bin/grep -GSL_CFLAGS = -I/usr/include -GSL_CONFIG = /usr/bin/gsl-config -GSL_LIBS = -lgsl -lgslcblas -lm -GSL_VERSION = 1.13 -INSTALL = /usr/bin/install -c -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -LD = /usr/bin/ld -LDFLAGS = -LIBOBJS = -LIBS = -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LIPO = -LN_S = ln -s -LTLIBOBJS = -MAKEINFO = ${SHELL} /home/localoriuser/dev/dsimsvn/config/missing --run makeinfo -MKDIR_P = /bin/mkdir -p -MPIGEN_CFLAGS = -I/usr/include/openmpi-i386 -I/usr/include/openmpi-i386/openmpi -I/usr/include/openmpi-i386/32 -m32 -MPIGEN_LIBS = -L/usr/lib/openmpi/lib -lmpi_cxx -MPIGEN_VERSION = 1.3.3 -MYSQL_CFLAGS = -I/usr/include/mysql -MYSQL_C_LIB = mysqlclient -MYSQL_LIBS = -L/usr/lib/mysql -lmysqlclient -MYSQL_VERSION = 5.1.46 -NM = /usr/bin/nm -B -NMEDIT = -OBJDUMP = objdump -OBJEXT = o -OPENMPI_CFLAGS = -I/usr/include/openmpi-i386 -I/usr/include/openmpi-i386/openmpi -I/usr/include/openmpi-i386/32 -m32 -OPENMPI_LIBS = -L/usr/lib/openmpi/lib -lmpi_cxx -OPENMPI_VERSION = 1.3.3 -OTOOL = -OTOOL64 = -PACKAGE = dsim -PACKAGE_BUGREPORT = den...@us... -PACKAGE_DEBUG = dsim -PACKAGE_NAME = DSIM -PACKAGE_STRING = DSIM 99.99.99 -PACKAGE_TARNAME = dsim -PACKAGE_VERSION = 99.99.99 -PATH_SEPARATOR = : -PERL = /usr/bin/perl -PYTHON = /usr/bin/python -PYTHON_ADD_LIBS = -lpthread -ldl -lutil -lm -PYTHON_CFLAGS = -I/usr/include/python2.6 -PYTHON_LIBS = -L/usr/lib -lpython2.6 -PYTHON_VERSION = 2.6.2 -RANLIB = ranlib -RPM_RELEASE = 1 -RT_LIBS = -lrt -SED = /bin/sed -SET_MAKE = -SHELL = /bin/sh -SOCI_CFLAGS = -DSOCI_HEADERS_BURIED -DSOCI_MYSQL_HEADERS_BURIED -I/usr/include/mysql -SOCI_CORE_LIB = soci_core -SOCI_LIBS = -L/usr/lib/mysql -lmysqlclient -lsoci_core -lsoci_mysql -ldl -SOCI_VERSION = 3.0.0 -STRIP = strip -UPLOAD_COMMAND = ncftpput -u ori-data -v orinet.nce.amadeus.net /remote/oridata/www/oridist/projects/dsim/99.99.99 -VERSION = 99.99.99 -XERCES_CFLAGS = -I/usr/include -XERCES_LIBS = -L/usr/lib -lxerces-c -XERCES_VERSION = 2.8.0 -abs_builddir = /home/localoriuser/dev/dsimsvn/test/boost/mpi -abs_srcdir = /home/localoriuser/dev/dsimsvn/test/boost/mpi -abs_top_builddir = /home/localoriuser/dev/dsimsvn -abs_top_srcdir = /home/localoriuser/dev/dsimsvn -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_DUMPBIN = -am__include = include -am__leading_dot = . -am__quote = -am__tar = ${AMTAR} chof - "$$tardir" -am__untar = ${AMTAR} xf - -bindir = ${exec_prefix}/bin -build = i686-pc-linux-gnu -build_alias = -build_cpu = i686 -build_os = linux-gnu -build_vendor = pc -builddir = . -datadir = ${datarootdir} -datarootdir = ${prefix}/share -diff_ok = yes -docdir = ${datarootdir}/doc/dsim-99.99.99 -doxygen_ok = yes -dvidir = ${docdir} -dvips_ok = no -exec_prefix = ${prefix} -gs_ok = yes -host = i686-pc-linux-gnu -host_alias = -host_cpu = i686 -host_os = linux-gnu -host_vendor = pc -htmldir = ${docdir} -includedir = ${prefix}/include -infodir = ${datarootdir}/info -install_sh = ${SHELL} /home/localoriuser/dev/dsimsvn/config/install-sh -latex_ok = no -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localedir = ${datarootdir}/locale -localstatedir = ${prefix}/var -lt_ECHO = echo -mandir = ${datarootdir}/man -mkdir_p = /bin/mkdir -p -oldincludedir = /usr/include -pdfdir = ${docdir} -prefix = /usr/local -program_transform_name = s,x,x, -psdir = ${docdir} -python_configdir = /usr/lib/python2.6/config -python_incdir = -python_libdir = /usr/lib -sbindir = ${exec_prefix}/sbin -sed_ok = yes -sharedstatedir = ${prefix}/com -srcdir = . -sysconfdir = ${prefix}/etc -target_alias = -top_build_prefix = ../../../ -top_builddir = ../../.. -top_srcdir = ../../.. -AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -AM_LDFLAGS = -MAINTAINERCLEANFILES = Makefile.in - -# -SUBDIRS = -EXTRA_DIST = pympi.py - -# mpi_c must be compiled with mpic++ -# Note: mpic++/mpiCC is a wrapper around the MPI C++ compiler, and knows -# where MPI is installed. So, there is no need to specify any other -# CFLAGS or LDFLAGS at that stage. -mpi_c_SOURCES = mpi_c.cpp - -# -mpi_SOURCES = mpi.cpp -mpi_CXXFLAGS = $(BOOST_CFLAGS) $(MPIGEN_CFLAGS) -mpi_LDFLAGS = $(BOOST_LIBS) $(BOOST_MPI_LIB) -mpi_LDADD = -mpi_p2p_SOURCES = mpi_p2p.cpp -mpi_p2p_CXXFLAGS = $(BOOST_CFLAGS) $(MPIGEN_CFLAGS) -mpi_p2p_LDFLAGS = $(BOOST_LIBS) $(BOOST_MPI_LIB) -mpi_p2p_LDADD = -mpi_p2p_nb_SOURCES = mpi_p2p_nb.cpp -mpi_p2p_nb_CXXFLAGS = $(BOOST_CFLAGS) $(MPIGEN_CFLAGS) -mpi_p2p_nb_LDFLAGS = $(BOOST_LIBS) $(BOOST_MPI_LIB) -mpi_p2p_nb_LDADD = -alo_example_SOURCES = alo_example.cpp -alo_example_CXXFLAGS = $(BOOST_CFLAGS) $(MPIGEN_CFLAGS) -alo_example_LDFLAGS = $(BOOST_LIBS) $(BOOST_MPI_LIB) -alo_example_LDADD = -all: all-recursive - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.common $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/boost/mpi/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu test/boost/mpi/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-checkPROGRAMS: - @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -alo_example$(EXEEXT): $(alo_example_OBJECTS) $(alo_example_DEPENDENCIES) - @rm -f alo_example$(EXEEXT) - $(alo_example_LINK) $(alo_example_OBJECTS) $(alo_example_LDADD) $(LIBS) -mpi$(EXEEXT): $(mpi_OBJECTS) $(mpi_DEPENDENCIES) - @rm -f mpi$(EXEEXT) - $(mpi_LINK) $(mpi_OBJECTS) $(mpi_LDADD) $(LIBS) -mpi_p2p$(EXEEXT): $(mpi_p2p_OBJECTS) $(mpi_p2p_DEPENDENCIES) - @rm -f mpi_p2p$(EXEEXT) - $(mpi_p2p_LINK) $(mpi_p2p_OBJECTS) $(mpi_p2p_LDADD) $(LIBS) -mpi_p2p_nb$(EXEEXT): $(mpi_p2p_nb_OBJECTS) $(mpi_p2p_nb_DEPENDENCIES) - @rm -f mpi_p2p_nb$(EXEEXT) - $(mpi_p2p_nb_LINK) $(mpi_p2p_nb_OBJECTS) $(mpi_p2p_nb_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -include ./$(DEPDIR)/alo_example-alo_example.Po -include ./$(DEPDIR)/mpi-mpi.Po -include ./$(DEPDIR)/mpi_c.Po -include ./$(DEPDIR)/mpi_p2p-mpi_p2p.Po -include ./$(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Po - -.cpp.o: - $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: - $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` - $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: - $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -# source='$<' object='$@' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(LTCXXCOMPILE) -c -o $@ $< - -alo_example-alo_example.o: alo_example.cpp - $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alo_example_CXXFLAGS) $(CXXFLAGS) -MT alo_example-alo_example.o -MD -MP -MF $(DEPDIR)/alo_example-alo_example.Tpo -c -o alo_example-alo_example.o `test -f 'alo_example.cpp' || echo '$(srcdir)/'`alo_example.cpp - $(am__mv) $(DEPDIR)/alo_example-alo_example.Tpo $(DEPDIR)/alo_example-alo_example.Po -# source='alo_example.cpp' object='alo_example-alo_example.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alo_example_CXXFLAGS) $(CXXFLAGS) -c -o alo_example-alo_example.o `test -f 'alo_example.cpp' || echo '$(srcdir)/'`alo_example.cpp - -alo_example-alo_example.obj: alo_example.cpp - $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alo_example_CXXFLAGS) $(CXXFLAGS) -MT alo_example-alo_example.obj -MD -MP -MF $(DEPDIR)/alo_example-alo_example.Tpo -c -o alo_example-alo_example.obj `if test -f 'alo_example.cpp'; then $(CYGPATH_W) 'alo_example.cpp'; else $(CYGPATH_W) '$(srcdir)/alo_example.cpp'; fi` - $(am__mv) $(DEPDIR)/alo_example-alo_example.Tpo $(DEPDIR)/alo_example-alo_example.Po -# source='alo_example.cpp' object='alo_example-alo_example.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alo_example_CXXFLAGS) $(CXXFLAGS) -c -o alo_example-alo_example.obj `if test -f 'alo_example.cpp'; then $(CYGPATH_W) 'alo_example.cpp'; else $(CYGPATH_W) '$(srcdir)/alo_example.cpp'; fi` - -mpi-mpi.o: mpi.cpp - $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_CXXFLAGS) $(CXXFLAGS) -MT mpi-mpi.o -MD -MP -MF $(DEPDIR)/mpi-mpi.Tpo -c -o mpi-mpi.o `test -f 'mpi.cpp' || echo '$(srcdir)/'`mpi.cpp - $(am__mv) $(DEPDIR)/mpi-mpi.Tpo $(DEPDIR)/mpi-mpi.Po -# source='mpi.cpp' object='mpi-mpi.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_CXXFLAGS) $(CXXFLAGS) -c -o mpi-mpi.o `test -f 'mpi.cpp' || echo '$(srcdir)/'`mpi.cpp - -mpi-mpi.obj: mpi.cpp - $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_CXXFLAGS) $(CXXFLAGS) -MT mpi-mpi.obj -MD -MP -MF $(DEPDIR)/mpi-mpi.Tpo -c -o mpi-mpi.obj `if test -f 'mpi.cpp'; then $(CYGPATH_W) 'mpi.cpp'; else $(CYGPATH_W) '$(srcdir)/mpi.cpp'; fi` - $(am__mv) $(DEPDIR)/mpi-mpi.Tpo $(DEPDIR)/mpi-mpi.Po -# source='mpi.cpp' object='mpi-mpi.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_CXXFLAGS) $(CXXFLAGS) -c -o mpi-mpi.obj `if test -f 'mpi.cpp'; then $(CYGPATH_W) 'mpi.cpp'; else $(CYGPATH_W) '$(srcdir)/mpi.cpp'; fi` - -mpi_p2p-mpi_p2p.o: mpi_p2p.cpp - $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_CXXFLAGS) $(CXXFLAGS) -MT mpi_p2p-mpi_p2p.o -MD -MP -MF $(DEPDIR)/mpi_p2p-mpi_p2p.Tpo -c -o mpi_p2p-mpi_p2p.o `test -f 'mpi_p2p.cpp' || echo '$(srcdir)/'`mpi_p2p.cpp - $(am__mv) $(DEPDIR)/mpi_p2p-mpi_p2p.Tpo $(DEPDIR)/mpi_p2p-mpi_p2p.Po -# source='mpi_p2p.cpp' object='mpi_p2p-mpi_p2p.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_CXXFLAGS) $(CXXFLAGS) -c -o mpi_p2p-mpi_p2p.o `test -f 'mpi_p2p.cpp' || echo '$(srcdir)/'`mpi_p2p.cpp - -mpi_p2p-mpi_p2p.obj: mpi_p2p.cpp - $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_CXXFLAGS) $(CXXFLAGS) -MT mpi_p2p-mpi_p2p.obj -MD -MP -MF $(DEPDIR)/mpi_p2p-mpi_p2p.Tpo -c -o mpi_p2p-mpi_p2p.obj `if test -f 'mpi_p2p.cpp'; then $(CYGPATH_W) 'mpi_p2p.cpp'; else $(CYGPATH_W) '$(srcdir)/mpi_p2p.cpp'; fi` - $(am__mv) $(DEPDIR)/mpi_p2p-mpi_p2p.Tpo $(DEPDIR)/mpi_p2p-mpi_p2p.Po -# source='mpi_p2p.cpp' object='mpi_p2p-mpi_p2p.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_CXXFLAGS) $(CXXFLAGS) -c -o mpi_p2p-mpi_p2p.obj `if test -f 'mpi_p2p.cpp'; then $(CYGPATH_W) 'mpi_p2p.cpp'; else $(CYGPATH_W) '$(srcdir)/mpi_p2p.cpp'; fi` - -mpi_p2p_nb-mpi_p2p_nb.o: mpi_p2p_nb.cpp - $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_nb_CXXFLAGS) $(CXXFLAGS) -MT mpi_p2p_nb-mpi_p2p_nb.o -MD -MP -MF $(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Tpo -c -o mpi_p2p_nb-mpi_p2p_nb.o `test -f 'mpi_p2p_nb.cpp' || echo '$(srcdir)/'`mpi_p2p_nb.cpp - $(am__mv) $(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Tpo $(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Po -# source='mpi_p2p_nb.cpp' object='mpi_p2p_nb-mpi_p2p_nb.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_nb_CXXFLAGS) $(CXXFLAGS) -c -o mpi_p2p_nb-mpi_p2p_nb.o `test -f 'mpi_p2p_nb.cpp' || echo '$(srcdir)/'`mpi_p2p_nb.cpp - -mpi_p2p_nb-mpi_p2p_nb.obj: mpi_p2p_nb.cpp - $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_nb_CXXFLAGS) $(CXXFLAGS) -MT mpi_p2p_nb-mpi_p2p_nb.obj -MD -MP -MF $(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Tpo -c -o mpi_p2p_nb-mpi_p2p_nb.obj `if test -f 'mpi_p2p_nb.cpp'; then $(CYGPATH_W) 'mpi_p2p_nb.cpp'; else $(CYGPATH_W) '$(srcdir)/mpi_p2p_nb.cpp'; fi` - $(am__mv) $(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Tpo $(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Po -# source='mpi_p2p_nb.cpp' object='mpi_p2p_nb-mpi_p2p_nb.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ -# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_nb_CXXFLAGS) $(CXXFLAGS) -c -o mpi_p2p_nb-mpi_p2p_nb.obj `if test -f 'mpi_p2p_nb.cpp'; then $(CYGPATH_W) 'mpi_p2p_nb.cpp'; else $(CYGPATH_W) '$(srcdir)/mpi_p2p_nb.cpp'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -clean: clean-recursive - -clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ - mostlyclean-am - -distclean: distclean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ - ctags-recursive install-am install-strip tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-checkPROGRAMS \ - clean-generic clean-libtool ctags ctags-recursive distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am - - -mpi_c: $(mpi_c_SOURCES) - mpic++ -o $@ $< - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: Deleted: trunk/dsim/test/boost/mpi/Makefile.in =================================================================== --- trunk/dsim/test/boost/mpi/Makefile.in 2010-05-25 11:14:30 UTC (rev 82) +++ trunk/dsim/test/boost/mpi/Makefile.in 2010-06-10 09:49:46 UTC (rev 83) @@ -1,826 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/Makefile.common -check_PROGRAMS = mpi_c$(EXEEXT) mpi$(EXEEXT) mpi_p2p$(EXEEXT) \ - mpi_p2p_nb$(EXEEXT) alo_example$(EXEEXT) -subdir = test/boost/mpi -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/config/ax_boost.m4 \ - $(top_srcdir)/config/ax_mysql.m4 \ - $(top_srcdir)/config/cppunit.m4 $(top_srcdir)/config/gsl.m4 \ - $(top_srcdir)/config/librt.m4 $(top_srcdir)/config/libtool.m4 \ - $(top_srcdir)/config/ltoptions.m4 \ - $(top_srcdir)/config/ltsugar.m4 \ - $(top_srcdir)/config/ltversion.m4 \ - $(top_srcdir)/config/lt~obsolete.m4 \ - $(top_srcdir)/config/openmpi.m4 $(top_srcdir)/config/python.m4 \ - $(top_srcdir)/config/soci.m4 $(top_srcdir)/config/xerces.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/stdair/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am_alo_example_OBJECTS = alo_example-alo_example.$(OBJEXT) -alo_example_OBJECTS = $(am_alo_example_OBJECTS) -alo_example_DEPENDENCIES = -alo_example_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(alo_example_CXXFLAGS) \ - $(CXXFLAGS) $(alo_example_LDFLAGS) $(LDFLAGS) -o $@ -am_mpi_OBJECTS = mpi-mpi.$(OBJEXT) -mpi_OBJECTS = $(am_mpi_OBJECTS) -mpi_DEPENDENCIES = -mpi_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(mpi_CXXFLAGS) $(CXXFLAGS) \ - $(mpi_LDFLAGS) $(LDFLAGS) -o $@ -am_mpi_c_OBJECTS = mpi_c.$(OBJEXT) -mpi_c_OBJECTS = $(am_mpi_c_OBJECTS) -mpi_c_LDADD = $(LDADD) -am_mpi_p2p_OBJECTS = mpi_p2p-mpi_p2p.$(OBJEXT) -mpi_p2p_OBJECTS = $(am_mpi_p2p_OBJECTS) -mpi_p2p_DEPENDENCIES = -mpi_p2p_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(mpi_p2p_CXXFLAGS) $(CXXFLAGS) \ - $(mpi_p2p_LDFLAGS) $(LDFLAGS) -o $@ -am_mpi_p2p_nb_OBJECTS = mpi_p2p_nb-mpi_p2p_nb.$(OBJEXT) -mpi_p2p_nb_OBJECTS = $(am_mpi_p2p_nb_OBJECTS) -mpi_p2p_nb_DEPENDENCIES = -mpi_p2p_nb_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(mpi_p2p_nb_CXXFLAGS) \ - $(CXXFLAGS) $(mpi_p2p_nb_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/stdair -depcomp = $(SHELL) $(top_srcdir)/config/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(alo_example_SOURCES) $(mpi_SOURCES) $(mpi_c_SOURCES) \ - $(mpi_p2p_SOURCES) $(mpi_p2p_nb_SOURCES) -DIST_SOURCES = $(alo_example_SOURCES) $(mpi_SOURCES) $(mpi_c_SOURCES) \ - $(mpi_p2p_SOURCES) $(mpi_p2p_nb_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BOOST_ASIO_LIB = @BOOST_ASIO_LIB@ -BOOST_CFLAGS = @BOOST_CFLAGS@ -BOOST_DATE_TIME_LIB = @BOOST_DATE_TIME_LIB@ -BOOST_FILESYSTEM_LIB = @BOOST_FILESYSTEM_LIB@ -BOOST_IOSTREAMS_LIB = @BOOST_IOSTREAMS_LIB@ -BOOST_LIBS = @BOOST_LIBS@ -BOOST_MPI_LIB = @BOOST_MPI_LIB@ -BOOST_MPI_PYTHON_LIB = @BOOST_MPI_PYTHON_LIB@ -BOOST_PROGRAM_OPTIONS_LIB = @BOOST_PROGRAM_OPTIONS_LIB@ -BOOST_PYTHON_LIB = @BOOST_PYTHON_LIB@ -BOOST_REGEX_LIB = @BOOST_REGEX_LIB@ -BOOST_SERIALIZATION_LIB = @BOOST_SERIALIZATION_LIB@ -BOOST_SIGNALS_LIB = @BOOST_SIGNALS_LIB@ -BOOST_SYSTEM_LIB = @BOOST_SYSTEM_LIB@ -BOOST_THREAD_LIB = @BOOST_THREAD_LIB@ -BOOST_UNIT_TEST_FRAMEWORK_LIB = @BOOST_UNIT_TEST_FRAMEWORK_LIB@ -BOOST_VERSION = @BOOST_VERSION@ -BOOST_WSERIALIZATION_LIB = @BOOST_WSERIALIZATION_LIB@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ -CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ -CPPUNIT_LIBS = @CPPUNIT_LIBS@ -CPPUNIT_VERSION = @CPPUNIT_VERSION@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CXXFLAGS_DEBUG = @CXXFLAGS_DEBUG@ -CXXFLAGS_OPT = @CXXFLAGS_OPT@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GENERIC_LIBRARY_VERSION = @GENERIC_LIBRARY_VERSION@ -GREP = @GREP@ -GSL_CFLAGS = @GSL_CFLAGS@ -GSL_CONFIG = @GSL_CONFIG@ -GSL_LIBS = @GSL_LIBS@ -GSL_VERSION = @GSL_VERSION@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -MPIGEN_CFLAGS = @MPIGEN_CFLAGS@ -MPIGEN_LIBS = @MPIGEN_LIBS@ -MPIGEN_VERSION = @MPIGEN_VERSION@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_C_LIB = @MYSQL_C_LIB@ -MYSQL_LIBS = @MYSQL_LIBS@ -MYSQL_VERSION = @MYSQL_VERSION@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENMPI_CFLAGS = @OPENMPI_CFLAGS@ -OPENMPI_LIBS = @OPENMPI_LIBS@ -OPENMPI_VERSION = @OPENMPI_VERSION@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_DEBUG = @PACKAGE_DEBUG@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PYTHON = @PYTHON@ -PYTHON_ADD_LIBS = @PYTHON_ADD_LIBS@ -PYTHON_CFLAGS = @PYTHON_CFLAGS@ -PYTHON_LIBS = @PYTHON_LIBS@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -RPM_RELEASE = @RPM_RELEASE@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SOCI_CFLAGS = @SOCI_CFLAGS@ -SOCI_CORE_LIB = @SOCI_CORE_LIB@ -SOCI_LIBS = @SOCI_LIBS@ -SOCI_VERSION = @SOCI_VERSION@ -STRIP = @STRIP@ -UPLOAD_COMMAND = @UPLOAD_COMMAND@ -VERSION = @VERSION@ -XERCES_CFLAGS = @XERCES_CFLAGS@ -XERCES_LIBS = @XERCES_LIBS@ -XERCES_VERSION = @XERCES_VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -diff_ok = @diff_ok@ -docdir = @docdir@ -doxygen_ok = @doxygen_ok@ -dvidir = @dvidir@ -dvips_ok = @dvips_ok@ -exec_prefix = @exec_prefix@ -gs_ok = @gs_ok@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -latex_ok = @latex_ok@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -python_configdir = @python_configdir@ -python_incdir = @python_incdir@ -python_libdir = @python_libdir@ -sbindir = @sbindir@ -sed_ok = @sed_ok@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -AM_LDFLAGS = -MAINTAINERCLEANFILES = Makefile.in - -# -SUBDIRS = -EXTRA_DIST = pympi.py - -# mpi_c must be compiled with mpic++ -# Note: mpic++/mpiCC is a wrapper around the MPI C++ compiler, and knows -# where MPI is installed. So, there is no need to specify any other -# CFLAGS or LDFLAGS at that stage. -mpi_c_SOURCES = mpi_c.cpp - -# -mpi_SOURCES = mpi.cpp -mpi_CXXFLAGS = $(BOOST_CFLAGS) $(MPIGEN_CFLAGS) -mpi_LDFLAGS = $(BOOST_LIBS) $(BOOST_MPI_LIB) -mpi_LDADD = -mpi_p2p_SOURCES = mpi_p2p.cpp -mpi_p2p_CXXFLAGS = $(BOOST_CFLAGS) $(MPIGEN_CFLAGS) -mpi_p2p_LDFLAGS = $(BOOST_LIBS) $(BOOST_MPI_LIB) -mpi_p2p_LDADD = -mpi_p2p_nb_SOURCES = mpi_p2p_nb.cpp -mpi_p2p_nb_CXXFLAGS = $(BOOST_CFLAGS) $(MPIGEN_CFLAGS) -mpi_p2p_nb_LDFLAGS = $(BOOST_LIBS) $(BOOST_MPI_LIB) -mpi_p2p_nb_LDADD = -alo_example_SOURCES = alo_example.cpp -alo_example_CXXFLAGS = $(BOOST_CFLAGS) $(MPIGEN_CFLAGS) -alo_example_LDFLAGS = $(BOOST_LIBS) $(BOOST_MPI_LIB) -alo_example_LDADD = -all: all-recursive - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.common $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/boost/mpi/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu test/boost/mpi/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-checkPROGRAMS: - @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -alo_example$(EXEEXT): $(alo_example_OBJECTS) $(alo_example_DEPENDENCIES) - @rm -f alo_example$(EXEEXT) - $(alo_example_LINK) $(alo_example_OBJECTS) $(alo_example_LDADD) $(LIBS) -mpi$(EXEEXT): $(mpi_OBJECTS) $(mpi_DEPENDENCIES) - @rm -f mpi$(EXEEXT) - $(mpi_LINK) $(mpi_OBJECTS) $(mpi_LDADD) $(LIBS) -mpi_p2p$(EXEEXT): $(mpi_p2p_OBJECTS) $(mpi_p2p_DEPENDENCIES) - @rm -f mpi_p2p$(EXEEXT) - $(mpi_p2p_LINK) $(mpi_p2p_OBJECTS) $(mpi_p2p_LDADD) $(LIBS) -mpi_p2p_nb$(EXEEXT): $(mpi_p2p_nb_OBJECTS) $(mpi_p2p_nb_DEPENDENCIES) - @rm -f mpi_p2p_nb$(EXEEXT) - $(mpi_p2p_nb_LINK) $(mpi_p2p_nb_OBJECTS) $(mpi_p2p_nb_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alo_example-alo_example.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-mpi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi_c.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi_p2p-mpi_p2p.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Po@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -alo_example-alo_example.o: alo_example.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alo_example_CXXFLAGS) $(CXXFLAGS) -MT alo_example-alo_example.o -MD -MP -MF $(DEPDIR)/alo_example-alo_example.Tpo -c -o alo_example-alo_example.o `test -f 'alo_example.cpp' || echo '$(srcdir)/'`alo_example.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/alo_example-alo_example.Tpo $(DEPDIR)/alo_example-alo_example.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='alo_example.cpp' object='alo_example-alo_example.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alo_example_CXXFLAGS) $(CXXFLAGS) -c -o alo_example-alo_example.o `test -f 'alo_example.cpp' || echo '$(srcdir)/'`alo_example.cpp - -alo_example-alo_example.obj: alo_example.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alo_example_CXXFLAGS) $(CXXFLAGS) -MT alo_example-alo_example.obj -MD -MP -MF $(DEPDIR)/alo_example-alo_example.Tpo -c -o alo_example-alo_example.obj `if test -f 'alo_example.cpp'; then $(CYGPATH_W) 'alo_example.cpp'; else $(CYGPATH_W) '$(srcdir)/alo_example.cpp'; fi` -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/alo_example-alo_example.Tpo $(DEPDIR)/alo_example-alo_example.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='alo_example.cpp' object='alo_example-alo_example.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alo_example_CXXFLAGS) $(CXXFLAGS) -c -o alo_example-alo_example.obj `if test -f 'alo_example.cpp'; then $(CYGPATH_W) 'alo_example.cpp'; else $(CYGPATH_W) '$(srcdir)/alo_example.cpp'; fi` - -mpi-mpi.o: mpi.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_CXXFLAGS) $(CXXFLAGS) -MT mpi-mpi.o -MD -MP -MF $(DEPDIR)/mpi-mpi.Tpo -c -o mpi-mpi.o `test -f 'mpi.cpp' || echo '$(srcdir)/'`mpi.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mpi-mpi.Tpo $(DEPDIR)/mpi-mpi.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mpi.cpp' object='mpi-mpi.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_CXXFLAGS) $(CXXFLAGS) -c -o mpi-mpi.o `test -f 'mpi.cpp' || echo '$(srcdir)/'`mpi.cpp - -mpi-mpi.obj: mpi.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_CXXFLAGS) $(CXXFLAGS) -MT mpi-mpi.obj -MD -MP -MF $(DEPDIR)/mpi-mpi.Tpo -c -o mpi-mpi.obj `if test -f 'mpi.cpp'; then $(CYGPATH_W) 'mpi.cpp'; else $(CYGPATH_W) '$(srcdir)/mpi.cpp'; fi` -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mpi-mpi.Tpo $(DEPDIR)/mpi-mpi.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mpi.cpp' object='mpi-mpi.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_CXXFLAGS) $(CXXFLAGS) -c -o mpi-mpi.obj `if test -f 'mpi.cpp'; then $(CYGPATH_W) 'mpi.cpp'; else $(CYGPATH_W) '$(srcdir)/mpi.cpp'; fi` - -mpi_p2p-mpi_p2p.o: mpi_p2p.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_CXXFLAGS) $(CXXFLAGS) -MT mpi_p2p-mpi_p2p.o -MD -MP -MF $(DEPDIR)/mpi_p2p-mpi_p2p.Tpo -c -o mpi_p2p-mpi_p2p.o `test -f 'mpi_p2p.cpp' || echo '$(srcdir)/'`mpi_p2p.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mpi_p2p-mpi_p2p.Tpo $(DEPDIR)/mpi_p2p-mpi_p2p.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mpi_p2p.cpp' object='mpi_p2p-mpi_p2p.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_CXXFLAGS) $(CXXFLAGS) -c -o mpi_p2p-mpi_p2p.o `test -f 'mpi_p2p.cpp' || echo '$(srcdir)/'`mpi_p2p.cpp - -mpi_p2p-mpi_p2p.obj: mpi_p2p.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_CXXFLAGS) $(CXXFLAGS) -MT mpi_p2p-mpi_p2p.obj -MD -MP -MF $(DEPDIR)/mpi_p2p-mpi_p2p.Tpo -c -o mpi_p2p-mpi_p2p.obj `if test -f 'mpi_p2p.cpp'; then $(CYGPATH_W) 'mpi_p2p.cpp'; else $(CYGPATH_W) '$(srcdir)/mpi_p2p.cpp'; fi` -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mpi_p2p-mpi_p2p.Tpo $(DEPDIR)/mpi_p2p-mpi_p2p.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mpi_p2p.cpp' object='mpi_p2p-mpi_p2p.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_CXXFLAGS) $(CXXFLAGS) -c -o mpi_p2p-mpi_p2p.obj `if test -f 'mpi_p2p.cpp'; then $(CYGPATH_W) 'mpi_p2p.cpp'; else $(CYGPATH_W) '$(srcdir)/mpi_p2p.cpp'; fi` - -mpi_p2p_nb-mpi_p2p_nb.o: mpi_p2p_nb.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_nb_CXXFLAGS) $(CXXFLAGS) -MT mpi_p2p_nb-mpi_p2p_nb.o -MD -MP -MF $(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Tpo -c -o mpi_p2p_nb-mpi_p2p_nb.o `test -f 'mpi_p2p_nb.cpp' || echo '$(srcdir)/'`mpi_p2p_nb.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Tpo $(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mpi_p2p_nb.cpp' object='mpi_p2p_nb-mpi_p2p_nb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_nb_CXXFLAGS) $(CXXFLAGS) -c -o mpi_p2p_nb-mpi_p2p_nb.o `test -f 'mpi_p2p_nb.cpp' || echo '$(srcdir)/'`mpi_p2p_nb.cpp - -mpi_p2p_nb-mpi_p2p_nb.obj: mpi_p2p_nb.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_nb_CXXFLAGS) $(CXXFLAGS) -MT mpi_p2p_nb-mpi_p2p_nb.obj -MD -MP -MF $(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Tpo -c -o mpi_p2p_nb-mpi_p2p_nb.obj `if test -f 'mpi_p2p_nb.cpp'; then $(CYGPATH_W) 'mpi_p2p_nb.cpp'; else $(CYGPATH_W) '$(srcdir)/mpi_p2p_nb.cpp'; fi` -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Tpo $(DEPDIR)/mpi_p2p_nb-mpi_p2p_nb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mpi_p2p_nb.cpp' object='mpi_p2p_nb-mpi_p2p_nb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpi_p2p_nb_CXXFLAGS) $(CXXFLAGS) -c -o mpi_p2p_nb-mpi_p2p_nb.obj `if test -f 'mpi_p2p_nb.cpp'; then $(CYGPATH_W) 'mpi_p2p_nb.cpp'; else $(CYGPATH_W) '$(srcdir)/mpi_p2p_nb.cpp'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \... [truncated message content] |
From: <gsa...@us...> - 2010-11-10 17:20:31
|
Revision: 149 http://dsim.svn.sourceforge.net/dsim/?rev=149&view=rev Author: gsabatier Date: 2010-11-10 17:20:23 +0000 (Wed, 10 Nov 2010) Log Message: ----------- [test] Added boost/spiritQi Modified Paths: -------------- trunk/dsim/test/boost/Makefile.am Added Paths: ----------- trunk/dsim/test/boost/spiritQi/ trunk/dsim/test/boost/spiritQi/Makefile.am trunk/dsim/test/boost/spiritQi/action_parser.cpp trunk/dsim/test/boost/spiritQi/bad_input.csv trunk/dsim/test/boost/spiritQi/complex_parser.cpp trunk/dsim/test/boost/spiritQi/employee_parser.cpp trunk/dsim/test/boost/spiritQi/good_input.csv trunk/dsim/test/boost/spiritQi/num_list1_parser.cpp trunk/dsim/test/boost/spiritQi/roman_parser.cpp trunk/dsim/test/boost/spiritQi/schedule_parser.cpp trunk/dsim/test/boost/spiritQi/stream_iterator_parser.cpp trunk/dsim/test/boost/spiritQi/sum_parser.cpp trunk/dsim/test/boost/spiritQi/world_schedule.csv Modified: trunk/dsim/test/boost/Makefile.am =================================================================== --- trunk/dsim/test/boost/Makefile.am 2010-11-10 16:56:23 UTC (rev 148) +++ trunk/dsim/test/boost/Makefile.am 2010-11-10 17:20:23 UTC (rev 149) @@ -6,6 +6,6 @@ ## SUBDIRS = accumulators asio filesystem intrusive mpi mpl \ - serialization signals spirit smart_pointers + serialization signals spirit spiritQi smart_pointers EXTRA_DIST = Property changes on: trunk/dsim/test/boost/spiritQi ___________________________________________________________________ Added: svn:ignore + employee_parser action_parser complex_parser num_list1_parser roman_parser sum_parser schedule_parser stream_iterator_parser .deps .libs Makefile Makefile.in Added: trunk/dsim/test/boost/spiritQi/Makefile.am =================================================================== --- trunk/dsim/test/boost/spiritQi/Makefile.am (rev 0) +++ trunk/dsim/test/boost/spiritQi/Makefile.am 2010-11-10 17:20:23 UTC (rev 149) @@ -0,0 +1,40 @@ +## command sub-directory +include $(top_srcdir)/Makefile.common + +MAINTAINERCLEANFILES = Makefile.in + +check_PROGRAMS = employee_parser action_parser complex_parser \ + num_list1_parser roman_parser sum_parser \ + schedule_parser stream_iterator_parser levenshtein + +employee_parser_SOURCES = employee_parser.cpp +employee_parser_CXXFLAGS = $(BOOST_CFLAGS) +employee_parser_LDADD = $(BOOST_LIBS) + +action_parser_SOURCES = action_parser.cpp +action_parser_CXXFLAGS = $(BOOST_CFLAGS) +action_parser_LDADD = $(BOOST_LIBS) + +complex_parser_SOURCES = complex_parser.cpp +complex_parser_CXXFLAGS = $(BOOST_CFLAGS) +complex_parser_LDADD = $(BOOST_LIBS) + +num_list1_parser_SOURCES = num_list1_parser.cpp +num_list1_parser_CXXFLAGS = $(BOOST_CFLAGS) +num_list1_parser_LDADD = $(BOOST_LIBS) + +roman_parser_SOURCES = roman_parser.cpp +roman_parser_CXXFLAGS = $(BOOST_CFLAGS) +roman_parser_LDADD = $(BOOST_LIBS) + +sum_parser_SOURCES = sum_parser.cpp +sum_parser_CXXFLAGS = $(BOOST_CFLAGS) +sum_parser_LDADD = $(BOOST_LIBS) + +schedule_parser_SOURCES = schedule_parser.cpp +schedule_parser_CXXFLAGS = $(BOOST_CFLAGS) +schedule_parser_LDADD = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) + +stream_iterator_parser_SOURCES = stream_iterator_parser.cpp +stream_iterator_parser_CXXFLAGS = $(BOOST_CFLAGS) +stream_iterator_parser_LDADD = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) Added: trunk/dsim/test/boost/spiritQi/action_parser.cpp =================================================================== --- trunk/dsim/test/boost/spiritQi/action_parser.cpp (rev 0) +++ trunk/dsim/test/boost/spiritQi/action_parser.cpp 2010-11-10 17:20:23 UTC (rev 149) @@ -0,0 +1,104 @@ +/*============================================================================= + Copyright (c) 2001-2010 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#include <boost/config/warning_disable.hpp> +#include <boost/spirit/include/qi.hpp> +#include <boost/lambda/lambda.hpp> +#include <boost/bind.hpp> + +#include <iostream> + +// Presented are various ways to attach semantic actions +// * Using plain function pointer +// * Using simple function object +// * Using boost.bind with a plain function +// * Using boost.bind with a member function +// * Using boost.lambda + +//[tutorial_semantic_action_functions +namespace client +{ + namespace qi = boost::spirit::qi; + + // A plain function + void print(int const& i) + { + std::cout << i << std::endl; + } + + // A member function + struct writer + { + void print(int const& i) const + { + std::cout << i << std::endl; + } + }; + + // A function object + struct print_action + { + void operator()(int const& i, qi::unused_type, qi::unused_type) const + { + std::cout << i << std::endl; + } + }; +} +//] + +int main() +{ + using boost::spirit::qi::int_; + using boost::spirit::qi::parse; + using client::print; + using client::writer; + using client::print_action; + + { // example using plain function + + char const *first = "{42}", *last = first + std::strlen(first); + //[tutorial_attach_actions1 + parse(first, last, '{' >> int_[&print] >> '}'); + //] + } + + { // example using simple function object + + char const *first = "{43}", *last = first + std::strlen(first); + //[tutorial_attach_actions2 + parse(first, last, '{' >> int_[print_action()] >> '}'); + //] + } + + { // example using boost.bind with a plain function + + char const *first = "{44}", *last = first + std::strlen(first); + //[tutorial_attach_actions3 + parse(first, last, '{' >> int_[boost::bind(&print, _1)] >> '}'); + //] + } + + { // example using boost.bind with a member function + + char const *first = "{44}", *last = first + std::strlen(first); + //[tutorial_attach_actions4 + writer w; + parse(first, last, '{' >> int_[boost::bind(&writer::print, &w, _1)] >> '}'); + //] + } + + { // example using boost.lambda + + namespace lambda = boost::lambda; + char const *first = "{45}", *last = first + std::strlen(first); + using lambda::_1; + //[tutorial_attach_actions5 + parse(first, last, '{' >> int_[std::cout << _1 << '\n'] >> '}'); + //] + } + + return 0; +} Added: trunk/dsim/test/boost/spiritQi/bad_input.csv =================================================================== --- trunk/dsim/test/boost/spiritQi/bad_input.csv (rev 0) +++ trunk/dsim/test/boost/spiritQi/bad_input.csv 2010-11-10 17:20:23 UTC (rev 149) @@ -0,0 +1,5 @@ +# test +# +# bad input + +123;42.0;a;1.4 Added: trunk/dsim/test/boost/spiritQi/complex_parser.cpp =================================================================== --- trunk/dsim/test/boost/spiritQi/complex_parser.cpp (rev 0) +++ trunk/dsim/test/boost/spiritQi/complex_parser.cpp 2010-11-10 17:20:23 UTC (rev 149) @@ -0,0 +1,101 @@ +/*============================================================================= + Copyright (c) 2002-2010 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +/////////////////////////////////////////////////////////////////////////////// +// +// A complex number micro parser. +// +// [ JDG May 10, 2002 ] spirit1 +// [ JDG May 9, 2007 ] spirit2 +// +/////////////////////////////////////////////////////////////////////////////// + +#include <boost/config/warning_disable.hpp> +#include <boost/spirit/include/qi.hpp> +#include <boost/spirit/include/phoenix_core.hpp> +#include <boost/spirit/include/phoenix_operator.hpp> + +#include <iostream> +#include <string> +#include <complex> + +/////////////////////////////////////////////////////////////////////////////// +// Our complex number parser/compiler +/////////////////////////////////////////////////////////////////////////////// +//[tutorial_complex_number +namespace client +{ + template <typename Iterator> + bool parse_complex(Iterator first, Iterator last, std::complex<double>& c) + { + using boost::spirit::qi::double_; + using boost::spirit::qi::_1; + using boost::spirit::qi::phrase_parse; + using boost::spirit::ascii::space; + using boost::phoenix::ref; + + double rN = 0.0; + double iN = 0.0; + bool r = phrase_parse(first, last, + + // Begin grammar + ( + '(' >> double_[ref(rN) = _1] + >> -(',' >> double_[ref(iN) = _1]) >> ')' + | double_[ref(rN) = _1] + ), + // End grammar + + space); + + if (!r || first != last) // fail if we did not get a full match + return false; + c = std::complex<double>(rN, iN); + return r; + } +} +//] + +//////////////////////////////////////////////////////////////////////////// +// Main program +//////////////////////////////////////////////////////////////////////////// +int +main() +{ + std::cout << "/////////////////////////////////////////////////////////\n\n"; + std::cout << "\t\tA complex number micro parser for Spirit...\n\n"; + std::cout << "/////////////////////////////////////////////////////////\n\n"; + + std::cout << "Give me a complex number of the form r or (r) or (r,i) \n"; + std::cout << "Type [q or Q] to quit\n\n"; + + std::string str; + while (getline(std::cin, str)) + { + if (str.empty() || str[0] == 'q' || str[0] == 'Q') + break; + + std::complex<double> c; + if (client::parse_complex(str.begin(), str.end(), c)) + { + std::cout << "-------------------------\n"; + std::cout << "Parsing succeeded\n"; + std::cout << "got: " << c << std::endl; + std::cout << "\n-------------------------\n"; + } + else + { + std::cout << "-------------------------\n"; + std::cout << "Parsing failed\n"; + std::cout << "-------------------------\n"; + } + } + + std::cout << "Bye... :-) \n\n"; + return 0; +} + + Added: trunk/dsim/test/boost/spiritQi/employee_parser.cpp =================================================================== --- trunk/dsim/test/boost/spiritQi/employee_parser.cpp (rev 0) +++ trunk/dsim/test/boost/spiritQi/employee_parser.cpp 2010-11-10 17:20:23 UTC (rev 149) @@ -0,0 +1,152 @@ + +/*============================================================================= + Copyright (c) 2002-2010 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +/////////////////////////////////////////////////////////////////////////////// +// +// A parser for arbitrary tuples. This example presents a parser +// for an employee structure. +// +// [ JDG May 9, 2007 ] +// +/////////////////////////////////////////////////////////////////////////////// + +#include <boost/config/warning_disable.hpp> +#include <boost/spirit/include/qi.hpp> +#include <boost/spirit/include/phoenix_core.hpp> +#include <boost/spirit/include/phoenix_operator.hpp> +#include <boost/spirit/include/phoenix_object.hpp> +#include <boost/fusion/include/adapt_struct.hpp> +#include <boost/fusion/include/io.hpp> + +#include <iostream> +#include <string> +#include <complex> + +namespace client +{ + namespace qi = boost::spirit::qi; + namespace ascii = boost::spirit::ascii; + + /////////////////////////////////////////////////////////////////////////// + // Our employee struct + /////////////////////////////////////////////////////////////////////////// + //[tutorial_employee_struct + struct employee + { + int age; + std::string surname; + std::string forename; + double salary; + }; + //] +} + +// We need to tell fusion about our employee struct +// to make it a first-class fusion citizen. This has to +// be in global scope. + +//[tutorial_employee_adapt_struct +BOOST_FUSION_ADAPT_STRUCT( + client::employee, + (int, age) + (std::string, surname) + (std::string, forename) + (double, salary) +) +//] + +namespace client +{ + /////////////////////////////////////////////////////////////////////////////// + // Our employee parser + /////////////////////////////////////////////////////////////////////////////// + //[tutorial_employee_parser + template <typename Iterator> + struct employee_parser : qi::grammar<Iterator, employee(), ascii::space_type> + { + employee_parser() : employee_parser::base_type(start) + { + using qi::int_; + using qi::lit; + using qi::double_; + using qi::lexeme; + using ascii::char_; + + quoted_string %= lexeme['"' >> +(char_ - '"') >> '"']; + + start %= + lit("employee") + >> '{' + >> int_ >> ',' + >> quoted_string >> ',' + >> quoted_string >> ',' + >> double_ + >> '}' + ; + } + + qi::rule<Iterator, std::string(), ascii::space_type> quoted_string; + qi::rule<Iterator, employee(), ascii::space_type> start; + }; + //] +} + +//////////////////////////////////////////////////////////////////////////// +// Main program +//////////////////////////////////////////////////////////////////////////// +int +main() +{ + std::cout << "/////////////////////////////////////////////////////////\n\n"; + std::cout << "\t\tAn employee parser for Spirit...\n\n"; + std::cout << "/////////////////////////////////////////////////////////\n\n"; + + std::cout + << "Give me an employee of the form :" + << "employee{age, \"surname\", \"forename\", salary } \n"; + std::cout << "Type [q or Q] to quit\n\n"; + + using boost::spirit::ascii::space; + typedef std::string::const_iterator iterator_type; + typedef client::employee_parser<iterator_type> employee_parser; + + employee_parser g; // Our grammar + std::string str; + while (getline(std::cin, str)) + { + if (str.empty() || str[0] == 'q' || str[0] == 'Q') + break; + + client::employee emp; + std::string::const_iterator iter = str.begin(); + std::string::const_iterator end = str.end(); + bool r = phrase_parse(iter, end, g, space, emp); + + if (r && iter == end) + { + std::cout << boost::fusion::tuple_open('['); + std::cout << boost::fusion::tuple_close(']'); + std::cout << boost::fusion::tuple_delimiter(", "); + + std::cout << "-------------------------\n"; + std::cout << "Parsing succeeded\n"; + std::cout << "got: " << boost::fusion::as_vector(emp) << std::endl; + std::cout << "\n-------------------------\n"; + } + else + { + std::cout << "-------------------------\n"; + std::cout << "Parsing failed\n"; + std::cout << "-------------------------\n"; + } + } + + std::cout << "Bye... :-) \n\n"; + return 0; +} + + Added: trunk/dsim/test/boost/spiritQi/good_input.csv =================================================================== --- trunk/dsim/test/boost/spiritQi/good_input.csv (rev 0) +++ trunk/dsim/test/boost/spiritQi/good_input.csv 2010-11-10 17:20:23 UTC (rev 149) @@ -0,0 +1,5 @@ +# test +# +# good input +8 ; +6; 7; Added: trunk/dsim/test/boost/spiritQi/num_list1_parser.cpp =================================================================== --- trunk/dsim/test/boost/spiritQi/num_list1_parser.cpp (rev 0) +++ trunk/dsim/test/boost/spiritQi/num_list1_parser.cpp 2010-11-10 17:20:23 UTC (rev 149) @@ -0,0 +1,90 @@ +/*============================================================================= + Copyright (c) 2002-2010 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +/////////////////////////////////////////////////////////////////////////////// +// +// This sample demontrates a parser for a comma separated list of numbers. +// No actions. +// +// [ JDG May 10, 2002 ] spirit1 +// [ JDG March 24, 2007 ] spirit2 +// +/////////////////////////////////////////////////////////////////////////////// + +#include <boost/config/warning_disable.hpp> +#include <boost/spirit/include/qi.hpp> + +#include <iostream> +#include <string> +#include <vector> + +namespace client +{ + namespace qi = boost::spirit::qi; + namespace ascii = boost::spirit::ascii; + + /////////////////////////////////////////////////////////////////////////// + // Our number list parser + /////////////////////////////////////////////////////////////////////////// + //[tutorial_numlist1 + template <typename Iterator> + bool parse_numbers(Iterator first, Iterator last) + { + using qi::double_; + using qi::phrase_parse; + using ascii::space; + + bool r = phrase_parse( + first, /*< start iterator >*/ + last, /*< end iterator >*/ + double_ >> *(',' >> double_), /*< the parser >*/ + space /*< the skip-parser >*/ + ); + if (first != last) // fail if we did not get a full match + return false; + return r; + } + //] +} + +//////////////////////////////////////////////////////////////////////////// +// Main program +//////////////////////////////////////////////////////////////////////////// +int +main() +{ + std::cout << "/////////////////////////////////////////////////////////\n\n"; + std::cout << "\t\tA comma separated list parser for Spirit...\n\n"; + std::cout << "/////////////////////////////////////////////////////////\n\n"; + + std::cout << "Give me a comma separated list of numbers.\n"; + std::cout << "Type [q or Q] to quit\n\n"; + + std::string str; + while (getline(std::cin, str)) + { + if (str.empty() || str[0] == 'q' || str[0] == 'Q') + break; + + if (client::parse_numbers(str.begin(), str.end())) + { + std::cout << "-------------------------\n"; + std::cout << "Parsing succeeded\n"; + std::cout << str << " Parses OK: " << std::endl; + } + else + { + std::cout << "-------------------------\n"; + std::cout << "Parsing failed\n"; + std::cout << "-------------------------\n"; + } + } + + std::cout << "Bye... :-) \n\n"; + return 0; +} + + Added: trunk/dsim/test/boost/spiritQi/roman_parser.cpp =================================================================== --- trunk/dsim/test/boost/spiritQi/roman_parser.cpp (rev 0) +++ trunk/dsim/test/boost/spiritQi/roman_parser.cpp 2010-11-10 17:20:23 UTC (rev 149) @@ -0,0 +1,186 @@ +/*============================================================================= + Copyright (c) 2001-2010 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +/////////////////////////////////////////////////////////////////////////////// +// +// A Roman Numerals Parser (demonstrating the symbol table). This is +// discussed in the "Symbols" chapter in the Spirit User's Guide. +// +// [ JDG August 22, 2002 ] spirit1 +// [ JDG March 13, 2007 ] spirit2 +// +/////////////////////////////////////////////////////////////////////////////// + +#include <boost/config/warning_disable.hpp> +#include <boost/spirit/include/qi.hpp> +#include <boost/spirit/include/phoenix_operator.hpp> + +#include <iostream> +#include <string> + +namespace client +{ + namespace qi = boost::spirit::qi; + namespace ascii = boost::spirit::ascii; + + /////////////////////////////////////////////////////////////////////////////// + // Parse roman hundreds (100..900) numerals using the symbol table. + // Notice that the data associated with each slot is the parser's attribute + // (which is passed to attached semantic actions). + /////////////////////////////////////////////////////////////////////////////// + //[tutorial_roman_hundreds + struct hundreds_ : qi::symbols<char, unsigned> + { + hundreds_() + { + add + ("C" , 100) + ("CC" , 200) + ("CCC" , 300) + ("CD" , 400) + ("D" , 500) + ("DC" , 600) + ("DCC" , 700) + ("DCCC" , 800) + ("CM" , 900) + ; + } + + } hundreds; + //] + + /////////////////////////////////////////////////////////////////////////////// + // Parse roman tens (10..90) numerals using the symbol table. + /////////////////////////////////////////////////////////////////////////////// + //[tutorial_roman_tens + struct tens_ : qi::symbols<char, unsigned> + { + tens_() + { + add + ("X" , 10) + ("XX" , 20) + ("XXX" , 30) + ("XL" , 40) + ("L" , 50) + ("LX" , 60) + ("LXX" , 70) + ("LXXX" , 80) + ("XC" , 90) + ; + } + + } tens; + //] + + /////////////////////////////////////////////////////////////////////////////// + // Parse roman ones (1..9) numerals using the symbol table. + /////////////////////////////////////////////////////////////////////////////// + //[tutorial_roman_ones + struct ones_ : qi::symbols<char, unsigned> + { + ones_() + { + add + ("I" , 1) + ("II" , 2) + ("III" , 3) + ("IV" , 4) + ("V" , 5) + ("VI" , 6) + ("VII" , 7) + ("VIII" , 8) + ("IX" , 9) + ; + } + + } ones; + //] + + /////////////////////////////////////////////////////////////////////////////// + // roman (numerals) grammar + // + // Note the use of the || operator. The expression + // a || b reads match a or b and in sequence. Try + // defining the roman numerals grammar in YACC or + // PCCTS. Spirit rules! :-) + /////////////////////////////////////////////////////////////////////////////// + //[tutorial_roman_grammar + template <typename Iterator> + struct roman : qi::grammar<Iterator, unsigned()> + { + roman() : roman::base_type(start) + { + using qi::eps; + using qi::lit; + using qi::_val; + using qi::_1; + using ascii::char_; + + start = eps [_val = 0] >> + ( + +lit('M') [_val += 1000] + || hundreds [_val += _1] + || tens [_val += _1] + || ones [_val += _1] + ) + ; + } + + qi::rule<Iterator, unsigned()> start; + }; + //] +} + +/////////////////////////////////////////////////////////////////////////////// +// Main program +/////////////////////////////////////////////////////////////////////////////// +int +main() +{ + std::cout << "/////////////////////////////////////////////////////////\n\n"; + std::cout << "\t\tRoman Numerals Parser\n\n"; + std::cout << "/////////////////////////////////////////////////////////\n\n"; + std::cout << "Type a Roman Numeral ...or [q or Q] to quit\n\n"; + + typedef std::string::const_iterator iterator_type; + typedef client::roman<iterator_type> roman; + + roman roman_parser; // Our grammar + + std::string str; + unsigned result; + while (std::getline(std::cin, str)) + { + if (str.empty() || str[0] == 'q' || str[0] == 'Q') + break; + + std::string::const_iterator iter = str.begin(); + std::string::const_iterator end = str.end(); + //[tutorial_roman_grammar_parse + bool r = parse(iter, end, roman_parser, result); + + if (r && iter == end) + { + std::cout << "-------------------------\n"; + std::cout << "Parsing succeeded\n"; + std::cout << "result = " << result << std::endl; + std::cout << "-------------------------\n"; + } + else + { + std::string rest(iter, end); + std::cout << "-------------------------\n"; + std::cout << "Parsing failed\n"; + std::cout << "stopped at: \": " << rest << "\"\n"; + std::cout << "-------------------------\n"; + } + //] + } + + std::cout << "Bye... :-) \n\n"; + return 0; +} Added: trunk/dsim/test/boost/spiritQi/schedule_parser.cpp =================================================================== --- trunk/dsim/test/boost/spiritQi/schedule_parser.cpp (rev 0) +++ trunk/dsim/test/boost/spiritQi/schedule_parser.cpp 2010-11-10 17:20:23 UTC (rev 149) @@ -0,0 +1,252 @@ +// STL +#include <istream> +#include <sstream> +#include <iostream> +#include <fstream> +#include <set> +#include <vector> +// Boost (Extended STL) +#include <boost/date_time/posix_time/posix_time.hpp> +#include <boost/date_time/gregorian/gregorian.hpp> +// Boost Spirit (Parsing) +#include <boost/spirit/include/qi.hpp> +#include <boost/spirit/include/phoenix_core.hpp> +#include <boost/spirit/include/phoenix_operator.hpp> +#include <boost/spirit/include/phoenix_object.hpp> +#include <boost/fusion/include/adapt_struct.hpp> +#include <boost/spirit/include/support_multi_pass.hpp> +#include <boost/fusion/include/io.hpp> +#include <boost/lambda/lambda.hpp> + + +typedef std::string::const_iterator iterator_t; +/** Flight-Period. */ +struct FlightPeriod_T { + // Attributes + std::string _airlineCode; + unsigned int _flightNumber; + boost::gregorian::date _dateRangeStart; + boost::gregorian::date _dateRangeEnd; + std::string _dow; + std::string _cabinCode; +}; + +/** Store the parsed airline code. */ +template <typename FLIGHT_PERIOD> +struct store_airline_code { + store_airline_code (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) {} + + void operator() (iterator_t iStr, iterator_t iStrEnd) const { + std::string lAirlineCode (iStr, iStrEnd); + _flightPeriod._airlineCode = lAirlineCode; + // std::cout << "Airline code: " << lAirlineCode << std::endl; + } + + FLIGHT_PERIOD& _flightPeriod; +}; + +/** Store the parsed cabin code. */ +template <typename FLIGHT_PERIOD> +struct store_cabin_code { + store_cabin_code (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) {} + + void operator() (char iChar) const { + _flightPeriod._cabinCode = iChar; + // std::cout << "Cabin code: " << lCabinCode << std::endl; + } + + FLIGHT_PERIOD& _flightPeriod; +}; + + +// /////////// Utilities ///////////// + +/** 1-digit-integer parser */ +boost::spirit::qi::uint_parser<int, 10, 1, 1> int1_p; + +/** 2-digit-integer parser */ +boost::spirit::qi::uint_parser<int, 10, 2, 2> uint2_p; + +/** 4-digit-integer parser */ +boost::spirit::qi::uint_parser<int, 10, 4, 4> uint4_p; + +/** Up-to-4-digit-integer parser */ +boost::spirit::qi::uint_parser<int, 10, 1, 4> uint1_4_p; + + +//////////////////////////////////////////////////////////////////////////// +// Parser +//////////////////////////////////////////////////////////////////////////// +template <typename ITERATOR, typename FLIGHT_PERIOD> +struct FlightPeriodParser : + boost::spirit::qi::grammar<ITERATOR, boost::spirit::ascii::space_type > { + + typedef store_airline_code<FLIGHT_PERIOD> store_airline_code_t; + typedef store_cabin_code<FLIGHT_PERIOD> store_cabin_code_t; + + FLIGHT_PERIOD _t; + + FlightPeriodParser () : + FlightPeriodParser::base_type(start) { + + using boost::spirit::ascii::string; + using boost::spirit::ascii::char_; + using boost::spirit::qi::lexeme; + using boost::spirit::qi::repeat; + using boost::spirit::qi::double_; + using boost::lambda::_1; + + + start = (comment | flight_period) ; + + comment = lexeme[ (repeat(2)[char_("/")]) ] >> *(char_); + + flight_period = airline_code + >> ';' >> flight_number + >> ';' >> date + >> ';' >> date + >> ';' >> dow + >> ';' + >> leg_list + >> segment_list + ; + + airline_code = lexeme[ (repeat(2)[char_("A-Z")]) ]; + + + flight_number = uint1_4_p; + + date = lexeme[ uint4_p + >> '-' >> uint2_p + >> '-' >> uint2_p ] + ; + + dow = + lexeme[ repeat(7)[char_("0-1")] ] + ; + + leg_list = +(leg); + + leg = leg_key + >> leg_details + >> +(cabin_details) + ; + + leg_key = + lexeme[ repeat(3)[char_("A-Z")] ] + >> ';' + >> lexeme[ repeat(3)[char_("A-Z")] ] + >> ';' + ; + + leg_details = + time + >> ';' >> time + >> ';' >> time + >> ';' + ; + + time = lexeme[ uint2_p + >> ':' >> uint2_p + >> !(':' >> uint2_p) ] + ; + + cabin_details = char_("A-Z") [store_cabin_code_t(_t)] + >> ';' >> double_ + >> ';' + ; + + segment_key = + repeat(3)[char_("0-9A-Z")] + >> ';' + >>repeat(3)[char_("0-9A-Z")] + >> ';' + ; + + segment_list = +(segment); + + segment = + general_segments | specific_segments + ; + + general_segments = + char_('0') + >> ';' + >> +(segment_cabin_details) + ; + + specific_segments = + char_('1') + >> ';' + >> +(segment_key >> full_segment_cabin_details) + ; + + full_segment_cabin_details = + +(segment_cabin_details) + ; + + segment_cabin_details = + char_("A-Z") + >> ';' >> (repeat(1,26)[char_("A-Z")]) + >> ';' + ; + + } + + boost::spirit::qi::rule<ITERATOR, boost::spirit::ascii::space_type> start, + comment, flight_period, airline_code, flight_number, date, dow, leg, leg_list, + leg_key, leg_details, time, cabin_details, segment, segment_list, segment_key, + general_segments, specific_segments, full_segment_cabin_details, segment_cabin_details; + +}; + + +//////////////////////////////////////////////////////////////////////////// +// Main program +//////////////////////////////////////////////////////////////////////////// +int main (int argc, char* argv[]) { + + char const* filename = "world_schedule.csv"; + + std::ifstream in(filename, std::ios_base::in); + + if (!in) { + std::cerr << "Error: Could not open input file: " + << filename << std::endl; + return 1; + } + + typedef FlightPeriodParser<std::string::const_iterator, FlightPeriod_T > lFlightPeriodParser; + lFlightPeriodParser flightParser; // Our grammar + + std::string::const_iterator iter; + std::string::const_iterator end; + + std::string line; + bool r = true; + using boost::spirit::ascii::space; + + + while (r && std::getline(in, line)) { + iter = line.begin(); + end = line.end(); + r = phrase_parse(iter, end, flightParser, space); + if (iter != end) { + r = false; + } + } + + if (r && iter == end) { + std::cout << "-------------------------\n"; + std::cout << "Parsing succeeded\n"; + std::cout << "-------------------------\n"; + return 0; + } else { + std::cout << "-------------------------\n"; + std::cout << "Parsing failed\n"; + std::cout << "-------------------------\n"; + } + return 0; +} Added: trunk/dsim/test/boost/spiritQi/stream_iterator_parser.cpp =================================================================== --- trunk/dsim/test/boost/spiritQi/stream_iterator_parser.cpp (rev 0) +++ trunk/dsim/test/boost/spiritQi/stream_iterator_parser.cpp 2010-11-10 17:20:23 UTC (rev 149) @@ -0,0 +1,91 @@ +// Copyright (c) 2010 Peter Schueller +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include <vector> +#include <istream> +#include <sstream> +#include <iostream> +#include <fstream> +#include <boost/spirit/include/qi.hpp> +#include <boost/spirit/include/support_multi_pass.hpp> + +namespace qi = boost::spirit::qi; +namespace ascii = boost::spirit::ascii; + + +//////////////////////////////////////////////////////////////////////////// +// Parser +//////////////////////////////////////////////////////////////////////////// +template <typename iterator_t> +bool parse(iterator_t& iStr, iterator_t& iStrEnd, + std::vector<double>& output) { + + // Parse list of doubles from input stream + bool r = qi::phrase_parse( + iStr, iStrEnd, // Iterators + *(qi::double_ >> ';'), // Recognize list of doubles + ascii::space | '#' >> *(ascii::char_ - qi::eol) >> qi::eol, // Skip comment + output); // Store double into this object + + // Return result of parsing + return r; + +} + +//////////////////////////////////////////////////////////////////////////// +// Main program +//////////////////////////////////////////////////////////////////////////// +int main (int argc, char* argv[]) { + + std::string lFilename("good_input.csv"); + std::ifstream File; + + // Read the command-line parameters + if (argc >= 1 && argv[1] != NULL) { + lFilename = argv[1]; + File.open (argv[1],std::ios_base::in); + } else { + // Default File to be parsed + File.open ("good_input.csv",std::ios_base::in); + } + + // Check the File existence + if (!File) { + std::cerr << "Unknown file named" << lFilename << std::endl; + return 1; + } + + // Iterate over stream input + typedef std::istreambuf_iterator<char> base_iterator_type; + base_iterator_type in_begin(File.rdbuf()); + + // Convert input iterator to forward iterator, usable by spirit parser + typedef boost::spirit::multi_pass<base_iterator_type>forward_iterator_type; + forward_iterator_type fwd_begin = + boost::spirit::make_default_multi_pass(in_begin); + forward_iterator_type fwd_end; + + // Prepare output + std::vector<double> output; + + try { + bool r = parse(fwd_begin, fwd_end, output); + // Error detection + if( !r || fwd_begin != fwd_end ) { + throw std::runtime_error("parse error in "+lFilename); + } else { + std::cout << "--------------------------------------------\n"; + std::cout << "Parsing of the file " << lFilename <<" succeeded\n"; + std::cout << "Got: "; + for (unsigned int i = 0; i < output.size(); i++) { + std::cout << output[i] << " "; + } + std::cout << "\n--------------------------------------------\n"; + } + } catch(const std::exception& e) { + std::cerr << "Exception: " << e.what() << std::endl; + } + return 0; +} + Added: trunk/dsim/test/boost/spiritQi/sum_parser.cpp =================================================================== --- trunk/dsim/test/boost/spiritQi/sum_parser.cpp (rev 0) +++ trunk/dsim/test/boost/spiritQi/sum_parser.cpp 2010-11-10 17:20:23 UTC (rev 149) @@ -0,0 +1,104 @@ +/*============================================================================= + Copyright (c) 2002-2010 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +/////////////////////////////////////////////////////////////////////////////// +// +// A parser for summing a comma-separated list of numbers using phoenix. +// +// [ JDG June 28, 2002 ] spirit1 +// [ JDG March 24, 2007 ] spirit2 +// +/////////////////////////////////////////////////////////////////////////////// + +#include <boost/config/warning_disable.hpp> +//[tutorial_adder_includes +#include <boost/spirit/include/qi.hpp> +#include <boost/spirit/include/phoenix_core.hpp> +#include <boost/spirit/include/phoenix_operator.hpp> +#include <iostream> +#include <string> +//] + +namespace client +{ + //[tutorial_adder_using + namespace qi = boost::spirit::qi; + namespace ascii = boost::spirit::ascii; + namespace phoenix = boost::phoenix; + + using qi::double_; + using qi::_1; + using ascii::space; + using phoenix::ref; + //] + + /////////////////////////////////////////////////////////////////////////// + // Our adder + /////////////////////////////////////////////////////////////////////////// + + //[tutorial_adder + template <typename Iterator> + bool adder(Iterator first, Iterator last, double& n) + { + bool r = qi::phrase_parse(first, last, + + // Begin grammar + ( + double_[ref(n) = _1] >> *(',' >> double_[ref(n) += _1]) + ) + , + // End grammar + + space); + + if (first != last) // fail if we did not get a full match + return false; + return r; + } + //] +} + +//////////////////////////////////////////////////////////////////////////// +// Main program +//////////////////////////////////////////////////////////////////////////// +int +main() +{ + std::cout << "/////////////////////////////////////////////////////////\n\n"; + std::cout << "\t\tA parser for summing a list of numbers...\n\n"; + std::cout << "/////////////////////////////////////////////////////////\n\n"; + + std::cout << "Give me a comma separated list of numbers.\n"; + std::cout << "The numbers are added using Phoenix.\n"; + std::cout << "Type [q or Q] to quit\n\n"; + + std::string str; + while (getline(std::cin, str)) + { + if (str.empty() || str[0] == 'q' || str[0] == 'Q') + break; + + double n; + if (client::adder(str.begin(), str.end(), n)) + { + std::cout << "-------------------------\n"; + std::cout << "Parsing succeeded\n"; + std::cout << str << " Parses OK: " << std::endl; + + std::cout << "sum = " << n; + std::cout << "\n-------------------------\n"; + } + else + { + std::cout << "-------------------------\n"; + std::cout << "Parsing failed\n"; + std::cout << "-------------------------\n"; + } + } + + std::cout << "Bye... :-) \n\n"; + return 0; +} Added: trunk/dsim/test/boost/spiritQi/world_schedule.csv =================================================================== --- trunk/dsim/test/boost/spiritQi/world_schedule.csv (rev 0) +++ trunk/dsim/test/boost/spiritQi/world_schedule.csv 2010-11-10 17:20:23 UTC (rev 149) @@ -0,0 +1,21 @@ +// Flights: AirlineCode; FlightNumber; Date-Range; ; DOW; Legs; Segments; +// Legs: BoardPoint; OffPoint; BoardTime; ArrivalDateOffSet; ArrivalTime; +// ElapsedTime; LegCabins; +// LegCabins: CabinCode; Capacity; +// Segments: Specific; +BA; 9; 2007-04-20; 2007-06-30; 0000011; LHR; BKK; 22:00; 15:15; 11:15; F; 5; J; 12; W; 20; Y; 300; BKK; SYD; 18:10; 06:05; 08:55; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKMLSQ; +BA; 9; 2007-04-20; 2007-06-30; 1111100; LHR; BKK; 22:00; 15:15; 11:15; F; 5; J; 12; W; 20; Y; 300; BKK; SYD; 18:10; 06:05; 08:55; F; 5; J; 12; W; 20; Y; 300; 1; LHR; BKK; F; FA; J; JCDI; W; WT; Y; YBHKMLSQ; BKK; SYD; F; FA; J; JCDI; W; WT; Y; YBHKMLSQ; LHR; SYD; F; FA; J; JCDI; W; WT; Y; YBHKMLSQ; +BA; 117; 2007-04-20; 3000-06-30; 1111111; LHR; JFK; 08:20; 11:00; 07:40; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKM; +BA; 175; 2007-04-20; 2007-06-30; 1111111; LHR; JFK; 10:55; 13:35; 07:40; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKMRL; +BA; 179; 2007-04-20; 2007-06-30; 1111111; LHR; JFK; 18:05; 20:45; 07:40; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKMRVNELSQO; +BA; 207; 2007-04-20; 2007-06-30; 1111111; LHR; MIA; 09:40; 14:25; 09:45; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKMRVNELSQO; +BA; 279; 2007-04-20; 2007-06-30; 1111111; LHR; LAX; 10:05; 13:10; 11:05; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKMRVNELSQO; +BA; 295; 2007-04-20; 2007-06-30; 1111111; LHR; ORD; 11:35; 14:00; 08:25; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKMRVNELSQO; +BA; 341; 2007-04-20; 2007-06-30; 1111111; NCE; LHR; 08:55; 10:05; 02:10; J; 12; Y; 300; 0; J; JCDI; Y; YBHKMRVNEQLSO; +BA; 343; 2007-04-20; 2007-06-30; 1111111; NCE; LHR; 11:00; 12:15; 02:15; J; 12; Y; 300; 0; J; JCDI; Y; YBHKMRVNEQLSO; +BA; 345; 2007-04-20; 2007-06-30; 1111111; NCE; LHR; 16:20; 17:25; 02:05; J; 12; Y; 300; 0; J; JCDI; Y; YBHKMRVNEQLSO; +BA; 347; 2007-04-20; 2007-06-30; 1111111; NCE; LHR; 13:55; 15:00; 02:05; J; 12; Y; 300; 0; J; JCDI; Y; YBHKMRVNEQLSO; +AA; 101; 2007-04-20; 2007-06-30; 1111111; LHR; JFK; 09:55; 12:50; 07:55; G; 300; 0; G; GHQKLMVSOWN; +AA; 117; 2007-04-20; 2007-06-30; 1111111; JFK; LAX; 14:20; 17:25; 06:05; F; 12; J; 20; Y; 300; 0; F; FA; J; JDI; Y; YBGHQKLMVSOWN; +AA; 181; 2007-04-20; 2007-06-30; 1111111; JFK; LAX; 17:00; 20:00; 06:00; F; 12; J; 20; Y; 300; 0; F; FA; J; JDI; Y; YBHKMLWVGSNOQ; +AA; 585; 2007-04-20; 2007-06-30; 1111111; JFK; MIA; 15:40; 18:50; 03:10; F; 12; Y; 300; 0; F; FAP; Y; YBHKMLWVGSONQ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-11-10 18:18:42
|
Revision: 153 http://dsim.svn.sourceforge.net/dsim/?rev=153&view=rev Author: denis_arnaud Date: 2010-11-10 18:18:36 +0000 (Wed, 10 Nov 2010) Log Message: ----------- [Boost Test] Re-activated the Spirit v2 parser tests, as they now work (but they are still limited). Modified Paths: -------------- trunk/dsim/test/boost/Makefile.am trunk/dsim/test/boost/random/SimulateTestSuite.log trunk/dsim/test/boost/spiritQi/Makefile.am trunk/dsim/test/boost/spiritQi/schedule_parser.cpp Modified: trunk/dsim/test/boost/Makefile.am =================================================================== --- trunk/dsim/test/boost/Makefile.am 2010-11-10 17:57:20 UTC (rev 152) +++ trunk/dsim/test/boost/Makefile.am 2010-11-10 18:18:36 UTC (rev 153) @@ -6,6 +6,6 @@ ## SUBDIRS = accumulators asio filesystem intrusive mpi mpl \ - serialization signals spirit smart_pointers + serialization signals spirit spiritQi smart_pointers EXTRA_DIST = Modified: trunk/dsim/test/boost/random/SimulateTestSuite.log =================================================================== --- trunk/dsim/test/boost/random/SimulateTestSuite.log 2010-11-10 17:57:20 UTC (rev 152) +++ trunk/dsim/test/boost/random/SimulateTestSuite.log 2010-11-10 18:18:36 UTC (rev 153) @@ -19,7 +19,7 @@ Simulation#; Sum of Lambdas; Total nb of events; Random draw (following normal law); 9; 299.178; 303; 276.597; Statistics for sum of Lambdas (min, max, mean, variance); -299.178, 299.178, 299.178, 8.5123e-12; +299.178, 299.178, 299.178, 0; Statistics for total nb of events (min, max, mean, variance); 286, 336, 301.3, 193.41; Statistics for random draws (min, max, mean, variance); Modified: trunk/dsim/test/boost/spiritQi/Makefile.am =================================================================== --- trunk/dsim/test/boost/spiritQi/Makefile.am 2010-11-10 17:57:20 UTC (rev 152) +++ trunk/dsim/test/boost/spiritQi/Makefile.am 2010-11-10 18:18:36 UTC (rev 153) @@ -5,7 +5,7 @@ check_PROGRAMS = employee_parser action_parser complex_parser \ num_list1_parser roman_parser sum_parser \ - schedule_parser stream_iterator_parser levenshtein + schedule_parser stream_iterator_parser employee_parser_SOURCES = employee_parser.cpp employee_parser_CXXFLAGS = $(BOOST_CFLAGS) Modified: trunk/dsim/test/boost/spiritQi/schedule_parser.cpp =================================================================== --- trunk/dsim/test/boost/spiritQi/schedule_parser.cpp 2010-11-10 17:57:20 UTC (rev 152) +++ trunk/dsim/test/boost/spiritQi/schedule_parser.cpp 2010-11-10 18:18:36 UTC (rev 153) @@ -52,7 +52,8 @@ store_cabin_code (FLIGHT_PERIOD& ioFlightPeriod) : _flightPeriod (ioFlightPeriod) {} - void operator() (char iChar) const { + void operator() (char iChar, boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { _flightPeriod._cabinCode = iChar; // std::cout << "Cabin code: " << lCabinCode << std::endl; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gsa...@us...> - 2010-11-16 10:08:16
|
Revision: 156 http://dsim.svn.sourceforge.net/dsim/?rev=156&view=rev Author: gsabatier Date: 2010-11-16 10:08:08 +0000 (Tue, 16 Nov 2010) Log Message: ----------- [Boost Test] Tests for the Spirit v2 parser are mow implemented Modified Paths: -------------- trunk/dsim/test/boost/Makefile.am trunk/dsim/test/boost/spirit/Makefile.am trunk/dsim/test/boost/spirit/world_schedule.csv trunk/dsim/test/boost/spiritQi/schedule_parser.cpp trunk/dsim/test/boost/spiritQi/world_schedule.csv Removed Paths: ------------- trunk/dsim/test/boost/spirit/action_parser.cpp trunk/dsim/test/boost/spirit/bad_input.csv trunk/dsim/test/boost/spirit/complex_parser.cpp trunk/dsim/test/boost/spirit/employee_parser.cpp trunk/dsim/test/boost/spirit/good_input.csv trunk/dsim/test/boost/spirit/num_list1_parser.cpp trunk/dsim/test/boost/spirit/roman_parser.cpp trunk/dsim/test/boost/spirit/stream_iterator_parser.cpp trunk/dsim/test/boost/spirit/sum_parser.cpp Modified: trunk/dsim/test/boost/Makefile.am =================================================================== --- trunk/dsim/test/boost/Makefile.am 2010-11-10 20:15:47 UTC (rev 155) +++ trunk/dsim/test/boost/Makefile.am 2010-11-16 10:08:08 UTC (rev 156) @@ -5,7 +5,7 @@ MAINTAINERCLEANFILES = Makefile.in ## -SUBDIRS = accumulators asio filesystem intrusive mpi mpl \ +SUBDIRS = accumulators asio filesystem intrusive mpl \ serialization signals spirit spiritQi smart_pointers EXTRA_DIST = Modified: trunk/dsim/test/boost/spirit/Makefile.am =================================================================== --- trunk/dsim/test/boost/spirit/Makefile.am 2010-11-10 20:15:47 UTC (rev 155) +++ trunk/dsim/test/boost/spirit/Makefile.am 2010-11-16 10:08:08 UTC (rev 156) @@ -3,42 +3,44 @@ MAINTAINERCLEANFILES = Makefile.in -check_PROGRAMS = employee_parser action_parser complex_parser \ - num_list1_parser roman_parser sum_parser \ - schedule_parser stream_iterator_parser levenshtein +check_PROGRAMS = full_calculator functor_parser number_parser \ + parameter_parser spirit_parser subrule_parser \ + schedule_parser search_string_parser levenshtein -levenshtein_SOURCES = levenshtein.cpp -levenshtein_CXXFLAGS = -levenshtein_LDFLAGS = +full_calculator_SOURCES = full_calculator.cpp +full_calculator_CXXFLAGS = $(BOOST_CFLAGS) +full_calculator_LDADD = $(BOOST_LIBS) -employee_parser_SOURCES = employee_parser.cpp -employee_parser_CXXFLAGS = $(BOOST_CFLAGS) -employee_parser_LDADD = $(BOOST_LIBS) +functor_parser_SOURCES = functor_parser.cpp +functor_parser_CXXFLAGS = $(BOOST_CFLAGS) +functor_parser_LDADD = $(BOOST_LIBS) -action_parser_SOURCES = action_parser.cpp -action_parser_CXXFLAGS = $(BOOST_CFLAGS) -action_parser_LDADD = $(BOOST_LIBS) +number_parser_SOURCES = number_parser.cpp +number_parser_CXXFLAGS = $(BOOST_CFLAGS) +number_parser_LDADD = $(BOOST_LIBS) -complex_parser_SOURCES = complex_parser.cpp -complex_parser_CXXFLAGS = $(BOOST_CFLAGS) -complex_parser_LDADD = $(BOOST_LIBS) +parameter_parser_SOURCES = parameter_parser.cpp +parameter_parser_CXXFLAGS = $(BOOST_CFLAGS) +parameter_parser_LDADD = $(BOOST_LIBS) -num_list1_parser_SOURCES = num_list1_parser.cpp -num_list1_parser_CXXFLAGS = $(BOOST_CFLAGS) -num_list1_parser_LDADD = $(BOOST_LIBS) +spirit_parser_SOURCES = spirit_parser.cpp +spirit_parser_CXXFLAGS = $(BOOST_CFLAGS) +spirit_parser_LDADD = $(BOOST_LIBS) -roman_parser_SOURCES = roman_parser.cpp -roman_parser_CXXFLAGS = $(BOOST_CFLAGS) -roman_parser_LDADD = $(BOOST_LIBS) +subrule_parser_SOURCES = subrule_parser.cpp +subrule_parser_CXXFLAGS = $(BOOST_CFLAGS) +subrule_parser_LDADD = $(BOOST_LIBS) -sum_parser_SOURCES = sum_parser.cpp -sum_parser_CXXFLAGS = $(BOOST_CFLAGS) -sum_parser_LDADD = $(BOOST_LIBS) - schedule_parser_SOURCES = schedule_parser.cpp schedule_parser_CXXFLAGS = $(BOOST_CFLAGS) schedule_parser_LDADD = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) -stream_iterator_parser_SOURCES = stream_iterator_parser.cpp -stream_iterator_parser_CXXFLAGS = $(BOOST_CFLAGS) -stream_iterator_parser_LDADD = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) +search_string_parser_SOURCES = search_string_parser.cpp +search_string_parser_CXXFLAGS = $(BOOST_CFLAGS) +search_string_parser_LDADD = $(BOOST_LIBS) $(BOOST_DATE_TIME_LIB) + +levenshtein_SOURCES = levenshtein.cpp +levenshtein_LDADD = + +EXTRA_DIST = test_full_calculator.sh test_parameter_parser.sh \ + test_schedule_parser.sh Deleted: trunk/dsim/test/boost/spirit/action_parser.cpp =================================================================== --- trunk/dsim/test/boost/spirit/action_parser.cpp 2010-11-10 20:15:47 UTC (rev 155) +++ trunk/dsim/test/boost/spirit/action_parser.cpp 2010-11-16 10:08:08 UTC (rev 156) @@ -1,104 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2010 Joel de Guzman - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#include <boost/config/warning_disable.hpp> -#include <boost/spirit/include/qi.hpp> -#include <boost/lambda/lambda.hpp> -#include <boost/bind.hpp> - -#include <iostream> - -// Presented are various ways to attach semantic actions -// * Using plain function pointer -// * Using simple function object -// * Using boost.bind with a plain function -// * Using boost.bind with a member function -// * Using boost.lambda - -//[tutorial_semantic_action_functions -namespace client -{ - namespace qi = boost::spirit::qi; - - // A plain function - void print(int const& i) - { - std::cout << i << std::endl; - } - - // A member function - struct writer - { - void print(int const& i) const - { - std::cout << i << std::endl; - } - }; - - // A function object - struct print_action - { - void operator()(int const& i, qi::unused_type, qi::unused_type) const - { - std::cout << i << std::endl; - } - }; -} -//] - -int main() -{ - using boost::spirit::qi::int_; - using boost::spirit::qi::parse; - using client::print; - using client::writer; - using client::print_action; - - { // example using plain function - - char const *first = "{42}", *last = first + std::strlen(first); - //[tutorial_attach_actions1 - parse(first, last, '{' >> int_[&print] >> '}'); - //] - } - - { // example using simple function object - - char const *first = "{43}", *last = first + std::strlen(first); - //[tutorial_attach_actions2 - parse(first, last, '{' >> int_[print_action()] >> '}'); - //] - } - - { // example using boost.bind with a plain function - - char const *first = "{44}", *last = first + std::strlen(first); - //[tutorial_attach_actions3 - parse(first, last, '{' >> int_[boost::bind(&print, _1)] >> '}'); - //] - } - - { // example using boost.bind with a member function - - char const *first = "{44}", *last = first + std::strlen(first); - //[tutorial_attach_actions4 - writer w; - parse(first, last, '{' >> int_[boost::bind(&writer::print, &w, _1)] >> '}'); - //] - } - - { // example using boost.lambda - - namespace lambda = boost::lambda; - char const *first = "{45}", *last = first + std::strlen(first); - using lambda::_1; - //[tutorial_attach_actions5 - parse(first, last, '{' >> int_[std::cout << _1 << '\n'] >> '}'); - //] - } - - return 0; -} Deleted: trunk/dsim/test/boost/spirit/bad_input.csv =================================================================== --- trunk/dsim/test/boost/spirit/bad_input.csv 2010-11-10 20:15:47 UTC (rev 155) +++ trunk/dsim/test/boost/spirit/bad_input.csv 2010-11-16 10:08:08 UTC (rev 156) @@ -1,5 +0,0 @@ -# test -# -# bad input - -123;42.0;a;1.4 Deleted: trunk/dsim/test/boost/spirit/complex_parser.cpp =================================================================== --- trunk/dsim/test/boost/spirit/complex_parser.cpp 2010-11-10 20:15:47 UTC (rev 155) +++ trunk/dsim/test/boost/spirit/complex_parser.cpp 2010-11-16 10:08:08 UTC (rev 156) @@ -1,101 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2010 Joel de Guzman - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -/////////////////////////////////////////////////////////////////////////////// -// -// A complex number micro parser. -// -// [ JDG May 10, 2002 ] spirit1 -// [ JDG May 9, 2007 ] spirit2 -// -/////////////////////////////////////////////////////////////////////////////// - -#include <boost/config/warning_disable.hpp> -#include <boost/spirit/include/qi.hpp> -#include <boost/spirit/include/phoenix_core.hpp> -#include <boost/spirit/include/phoenix_operator.hpp> - -#include <iostream> -#include <string> -#include <complex> - -/////////////////////////////////////////////////////////////////////////////// -// Our complex number parser/compiler -/////////////////////////////////////////////////////////////////////////////// -//[tutorial_complex_number -namespace client -{ - template <typename Iterator> - bool parse_complex(Iterator first, Iterator last, std::complex<double>& c) - { - using boost::spirit::qi::double_; - using boost::spirit::qi::_1; - using boost::spirit::qi::phrase_parse; - using boost::spirit::ascii::space; - using boost::phoenix::ref; - - double rN = 0.0; - double iN = 0.0; - bool r = phrase_parse(first, last, - - // Begin grammar - ( - '(' >> double_[ref(rN) = _1] - >> -(',' >> double_[ref(iN) = _1]) >> ')' - | double_[ref(rN) = _1] - ), - // End grammar - - space); - - if (!r || first != last) // fail if we did not get a full match - return false; - c = std::complex<double>(rN, iN); - return r; - } -} -//] - -//////////////////////////////////////////////////////////////////////////// -// Main program -//////////////////////////////////////////////////////////////////////////// -int -main() -{ - std::cout << "/////////////////////////////////////////////////////////\n\n"; - std::cout << "\t\tA complex number micro parser for Spirit...\n\n"; - std::cout << "/////////////////////////////////////////////////////////\n\n"; - - std::cout << "Give me a complex number of the form r or (r) or (r,i) \n"; - std::cout << "Type [q or Q] to quit\n\n"; - - std::string str; - while (getline(std::cin, str)) - { - if (str.empty() || str[0] == 'q' || str[0] == 'Q') - break; - - std::complex<double> c; - if (client::parse_complex(str.begin(), str.end(), c)) - { - std::cout << "-------------------------\n"; - std::cout << "Parsing succeeded\n"; - std::cout << "got: " << c << std::endl; - std::cout << "\n-------------------------\n"; - } - else - { - std::cout << "-------------------------\n"; - std::cout << "Parsing failed\n"; - std::cout << "-------------------------\n"; - } - } - - std::cout << "Bye... :-) \n\n"; - return 0; -} - - Deleted: trunk/dsim/test/boost/spirit/employee_parser.cpp =================================================================== --- trunk/dsim/test/boost/spirit/employee_parser.cpp 2010-11-10 20:15:47 UTC (rev 155) +++ trunk/dsim/test/boost/spirit/employee_parser.cpp 2010-11-16 10:08:08 UTC (rev 156) @@ -1,152 +0,0 @@ - -/*============================================================================= - Copyright (c) 2002-2010 Joel de Guzman - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -/////////////////////////////////////////////////////////////////////////////// -// -// A parser for arbitrary tuples. This example presents a parser -// for an employee structure. -// -// [ JDG May 9, 2007 ] -// -/////////////////////////////////////////////////////////////////////////////// - -#include <boost/config/warning_disable.hpp> -#include <boost/spirit/include/qi.hpp> -#include <boost/spirit/include/phoenix_core.hpp> -#include <boost/spirit/include/phoenix_operator.hpp> -#include <boost/spirit/include/phoenix_object.hpp> -#include <boost/fusion/include/adapt_struct.hpp> -#include <boost/fusion/include/io.hpp> - -#include <iostream> -#include <string> -#include <complex> - -namespace client -{ - namespace qi = boost::spirit::qi; - namespace ascii = boost::spirit::ascii; - - /////////////////////////////////////////////////////////////////////////// - // Our employee struct - /////////////////////////////////////////////////////////////////////////// - //[tutorial_employee_struct - struct employee - { - int age; - std::string surname; - std::string forename; - double salary; - }; - //] -} - -// We need to tell fusion about our employee struct -// to make it a first-class fusion citizen. This has to -// be in global scope. - -//[tutorial_employee_adapt_struct -BOOST_FUSION_ADAPT_STRUCT( - client::employee, - (int, age) - (std::string, surname) - (std::string, forename) - (double, salary) -) -//] - -namespace client -{ - /////////////////////////////////////////////////////////////////////////////// - // Our employee parser - /////////////////////////////////////////////////////////////////////////////// - //[tutorial_employee_parser - template <typename Iterator> - struct employee_parser : qi::grammar<Iterator, employee(), ascii::space_type> - { - employee_parser() : employee_parser::base_type(start) - { - using qi::int_; - using qi::lit; - using qi::double_; - using qi::lexeme; - using ascii::char_; - - quoted_string %= lexeme['"' >> +(char_ - '"') >> '"']; - - start %= - lit("employee") - >> '{' - >> int_ >> ',' - >> quoted_string >> ',' - >> quoted_string >> ',' - >> double_ - >> '}' - ; - } - - qi::rule<Iterator, std::string(), ascii::space_type> quoted_string; - qi::rule<Iterator, employee(), ascii::space_type> start; - }; - //] -} - -//////////////////////////////////////////////////////////////////////////// -// Main program -//////////////////////////////////////////////////////////////////////////// -int -main() -{ - std::cout << "/////////////////////////////////////////////////////////\n\n"; - std::cout << "\t\tAn employee parser for Spirit...\n\n"; - std::cout << "/////////////////////////////////////////////////////////\n\n"; - - std::cout - << "Give me an employee of the form :" - << "employee{age, \"surname\", \"forename\", salary } \n"; - std::cout << "Type [q or Q] to quit\n\n"; - - using boost::spirit::ascii::space; - typedef std::string::const_iterator iterator_type; - typedef client::employee_parser<iterator_type> employee_parser; - - employee_parser g; // Our grammar - std::string str; - while (getline(std::cin, str)) - { - if (str.empty() || str[0] == 'q' || str[0] == 'Q') - break; - - client::employee emp; - std::string::const_iterator iter = str.begin(); - std::string::const_iterator end = str.end(); - bool r = phrase_parse(iter, end, g, space, emp); - - if (r && iter == end) - { - std::cout << boost::fusion::tuple_open('['); - std::cout << boost::fusion::tuple_close(']'); - std::cout << boost::fusion::tuple_delimiter(", "); - - std::cout << "-------------------------\n"; - std::cout << "Parsing succeeded\n"; - std::cout << "got: " << boost::fusion::as_vector(emp) << std::endl; - std::cout << "\n-------------------------\n"; - } - else - { - std::cout << "-------------------------\n"; - std::cout << "Parsing failed\n"; - std::cout << "-------------------------\n"; - } - } - - std::cout << "Bye... :-) \n\n"; - return 0; -} - - Deleted: trunk/dsim/test/boost/spirit/good_input.csv =================================================================== --- trunk/dsim/test/boost/spirit/good_input.csv 2010-11-10 20:15:47 UTC (rev 155) +++ trunk/dsim/test/boost/spirit/good_input.csv 2010-11-16 10:08:08 UTC (rev 156) @@ -1,5 +0,0 @@ -# test -# -# good input -8 ; -6; 7; Deleted: trunk/dsim/test/boost/spirit/num_list1_parser.cpp =================================================================== --- trunk/dsim/test/boost/spirit/num_list1_parser.cpp 2010-11-10 20:15:47 UTC (rev 155) +++ trunk/dsim/test/boost/spirit/num_list1_parser.cpp 2010-11-16 10:08:08 UTC (rev 156) @@ -1,90 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2010 Joel de Guzman - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -/////////////////////////////////////////////////////////////////////////////// -// -// This sample demontrates a parser for a comma separated list of numbers. -// No actions. -// -// [ JDG May 10, 2002 ] spirit1 -// [ JDG March 24, 2007 ] spirit2 -// -/////////////////////////////////////////////////////////////////////////////// - -#include <boost/config/warning_disable.hpp> -#include <boost/spirit/include/qi.hpp> - -#include <iostream> -#include <string> -#include <vector> - -namespace client -{ - namespace qi = boost::spirit::qi; - namespace ascii = boost::spirit::ascii; - - /////////////////////////////////////////////////////////////////////////// - // Our number list parser - /////////////////////////////////////////////////////////////////////////// - //[tutorial_numlist1 - template <typename Iterator> - bool parse_numbers(Iterator first, Iterator last) - { - using qi::double_; - using qi::phrase_parse; - using ascii::space; - - bool r = phrase_parse( - first, /*< start iterator >*/ - last, /*< end iterator >*/ - double_ >> *(',' >> double_), /*< the parser >*/ - space /*< the skip-parser >*/ - ); - if (first != last) // fail if we did not get a full match - return false; - return r; - } - //] -} - -//////////////////////////////////////////////////////////////////////////// -// Main program -//////////////////////////////////////////////////////////////////////////// -int -main() -{ - std::cout << "/////////////////////////////////////////////////////////\n\n"; - std::cout << "\t\tA comma separated list parser for Spirit...\n\n"; - std::cout << "/////////////////////////////////////////////////////////\n\n"; - - std::cout << "Give me a comma separated list of numbers.\n"; - std::cout << "Type [q or Q] to quit\n\n"; - - std::string str; - while (getline(std::cin, str)) - { - if (str.empty() || str[0] == 'q' || str[0] == 'Q') - break; - - if (client::parse_numbers(str.begin(), str.end())) - { - std::cout << "-------------------------\n"; - std::cout << "Parsing succeeded\n"; - std::cout << str << " Parses OK: " << std::endl; - } - else - { - std::cout << "-------------------------\n"; - std::cout << "Parsing failed\n"; - std::cout << "-------------------------\n"; - } - } - - std::cout << "Bye... :-) \n\n"; - return 0; -} - - Deleted: trunk/dsim/test/boost/spirit/roman_parser.cpp =================================================================== --- trunk/dsim/test/boost/spirit/roman_parser.cpp 2010-11-10 20:15:47 UTC (rev 155) +++ trunk/dsim/test/boost/spirit/roman_parser.cpp 2010-11-16 10:08:08 UTC (rev 156) @@ -1,186 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2010 Joel de Guzman - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -/////////////////////////////////////////////////////////////////////////////// -// -// A Roman Numerals Parser (demonstrating the symbol table). This is -// discussed in the "Symbols" chapter in the Spirit User's Guide. -// -// [ JDG August 22, 2002 ] spirit1 -// [ JDG March 13, 2007 ] spirit2 -// -/////////////////////////////////////////////////////////////////////////////// - -#include <boost/config/warning_disable.hpp> -#include <boost/spirit/include/qi.hpp> -#include <boost/spirit/include/phoenix_operator.hpp> - -#include <iostream> -#include <string> - -namespace client -{ - namespace qi = boost::spirit::qi; - namespace ascii = boost::spirit::ascii; - - /////////////////////////////////////////////////////////////////////////////// - // Parse roman hundreds (100..900) numerals using the symbol table. - // Notice that the data associated with each slot is the parser's attribute - // (which is passed to attached semantic actions). - /////////////////////////////////////////////////////////////////////////////// - //[tutorial_roman_hundreds - struct hundreds_ : qi::symbols<char, unsigned> - { - hundreds_() - { - add - ("C" , 100) - ("CC" , 200) - ("CCC" , 300) - ("CD" , 400) - ("D" , 500) - ("DC" , 600) - ("DCC" , 700) - ("DCCC" , 800) - ("CM" , 900) - ; - } - - } hundreds; - //] - - /////////////////////////////////////////////////////////////////////////////// - // Parse roman tens (10..90) numerals using the symbol table. - /////////////////////////////////////////////////////////////////////////////// - //[tutorial_roman_tens - struct tens_ : qi::symbols<char, unsigned> - { - tens_() - { - add - ("X" , 10) - ("XX" , 20) - ("XXX" , 30) - ("XL" , 40) - ("L" , 50) - ("LX" , 60) - ("LXX" , 70) - ("LXXX" , 80) - ("XC" , 90) - ; - } - - } tens; - //] - - /////////////////////////////////////////////////////////////////////////////// - // Parse roman ones (1..9) numerals using the symbol table. - /////////////////////////////////////////////////////////////////////////////// - //[tutorial_roman_ones - struct ones_ : qi::symbols<char, unsigned> - { - ones_() - { - add - ("I" , 1) - ("II" , 2) - ("III" , 3) - ("IV" , 4) - ("V" , 5) - ("VI" , 6) - ("VII" , 7) - ("VIII" , 8) - ("IX" , 9) - ; - } - - } ones; - //] - - /////////////////////////////////////////////////////////////////////////////// - // roman (numerals) grammar - // - // Note the use of the || operator. The expression - // a || b reads match a or b and in sequence. Try - // defining the roman numerals grammar in YACC or - // PCCTS. Spirit rules! :-) - /////////////////////////////////////////////////////////////////////////////// - //[tutorial_roman_grammar - template <typename Iterator> - struct roman : qi::grammar<Iterator, unsigned()> - { - roman() : roman::base_type(start) - { - using qi::eps; - using qi::lit; - using qi::_val; - using qi::_1; - using ascii::char_; - - start = eps [_val = 0] >> - ( - +lit('M') [_val += 1000] - || hundreds [_val += _1] - || tens [_val += _1] - || ones [_val += _1] - ) - ; - } - - qi::rule<Iterator, unsigned()> start; - }; - //] -} - -/////////////////////////////////////////////////////////////////////////////// -// Main program -/////////////////////////////////////////////////////////////////////////////// -int -main() -{ - std::cout << "/////////////////////////////////////////////////////////\n\n"; - std::cout << "\t\tRoman Numerals Parser\n\n"; - std::cout << "/////////////////////////////////////////////////////////\n\n"; - std::cout << "Type a Roman Numeral ...or [q or Q] to quit\n\n"; - - typedef std::string::const_iterator iterator_type; - typedef client::roman<iterator_type> roman; - - roman roman_parser; // Our grammar - - std::string str; - unsigned result; - while (std::getline(std::cin, str)) - { - if (str.empty() || str[0] == 'q' || str[0] == 'Q') - break; - - std::string::const_iterator iter = str.begin(); - std::string::const_iterator end = str.end(); - //[tutorial_roman_grammar_parse - bool r = parse(iter, end, roman_parser, result); - - if (r && iter == end) - { - std::cout << "-------------------------\n"; - std::cout << "Parsing succeeded\n"; - std::cout << "result = " << result << std::endl; - std::cout << "-------------------------\n"; - } - else - { - std::string rest(iter, end); - std::cout << "-------------------------\n"; - std::cout << "Parsing failed\n"; - std::cout << "stopped at: \": " << rest << "\"\n"; - std::cout << "-------------------------\n"; - } - //] - } - - std::cout << "Bye... :-) \n\n"; - return 0; -} Deleted: trunk/dsim/test/boost/spirit/stream_iterator_parser.cpp =================================================================== --- trunk/dsim/test/boost/spirit/stream_iterator_parser.cpp 2010-11-10 20:15:47 UTC (rev 155) +++ trunk/dsim/test/boost/spirit/stream_iterator_parser.cpp 2010-11-16 10:08:08 UTC (rev 156) @@ -1,91 +0,0 @@ -// Copyright (c) 2010 Peter Schueller -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include <vector> -#include <istream> -#include <sstream> -#include <iostream> -#include <fstream> -#include <boost/spirit/include/qi.hpp> -#include <boost/spirit/include/support_multi_pass.hpp> - -namespace qi = boost::spirit::qi; -namespace ascii = boost::spirit::ascii; - - -//////////////////////////////////////////////////////////////////////////// -// Parser -//////////////////////////////////////////////////////////////////////////// -template <typename iterator_t> -bool parse(iterator_t& iStr, iterator_t& iStrEnd, - std::vector<double>& output) { - - // Parse list of doubles from input stream - bool r = qi::phrase_parse( - iStr, iStrEnd, // Iterators - *(qi::double_ >> ';'), // Recognize list of doubles - ascii::space | '#' >> *(ascii::char_ - qi::eol) >> qi::eol, // Skip comment - output); // Store double into this object - - // Return result of parsing - return r; - -} - -//////////////////////////////////////////////////////////////////////////// -// Main program -//////////////////////////////////////////////////////////////////////////// -int main (int argc, char* argv[]) { - - std::string lFilename("good_input.csv"); - std::ifstream File; - - // Read the command-line parameters - if (argc >= 1 && argv[1] != NULL) { - lFilename = argv[1]; - File.open (argv[1],std::ios_base::in); - } else { - // Default File to be parsed - File.open ("good_input.csv",std::ios_base::in); - } - - // Check the File existence - if (!File) { - std::cerr << "Unknown file named" << lFilename << std::endl; - return 1; - } - - // Iterate over stream input - typedef std::istreambuf_iterator<char> base_iterator_type; - base_iterator_type in_begin(File.rdbuf()); - - // Convert input iterator to forward iterator, usable by spirit parser - typedef boost::spirit::multi_pass<base_iterator_type>forward_iterator_type; - forward_iterator_type fwd_begin = - boost::spirit::make_default_multi_pass(in_begin); - forward_iterator_type fwd_end; - - // Prepare output - std::vector<double> output; - - try { - bool r = parse(fwd_begin, fwd_end, output); - // Error detection - if( !r || fwd_begin != fwd_end ) { - throw std::runtime_error("parse error in "+lFilename); - } else { - std::cout << "--------------------------------------------\n"; - std::cout << "Parsing of the file " << lFilename <<" succeeded\n"; - std::cout << "Got: "; - for (unsigned int i = 0; i < output.size(); i++) { - std::cout << output[i] << " "; - } - std::cout << "\n--------------------------------------------\n"; - } - } catch(const std::exception& e) { - std::cerr << "Exception: " << e.what() << std::endl; - } - return 0; -} - Deleted: trunk/dsim/test/boost/spirit/sum_parser.cpp =================================================================== --- trunk/dsim/test/boost/spirit/sum_parser.cpp 2010-11-10 20:15:47 UTC (rev 155) +++ trunk/dsim/test/boost/spirit/sum_parser.cpp 2010-11-16 10:08:08 UTC (rev 156) @@ -1,104 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2010 Joel de Guzman - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -/////////////////////////////////////////////////////////////////////////////// -// -// A parser for summing a comma-separated list of numbers using phoenix. -// -// [ JDG June 28, 2002 ] spirit1 -// [ JDG March 24, 2007 ] spirit2 -// -/////////////////////////////////////////////////////////////////////////////// - -#include <boost/config/warning_disable.hpp> -//[tutorial_adder_includes -#include <boost/spirit/include/qi.hpp> -#include <boost/spirit/include/phoenix_core.hpp> -#include <boost/spirit/include/phoenix_operator.hpp> -#include <iostream> -#include <string> -//] - -namespace client -{ - //[tutorial_adder_using - namespace qi = boost::spirit::qi; - namespace ascii = boost::spirit::ascii; - namespace phoenix = boost::phoenix; - - using qi::double_; - using qi::_1; - using ascii::space; - using phoenix::ref; - //] - - /////////////////////////////////////////////////////////////////////////// - // Our adder - /////////////////////////////////////////////////////////////////////////// - - //[tutorial_adder - template <typename Iterator> - bool adder(Iterator first, Iterator last, double& n) - { - bool r = qi::phrase_parse(first, last, - - // Begin grammar - ( - double_[ref(n) = _1] >> *(',' >> double_[ref(n) += _1]) - ) - , - // End grammar - - space); - - if (first != last) // fail if we did not get a full match - return false; - return r; - } - //] -} - -//////////////////////////////////////////////////////////////////////////// -// Main program -//////////////////////////////////////////////////////////////////////////// -int -main() -{ - std::cout << "/////////////////////////////////////////////////////////\n\n"; - std::cout << "\t\tA parser for summing a list of numbers...\n\n"; - std::cout << "/////////////////////////////////////////////////////////\n\n"; - - std::cout << "Give me a comma separated list of numbers.\n"; - std::cout << "The numbers are added using Phoenix.\n"; - std::cout << "Type [q or Q] to quit\n\n"; - - std::string str; - while (getline(std::cin, str)) - { - if (str.empty() || str[0] == 'q' || str[0] == 'Q') - break; - - double n; - if (client::adder(str.begin(), str.end(), n)) - { - std::cout << "-------------------------\n"; - std::cout << "Parsing succeeded\n"; - std::cout << str << " Parses OK: " << std::endl; - - std::cout << "sum = " << n; - std::cout << "\n-------------------------\n"; - } - else - { - std::cout << "-------------------------\n"; - std::cout << "Parsing failed\n"; - std::cout << "-------------------------\n"; - } - } - - std::cout << "Bye... :-) \n\n"; - return 0; -} Modified: trunk/dsim/test/boost/spirit/world_schedule.csv =================================================================== --- trunk/dsim/test/boost/spirit/world_schedule.csv 2010-11-10 20:15:47 UTC (rev 155) +++ trunk/dsim/test/boost/spirit/world_schedule.csv 2010-11-16 10:08:08 UTC (rev 156) @@ -3,9 +3,9 @@ // ElapsedTime; LegCabins; // LegCabins: CabinCode; Capacity; // Segments: Specific; -BA; 9; 2007-04-20; 2007-06-30; 0000011; LHR; BKK; 22:00; 15:15; 11:15; F; 5; J; 12; W; 20; Y; 300; BKK; SYD; 18:10; 06:05; 08:55; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKMLSQ; -BA; 9; 2007-04-20; 2007-06-30; 1111100; LHR; BKK; 22:00; 15:15; 11:15; F; 5; J; 12; W; 20; Y; 300; BKK; SYD; 18:10; 06:05; 08:55; F; 5; J; 12; W; 20; Y; 300; 1; LHR; BKK; F; FA; J; JCDI; W; WT; Y; YBHKMLSQ; BKK; SYD; F; FA; J; JCDI; W; WT; Y; YBHKMLSQ; LHR; SYD; F; FA; J; JCDI; W; WT; Y; YBHKMLSQ; -BA; 117; 2007-04-20; 3000-06-30; 1111111; LHR; JFK; 08:20; 11:00; 07:40; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKM; +BA; 9; 2007-04-20; 2007-06-30; 0000011; LHR; BKK; 22:00; 15:15 / +1; 11:15; F; 5; J; 12; W; 20; Y; 300; BKK; SYD; 18:10 / +1; 06:05 / +2; 08:55; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKMLSQ; +BA; 9; 2007-04-20; 2007-06-30; 1111100; LHR; BKK; 22:00; 15:15 / +1; 11:15; F; 5; J; 12; W; 20; Y; 300; BKK; SYD; 18:10 / +1; 06:05 / +2; 08:55; F; 5; J; 12; W; 20; Y; 300; 1; LHR; BKK; F; FA; J; JCDI; W; WT; Y; YBHKMLSQ; BKK; SYD; F; FA; J; JCDI; W; WT; Y; YBHKMLSQ; LHR; SYD; F; FA; J; JCDI; W; WT; Y; YBHKMLSQ; +BA; 117; 2007-04-20; 2007-06-30; 1111111; LHR; JFK; 08:20; 11:00; 07:40; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKM; BA; 175; 2007-04-20; 2007-06-30; 1111111; LHR; JFK; 10:55; 13:35; 07:40; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKMRL; BA; 179; 2007-04-20; 2007-06-30; 1111111; LHR; JFK; 18:05; 20:45; 07:40; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKMRVNELSQO; BA; 207; 2007-04-20; 2007-06-30; 1111111; LHR; MIA; 09:40; 14:25; 09:45; F; 5; J; 12; W; 20; Y; 300; 0; F; FA; J; JCDI; W; WT; Y; YBHKMRVNELSQO; Modified: trunk/dsim/test/boost/spiritQi/schedule_parser.cpp =================================================================== --- trunk/dsim/test/boost/spiritQi/schedule_parser.cpp 2010-11-10 20:15:47 UTC (rev 155) +++ trunk/dsim/test/boost/spiritQi/schedule_parser.cpp 2010-11-16 10:08:08 UTC (rev 156) @@ -20,52 +20,695 @@ typedef std::string::const_iterator iterator_t; + +/** LegCabin-Details. */ +struct Cabin_T { + // Attributes + std::string _cabinCode; + double _capacity; + + void display() const { + std::cout << " " << _cabinCode << " " << _capacity << ", "; + } +}; + +/** List of Cabin-Detail strucutres. */ +typedef std::vector<Cabin_T> CabinList_T; + +/** Leg. */ +struct Leg_T { + // Attributes + std::string _boardPoint; + boost::posix_time::time_duration _boardTime; + boost::gregorian::date_duration _boardDateOffSet; + std::string _offPoint; + boost::posix_time::time_duration _offTime; + boost::gregorian::date_duration _offDateOffSet; + boost::posix_time::time_duration _elapsed; + CabinList_T _cabinList; + + /** Constructor. */ + Leg_T () : _boardDateOffSet (0), _offDateOffSet (0) {} + + void display() const { + std::cout << " " << _boardPoint << " / " + << boost::posix_time::to_simple_string (_boardTime) + << " -- " << _offPoint << " / " + << boost::posix_time::to_simple_string (_offTime) + << " --> " << boost::posix_time::to_simple_string (_elapsed) + << std::endl; + for (CabinList_T::const_iterator itCabin = _cabinList.begin(); + itCabin != _cabinList.end(); itCabin++) { + const Cabin_T& lCabin = *itCabin; + lCabin.display(); + } + std::cout << std::endl; + } +}; + +/** List of Leg strucutres. */ +typedef std::vector<Leg_T> LegList_T; + +/** SegmentCabin-Details. */ +struct SegmentCabin_T { + // Attributes + std::string _cabinCode; + std::string _classes; + + void display() const { + std::cout << " " << _cabinCode << " " << _classes << ", "; + } +}; + +/** List of SegmentCabin-Detail strucutres. */ +typedef std::vector<SegmentCabin_T> SegmentCabinList_T; + +/** Segment. */ +struct Segment_T { + // Attributes + std::string _boardPoint; + boost::posix_time::time_duration _boardTime; + boost::gregorian::date_duration _boardDateOffSet; + std::string _offPoint; + boost::posix_time::time_duration _offTime; + boost::gregorian::date_duration _offDateOffSet; + boost::posix_time::time_duration _elapsed; + SegmentCabinList_T _cabinList; + + /** Constructor. */ + Segment_T () : _boardDateOffSet (0), _offDateOffSet (0) {} + + void display() const { + std::cout << " " << _boardPoint << " / " + << boost::posix_time::to_simple_string (_boardTime) + << " -- " << _offPoint << " / " + << boost::posix_time::to_simple_string (_offTime) + << " --> " << boost::posix_time::to_simple_string (_elapsed) + << std::endl; + for (SegmentCabinList_T::const_iterator itCabin = _cabinList.begin(); + itCabin != _cabinList.end(); itCabin++) { + const SegmentCabin_T& lCabin = *itCabin; + lCabin.display(); + } + std::cout << std::endl; + } +}; + +/** List of Segment strucutres. */ +typedef std::vector<Segment_T> SegmentList_T; + /** Flight-Period. */ struct FlightPeriod_T { + // Attributes std::string _airlineCode; unsigned int _flightNumber; boost::gregorian::date _dateRangeStart; boost::gregorian::date _dateRangeEnd; std::string _dow; - std::string _cabinCode; + LegList_T _legList; + SegmentList_T _segmentList; + + /** Constructor. */ + FlightPeriod_T () : _legAlreadyDefined (false), _itSeconds (0) {} + + /** Set the date from the staging details. */ + boost::gregorian::date getDate() const { + return boost::gregorian::date (_itYear, _itMonth, _itDay); + } + + /** Set the time from the staging details. */ + boost::posix_time::time_duration getTime() const { + return boost::posix_time::hours (_itHours) + + boost::posix_time::minutes (_itMinutes) + + boost::posix_time::seconds (_itSeconds); + } + + void display() const { + std::cout << _airlineCode << _flightNumber + << ", " << boost::gregorian::to_simple_string (_dateRangeStart) + << " - " << boost::gregorian::to_simple_string (_dateRangeEnd) + << " - " << _dow + << std::endl; + + for (LegList_T::const_iterator itLeg = _legList.begin(); + itLeg != _legList.end(); itLeg++) { + const Leg_T& lLeg = *itLeg; + lLeg.display(); + } + + for (SegmentList_T::const_iterator itSegment = _segmentList.begin(); + itSegment != _segmentList.end(); itSegment++) { + const Segment_T& lSegment = *itSegment; + lSegment.display(); + } + + //std::cout << "[Debug] - Staging Leg: "; + //_itLeg.display(); + //std::cout << "[Debug] - Staging Cabin: "; + //_itCabin.display(); + //std::cout << "[Debug] - Staging Segment: "; + //_itSegment.display(); + } + + /** Add the given airport to the internal lists (if not already existing). */ + void addAirport (const std::string& iAirport) { + std::set<std::string>::const_iterator itAirport = + _airportList.find (iAirport); + if (itAirport == _airportList.end()) { + // Add the airport code to the airport set + const bool insertSuccessful = _airportList.insert (iAirport).second; + + if (insertSuccessful == false) { + // TODO: throw an exception + } + // Add the airport code to the airport vector + _airportOrderedList.push_back (iAirport); + } + } + + /** Build the routing (segments). */ + void buildSegments () { + // The list of airports encompasses all the airports on which + // the flight takes off or lands. Moreover, that list is + // time-ordered: the first airport is the initial departure of + // the flight, and the last airport is the eventual point of + // rest of the flight. + // Be l the size of the ordered list of airports. + // We want to generate all the segment combinations from the legs + // and, hence, from all the possible (time-ordered) airport pairs. + // Thus, we both iterator on i=0...l-1 and j=i+1...l + assert (_airportOrderedList.size() >= 2); + + _segmentList.clear(); + for (std::vector<std::string>::const_iterator itAirport_i = + _airportOrderedList.begin(); + itAirport_i != _airportOrderedList.end()-1; ++itAirport_i) { + for (std::vector<std::string>::const_iterator itAirport_j = + itAirport_i + 1; + itAirport_j != _airportOrderedList.end(); ++itAirport_j) { + Segment_T lSegment; + lSegment._boardPoint = *itAirport_i; + lSegment._offPoint = *itAirport_j; + + _segmentList.push_back (lSegment); + } + } + + // Clear the lists of airports, so that it is ready for the next flight + _airportList.clear(); + _airportOrderedList.clear(); + } + + /** Add, to the Segment whose key corresponds to the + given (board point, off point) pair, the specific segment cabin + details (mainly, the list of the class codes). + <br>Note that the Segment structure is retrieved from the internal + list, already filled by a previous step (the buildSegments() + method). */ + void addSegmentCabin (const Segment_T& iSegment, + const SegmentCabin_T& iCabin) { + // Retrieve the Segment structure corresponding to the (board, off) point + // pair. + SegmentList_T::iterator itSegment = _segmentList.begin(); + for ( ; itSegment != _segmentList.end(); ++itSegment) { + const Segment_T& lSegment = *itSegment; + + const std::string& lBoardPoint = iSegment._boardPoint; + const std::string& lOffPoint = iSegment._offPoint; + if (lSegment._boardPoint == lBoardPoint + && lSegment._offPoint == lOffPoint) { + break; + } + } + + // If the segment key (airport pair) given in the schedule input file + // does not correspond to the leg (board, off) points, throw an exception + // so that the user knows the schedule input file is corrupted. + if (itSegment == _segmentList.end()) { + std::cerr << "Within the schedule input file, there is a flight for which the airports of segments and those of the legs do not correspond."; + throw std::exception(); + } + + // Add the Cabin structure to the Segment Cabin structure. + assert (itSegment != _segmentList.end()); + Segment_T& lSegment = *itSegment; + lSegment._cabinList.push_back (iCabin); + } + + /** Add, to all the Segment, the general segment cabin details + (mainly, the list of the class codes). + <br>Note that the Segment structures are stored within the internal + list, already filled by a previous step (the buildSegments() + method). */ + void addSegmentCabin (const SegmentCabin_T& iCabin) { + // Iterate on all the Segment (as they get the same cabin definitions) + for (SegmentList_T::iterator itSegment = _segmentList.begin(); + itSegment != _segmentList.end(); ++itSegment) { + Segment_T& lSegment = *itSegment; + lSegment._cabinList.push_back (iCabin); + } + } + + /** Staging Leg (resp. Cabin) structure, gathering the result of the iteration + on one leg (resp. cabin). */ + bool _legAlreadyDefined; + Leg_T _itLeg; + Cabin_T _itCabin; + + /** Staging Date. */ + unsigned int _itYear; + unsigned int _itMonth; + unsigned int _itDay; + + /** Staging Time. */ + long _itHours; + long _itMinutes; + long _itSeconds; + int _dateOffSet; + + /** Staging Airport List (helper to derive the list of Segment + structures). */ + std::set<std::string> _airportList; + std::vector<std::string> _airportOrderedList; + + /** Staging Segment-related attributes. */ + bool _areSegmentDefinitionsSpecific; + Segment_T _itSegment; + SegmentCabin_T _itSegmentCabin; + }; +/////////////////////////////////////////////////////////////////////////////// +// +// Semantic actions +// +/////////////////////////////////////////////////////////////////////////////// + /** Store the parsed airline code. */ template <typename FLIGHT_PERIOD> struct store_airline_code { store_airline_code (FLIGHT_PERIOD& ioFlightPeriod) : _flightPeriod (ioFlightPeriod) {} - void operator() (iterator_t iStr, iterator_t iStrEnd) const { - std::string lAirlineCode (iStr, iStrEnd); + void operator() (std::vector<char> iChar, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + std::string lAirlineCode (iChar.begin(), iChar.end()); _flightPeriod._airlineCode = lAirlineCode; // std::cout << "Airline code: " << lAirlineCode << std::endl; + + // As that's the beginning of a new flight, the list of legs must be reset + _flightPeriod._legList.clear(); } FLIGHT_PERIOD& _flightPeriod; }; +/** Store the parsed flight number. */ +template <typename FLIGHT_PERIOD> +struct store_flight_number { + store_flight_number (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) {} + + void operator() (unsigned int iNumber, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + _flightPeriod._flightNumber = iNumber; + //std::cout << "Flight number: " << iNumber << std::endl; + } + + FLIGHT_PERIOD& _flightPeriod; +}; + +/** Store the start of the date range. */ +template <typename FLIGHT_PERIOD> +struct store_date_range_start { + store_date_range_start (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) {} + + void operator() (boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + _flightPeriod._dateRangeStart = _flightPeriod.getDate(); + //std::cout << "Date Range Start: " + // << _flightPeriod._dateRangeStart << std::endl; + + // Reset the number of seconds + _flightPeriod._itSeconds = 0; + } + + FLIGHT_PERIOD& _flightPeriod; +}; + +/** Store the end of the date range. */ +template <typename FLIGHT_PERIOD> +struct store_date_range_end { + store_date_range_end (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) {} + + void operator() (boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + _flightPeriod._dateRangeEnd = _flightPeriod.getDate(); + //std::cout << "Date Range End: " + // << _flightPeriod._dateRangeEnd << std::endl; + + // Reset the number of seconds + _flightPeriod._itSeconds = 0; + } + + FlightPeriod_T& _flightPeriod; +}; + +/** Store the DOW (day of the Week). */ +template <typename FLIGHT_PERIOD> +struct store_dow { + store_dow (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) {} + + void operator() (std::vector<char> iChar, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + std::string lDow (iChar.begin(), iChar.end()); + _flightPeriod._dow = lDow; + //std::cout << "DOW: " << lDow << std::endl; + } + + FLIGHT_PERIOD& _flightPeriod; +}; + +/** Store the parsed board point. */ +template <typename FLIGHT_PERIOD> +struct store_board_point { + store_board_point (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) {} + + void operator() (std::vector<char> iChar, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + std::string lBoardPoint (iChar.begin(), iChar.end()); + //std::cout << "Board point: " << lBoardPoint << std::endl; + + // If a leg has already been parsed, add it to the FlightPeriod + if (_flightPeriod._legAlreadyDefined == true) { + _flightPeriod._legList.push_back (_flightPeriod._itLeg); + } else { + _flightPeriod._legAlreadyDefined = true; + } + + // Set the (new) board point + _flightPeriod._itLeg._boardPoint = lBoardPoint; + + // As that's the beginning of a new leg, the list of cabins must be reset + _flightPeriod._itLeg._cabinList.clear(); + + // Add the airport code if it is not already stored in the airport lists + _flightPeriod.addAirport (lBoardPoint); + } + + FLIGHT_PERIOD& _flightPeriod; +}; + +/** Store the parsed off point. */ +template <typename FLIGHT_PERIOD> +struct store_off_point { + store_off_point (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) {} + + void operator() (std::vector<char> iChar, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + std::string lOffPoint (iChar.begin(), iChar.end()); + _flightPeriod._itLeg._offPoint = lOffPoint; + //std::cout << "Off point: " << lOffPoint << std::endl; + + // Add the airport code if it is not already stored in the airport lists + _flightPeriod.addAirport (lOffPoint); + } + + FLIGHT_PERIOD& _flightPeriod; +}; + +/** Store the board time. */ +template <typename FLIGHT_PERIOD> +struct store_board_time { + store_board_time (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) {} + + void operator() (boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + _flightPeriod._itLeg._boardTime = _flightPeriod.getTime(); + + //std::cout << "Board time: " + //<< _flightPeriod._itLeg._boardTime << std::endl; + + // Reset the number of seconds + _flightPeriod._itSeconds = 0; + + // Reset the date off-set + _flightPeriod._dateOffSet = 0; + } + + FLIGHT_PERIOD& _flightPeriod; +}; + +/** Store the off time. */ +template <typename FLIGHT_PERIOD> +struct store_off_time { + store_off_time (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) {} + + void operator() (boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + _flightPeriod._itLeg._offTime = _flightPeriod.getTime(); + + //std::cout << "Off time: " + // << _flightPeriod._itLeg._offTime << std::endl; + + // Reset the number of seconds + _flightPeriod._itSeconds = 0; + + // As the board date off set is optional, it can be set only afterwards, + // based on the staging date off-set value (_flightPeriod._dateOffSet). + const boost::gregorian::date_duration lDateOffSet (_flightPeriod._dateOffSet); + _flightPeriod._itLeg._boardDateOffSet = lDateOffSet; + } + + FLIGHT_PERIOD& _flightPeriod; +}; + +/** Store the elapsed time. */ +template <typename FLIGHT_PERIOD> +struct store_elapsed_time { + store_elapsed_time (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) {} + + void operator() (boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + + _flightPeriod._itLeg._elapsed = _flightPeriod.getTime(); + + //std::cout << "Elapsed time: " + // << _flightPeriod._itLeg._elapsed << std::endl; + + // Reset the number of seconds + _flightPeriod._itSeconds = 0; + + // As the board date off set is optional, it can be set only afterwards, + // based on the staging date off-set value (_flightPeriod._dateOffSet). + const boost::gregorian::date_duration lDateOffSet (_flightPeriod._dateOffSet); + _flightPeriod._itLeg._offDateOffSet = lDateOffSet; + } + + FLIGHT_PERIOD& _flightPeriod; +}; + /** Store the parsed cabin code. */ template <typename FLIGHT_PERIOD> struct store_cabin_code { store_cabin_code (FLIGHT_PERIOD& ioFlightPeriod) : _flightPeriod (ioFlightPeriod) {} - void operator() (char iChar, boost::spirit::qi::unused_type, + void operator() (char iChar, + boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const { - _flightPeriod._cabinCode = iChar; - // std::cout << "Cabin code: " << lCabinCode << std::endl; + _flightPeriod._itCabin._cabinCode = iChar; + //std::cout << "Cabin code: " << _flightPeriod._itCabin._cabinCode << std::endl; } FLIGHT_PERIOD& _flightPeriod; }; + +/** Store the parsed capacity. */ +template <typename FLIGHT_PERIOD> +struct store_capacity { + store_capacity (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) {} + + void operator() (double iReal, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + _flightPeriod._itCabin._capacity = iReal; + //std::cout << "Capacity: " << iReal << std::endl; + + // The capacity is the last (according to arrival order) detail + // of the cabin. Hence, when a capacity is parsed, it means that + // the full cabin details have already been parsed as well: the + // cabin can thus be added to the leg. + _flightPeriod._itLeg._cabinList.push_back (_flightPeriod._itCabin); + } + + FLIGHT_PERIOD& _flightPeriod; +}; + +/** Store whether or not all the segments are the same. */ +template <typename FLIGHT_PERIOD> +struct store_segment_specificity { + store_segment_specificity (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) { + } + + void operator() (char iChar, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + if (iChar == '0') { + _flightPeriod._areSegmentDefinitionsSpecific = false; + } else { + _flightPeriod._areSegmentDefinitionsSpecific = true; + } + + // Do a few sanity checks: the two lists should get exactly the same + // content (in terms of airport codes). The only difference is that one + // is a STL set, and the other a STL vector. + assert (_flightPeriod._airportList.size() + == _flightPeriod._airportOrderedList.size()); + assert (_flightPeriod._airportList.size() >= 2); + + // Since all the legs have now been parsed, we get all the airports + // and the segments may be built. + _flightPeriod.buildSegments(); + } + + FLIGHT_PERIOD& _flightPeriod; +}; + +/** Store the board point of the segment. */ +template <typename FLIGHT_PERIOD> +struct store_segment_board_point { + store_segment_board_point (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) { + } + + void operator() (std::vector<char> iChar, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + std::string lBoardPoint (iChar.begin(), iChar.end()); + _flightPeriod._itSegment._boardPoint = lBoardPoint; + //std::cout << "Board point: " << lBoardPoint << std::endl; + } + + FLIGHT_PERIOD& _flightPeriod; +}; + +/** Store the off point of the segment. */ +template <typename FLIGHT_PERIOD> +struct store_segment_off_point { + store_segment_off_point (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) { + } + + void operator() (std::vector<char> iChar, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + std::string lOffPoint (iChar.begin(), iChar.end()); + _flightPeriod._itSegment._offPoint = lOffPoint; + //std::cout << "Off point: " << lOffPoint << std::endl; + } + + FLIGHT_PERIOD& _flightPeriod; +}; + +/** Store the cabin code of the segment. */ +template <typename FLIGHT_PERIOD> +struct store_segment_cabin_code { + store_segment_cabin_code (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) { + } + + void operator() (char iChar, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + _flightPeriod._itSegmentCabin._cabinCode = iChar; + //std::cout << "Cabin code: " << iChar << std::endl; + } + + FLIGHT_PERIOD& _flightPeriod; +}; + +/** Store the classes of the segment-cabin. */ +template <typename FLIGHT_PERIOD> +struct store_classes { + store_classes (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) { + } + + void operator() (std::vector<char> iChar, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + std::string lClasses (iChar.begin(), iChar.end()); + _flightPeriod._itSegmentCabin._classes = lClasses; + //std::cout << "Classes: " << lClasses << std::endl; + + // The list of classes is the last (according to the arrival order + // within the schedule input file) detail of the segment cabin. Hence, + // when a list of classes is parsed, it means that the full segment + // cabin details have already been parsed as well: the segment cabin + // can thus be added to the segment. + if (_flightPeriod._areSegmentDefinitionsSpecific == true) { + _flightPeriod.addSegmentCabin (_flightPeriod._itSegment, + _flightPeriod._itSegmentCabin); + } else { + _flightPeriod.addSegmentCabin (_flightPeriod._itSegmentCabin); + } + } + + FLIGHT_PERIOD& _flightPeriod; +}; +/** Mark the end of the flight-period parsing. */ +template <typename FLIGHT_PERIOD> +struct do_end_flight { + do_end_flight (FLIGHT_PERIOD& ioFlightPeriod) + : _flightPeriod (ioFlightPeriod) {} + + void operator() (boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type, + boost::spirit::qi::unused_type) const { + //std::cout << "End of Flight-Period " << std::endl; + assert (_flightPeriod._legAlreadyDefined == true); + _flightPeriod._legList.push_back (_flightPeriod._itLeg); + + // Display the result + _flightPeriod.display(); + + // The lists of legs and cabins must be reset + _flightPeriod._legAlreadyDefined = false; + _flightPeriod._itLeg._cabinList.clear(); + + } + + FLIGHT_PERIOD& _flightPeriod; +}; + // /////////// Utilities ///////////// /** 1-digit-integer parser */ -boost::spirit::qi::uint_parser<int, 10, 1, 1> int1_p; +boost::spirit::qi::int_parser<unsigned int, 10, 1, 1> int1_p; /** 2-digit-integer parser */ boost::spirit::qi::uint_parser<int, 10, 2, 2> ... [truncated message content] |
From: <den...@us...> - 2010-09-25 17:08:54
|
Revision: 134 http://dsim.svn.sourceforge.net/dsim/?rev=134&view=rev Author: denis_arnaud Date: 2010-09-25 17:08:48 +0000 (Sat, 25 Sep 2010) Log Message: ----------- [Test] Added a test for order statistics with Boost.Random Added Paths: ----------- trunk/dsim/test/boost/random/ trunk/dsim/test/boost/random/Makefile.am trunk/dsim/test/boost/random/random_demo.cpp trunk/dsim/test/boost/random/random_order_stats.cpp Property changes on: trunk/dsim/test/boost/random ___________________________________________________________________ Added: svn:ignore + .deps .libs Makefile.in Makefile random_demo random_order_stats random_demo.rng Added: trunk/dsim/test/boost/random/Makefile.am =================================================================== --- trunk/dsim/test/boost/random/Makefile.am (rev 0) +++ trunk/dsim/test/boost/random/Makefile.am 2010-09-25 17:08:48 UTC (rev 134) @@ -0,0 +1,17 @@ +## test/boost/random sub-directory +include $(top_srcdir)/Makefile.common + +MAINTAINERCLEANFILES = Makefile.in + +EXTRA_DIST = + +# +check_PROGRAMS = random_demo random_order_stats + +random_demo_SOURCES = random_demo.cpp +random_demo_CXXFLAGS = $(BOOST_CFLAGS) +random_demo_LDADD = $(BOOST_LIBS) + +random_order_stats_SOURCES = random_order_stats.cpp +random_order_stats_CXXFLAGS = $(BOOST_CFLAGS) +random_order_stats_LDADD = $(BOOST_LIBS) Added: trunk/dsim/test/boost/random/random_demo.cpp =================================================================== --- trunk/dsim/test/boost/random/random_demo.cpp (rev 0) +++ trunk/dsim/test/boost/random/random_demo.cpp 2010-09-25 17:08:48 UTC (rev 134) @@ -0,0 +1,121 @@ +/* boost random_demo.cpp profane demo + * + * Copyright Jens Maurer 2000 + * Distributed under the Boost Software License, Version 1.0. (See + * accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * $Id: random_demo.cpp 60755 2010-03-22 00:45:06Z steven_watanabe $ + * + * A short demo program how to use the random number library. + */ + +#include <iostream> +#include <fstream> +#include <ctime> // std::time + +#include <boost/random/linear_congruential.hpp> +#include <boost/random/uniform_int.hpp> +#include <boost/random/uniform_real.hpp> +#include <boost/random/variate_generator.hpp> +#include <boost/generator_iterator.hpp> + +// This is a typedef for a random number generator. +// Try boost::mt19937 or boost::ecuyer1988 instead of boost::minstd_rand +typedef boost::minstd_rand base_generator_type; + +// This is a reproducible simulation experiment. See main(). +void experiment (base_generator_type& generator) { + // Define a uniform random number distribution of integer values between + // 1 and 6 inclusive. + typedef boost::uniform_int<> distribution_type; + typedef boost::variate_generator<base_generator_type&, + distribution_type> gen_type; + gen_type die_gen (generator, distribution_type (1, 6)); + + // If you want to use an STL iterator interface, use iterator_adaptors.hpp. + // Unfortunately, this doesn't work on SunCC yet. + boost::generator_iterator<gen_type> die (&die_gen); + for (int i = 0; i < 10; i++) { + std::cout << *die++ << " "; + } + std::cout << std::endl; +} + +int main() { + // Define a random number generator and initialize it with a reproducible + // seed. + // (The seed is unsigned, otherwise the wrong overload may be selected + // when using mt19937 as the base_generator_type.) + base_generator_type generator (42u); + + std::cout << "10 samples of a uniform distribution in [0..1):" << std::endl; + + // Define a uniform random number distribution which produces "double" + // values between 0 and 1 (0 inclusive, 1 exclusive). + boost::uniform_real<> uni_dist (0,1); + boost::variate_generator<base_generator_type&, + boost::uniform_real<> > uni (generator, uni_dist); + + std::cout.setf (std::ios::fixed); + // You can now retrieve random numbers from that distribution by means + // of a STL Generator interface, i.e. calling the generator as a zero- + // argument function. + for (int i = 0; i < 10; i++) { + std::cout << uni() << std::endl; + } + + /* + * Change seed to something else. + * + * Caveat: std::time(0) is not a very good truly-random seed. When + * called in rapid succession, it could return the same values, and + * thus the same random number sequences could ensue. If not the same + * values are returned, the values differ only slightly in the + * lowest bits. A linear congruential generator with a small factor + * wrapped in a uniform_smallint (see experiment) will produce the same + * values for the first few iterations. This is because uniform_smallint + * takes only the highest bits of the generator, and the generator itself + * needs a few iterations to spread the initial entropy from the lowest bits + * to the whole state. + */ + generator.seed (static_cast<unsigned int> (std::time(0))); + + std::cout << std::endl << "experiment: roll a die 10 times:" << std::endl; + + // You can save a generator's state by copy construction. + base_generator_type saved_generator = generator; + + // When calling other functions which take a generator or distribution + // as a parameter, make sure to always call by reference (or pointer). + // Calling by value invokes the copy constructor, which means that the + // sequence of random numbers at the caller is disconnected from the + // sequence at the callee. + experiment (generator); + + std::cout << "redo the experiment to verify it:" << std::endl; + experiment (saved_generator); + + // After that, both generators are equivalent + assert (generator == saved_generator); + + // as a degenerate case, you can set min = max for uniform_int + boost::uniform_int<> degen_dist(4,4); + boost::variate_generator<base_generator_type&, + boost::uniform_int<> > deg (generator, degen_dist); + std::cout << std::endl << "degenerate case:" << std::endl; + std::cout << deg() << " " << deg() << " " << deg() << std::endl; + +#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE + { + // You can save the generator state for future use. You can read the + // state back in at any later time using operator>>. + std::ofstream file ("random_demo.rng", std::ofstream::trunc); + file << generator; + } +#endif + + // Some compilers don't pay attention to std:3.6.1/5 and issue a + // warning here if "return 0;" is omitted. + return 0; +} Added: trunk/dsim/test/boost/random/random_order_stats.cpp =================================================================== --- trunk/dsim/test/boost/random/random_order_stats.cpp (rev 0) +++ trunk/dsim/test/boost/random/random_order_stats.cpp 2010-09-25 17:08:48 UTC (rev 134) @@ -0,0 +1,79 @@ +#include <cassert> +#include <iostream> +#include <sstream> +// Boost.Random +#include <boost/random/linear_congruential.hpp> +#include <boost/random/uniform_int.hpp> +#include <boost/random/uniform_real.hpp> +#include <boost/random/variate_generator.hpp> +#include <boost/generator_iterator.hpp> + +// Type definition for a random number generator (mt19937). +typedef boost::minstd_rand base_generator_type; + +// //////////////////////////////////////////////////// +void gen_save (std::string& ioState, const base_generator_type& iGenerator) { + std::ostringstream oStr; + oStr << iGenerator; + ioState = oStr.str(); +} + +// //////////////////////////////////////////////////// +void gen_restore (const std::string& iState, base_generator_type& ioGenerator) { + std::istringstream iStr (iState); + iStr >> ioGenerator; +} + +// /////////////// M A I N ///////////////// +int main() { + // Define a random number generator and initialize it with a reproducible + // seed. + // <br>The seed is unsigned, otherwise the wrong overload may be selected + // when using mt19937 as the base_generator_type. + base_generator_type generator (42u); + + std::cout << "10 samples of a uniform distribution in [0..1):" << std::endl; + + // Store current formatting flags of std::cout + std::ios::fmtflags oldFlags = std::cout.flags(); + + std::cout.setf (std::ios::fixed); + + // Draw randomly + double lDrawnNumber = 0.0; + std::string lGeneratorState; + double average = 0.0; + const unsigned int lNbOfDraws = 100; + for (unsigned int i = 1; i <= lNbOfDraws; ++i) { + // Change the lower bound of the range of the uniform distribution + boost::uniform_real<> uni_dist (lDrawnNumber, 1); + boost::variate_generator<base_generator_type&, + boost::uniform_real<> > uni_gen (generator, + uni_dist); + + // Restore the generator state (seed) + if (i != 1) { + // Restore the generator state + gen_restore (lGeneratorState, generator); + } + + // Draw a random number corresponding to the uniform [x,1) range + lDrawnNumber = uni_gen(); + average += lDrawnNumber / lNbOfDraws; + + // Save the generator state (seed) + gen_save (lGeneratorState, generator); + + // DEBUG + std::cout << "[" << i << "]: " << lDrawnNumber << std::endl; + } + + // DEBUG + std::cout << "Average on " << lNbOfDraws << " draws: " << average + << std::endl; + + // Reset formatting flags of std::cout + std::cout.flags (oldFlags); + + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |