perftest-1.3a/0000777000115300004540000000000007666706563007141 5perftest-1.3a/README0000664000115300004540000001245307564504035007727 This directory contains programs that are part of the mpptest performance test suite. By default, they generate output for the C.It graphics program; the -gnuplot option will generate data for Gnuplot. Because of limitations of Gnuplot, the full generality of these commands is not supported when gnuplot output is selected. To build the programs, use configure. In many cases, all you need to do is invoke configure. If that doesn't work, use the following: MPICH: ./configure --with-mpich SGI MPI: ./configure --with-sgimpi IBM MPI ./configure --with-ibmmpi Others (assuming that your shell is csh or tcsh): setenv CC name-of-C-compiler for MPI programs setenv F77 name-of-Fortran-compiler for MPI programs setenv MPILIB name-of-mpi-library ./configure If you are cross-compiling, but you can run programs locally using a different compiler, add the following environment variables setenv TESTCC name-of-C-compiler-for-local-programs setenv TESTF77 name-of-Fortran-compiler-for-local-programs The programs that you want to run are mpptest and goptest. You can run these as you would any MPI program, or you can use the following scripts that will generate data automatically. To use these, you will also need to create a script that runs an MPI program with some arguments; samples are provided for IBM's MPI in mpirun.ibm . For MPICH, you may use the mpirun provided by MPICH. For a quick overview of the performance of your system, try mpirun -np 2 mpptest -logscale mpirun -np 16 mpptest -bisect -logscale (the latter assumes that you have 16 processors). Several scripts have been provided to generate data. The following two run mpptest and goptest with common options. runmpptest - point-to-point tests and collective as a function of data length rungoptest - collective as a function of the number of processes To get an idea about your system, do (assuming a 32 processor system) ./runmpptest -short -pair -blocking -givedy -gnuplot -fname pt2pt.mpl ./runmpptest -np 32 -bisect -short -blocking -gnuplot -fname bisect.mpl ./rungoptest -maxnp 32 -add -bcast -gnuplot -fname bcast.mpl (use -mpirunpgm ./mpirun.ibm to select an alternate mpirun program (mpirun.ibm in this case) ) Then gnuplot pt2pt.mpl gnuplot bisect.mpl gnuplot bcast.mpl will generate plots of the performance of MPI_Send/MPI_Recv, (point to point and bisection bandwidth) and MPI_Bcast. These routines may be used for additional testing. For example, ./runmpptest -long -pair -nonblocking -givedy -gnuplot -fname nbpt2pt.mpl will give the performance of the nonblocking MPI routines with long messages. The script basetest can be used to get common information about your system for both point-to-point and collective calls. It In addition, mpptest and goptest may be used alone. Both take -help and give a summary of options. For example, ./mpptest -sz 2 -cachesize 1000000 causes the messages to be taken from a buffer of size 1000000, reducing the reuse of memory locations. The copytest program gives a rough estimate of how fast memcpy works in a single address space. To use mpirun -np 1 copytest This copies data from one place to another three times; the first copy may take longer because of the need to page in (and possibly initialize to zero) data. If the data cache is large enough, the second and third copies may be faster than expected. (You need to use mpirun because copytest uses MPI_Wtime to get times) Finally, the program buflimit is a simple program that estimates the size of message that you can send with an MPI_Send without having a matching receive. Just run mpirun -np 2 buflimit The following uses of runmpptest and rungoptest will produce a basic survey of your system. This script can be placed in a file and executed. -- cut here -- #! /bin/sh ./runmpptest -short -pair -blocking -givedy -gnuplot -fname pt2ptshort.mpl ./runmpptest -long -pair -blocking -givedy -gnuplot -fname pt2ptlong.mpl ./runmpptest -long -pair -nonblocking -givedy -gnuplot -fname nbpt2ptlong.mpl ./runmpptest -np 32 -bisect -short -blocking -gnuplot -fname bisectshort.mpl ./runmpptest -np 32 -bisect -long -blocking -gnuplot -fname bisectlong.mpl ./rungoptest -maxnp 32 -add -bcast -gnuplot -fname bcast.mpl temp=`which $gnuplot | head -1` if [ ! -x "$temp" ] ; then echo "Creating tar file of plot data" tar cf data.tar *.mpl *.??? else for file in *.mpl ; do filebase=`basename $file` # Use set terminal postscript eps # to get encapsulated Postscript for including in documents gnuplot <>${filebase}.ps set terminal postscript load $file EOF echo "Created file ${filebase}.ps" end fi -- cut here -- If you have access to the graphics program C.It (very few of you will), you can get slightly nicer output, as well as more easily getting "rate" graphs. To do this, do the following: Use -cit instead of -gnuplot as the option to mpptest. Add the -rate option to mpptest. For example, the basic performance plots for latency and bandwidth, using C.It output form, can be generated with mpirun -np 2 mpptest -cit -auto -autodx 4 > short.cit mpirun -np 2 mpptest -cit -rate -size 16000 1600000 16000 > long.cit Nonblocking versions are mpirun -np 2 mpptest -cit -async -auto -autodx 4 > short.cit mpirun -np 2 mpptest -cit -async -rate -size 16000 1600000 16000 > long.cit perftest-1.3a/stamp-h.in0000664000115300004540000000001207666706557010754 timestamp perftest-1.3a/Makefile.am0000664000115300004540000000257607353711272011107 # Process this file with automake to generate a Makefile.in # Automake controls AUTOMAKE_OPTIONS = foreign no-installinfo no-texinfo.tex ACLOCAL_AMFLAGS = -I config/confdb # Use AM_xFLAGS to modify compiler behavior AM_CFLAGS=${COPTIONS} # Package Description start here bin_PROGRAMS = mpptest goptest buflimit EXTRA_PROGRAMS = tunepkt pktuse copytest vectest stress ctest cluster tcomm EXTRA_SCRIPTS = rungoptest runmpptest runsample noinst_HEADERS = mpptest.h getopts.h extra_SOURCES = gopf.c grph.c ovlap.c pair.c pattern.c getopts.c \ rate.c mpe_seq.c copy.c mpptest_SOURCES = mpptest.c $(extra_SOURCES) halo.c goptest_SOURCES = goptest.c $(extra_SOURCES) vectest_SOURCES = vectest.f stress_SOURCES = stress.c daytime.c getopts.c tcomm_SOURCES = tcomm.c mpe_seq.c getopts.c copytest_SOURCES = copytest.c duff.c # Distribution modifications EXTRA_DIST = config ${EXTRA_SCRIPTS} # # Autoconf/make oftens find the wrong versions of autoconf/make/header/local dist-hook: -find ${distdir} -name CVS -print | sed 's/^/rm -rf /g' | sh cd ${distdir} ; sed -e 's/^AUTOMAKE.*/AUTOMAKE = true/g' \ -e 's/^AUTOCONF *=.*/AUTOCONF = true/g' \ -e 's/^AUTOHEADER *=.*/AUTOHEADER = true/g' \ -e 's/^ACLOCAL *=.*/ACLOCAL = true/g' Makefile.in > .tmp ; \ rm -f Makefile.in ; \ mv .tmp Makefile.in distclean-local: rm -f config.system clean-local: rm -f ${EXTRA_PROGRAMS} rm -f work.pc work.pcl perftest-1.3a/Makefile.in0000664000115300004540000003571307666706563011135 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 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. # Process this file with automake to generate a Makefile.in # Automake controls SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = true AUTOCONF = true AUTOMAKE = true AUTOHEADER = true INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ COPTIONS = @COPTIONS@ CPP = @CPP@ CXX = @CXX@ F77 = @F77@ F90 = @F90@ F90MODEXT = @F90MODEXT@ F90MODINCFLAG = @F90MODINCFLAG@ FOPTIONS = @FOPTIONS@ GRAPHICS_PGM = @GRAPHICS_PGM@ HAVE_ROMIO = @HAVE_ROMIO@ MAKE = @MAKE@ MAKEINFO = @MAKEINFO@ MPIBOOT = @MPIBOOT@ MPICC = @MPICC@ MPICXX = @MPICXX@ MPIF77 = @MPIF77@ MPIF90 = @MPIF90@ MPIRUN = @MPIRUN@ MPIUNBOOT = @MPIUNBOOT@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ TESTCPP = @TESTCPP@ VERSION = @VERSION@ AUTOMAKE = true ACLOCAL_AMFLAGS = -I config/confdb # Use AM_xFLAGS to modify compiler behavior AM_CFLAGS = ${COPTIONS} # Package Description start here bin_PROGRAMS = mpptest goptest buflimit EXTRA_PROGRAMS = tunepkt pktuse copytest vectest stress ctest cluster tcomm EXTRA_SCRIPTS = rungoptest runmpptest runsample noinst_HEADERS = mpptest.h getopts.h extra_SOURCES = gopf.c grph.c ovlap.c pair.c pattern.c getopts.c rate.c mpe_seq.c copy.c mpptest_SOURCES = mpptest.c $(extra_SOURCES) halo.c goptest_SOURCES = goptest.c $(extra_SOURCES) vectest_SOURCES = vectest.f stress_SOURCES = stress.c daytime.c getopts.c tcomm_SOURCES = tcomm.c mpe_seq.c getopts.c copytest_SOURCES = copytest.c duff.c # Distribution modifications EXTRA_DIST = config ${EXTRA_SCRIPTS} ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = mpptestconf.h CONFIG_CLEAN_FILES = PROGRAMS = $(bin_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ tunepkt_SOURCES = tunepkt.c tunepkt_OBJECTS = tunepkt.o tunepkt_LDADD = $(LDADD) tunepkt_DEPENDENCIES = tunepkt_LDFLAGS = pktuse_SOURCES = pktuse.c pktuse_OBJECTS = pktuse.o pktuse_LDADD = $(LDADD) pktuse_DEPENDENCIES = pktuse_LDFLAGS = copytest_OBJECTS = copytest.o duff.o copytest_LDADD = $(LDADD) copytest_DEPENDENCIES = copytest_LDFLAGS = vectest_OBJECTS = vectest.o vectest_LDADD = $(LDADD) vectest_DEPENDENCIES = vectest_LDFLAGS = stress_OBJECTS = stress.o daytime.o getopts.o stress_LDADD = $(LDADD) stress_DEPENDENCIES = stress_LDFLAGS = ctest_SOURCES = ctest.c ctest_OBJECTS = ctest.o ctest_LDADD = $(LDADD) ctest_DEPENDENCIES = ctest_LDFLAGS = cluster_SOURCES = cluster.c cluster_OBJECTS = cluster.o cluster_LDADD = $(LDADD) cluster_DEPENDENCIES = cluster_LDFLAGS = tcomm_OBJECTS = tcomm.o mpe_seq.o getopts.o tcomm_LDADD = $(LDADD) tcomm_DEPENDENCIES = tcomm_LDFLAGS = mpptest_OBJECTS = mpptest.o gopf.o grph.o ovlap.o pair.o pattern.o \ getopts.o rate.o mpe_seq.o copy.o halo.o mpptest_LDADD = $(LDADD) mpptest_DEPENDENCIES = mpptest_LDFLAGS = goptest_OBJECTS = goptest.o gopf.o grph.o ovlap.o pair.o pattern.o \ getopts.o rate.o mpe_seq.o copy.o goptest_LDADD = $(LDADD) goptest_DEPENDENCIES = goptest_LDFLAGS = buflimit_SOURCES = buflimit.c buflimit_OBJECTS = buflimit.o buflimit_LDADD = $(LDADD) buflimit_DEPENDENCIES = buflimit_LDFLAGS = FFLAGS = @FFLAGS@ F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS) F77LD = $(F77) F77LINK = $(F77LD) $(AM_FFLAGS) $(FFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ HEADERS = $(noinst_HEADERS) DIST_COMMON = README ./stamp-h.in Makefile.am Makefile.in acconfig.h \ aclocal.m4 configure configure.in mpptestconf.h.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gnutar GZIP_ENV = --best SOURCES = tunepkt.c pktuse.c $(copytest_SOURCES) $(vectest_SOURCES) $(stress_SOURCES) ctest.c cluster.c $(tcomm_SOURCES) $(mpptest_SOURCES) $(goptest_SOURCES) buflimit.c OBJECTS = tunepkt.o pktuse.o $(copytest_OBJECTS) $(vectest_OBJECTS) $(stress_OBJECTS) ctest.o cluster.o $(tcomm_OBJECTS) $(mpptest_OBJECTS) $(goptest_OBJECTS) buflimit.o all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .f .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): configure.in config/confdb/aclangf90.m4 \ config/confdb/aclocal.m4 config/confdb/aclocal_am.m4 \ config/confdb/aclocal_bugfix.m4 \ config/confdb/aclocal_cache.m4 \ config/confdb/aclocal_cc.m4 \ config/confdb/aclocal_cross.m4 \ config/confdb/aclocal_cxx.m4 \ config/confdb/aclocal_f77.m4 \ config/confdb/aclocal_f90.m4 \ config/confdb/aclocal_java.m4 \ config/confdb/aclocal_make.m4 \ config/confdb/aclocal_mpi.m4 \ config/confdb/aclocal_perl.m4 \ config/confdb/aclocal_shl.m4 \ config/confdb/aclocal_web.m4 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) mpptestconf.h: stamp-h @if test ! -f $@; then \ rm -f stamp-h; \ $(MAKE) stamp-h; \ else :; fi stamp-h: $(srcdir)/mpptestconf.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=mpptestconf.h \ $(SHELL) ./config.status @echo timestamp > stamp-h 2> /dev/null $(srcdir)/mpptestconf.h.in: $(srcdir)/stamp-h.in @if test ! -f $@; then \ rm -f $(srcdir)/stamp-h.in; \ $(MAKE) $(srcdir)/stamp-h.in; \ else :; fi $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null mostlyclean-hdr: clean-hdr: distclean-hdr: -rm -f mpptestconf.h maintainer-clean-hdr: mostlyclean-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) distclean-binPROGRAMS: maintainer-clean-binPROGRAMS: install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) list='$(bin_PROGRAMS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: tunepkt: $(tunepkt_OBJECTS) $(tunepkt_DEPENDENCIES) @rm -f tunepkt $(LINK) $(tunepkt_LDFLAGS) $(tunepkt_OBJECTS) $(tunepkt_LDADD) $(LIBS) pktuse: $(pktuse_OBJECTS) $(pktuse_DEPENDENCIES) @rm -f pktuse $(LINK) $(pktuse_LDFLAGS) $(pktuse_OBJECTS) $(pktuse_LDADD) $(LIBS) copytest: $(copytest_OBJECTS) $(copytest_DEPENDENCIES) @rm -f copytest $(LINK) $(copytest_LDFLAGS) $(copytest_OBJECTS) $(copytest_LDADD) $(LIBS) vectest: $(vectest_OBJECTS) $(vectest_DEPENDENCIES) @rm -f vectest $(F77LINK) $(vectest_LDFLAGS) $(vectest_OBJECTS) $(vectest_LDADD) $(LIBS) stress: $(stress_OBJECTS) $(stress_DEPENDENCIES) @rm -f stress $(LINK) $(stress_LDFLAGS) $(stress_OBJECTS) $(stress_LDADD) $(LIBS) ctest: $(ctest_OBJECTS) $(ctest_DEPENDENCIES) @rm -f ctest $(LINK) $(ctest_LDFLAGS) $(ctest_OBJECTS) $(ctest_LDADD) $(LIBS) cluster: $(cluster_OBJECTS) $(cluster_DEPENDENCIES) @rm -f cluster $(LINK) $(cluster_LDFLAGS) $(cluster_OBJECTS) $(cluster_LDADD) $(LIBS) tcomm: $(tcomm_OBJECTS) $(tcomm_DEPENDENCIES) @rm -f tcomm $(LINK) $(tcomm_LDFLAGS) $(tcomm_OBJECTS) $(tcomm_LDADD) $(LIBS) mpptest: $(mpptest_OBJECTS) $(mpptest_DEPENDENCIES) @rm -f mpptest $(LINK) $(mpptest_LDFLAGS) $(mpptest_OBJECTS) $(mpptest_LDADD) $(LIBS) goptest: $(goptest_OBJECTS) $(goptest_DEPENDENCIES) @rm -f goptest $(LINK) $(goptest_LDFLAGS) $(goptest_OBJECTS) $(goptest_LDADD) $(LIBS) buflimit: $(buflimit_OBJECTS) $(buflimit_DEPENDENCIES) @rm -f buflimit $(LINK) $(buflimit_LDFLAGS) $(buflimit_OBJECTS) $(buflimit_LDADD) $(LIBS) .f.o: $(F77COMPILE) -c $< tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) mpptestconf.h.in $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)mpptestconf.h.in$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags mpptestconf.h.in $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-info-am: install-info: install-info-am all-recursive-am: mpptestconf.h $(MAKE) $(AM_MAKEFLAGS) all-recursive install-exec-am: install-binPROGRAMS install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-binPROGRAMS uninstall: uninstall-am all-am: Makefile $(PROGRAMS) $(HEADERS) mpptestconf.h all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ mostlyclean-compile mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-tags \ clean-generic mostlyclean-am clean-local clean: clean-am distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \ distclean-tags distclean-generic clean-am \ distclean-local distclean: distclean-am -rm -f config.status maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am -rm -f config.status .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile tags mostlyclean-tags distclean-tags \ clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ check-am installcheck-am installcheck install-info-am install-info \ all-recursive-am install-exec-am install-exec install-data-am \ install-data install-am install uninstall-am uninstall all-redirect \ all-am all installdirs mostlyclean-generic distclean-generic \ clean-generic maintainer-clean-generic clean mostlyclean distclean \ maintainer-clean # # Autoconf/make oftens find the wrong versions of autoconf/make/header/local dist-hook: -find ${distdir} -name CVS -print | sed 's/^/rm -rf /g' | sh cd ${distdir} ; sed -e 's/^AUTOMAKE.*/AUTOMAKE = true/g' \ -e 's/^AUTOCONF *=.*/AUTOCONF = true/g' \ -e 's/^AUTOHEADER *=.*/AUTOHEADER = true/g' \ -e 's/^ACLOCAL *=.*/ACLOCAL = true/g' Makefile.in > .tmp ; \ rm -f Makefile.in ; \ mv .tmp Makefile.in distclean-local: rm -f config.system clean-local: rm -f ${EXTRA_PROGRAMS} rm -f work.pc work.pcl # 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: perftest-1.3a/acconfig.h0000664000115300004540000000007307244514714010764 #undef HAVE_SHMALLOC #undef restrict #undef HAVE_LONG_LONG perftest-1.3a/aclocal.m40000664000115300004540000026255207666706435010731 dnl aclocal.m4 generated automatically by aclocal 1.4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) dnl test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) # # Check to make sure that the build environment is sane. # AC_DEFUN(AM_SANITY_CHECK, [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "[$]2" = conftestfile ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi rm -f conftest* AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. AC_DEFUN(AM_MISSING_PROG, [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found) else $1="$3/missing $2" AC_MSG_RESULT(missing) fi AC_SUBST($1)]) # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, [AC_PREREQ([2.12]) AC_CONFIG_HEADER([$1]) dnl When config.status generates a header, we must update the stamp-h file. dnl This file resides in the same directory as the config header dnl that is generated. We must strip everything past the first ":", dnl and everything past the last "/". AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, <>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, <>; do case " <<$>>CONFIG_HEADERS " in *" <<$>>am_file "*<<)>> echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx ;; esac am_indx=`expr "<<$>>am_indx" + 1` done<<>>dnl>>) changequote([,]))]) dnl dnl This is a replacement for AC_PROG_CC that does not prefer gcc and dnl that does not mess with CFLAGS. See acspecific.m4 for the original defn. dnl dnl/*D dnl PAC_PROG_CC - Find a working C compiler dnl dnl Synopsis: dnl PAC_PROG_CC dnl dnl Output Effect: dnl Sets the variable CC if it is not already set dnl dnl Notes: dnl Unlike AC_PROG_CC, this does not prefer gcc and does not set CFLAGS. dnl It does check that the compiler can compile a simple C program. dnl It also sets the variable GCC to yes if the compiler is gcc. It does dnl not yet check for some special options needed in particular for dnl parallel computers, such as -Tcray-t3e, or special options to get dnl full ANSI/ISO C, such as -Aa for HP. dnl dnl D*/ dnl 2.52 doesn't have AC_PROG_CC_GNU ifdef([AC_PROG_CC_GNU],,[AC_DEFUN([AC_PROG_CC_GNU],)]) AC_DEFUN(PAC_PROG_CC,[ AC_PROVIDE([AC_PROG_CC]) AC_CHECK_PROGS(CC, cc xlC xlc pgcc icc gcc ) test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) PAC_PROG_CC_WORKS AC_PROG_CC_GNU if test "$ac_cv_prog_gcc" = yes; then GCC=yes else GCC= fi ]) dnl dnl/*D dnl PAC_C_CHECK_COMPILER_OPTION - Check that a compiler option is accepted dnl without warning messages dnl dnl Synopsis: dnl PAC_C_CHECK_COMPILER_OPTION(optionname,action-if-ok,action-if-fail) dnl dnl Output Effects: dnl dnl If no actions are specified, a working value is added to 'COPTIONS' dnl dnl Notes: dnl This is now careful to check that the output is different, since dnl some compilers are noisy. dnl dnl We are extra careful to prototype the functions in case compiler options dnl that complain about poor code are in effect. dnl dnl Because this is a long script, we have ensured that you can pass a dnl variable containing the option name as the first argument. dnl D*/ AC_DEFUN(PAC_C_CHECK_COMPILER_OPTION,[ AC_MSG_CHECKING([that C compiler accepts option $1]) save_CFLAGS="$CFLAGS" CFLAGS="$1 $CFLAGS" rm -f conftest.out echo 'int try(void);int try(void){return 0;}' > conftest2.c echo 'int main(void);int main(void){return 0;}' > conftest.c if ${CC-cc} $save_CFLAGS $CPPFLAGS -o conftest conftest.c $LDFLAGS >conftest.bas 2>&1 ; then if ${CC-cc} $CFLAGS $CPPFLAGS -o conftest conftest.c $LDFLAGS >conftest.out 2>&1 ; then if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then AC_MSG_RESULT(yes) AC_MSG_CHECKING([that routines compiled with $1 can be linked with ones compiled without $1]) /bin/rm -f conftest.out /bin/rm -f conftest.bas if ${CC-cc} -c $save_CFLAGS $CPPFLAGS conftest2.c >conftest2.out 2>&1 ; then if ${CC-cc} $CFLAGS $CPPFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.bas 2>&1 ; then if ${CC-cc} $CFLAGS $CPPFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.out 2>&1 ; then if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then AC_MSG_RESULT(yes) CFLAGS="$save_CFLAGS" ifelse($2,,COPTIONS="$COPTIONS $1",$2) elif test -s conftest.out ; then cat conftest.out >&AC_FD_CC AC_MSG_RESULT(no) CFLAGS="$save_CFLAGS" $3 else AC_MSG_RESULT(no) CFLAGS="$save_CFLAGS" $3 fi else if test -s conftest.out ; then cat conftest.out >&AC_FD_CC fi AC_MSG_RESULT(no) CFLAGS="$save_CFLAGS" $3 fi else # Could not link with the option! AC_MSG_RESULT(no) fi else if test -s conftest2.out ; then cat conftest.out >&AC_FD_CC fi AC_MSG_RESULT(no) CFLAGS="$save_CFLAGS" $3 fi else cat conftest.out >&AC_FD_CC AC_MSG_RESULT(no) $3 CFLAGS="$save_CFLAGS" fi else AC_MSG_RESULT(no) $3 if test -s conftest.out ; then cat conftest.out >&AC_FD_CC ; fi CFLAGS="$save_CFLAGS" fi else # Could not compile without the option! AC_MSG_RESULT(no) fi rm -f conftest* ]) dnl dnl/*D dnl PAC_C_OPTIMIZATION - Determine C options for producing optimized code dnl dnl Synopsis dnl PAC_C_OPTIMIZATION([action if found]) dnl dnl Output Effect: dnl Adds options to 'COPTIONS' if no other action is specified dnl dnl Notes: dnl This is a temporary standin for compiler optimization. dnl It should try to match known systems to known compilers (checking, of dnl course), and then falling back to some common defaults. dnl Note that many compilers will complain about -g and aggressive dnl optimization. dnl D*/ AC_DEFUN(PAC_C_OPTIMIZATION,[ for copt in "-O4 -Ofast" "-Ofast" "-fast" "-O3" "-xO3" "-O" ; do PAC_C_CHECK_COMPILER_OPTION($copt,found_opt=yes,found_opt=no) if test "$found_opt" = "yes" ; then ifelse($1,,COPTIONS="$COPTIONS $copt",$1) break fi done if test "$ac_cv_prog_gcc" = "yes" ; then for copt in "-fomit-frame-pointer" "-finline-functions" \ "-funroll-loops" ; do PAC_C_CHECK_COMPILER_OPTION($copt,found_opt=yes,found_opt=no) if test $found_opt = "yes" ; then ifelse($1,,COPTIONS="$COPTIONS $copt",$1) # no break because we're trying to add them all fi done # We could also look for architecture-specific gcc options fi ]) dnl dnl/*D dnl PAC_C_DEPENDS - Determine how to use the C compiler to generate dnl dependency information dnl dnl Synopsis: dnl PAC_C_DEPENDS dnl dnl Output Effects: dnl Sets the following shell variables and call AC_SUBST for them: dnl+ C_DEPEND_OPT - Compiler options needed to create dependencies dnl. C_DEPEND_OUT - Shell redirection for dependency file (may be empty) dnl. C_DEPEND_PREFIX - Empty (null) or true; this is used to handle dnl systems that do not provide dependency information dnl- C_DEPEND_MV - Command to move created dependency file dnl Also creates a Depends file in the top directory (!). dnl dnl In addition, the variable 'C_DEPEND_DIR' must be set to indicate the dnl directory in which the dependency files should live. dnl dnl Notes: dnl A typical Make rule that exploits this macro is dnl.vb dnl # dnl # Dependency processing dnl .SUFFIXES: .dep dnl DEP_SOURCES = ${SOURCES:%.c=.dep/%.dep} dnl C_DEPEND_DIR = .dep dnl Depends: ${DEP_SOURCES} dnl @-rm -f Depends dnl cat .dep/*.dep >Depends dnl .dep/%.dep:%.c dnl @if [ ! -d .dep ] ; then mkdir .dep ; fi dnl @@C_DEPEND_PREFIX@ ${C_COMPILE} @C_DEPEND_OPT@ $< @C_DEPEND_OUT@ dnl @@C_DEPEND_MV@ dnl dnl depends-clean: dnl @-rm -f *.dep ${srcdir}/*.dep Depends ${srcdir}/Depends dnl @-touch Depends dnl.ve dnl dnl For each file 'foo.c', this creates a file 'foo.dep' and creates a file dnl 'Depends' that contains all of the '*.dep' files. dnl dnl For your convenience, the autoconf variable 'C_DO_DEPENDS' names a file dnl that may contain this code (you must have `dependsrule` or dnl `dependsrule.in` in the same directory as the other auxillery configure dnl scripts (set with dnl 'AC_CONFIG_AUX_DIR'). If you use `dependsrule.in`, dnl you must have `dependsrule` in 'AC_OUTPUT' before this `Makefile`. dnl dnl D*/ dnl dnl Eventually, we can add an option to the C_DEPEND_MV to strip system dnl includes, such as /usr/xxxx and /opt/xxxx dnl AC_DEFUN(PAC_C_DEPENDS,[ AC_SUBST(C_DEPEND_OPT)AM_IGNORE(C_DEPEND_OPT) AC_SUBST(C_DEPEND_OUT)AM_IGNORE(C_DEPEND_OUT) AC_SUBST(C_DEPEND_MV)AM_IGNORE(C_DEPEND_MV) AC_SUBST(C_DEPEND_PREFIX)AM_IGNORE(C_DEPEND_PREFIX) AC_SUBST_FILE(C_DO_DEPENDS) dnl set the value of the variable to a dnl file that contains the dependency code, such as dnl ${top_srcdir}/maint/dependrule if test -n "$ac_cv_c_depend_opt" ; then AC_MSG_RESULT([Option $ac_cv_c_depend_opt creates dependencies (cached)]) C_DEPEND_OUT="$ac_cv_c_depend_out" C_DEPEND_MV="$ac_cv_c_depend_mv" C_DEPEND_OPT="$ac_cv_c_depend_opt" C_DEPEND_PREFIX="$ac_cv_c_depend_prefix" C_DO_DEPENDS="$ac_cv_c_do_depends" else # Determine the values rm -f conftest* dnl dnl Some systems (/usr/ucb/cc on Solaris) do not generate a dependency for dnl an include that doesn't begin in column 1 dnl cat >conftest.c <conftest.out 2>conftest.err && \ test ! -s conftest.err ; then dnl Check for dependency info in conftest.out if test -s conftest.u ; then C_DEPEND_OUT="" C_DEPEND_MV='mv $[*].u ${C_DEPEND_DIR}/$[*].dep' pac_dep_file=conftest.u elif test -s conftest.d ; then C_DEPEND_OUT="" C_DEPEND_MV='mv $[*].d ${C_DEPEND_DIR}/$[*].dep' pac_dep_file=conftest.d else dnl C_DEPEND_OUT='>${C_DEPEND_DIR}/$[*].dep' dnl This for is needed for VPATH. Perhaps the others should match. C_DEPEND_OUT='>$@' C_DEPEND_MV=: pac_dep_file=conftest.out fi if grep 'confdefs.h' $pac_dep_file >/dev/null 2>&1 ; then AC_MSG_RESULT(yes) C_DEPEND_OPT="$copt" AC_MSG_CHECKING([whether .o file created with dependency file]) if test -s conftest.o ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) echo "Output of $copt option was" >&AC_FD_CC cat $pac_dep_file >&AC_FD_CC fi break else AC_MSG_RESULT(no) fi else echo "Error in compiling program with flags $copt" >&AC_FD_CC cat conftest.out >&AC_FD_CC if test -s conftest.err ; then cat conftest.err >&AC_FD_CC ; fi AC_MSG_RESULT(no) fi copt="" done if test -f $CONFIG_AUX_DIR/dependsrule -o \ -f $CONFIG_AUX_DIR/dependsrule.in; then C_DO_DEPENDS="$CONFIG_AUX_DIR/dependsrule" else C_DO_DEPENDS="/dev/null" fi if test "X$copt" = "X" ; then C_DEPEND_PREFIX="true" else C_DEPEND_PREFIX="" fi ac_cv_c_depend_out="$C_DEPEND_OUT" ac_cv_c_depend_mv="$C_DEPEND_MV" ac_cv_c_depend_opt="$C_DEPEND_OPT" ac_cv_c_depend_prefix="$C_DEPEND_PREFIX" ac_cv_c_do_depends="$C_DO_DEPENDS" fi ]) dnl dnl/*D dnl PAC_C_PROTOTYPES - Check that the compiler accepts ANSI prototypes. dnl dnl Synopsis: dnl PAC_C_PROTOTYPES([action if true],[action if false]) dnl dnl D*/ AC_DEFUN(PAC_C_PROTOTYPES,[ AC_CACHE_CHECK([if $CC supports function prototypes], pac_cv_c_prototypes,[ AC_TRY_COMPILE([int f(double a){return 0;}],[return 0];, pac_cv_c_prototypes="yes",pac_cv_c_prototypes="no")]) if test "$pac_cv_c_prototypes" = "yes" ; then ifelse([$1],,:,[$1]) else ifelse([$2],,:,[$2]) fi ])dnl dnl dnl/*D dnl PAC_FUNC_SEMCTL - Check for semctl and its argument types dnl dnl Synopsis: dnl PAC_FUNC_SEMCTL dnl dnl Output Effects: dnl Sets 'HAVE_SEMCTL' if semctl is available. dnl Sets 'HAVE_UNION_SEMUN' if 'union semun' is available. dnl Sets 'SEMCTL_NEEDS_SEMUN' if a 'union semun' type must be passed as the dnl fourth argument to 'semctl'. dnl D*/ dnl Check for semctl and arguments AC_DEFUN(PAC_FUNC_SEMCTL,[ AC_CHECK_FUNC(semctl) if test "$ac_cv_func_semctl" = "yes" ; then AC_CACHE_CHECK([for union semun], pac_cv_type_union_semun,[ AC_TRY_COMPILE([#include #include #include ],[union semun arg;arg.val=0;], pac_cv_type_union_semun="yes",pac_cv_type_union_semun="no")]) if test "$pac_cv_type_union_semun" = "yes" ; then AC_DEFINE(HAVE_UNION_SEMUN,1,[Has union semun]) # # See if we can use an int in semctl or if we need the union AC_CACHE_CHECK([whether semctl needs union semun], pac_cv_func_semctl_needs_semun,[ AC_TRY_COMPILE([#include #include #include ],[ int arg = 0; semctl( 1, 1, SETVAL, arg );], pac_cv_func_semctl_needs_semun="yes", pac_cv_func_semctl_needs_semun="no") ]) if test "$pac_cv_func_semctl_needs_semun" = "yes" ; then AC_DEFINE(SEMCTL_NEEDS_SEMUN,1,[Needs an explicit definition of semun]) fi fi fi ]) dnl dnl/*D dnl PAC_C_VOLATILE - Check if C supports volatile dnl dnl Synopsis: dnl PAC_C_VOLATILE dnl dnl Output Effect: dnl Defines 'volatile' as empty if volatile is not available. dnl dnl D*/ AC_DEFUN(PAC_C_VOLATILE,[ AC_CACHE_CHECK([for volatile], pac_cv_c_volatile,[ AC_TRY_COMPILE(,[volatile int a;],pac_cv_c_volatile="yes", pac_cv_c_volatile="no")]) if test "$pac_cv_c_volatile" = "no" ; then AC_DEFINE(volatile,,[if C does not support volatile]) fi ])dnl dnl dnl/*D dnl PAC_C_INLINE - Check if C supports inline dnl dnl Synopsis: dnl PAC_C_INLINE dnl dnl Output Effect: dnl Defines 'inline' as empty if inline is not available. dnl dnl D*/ AC_DEFUN(PAC_C_INLINE,[ AC_CACHE_CHECK([for inline], pac_cv_c_inline,[ AC_TRY_COMPILE([inline int a( int b ){return b+1;}],[int a;], pac_cv_c_inline="yes",pac_cv_c_inline="no")]) if test "$pac_cv_c_inline" = "no" ; then AC_DEFINE(inline,,[if C does not support inline]) fi ])dnl dnl dnl/*D dnl PAC_C_CPP_CONCAT - Check whether the C compiler accepts ISO CPP string dnl concatenation dnl dnl Synopsis: dnl PAC_C_CPP_CONCAT([true-action],[false-action]) dnl dnl Output Effects: dnl Invokes the true or false action dnl dnl D*/ AC_DEFUN(PAC_C_CPP_CONCAT,[ pac_pound="#" AC_CACHE_CHECK([that the compiler $CC accepts $ac_pound$ac_pound for concatenation in cpp], pac_cv_c_cpp_concat,[ AC_TRY_COMPILE([ #define concat(a,b) a##b],[int concat(a,b);return ab;], pac_cv_cpp_concat="yes",pac_cv_cpp_concat="no")]) if test $pac_cv_c_cpp_concat = "yes" ; then ifelse([$1],,:,[$1]) else ifelse([$2],,:,[$2]) fi ])dnl dnl dnl/*D dnl PAC_FUNC_GETTIMEOFDAY - Check whether gettimeofday takes 1 or 2 arguments dnl dnl Synopsis dnl PAC_IS_GETTIMEOFDAY_OK(ok_action,failure_action) dnl dnl Notes: dnl One version of Solaris accepted only one argument. dnl dnl D*/ AC_DEFUN(PAC_FUNC_GETTIMEOFDAY,[ AC_CACHE_CHECK([whether gettimeofday takes 2 arguments], pac_cv_func_gettimeofday,[ AC_TRY_COMPILE([#include ],[struct timeval tp; gettimeofday(&tp,(void*)0);return 0;],pac_cv_func_gettimeofday="yes", pac_cv_func_gettimeofday="no") ]) if test "$pac_cv_func_gettimeofday" = "yes" ; then ifelse($1,,:,$1) else ifelse($2,,:,$2) fi ]) dnl dnl/*D dnl PAC_C_RESTRICT - Check if C supports restrict dnl dnl Synopsis: dnl PAC_C_RESTRICT dnl dnl Output Effect: dnl Defines 'restrict' if some version of restrict is supported; otherwise dnl defines 'restrict' as empty. This allows you to include 'restrict' in dnl declarations in the same way that 'AC_C_CONST' allows you to use 'const' dnl in declarations even when the C compiler does not support 'const' dnl dnl Note that some compilers accept restrict only with additional options. dnl DEC/Compaq/HP Alpha Unix (Tru64 etc.) -accept restrict_keyword dnl dnl D*/ AC_DEFUN(PAC_C_RESTRICT,[ AC_CACHE_CHECK([for restrict], pac_cv_c_restrict,[ AC_TRY_COMPILE(,[int * restrict a;],pac_cv_c_restrict="restrict", pac_cv_c_restrict="no") if test "$pac_cv_c_restrict" = "no" ; then AC_TRY_COMPILE(,[int * _Restrict a;],pac_cv_c_restrict="_Restrict", pac_cv_c_restrict="no") fi if test "$pac_cv_c_restrict" = "no" ; then AC_TRY_COMPILE(,[int * __restrict a;],pac_cv_c_restrict="__restrict", pac_cv_c_restrict="no") fi ]) if test "$pac_cv_c_restrict" = "no" ; then restrict_val="" elif test "$pac_cv_c_restrict" != "restrict" ; then restrict_val=$pac_cv_c_restrict fi if test "$restrict_val" != "restrict" ; then AC_DEFINE_UNQUOTED(restrict,$restrict_val,[if C does not support restrict]) fi ])dnl dnl dnl/*D dnl PAC_HEADER_STDARG - Check whether standard args are defined and whether dnl they are old style or new style dnl dnl Synopsis: dnl PAC_HEADER_STDARG(action if works, action if oldstyle, action if fails) dnl dnl Output Effects: dnl Defines HAVE_STDARG_H if the header exists. dnl defines dnl dnl Notes: dnl It isn't enough to check for stdarg. Even gcc doesn't get it right; dnl on some systems, the gcc version of stdio.h loads stdarg.h `with the wrong dnl options` (causing it to choose the `old style` 'va_start' etc). dnl dnl The original test tried the two-arg version first; the old-style dnl va_start took only a single arg. dnl This turns out to be VERY tricky, because some compilers (e.g., Solaris) dnl are quite happy to accept the *wrong* number of arguments to a macro! dnl Instead, we try to find a clean compile version, using our special dnl PAC_C_TRY_COMPILE_CLEAN command. dnl dnl D*/ AC_DEFUN(PAC_HEADER_STDARG,[ AC_CHECK_HEADER(stdarg.h) dnl Sets ac_cv_header_stdarg_h if test "$ac_cv_header_stdarg_h" = "yes" ; then dnl results are yes,oldstyle,no. AC_CACHE_CHECK([whether stdarg is oldstyle], pac_cv_header_stdarg_oldstyle,[ PAC_C_TRY_COMPILE_CLEAN([#include #include ], [int func( int a, ... ){ int b; va_list ap; va_start( ap ); b = va_arg(ap, int); printf( "%d-%d\n", a, b ); va_end(ap); fflush(stdout); return 0; } int main() { func( 1, 2 ); return 0;}],pac_check_compile) case $pac_check_compile in 0) pac_cv_header_stdarg_oldstyle="yes" ;; 1) pac_cv_header_stdarg_oldstyle="may be newstyle" ;; 2) pac_cv_header_stdarg_oldstyle="no" # compile failed ;; esac ]) if test "$pac_cv_header_stdarg_oldstyle" = "yes" ; then ifelse($2,,:,[$2]) else AC_CACHE_CHECK([whether stdarg works], pac_cv_header_stdarg_works,[ PAC_C_TRY_COMPILE_CLEAN([ #include #include ],[ int func( int a, ... ){ int b; va_list ap; va_start( ap, a ); b = va_arg(ap, int); printf( "%d-%d\n", a, b ); va_end(ap); fflush(stdout); return 0; } int main() { func( 1, 2 ); return 0;}],pac_check_compile) case $pac_check_compile in 0) pac_cv_header_stdarg_works="yes" ;; 1) pac_cv_header_stdarg_works="yes with warnings" ;; 2) pac_cv_header_stdarg_works="no" ;; esac ]) fi # test on oldstyle if test "$pac_cv_header_stdarg_works" = "no" ; then ifelse($3,,:,[$3]) else ifelse($1,,:,[$1]) fi else ifelse($3,,:,[$3]) fi # test on header ]) dnl/*D dnl PAC_C_TRY_COMPILE_CLEAN - Try to compile a program, separating success dnl with no warnings from success with warnings. dnl dnl Synopsis: dnl PAC_C_TRY_COMPILE_CLEAN(header,program,flagvar) dnl dnl Output Effect: dnl The 'flagvar' is set to 0 (clean), 1 (dirty but success ok), or 2 dnl (failed). dnl dnl D*/ AC_DEFUN(PAC_C_TRY_COMPILE_CLEAN,[ $3=2 dnl Get the compiler output to test against if test -z "$pac_TRY_COMPLILE_CLEAN" ; then rm -f conftest* echo 'int try(void);int try(void){return 0;}' > conftest.c if ${CC-cc} $CFLAGS -c conftest.c >conftest.bas 2>&1 ; then if test -s conftest.bas ; then pac_TRY_COMPILE_CLEAN_OUT=`cat conftest.bas` fi pac_TRY_COMPILE_CLEAN=1 else AC_MSG_WARN([Could not compile simple test program!]) if test -s conftest.bas ; then cat conftest.bas >> config.log ; fi fi fi dnl dnl Create the program that we need to test with rm -f conftest* cat >conftest.c <conftest.bas 2>&1 ; then dnl Success. Is the output the same? if test "$pac_TRY_COMPILE_CLEAN_OUT" = "`cat conftest.bas`" ; then $3=0 else cat conftest.c >>config.log if test -s conftest.bas ; then cat conftest.bas >> config.log ; fi $3=1 fi else dnl Failure. Set flag to 2 cat conftest.c >>config.log if test -s conftest.bas ; then cat conftest.bas >> config.log ; fi $3=2 fi rm -f conftest* ]) dnl dnl/*D dnl PAC_PROG_C_UNALIGNED_DOUBLES - Check that the C compiler allows unaligned dnl doubles dnl dnl Synopsis: dnl PAC_PROG_C_UNALIGNED_DOUBLES(action-if-true,action-if-false, dnl action-if-unknown) dnl dnl Notes: dnl 'action-if-unknown' is used in the case of cross-compilation. dnl D*/ AC_DEFUN(PAC_PROG_C_UNALIGNED_DOUBLES,[ AC_CACHE_CHECK([whether C compiler allows unaligned doubles], pac_cv_prog_c_unaligned_doubles,[ AC_TRY_RUN([ void fetch_double( v ) double *v; { *v = 1.0; } int main( argc, argv ) int argc; char **argv; { int p[4]; double *p_val; fetch_double( (double *)&(p[0]) ); p_val = (double *)&(p[0]); if (*p_val != 1.0) return 1; fetch_double( (double *)&(p[1]) ); p_val = (double *)&(p[1]); if (*p_val != 1.0) return 1; return 0; } ],pac_cv_prog_c_unaligned_doubles="yes",pac_cv_prog_c_unaligned_doubles="no", pac_cv_prog_c_unaligned_doubles="unknown")]) ifelse($1,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "yes" ; then $1 fi) ifelse($2,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "no" ; then $2 fi) ifelse($3,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "unknown" ; then $3 fi) ]) dnl dnl/*D dnl PAC_PROG_C_WEAK_SYMBOLS - Test whether C supports weak symbols. dnl dnl Synopsis dnl PAC_PROG_C_WEAK_SYMBOLS(action-if-true,action-if-false) dnl dnl Output Effect: dnl Defines one of the following if a weak symbol pragma is found: dnl.vb dnl HAVE_PRAGMA_WEAK - #pragma weak dnl HAVE_PRAGMA_HP_SEC_DEF - #pragma _HP_SECONDARY_DEF dnl HAVE_PRAGMA_CRI_DUP - #pragma _CRI duplicate x as y dnl.ve dnl May also define dnl.vb dnl HAVE_WEAK_ATTRIBUTE dnl.ve dnl if functions can be declared as 'int foo(...) __attribute__ ((weak));' dnl sets the shell variable pac_cv_attr_weak to yes. dnl dnl D*/ AC_DEFUN(PAC_PROG_C_WEAK_SYMBOLS,[ pragma_extra_message="" AC_CACHE_CHECK([for type of weak symbol support], pac_cv_prog_c_weak_symbols,[ # Test for weak symbol support... # We can't put # in the message because it causes autoconf to generate # incorrect code AC_TRY_LINK([ extern int PFoo(int); #pragma weak PFoo = Foo int Foo(a) { return a; } ],[return PFoo(1);],has_pragma_weak=yes) # # Some systems (Linux ia64 and ecc, for example), support weak symbols # only within a single object file! This tests that case. # Note that there is an extern int PFoo declaration before the # pragma. Some compilers require this in order to make the weak symbol # extenally visible. if test "$has_pragma_weak" = yes ; then rm -f conftest* cat >>conftest1.c <>conftest2.c <>config.log echo "Failed program was" >>config.log cat conftest1.c >>config.log cat conftest2.c >>config.log if test -s conftest.out ; then cat conftest.out >> config.log ; fi has_pragma_weak=0 pragma_extra_message="pragma weak does not work outside of a file" fi rm -f conftest* fi dnl if test -z "$pac_cv_prog_c_weak_symbols" ; then AC_TRY_LINK([ extern int PFoo(int); #pragma _HP_SECONDARY_DEF Foo PFoo int Foo(a) { return a; } ],[return PFoo(1);],pac_cv_prog_c_weak_symbols="pragma _HP_SECONDARY_DEF") fi dnl if test -z "$pac_cv_prog_c_weak_symbols" ; then AC_TRY_LINK([ extern int PFoo(int); #pragma _CRI duplicate PFoo as Foo int Foo(a) { return a; } ],[return PFoo(1);],pac_cv_prog_c_weak_symbols="pragma _CRI duplicate x as y") fi dnl if test -z "$pac_cv_prog_c_weak_symbols" ; then pac_cv_prog_c_weak_symbols="no" fi dnl dnl If there is an extra explanatory message, echo it now so that it dnl doesn't interfere with the cache result value if test -n "$pragma_extra_message" ; then echo $pragma_extra_message fi dnl ]) if test "$pac_cv_prog_c_weak_symbols" = "no" ; then ifelse([$2],,:,[$2]) else case "$pac_cv_prog_c_weak_symbols" in "pragma weak") AC_DEFINE(HAVE_PRAGMA_WEAK,1,[Supports weak pragma]) ;; "pragma _HP") AC_DEFINE(HAVE_PRAGMA_HP_SEC_DEF,1,[HP style weak pragma]) ;; "pragma _CRI") AC_DEFINE(HAVE_PRAGMA_CRI_DUP,1,[Cray style weak pragma]) ;; esac ifelse([$1],,:,[$1]) fi AC_CACHE_CHECK([whether __attribute__ ((weak)) allowed], pac_cv_attr_weak,[ AC_TRY_COMPILE([int foo(int) __attribute__ ((weak));],[int a;], pac_cv_attr_weak=yes,pac_cv_attr_weak=no)]) ]) # # This is a replacement that checks that FAILURES are signaled as well # (later configure macros look for the .o file, not just success from the # compiler, but they should not HAVE to # dnl --- insert 2.52 compatibility here --- dnl 2.52 does not have AC_PROG_CC_WORKS ifdef([AC_PROG_CC_WORKS],,[AC_DEFUN([AC_PROG_CC_WORKS],)]) dnl AC_DEFUN(PAC_PROG_CC_WORKS, [AC_PROG_CC_WORKS AC_MSG_CHECKING([whether the C compiler sets its return status correctly]) AC_LANG_SAVE AC_LANG_C AC_TRY_COMPILE(,[int a = bzzzt;],notbroken=no,notbroken=yes) AC_MSG_RESULT($notbroken) if test "$notbroken" = "no" ; then AC_MSG_ERROR([installation or configuration problem: C compiler does not correctly set error code when a fatal error occurs]) fi ]) dnl dnl/*D dnl PAC_FUNC_CRYPT - Check that the function crypt is defined dnl dnl Synopsis: dnl PAC_FUNC_CRYPT dnl dnl Output Effects: dnl dnl In Solaris, the crypt function is not defined in unistd unless dnl _XOPEN_SOURCE is defines and _XOPEN_VERSION is 4 or greater. dnl We test by looking for a missing crypt by defining our own dnl incompatible one and trying to compile it. dnl Defines NEED_CRYPT_PROTOTYPE if no prototype is found. dnl D*/ AC_DEFUN(PAC_FUNC_CRYPT,[ AC_CACHE_CHECK([if crypt defined in unistd.h], pac_cv_func_crypt_defined,[ AC_TRY_COMPILE([ #include double crypt(double a){return a;}],[return 0];, pac_cv_func_crypt_defined="no",pac_cv_func_crypt_defined="yes")]) if test "$pac_cv_func_crypt_defined" = "no" ; then # check to see if defining _XOPEN_SOURCE helps AC_CACHE_CHECK([if crypt defined in unistd with _XOPEN_SOURCE], pac_cv_func_crypt_xopen,[ AC_TRY_COMPILE([ #define _XOPEN_SOURCE #include double crypt(double a){return a;}],[return 0];, pac_cv_func_crypt_xopen="no",pac_cv_func_crypt_xopen="yes")]) fi if test "$pac_cv_func_crypt_xopen" = "yes" ; then AC_DEFINE(_XOPEN_SOURCE,1,[if xopen needed for crypt]) elif test "$pac_cv_func_crypt_defined" = "no" ; then AC_DEFINE(NEED_CRYPT_PROTOTYPE,1,[if a prototype for crypt is needed]) fi ])dnl dnl/*D dnl PAC_ARG_STRICT - Add --enable-strict to configure. dnl dnl Synopsis: dnl PAC_ARG_STRICT dnl dnl Output effects: dnl Adds '--enable-strict' to the command line. If this is enabled, then dnl if no compiler has been set, set 'CC' to 'gcc'. dnl If the compiler is 'gcc', 'COPTIONS' is set to include dnl.vb dnl -O -Wall -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL dnl.ve dnl dnl If the value 'all' is given to '--enable-strict', additional warning dnl options are included. These are dnl.vb dnl -Wunused -Wshadow -Wmissing-declarations -Wno-long-long -Wpointer-arith dnl.ve dnl dnl This only works where 'gcc' is available. dnl In addition, it exports the variable 'enable_strict_done'. This dnl ensures that subsidiary 'configure's do not add the above flags to dnl 'COPTIONS' once the top level 'configure' sees '--enable-strict'. To ensure dnl this, 'COPTIONS' is also exported. dnl dnl Not yet available: options when using other compilers. However, dnl here are some possible choices dnl Solaris cc dnl -fd -v -Xc dnl IRIX dnl -ansi -DEBUG:trap_uninitialized=ON:varargs_interface_check=ON:verbose_runtime=ON dnl dnl D*/ AC_DEFUN(PAC_ARG_STRICT,[ AC_ARG_ENABLE(strict, [--enable-strict - Turn on strict compilation testing when using gcc]) export enable_strict_done export COPTIONS if test "$enable_strict_done" != "yes" ; then if test "$enable_strict" = "yes" ; then enable_strict_done="yes" if test -z "CC" ; then AC_CHECK_PROGS(CC,gcc) if test "$CC" = "gcc" ; then COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL" fi fi elif test "$enable_strict" = "all" ; then enable_strict_done="yes" if test -z "CC" ; then AC_CHECK_PROGS(CC,gcc) if test "$CC" = "gcc" ; then COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL -Wunused -Wshadow -Wmissing-declarations -Wno-long-long" fi fi fi fi ]) dnl/*D dnl PAC_ARG_CC_G - Add debugging flags for the C compiler dnl dnl Synopsis: dnl PAC_ARG_CC_G dnl dnl Output Effect: dnl Adds '-g' to 'COPTIONS' and exports 'COPTIONS'. Sets and exports the dnl variable 'enable_g_simple' so that subsidiary 'configure's will not dnl add another '-g'. dnl dnl Notes: dnl '--enable-g' should be used for all internal debugging modes if possible. dnl Use the 'enable_val' that 'enable_g' is set to to pass particular values, dnl and ignore any values that are not recognized (some other 'configure' dnl may have used them. Of course, if you need extra values, you must dnl add code to extract values from 'enable_g'. dnl dnl For example, to look for a particular keyword, you could use dnl.vb dnl SaveIFS="$IFS" dnl IFS="," dnl for key in $enable_g ; do dnl case $key in dnl mem) # add code for memory debugging dnl ;; dnl *) # ignore all other values dnl ;; dnl esac dnl done dnl IFS="$SaveIFS" dnl.ve dnl dnl D*/ AC_DEFUN(PAC_ARG_CC_G,[ AC_ARG_ENABLE(g, [--enable-g - Turn on debugging of the package (typically adds -g to COPTIONS)]) export COPTIONS export enable_g_simple if test -n "$enable_g" -a "$enable_g" != "no" -a \ "$enable_g_simple" != "done" ; then enable_g_simple="done" if test "$enable_g" = "g" -o "$enable_g" = "yes" ; then COPTIONS="$COPTIONS -g" fi fi ]) dnl dnl Simple version for both options dnl AC_DEFUN(PAC_ARG_CC_COMMON,[ PAC_ARG_CC_G PAC_ARG_STRICT ]) dnl dnl Eventually, this can be used instead of the funky Fortran stuff to dnl access the command line from a C routine. dnl # dnl # Under IRIX (some version) __Argc and __Argv gave the argc,argv values dnl #Under linux, __libc_argv and __libc_argc dnl AC_MSG_CHECKING([for alternative argc,argv names]) dnl AC_TRY_LINK([ dnl extern int __Argc; extern char **__Argv;],[return __Argc;], dnl alt_argv="__Argv") dnl if test -z "$alt_argv" ; then dnl AC_TRY_LINK([ dnl extern int __libc_argc; extern char **__libc_argv;],[return __lib_argc;], dnl alt_argv="__lib_argv") dnl fi dnl if test -z "$alt_argv" ; then dnl AC_MSG_RESULT(none found)) dnl else dnl AC_MSG_RESULT($alt_argv) dnl fi dnl dnl dnl Check whether we need -fno-common to correctly compile the source code. dnl This is necessary if global variables are defined without values in dnl gcc. Here is the test dnl conftest1.c: dnl extern int a; int a; dnl conftest2.c: dnl extern int a; int main(int argc; char *argv[] ){ return a; } dnl Make a library out of conftest1.c and try to link with it. dnl If that fails, recompile it with -fno-common and see if that works. dnl If so, add -fno-common to CFLAGS dnl An alternative is to use, on some systems, ranlib -c to force dnl the system to find common symbols. dnl dnl NOT TESTED AC_DEFUN(PAC_PROG_C_BROKEN_COMMON,[ AC_MSG_CHECKING([whether global variables handled properly]) AC_REQUIRE([AC_PROG_RANLIB]) ac_cv_prog_cc_globals_work=no echo 'extern int a; int a;' > conftest1.c echo 'extern int a; int main( ){ return a; }' > conftest2.c if ${CC-cc} $CFLAGS -c conftest1.c >conftest.out 2>&1 ; then if ${AR-ar} cr libconftest.a conftest1.o >/dev/null 2>&1 ; then if ${RANLIB-:} libconftest.a >/dev/null 2>&1 ; then if ${CC-cc} $CFLAGS -o conftest conftest2.c $LDFLAGS libconftest.a >>conftest.out 2>&1 ; then # Success! C works ac_cv_prog_cc_globals_work=yes else # Failure! Do we need -fno-common? ${CC-cc} $CFLAGS -fno-common -c conftest1.c >> conftest.out 2>&1 rm -f libconftest.a ${AR-ar} cr libconftest.a conftest1.o ${RANLIB-:} libconftest.a if ${CC-cc} $CFLAGS -o conftest conftest2.c $LDFLAGS libconftest.a >> conftest.out 2>&1 ; then ac_cv_prog_cc_globals_work="needs -fno-common" CFLAGS="$CFLAGS -fno-common" fi fi fi fi fi rm -f conftest* libconftest* AC_MSG_RESULT($ac_cv_prog_cc_globals_work) ]) dnl dnl dnl Return the structure alignment in pac_cv_c_struct_align dnl Possible values include dnl packed dnl largest dnl two dnl four dnl eight dnl dnl In addition, a "Could not determine alignment" and a dnl "Multiple cases:" return is possible. AC_DEFUN(PAC_C_STRUCT_ALIGNMENT,[ AC_CACHE_CHECK([for C struct alignment],pac_cv_c_struct_align,[ AC_TRY_RUN([ #include #define DBG(a,b,c) int main( int argc, char *argv[] ) { FILE *cf; int is_packed = 1; int is_two = 1; int is_four = 1; int is_eight = 1; int is_largest = 1; struct { char a; int b; } char_int; struct { char a; short b; } char_short; struct { char a; long b; } char_long; struct { char a; float b; } char_float; struct { char a; double b; } char_double; struct { char a; int b; char c; } char_int_char; struct { char a; short b; char c; } char_short_char; #ifdef HAVE_LONG_DOUBLE struct { char a; long double b; } char_long_double; #endif int size, extent; size = sizeof(char) + sizeof(int); extent = sizeof(char_int); if (size != extent) is_packed = 0; if ( (extent % sizeof(int)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if ( (extent % 4) != 0) is_four = 0; if (sizeof(int) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_int",size,extent); size = sizeof(char) + sizeof(short); extent = sizeof(char_short); if (size != extent) is_packed = 0; if ( (extent % sizeof(short)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if (sizeof(short) == 4 && (extent % 4) != 0) is_four = 0; if (sizeof(short) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_short",size,extent); size = sizeof(char) + sizeof(long); extent = sizeof(char_long); if (size != extent) is_packed = 0; if ( (extent % sizeof(long)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if ( (extent % 4) != 0) is_four = 0; if (sizeof(long) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_long",size,extent); size = sizeof(char) + sizeof(float); extent = sizeof(char_float); if (size != extent) is_packed = 0; if ( (extent % sizeof(float)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if ( (extent % 4) != 0) is_four = 0; if (sizeof(float) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_float",size,extent); size = sizeof(char) + sizeof(double); extent = sizeof(char_double); if (size != extent) is_packed = 0; if ( (extent % sizeof(double)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if ( (extent % 4) != 0) is_four = 0; if (sizeof(double) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_double",size,extent); #ifdef HAVE_LONG_DOUBLE size = sizeof(char) + sizeof(long double); extent = sizeof(char_long_double); if (size != extent) is_packed = 0; if ( (extent % sizeof(long double)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if ( (extent % 4) != 0) is_four = 0; if (sizeof(long double) >= 8 && (extent % 8) != 0) is_eight = 0; DBG("char_long-double",size,extent); #endif /* char int char helps separate largest from 4/8 aligned */ size = sizeof(char) + sizeof(int) + sizeof(char); extent = sizeof(char_int_char); if (size != extent) is_packed = 0; if ( (extent % sizeof(int)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if ( (extent % 4) != 0) is_four = 0; if (sizeof(int) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_int_char",size,extent); /* char short char helps separate largest from 4/8 aligned */ size = sizeof(char) + sizeof(short) + sizeof(char); extent = sizeof(char_short_char); if (size != extent) is_packed = 0; if ( (extent % sizeof(short)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if (sizeof(short) == 4 && (extent % 4) != 0) is_four = 0; if (sizeof(short) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_short_char",size,extent); /* If aligned mod 8, it will be aligned mod 4 */ if (is_eight) { is_four = 0; is_two = 0; } if (is_four) is_two = 0; /* largest superceeds eight */ if (is_largest) is_eight = 0; /* Tabulate the results */ cf = fopen( "ctest.out", "w" ); if (is_packed + is_largest + is_two + is_four + is_eight == 0) { fprintf( cf, "Could not determine alignment\n" ); } else { if (is_packed + is_largest + is_two + is_four + is_eight != 1) { fprintf( cf, "Multiple cases:\n" ); } if (is_packed) fprintf( cf, "packed\n" ); if (is_largest) fprintf( cf, "largest\n" ); if (is_two) fprintf( cf, "two\n" ); if (is_four) fprintf( cf, "four\n" ); if (is_eight) fprintf( cf, "eight\n" ); } fclose( cf ); return 0; }], pac_cv_c_struct_align=`cat ctest.out` ,pac_cv_c_struct_align="unknown",pac_cv_c_struct_align="$CROSS_STRUCT_ALIGN") rm -f ctest.out ]) if test -z "$pac_cv_c_struct_align" ; then pac_cv_c_struct_align="unknown" fi ]) dnl dnl dnl/*D dnl PAC_FUNC_NEEDS_DECL - Set NEEDS__DECL if a declaration is needed dnl dnl Synopsis: dnl PAC_FUNC_NEEDS_DECL(headerfiles,funcname) dnl dnl Output Effect: dnl Sets 'NEEDS__DECL' if 'funcname' is not declared by the dnl headerfiles. dnl D*/ AC_DEFUN(PAC_FUNC_NEEDS_DECL,[ AC_CACHE_CHECK([whether $2 needs a declaration], pac_cv_func_decl_$2,[ AC_TRY_COMPILE([$1],[int a=$2(27,1.0,"foo");], pac_cv_func_decl_$2=yes,pac_cv_func_decl_$2=no)]) if test "$pac_cv_func_decl_$2" = "yes" ; then changequote(<<,>>)dnl define(<>, translit(NEEDS_$2_DECL, [a-z *], [A-Z__]))dnl changequote([, ])dnl AC_DEFINE_UNQUOTED(PAC_FUNC_NAME,1,[Define if $2 needs a declaration]) undefine([PAC_FUNC_NAME]) fi ])dnl dnl dnl /*D dnl PAC_CHECK_SIZEOF_DERIVED - Get the size of a user-defined type, dnl such as a struct dnl dnl PAC_CHECK_SIZEOF_DERIVED(shortname,definition,defaultsize) dnl Like AC_CHECK_SIZEOF, but handles arbitrary types. dnl Unlike AC_CHECK_SIZEOF, does not define SIZEOF_xxx (because dnl autoheader can''t handle this case) dnl D*/ AC_DEFUN(PAC_CHECK_SIZEOF_DERIVED,[ changequote(<<,>>)dnl define(<>,translit(sizeof_$1,[a-z *], [A-Z_P]))dnl define(<>,translit(pac_cv_sizeof_$1,[ *], [_p]))dnl changequote([,])dnl AC_MSG_CHECKING(size of $1) AC_CACHE_VAL(AC_CV_NAME, [AC_TRY_RUN([#include main() { $2 a; FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(a)); exit(0); }],AC_CV_NAME=`cat conftestval`,AC_CV_NAME=0,ifelse([$3],,,AC_CV_NAME=$3))]) AC_MSG_RESULT($AC_CV_NAME) dnl AC_DEFINE_UNQUOTED(AC_TYPE_NAME,$AC_CV_NAME) undefine([AC_TYPE_NAME])undefine([AC_CV_NAME]) ]) dnl dnl PAC_C_GNU_ATTRIBUTE - See if the GCC __attribute__ specifier is allow. dnl Use the following dnl #ifndef HAVE_GCC_ATTRIBUTE dnl #define __attribute__(a) dnl #endif dnl If *not*, define __attribute__(a) as null dnl dnl We start by requiring Gcc. Some other compilers accept __attribute__ dnl but generate warning messages, or have different interpretations dnl (which seems to make __attribute__ just as bad as #pragma) dnl For example, the Intel icc compiler accepts __attribute__ and dnl __attribute__((pure)) but generates warnings for __attribute__((format...)) dnl AC_DEFUN([PAC_C_GNU_ATTRIBUTE],[ AC_REQUIRE([AC_PROG_CC_GNU]) if test "$ac_cv_prog_gcc" = "yes" ; then AC_CACHE_CHECK([whether __attribute__ allowed], pac_cv_gnu_attr_pure,[ AC_TRY_COMPILE([int foo(int) __attribute__ ((pure));],[int a;], pac_cv_gnu_attr_pure=yes,pac_cv_gnu_attr_pure=no)]) AC_CACHE_CHECK([whether __attribute__((format)) allowed], pac_cv_gnu_attr_format,[ AC_TRY_COMPILE([int foo(char *,...) __attribute__ ((format(printf,1,2)));],[int a;], pac_cv_gnu_attr_format=yes,pac_cv_gnu_attr_format=no)]) if test "$pac_cv_gnu_attr_pure" = "yes" -a "$pac_cv_gnu_attr_format" = "yes" ; then AC_DEFINE(HAVE_GCC_ATTRIBUTE,1,[Define if GNU __attribute__ is supported]) fi fi ]) AC_DEFUN(AM_IGNORE,[]) dnl dnl Fixes to bugs in AC_xxx macros dnl dnl (AC_TRY_COMPILE is missing a newline after the end in the Fortran dnl branch; that has been fixed in-place) dnl dnl (AC_PROG_CC makes many dubious assumptions. One is that -O is safe dnl with -g, even with gcc. This isn't true; gcc will eliminate dead code dnl when -O is used, even if you added code explicitly for debugging dnl purposes. -O shouldn't do dead code elimination when -g is selected, dnl unless a specific option is selected. Unfortunately, there is no dnl documented option to turn off dead code elimination. dnl dnl dnl (AC_CHECK_HEADER and AC_CHECK_HEADERS both make the erroneous assumption dnl that the C-preprocessor and the C (or C++) compilers are the same program dnl and have the same search paths. In addition, CHECK_HEADER looks for dnl error messages to decide that the file is not available; unfortunately, dnl it also interprets messages such as "evaluation copy" and warning messages dnl from broken CPP programs (such as IBM's xlc -E, which often warns about dnl "lm not a valid option"). Instead, we try a compilation step with the dnl C compiler. dnl dnl AC_CONFIG_AUX_DIRS only checks for install-sh, but assumes other dnl values are present. Also doesn't provide a way to override the dnl sources of the various configure scripts. This replacement dnl version of AC_CONFIG_AUX_DIRS overcomes this. dnl Internal subroutine. dnl Search for the configuration auxiliary files in directory list $1. dnl We look only for install-sh, so users of AC_PROG_INSTALL dnl do not automatically need to distribute the other auxiliary files. dnl AC_CONFIG_AUX_DIRS(DIR ...) dnl Also note that since AC_CONFIG_AUX_DIR_DEFAULT calls this, there dnl isn't a easy way to fix it other than replacing it completely. dnl This fix applies to 2.13 dnl/*D dnl AC_CONFIG_AUX_DIRS - Find the directory containing auxillery scripts dnl for configure dnl dnl Synopsis: dnl AC_CONFIG_AUX_DIRS( [ directories to search ] ) dnl dnl Output Effect: dnl Sets 'ac_config_guess' to location of 'config.guess', 'ac_config_sub' dnl to location of 'config.sub', 'ac_install_sh' to the location of dnl 'install-sh' or 'install.sh', and 'ac_configure' to the location of a dnl Cygnus-style 'configure'. Only 'install-sh' is guaranteed to exist, dnl since the other scripts are needed only by some special macros. dnl dnl The environment variable 'CONFIG_AUX_DIR', if set, overrides the dnl directories listed. This is an extension to the 'autoconf' version of dnl this macro. dnl D*/ undefine([AC_CONFIG_AUX_DIRS]) AC_DEFUN(AC_CONFIG_AUX_DIRS, [if test -f $CONFIG_AUX_DIR/install-sh ; then ac_aux_dir=$CONFIG_AUX_DIR else ac_aux_dir= for ac_dir in $1; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done fi if test -z "$ac_aux_dir"; then AC_MSG_ERROR([can not find install-sh or install.sh in $1]) fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl ]) undefine([AC_CHECK_HEADER]) AC_DEFUN(AC_CHECK_HEADER, [dnl Do the transliteration at runtime so arg 1 can be a shell variable. ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(ac_cv_header_$ac_safe, [cat >conftest.c< int conftest() {return 0;} EOF ac_compile_for_cpp='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&AC_FD_CC' if AC_TRY_EVAL(ac_compile_for_cpp); then eval "ac_cv_header_$ac_safe=yes" else eval "ac_cv_header_$ac_safe=no" echo "configure: failed program was:" >&AC_FD_CC cat conftest.c >&AC_FD_CC fi rm -f conftest* ])dnl if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) ifelse([$3], , , [$3 ])dnl fi ]) dnl dnl This internal macro fails to work properly with OTHER internal macros. dnl Basically, if the prologue is [], then no message should be generated. dnl This macro is in autoconf 2.52 m4_define([AC_LANG_PROGRAM(Fortran 77)], [m4_if([$1],[[[]]],,[m4_ifval([$1], [m4_warn([syntax], [$0: ignoring PROLOGUE: $1])])])dnl program main $2 end]) dnl dnl/*D dnl AC_CACHE_LOAD - Replacement for autoconf cache load dnl dnl Notes: dnl Caching in autoconf is broken (through version 2.13). The problem is dnl that the cache is read dnl without any check for whether it makes any sense to read it. dnl A common problem is a build on a shared file system; connecting to dnl a different computer and then building within the same directory will dnl lead to at best error messages from configure and at worse a build that dnl is wrong but fails only at run time (e.g., wrong datatype sizes used). dnl Later versions of autoconf do include some checks for changes in the dnl environment that impact the choices, but still misses problems with dnl multiple different systems. dnl dnl This fixes that by requiring the user to explicitly enable caching dnl before the cache file will be loaded. dnl dnl To use this version of 'AC_CACHE_LOAD', you need to include dnl 'aclocal_cache.m4' in your 'aclocal.m4' file. The sowing 'aclocal.m4' dnl file includes this file. dnl dnl If no --enable-cache or --disable-cache option is selected, the dnl command causes configure to keep track of the system being configured dnl in a config.system file; if the current system matches the value stored dnl in that file (or there is neither a config.cache nor config.system file), dnl configure will enable caching. In order to ensure that the configure dnl tests make sense, the values of CC, F77, F90, and CXX are also included dnl in the config.system file. dnl dnl Bugs: dnl This does not work with the Cygnus configure because the enable arguments dnl are processed *after* AC_CACHE_LOAD (!). To address this, we avoid dnl changing the value of enable_cache, and use real_enable_cache, duplicating dnl the "notgiven" value. dnl dnl See Also: dnl PAC_ARG_CACHING dnl D*/ define([AC_CACHE_LOAD], [if test "X$cache_system" = "X" ; then # A default file name, just in case cache_system="config.system" if test "$cache_file" != "/dev/null" ; then # Get the directory for the cache file, if any changequote(,) cache_system=`echo $cache_file | sed -e 's%^\(.*/\)[^/]*%\1/config.system%'` changequote([,]) test "x$cache_system" = "x$cache_file" && cache_system="config.system" # else # We must *not* set enable_cache to no because we need to know if # enable_cache was not set. # enable_cache=no fi fi dnl dnl The "action-if-not-given" part of AC_ARG_ENABLE is not executed until dnl after the AC_CACHE_LOAD is executed (!). Thus, the value of dnl enable_cache if neither --enable-cache or --disable-cache is selected dnl is null. Just in case autoconf ever fixes this, we test both cases. if test -z "$real_enable_cache" ; then real_enable_cache=$enable_cache if test -z "$real_enable_cache" ; then real_enable_cache="notgiven" ; fi fi if test "X$real_enable_cache" = "Xnotgiven" ; then # check for valid cache file if test -z "$cache_system" ; then cache_system="config.system" ; fi if uname -srm >/dev/null 2>&1 ; then dnl cleanargs=`echo "$*" | tr '"' ' '` cleanargs=`echo "$CC $F77 $CXX $F90" | tr '"' ' '` testval="`uname -srm` $cleanargs" if test -f "$cache_system" -a -n "$testval" ; then if test "$testval" = "`cat $cache_system`" ; then real_enable_cache="yes" fi elif test ! -f "$cache_system" -a -n "$testval" ; then echo "$testval" > $cache_system # remove the cache file because it may not correspond to our # system rm -f $cache_file real_enable_cache="yes" fi fi fi if test "X$real_enable_cache" = "Xyes" -a "$cache_file" = "/dev/null" ; then real_enable_cache=no fi if test "X$real_enable_cache" = "Xyes" ; then if test -r "$cache_file" ; then echo "loading cache $cache_file" if test -w "$cache_file" ; then # Clean the cache file (ergh) PAC_CACHE_CLEAN fi . $cache_file else echo "creating cache $cache_file" > $cache_file rm -f $cache_system cleanargs=`echo "$CC $F77 $CXX" | tr '"' ' '` testval="`uname -srm` $cleanargs" echo "$testval" > $cache_system fi else cache_file="/dev/null" fi ]) dnl dnl/*D dnl PAC_ARG_CACHING - Enable caching of results from a configure execution dnl dnl Synopsis: dnl PAC_ARG_CACHING dnl dnl Output Effects: dnl Adds '--enable-cache' and '--disable-cache' to the command line arguments dnl accepted by 'configure'. dnl dnl See Also: dnl AC_CACHE_LOAD dnl D*/ dnl Add this call to the other ARG_ENABLE calls. Note that the values dnl set here are redundant; the LOAD_CACHE call relies on the way autoconf dnl initially processes ARG_ENABLE commands. AC_DEFUN(PAC_ARG_CACHING,[ AC_ARG_ENABLE(cache, [--enable-cache - Turn on configure caching], enable_cache="$enableval",enable_cache="notgiven") ]) dnl dnl Clean the cache of extraneous quotes that AC_CACHE_SAVE may add AC_DEFUN([PAC_CACHE_CLEAN],[ rm -f confcache sed -e "s/'\\\\''//g" -e "s/'\\\\/'/" -e "s/\\\\'/'/" \ -e "s/'\\\\''//g" $cache_file > confcache if cmp -s $cache_file confcache ; then : else if test -w $cache_file ; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache if test "$DEBUG_AUTOCONF_CACHE" = "yes" ; then echo "Results of cleaned cache file:" echo "--------------------------------------------------------" cat $cache_file echo "--------------------------------------------------------" fi ]) dnl/*D dnl PAC_SUBDIR_CACHE - Create a cache file before ac_output for subdirectory dnl configures. dnl dnl Synopsis: dnl PAC_SUBDIR_CACHE dnl dnl Output Effects: dnl dnl Create a cache file before ac_output so that subdir configures don't dnl make mistakes. dnl We can't use OUTPUT_COMMANDS to remove the cache file, because those dnl commands are executed *before* the subdir configures. dnl dnl D*/ AC_DEFUN(PAC_SUBDIR_CACHE,[ if test "$cache_file" = "/dev/null" -a "X$real_enable_cache" = "Xnotgiven" ; then cache_file=$$conf.cache touch $cache_file dnl dnl For Autoconf 2.52+, we should ensure that the environment is set dnl for the cache. ac_cv_env_CC_set=set ac_cv_env_CC_value=$CC ac_cv_env_CFLAGS_set=set ac_cv_env_CFLAGS_value=$CFLAGS ac_cv_env_CPP_set=set ac_cv_env_CPP_value=$CPP ac_cv_env_CPPFLAGS_set=set ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_LDFLAGS_set=set ac_cv_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LIBS_set=set ac_cv_env_LIBS_value=$LIBS ac_cv_env_FC_set=set ac_cv_env_FC_value=$FC ac_cv_env_F77_set=set ac_cv_env_F77_value=$F77 ac_cv_env_FFLAGS_set=set ac_cv_env_FFLAGS_value=$FFLAGS ac_cv_env_CXX_set=set ac_cv_env_CXX_value=$CXX dnl other parameters are dnl build_alias, host_alias, target_alias # It turns out that A C CACHE_SAVE can't be invoked more than once # with data that contains blanks. What happens is that the quotes # that it adds get quoted and then added again. To avoid this, # we strip off the outer quotes for all cached variables AC_CACHE_SAVE PAC_CACHE_CLEAN ac_configure_args="$ac_configure_args -enable-cache" fi dnl Unconditionally export these values. Subdir configures break otherwise export CC export CFLAGS export LDFLAGS export LIBS export CPPFLAGS export CPP export FC export F77 export CXX export FFLAGS export CCFLAGS ]) AC_DEFUN(PAC_SUBDIR_CACHE_CLEANUP,[ if test "$cache_file" != "/dev/null" -a "X$real_enable_cache" = "Xnotgiven" ; then rm -f $cache_file fi ]) dnl dnl/*D dnl PAC_LIB_MPI - Check for MPI library dnl dnl Synopsis: dnl PAC_LIB_MPI([action if found],[action if not found]) dnl dnl Output Effect: dnl dnl Notes: dnl Currently, only checks for lib mpi and mpi.h. Later, we will add dnl MPI_Pcontrol prototype (const int or not?). dnl dnl If PAC_ARG_MPICH_BUILDING is included, this will work correctly dnl when MPICH is being built. dnl dnl Prerequisites: dnl autoconf version 2.13 (for AC_SEARCH_LIBS) dnl D*/ dnl Other tests to add: dnl Version of MPI dnl MPI-2 I/O? dnl MPI-2 Spawn? dnl MPI-2 RMA? dnl PAC_LIB_MPI([found text],[not found text]) AC_DEFUN(PAC_LIB_MPI,[ AC_PREREQ(2.13) if test "X$pac_lib_mpi_is_building" != "Xyes" ; then # Use CC if TESTCC is defined if test "X$pac_save_level" != "X" ; then pac_save_TESTCC="${TESTCC}" pac_save_TESTCPP="${TESTCPP}" CC="$pac_save_CC" if test "X$pac_save_CPP" != "X" ; then CPP="$pac_save_CPP" fi fi # Look for MPILIB first if it is defined AC_SEARCH_LIBS(MPI_Init,$MPILIB mpi mpich) if test "$ac_cv_search_MPI_Init" = "no" ; then ifelse($2,, AC_MSG_ERROR([Could not find MPI library]),[$2]) fi AC_CHECK_HEADER(mpi.h,pac_have_mpi_h="yes",pac_have_mpi_h="no") if test $pac_have_mpi_h = "no" ; then ifelse($2,, AC_MSG_ERROR([Could not find mpi.h include file]),[$2]) fi if test "X$pac_save_level" != "X" ; then CC="$pac_save_TESTCC" CPP="$pac_save_TESTCPP" fi fi ifelse($1,,,[$1]) ]) dnl dnl dnl/*D dnl PAC_ARG_MPICH_BUILDING - Add configure command-line argument to indicated dnl that MPICH is being built dnl dnl Output Effect: dnl Adds the command-line switch '--with-mpichbuilding' that may be used to dnl indicate that MPICH is building. This allows a configure to work-around dnl the fact that during a build of MPICH, certain commands, particularly the dnl compilation commands such as 'mpicc', are not yet functional. The dnl variable 'pac_lib_mpi_is_building' is set to 'yes' if in an MPICH build, dnl 'no' otherwise. dnl dnl See Also: dnl PAC_LIB_MPI dnl D*/ AC_DEFUN(PAC_ARG_MPICH_BUILDING,[ AC_ARG_WITH(mpichbuilding, [--with-mpichbuilding - Assume that MPICH is being built], pac_lib_mpi_is_building=$withval,pac_lib_mpi_is_building="no") ]) dnl dnl dnl This should also set MPIRUN. dnl dnl/*D dnl PAC_ARG_MPI_TYPES - Add command-line switches for different MPI dnl environments dnl dnl Synopsis: dnl PAC_ARG_MPI_TYPES([default]) dnl dnl Output Effects: dnl Adds the following command line options to configure dnl+ \-\-with\-mpich[=path] - MPICH. 'path' is the location of MPICH commands dnl. \-\-with\-ibmmpi - IBM MPI dnl. \-\-with\-lammpi[=path] - LAM/MPI dnl- \-\-with\-sgimpi - SGI MPI dnl If no type is selected, and a default ("mpich", "ibmmpi", or "sgimpi") dnl is given, that type is used as if '--with-' was given. dnl dnl Sets 'CC', 'F77', 'TESTCC', 'TESTF77', and 'MPILIBNAME'. Does `not` dnl perform an AC_SUBST for these values. dnl Also sets 'MPIBOOT' and 'MPIUNBOOT'. These are used to specify dnl programs that may need to be run before and after running MPI programs. dnl For example, 'MPIBOOT' may start demons necessary to run MPI programs and dnl 'MPIUNBOOT' will stop those demons. dnl dnl See also: dnl PAC_LANG_PUSH_COMPILERS, PAC_LIB_MPI dnl D*/ AC_DEFUN(PAC_ARG_MPI_TYPES,[ AC_PROVIDE([AC_PROG_CC]) AC_SUBST(CC) AC_SUBST(CXX) AC_SUBST(F77) AC_SUBST(F90) AC_ARG_WITH(mpich, [--with-mpich=path - Assume that we are building with MPICH], ac_mpi_type=mpich) AC_ARG_WITH(lammpi, [--with-lammpi=path - Assume that we are building with LAM/MPI], ac_mpi_type=lammpi) AC_ARG_WITH(ibmmpi, [--with-ibmmpi - Use the IBM SP implementation of MPI], ac_mpi_type=ibmmpi) AC_ARG_WITH(sgimpi, [--with-sgimpi - Use the SGI implementation of MPI], ac_mpi_type=sgimpi) if test "X$ac_mpi_type" = "X" ; then if test "X$1" != "X" ; then ac_mpi_type=$1 else ac_mpi_type=unknown fi fi if test "$ac_mpi_type" = "unknown" -a "$pac_lib_mpi_is_building" = "yes" ; then ac_mpi_type="mpich" fi case $ac_mpi_type in mpich) dnl dnl This isn't correct. It should try to get the underlying compiler dnl from the mpicc and mpif77 scripts or mpireconfig if test "X$pac_lib_mpi_is_building" != "Xyes" ; then save_PATH="$PATH" if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then # Look for commands; if not found, try adding bin to the # path if test ! -x $with_mpich/mpicc -a -x $with_mpich/bin/mpicc ; then with_mpich="$with_mpich/bin" fi PATH=$with_mpich:${PATH} fi AC_PATH_PROG(MPICC,mpicc) TESTCC=${CC-cc} CC="$MPICC" AC_PATH_PROG(MPIF77,mpif77) TESTF77=${F77-f77} F77="$MPIF77" AC_PATH_PROG(MPIF90,mpif90) TESTF90=${F90-f90} F90="$MPIF90" AC_PATH_PROG(MPICXX,mpiCC) TESTCXX=${CXX-CC} CXX="$MPICXX" # We may want to restrict this to the path containing mpirun AC_PATH_PROG(MPIRUN,mpirun) AC_PATH_PROG(MPIBOOT,mpichboot) AC_PATH_PROG(MPIUNBOOT,mpichstop) PATH="$save_PATH" MPILIBNAME="mpich" else # All of the above should have been passed in the environment! : fi ;; lammpi) dnl dnl This isn't correct. It should try to get the underlying compiler dnl from the mpicc and mpif77 scripts or mpireconfig save_PATH="$PATH" if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then # Look for commands; if not found, try adding bin to the path if test ! -x $with_lammpi/mpicc -a -x $with_lammpi/bin/mpicc ; then with_lammpi="$with_lammpi/bin" fi PATH=$with_lammpi:${PATH} fi AC_PATH_PROG(MPICC,mpicc) TESTCC=${CC-cc} CC="$MPICC" AC_PATH_PROG(MPIF77,mpif77) TESTF77=${F77-f77} F77="$MPIF77" AC_PATH_PROG(MPIF90,mpif90) TESTF90=${F90-f90} F90="$MPIF90" AC_PATH_PROG(MPICXX,mpiCC) TESTCXX=${CXX-CC} CXX="$MPICXX" PATH="$save_PATH" MPILIBNAME="lammpi" MPIBOOT="lamboot" MPIUNBOOT="wipe" MPIRUN="mpirun" ;; ibmmpi) TESTCC=${CC-xlC}; TESTF77=${F77-xlf}; CC=mpcc; F77=mpxlf # There is no mpxlf90, but the options langlvl and free can # select the F90 version of xlf TESTF90=${F90-xlf90}; F90="mpxlf -qlanglvl=90ext -qfree=f90" MPILIBNAME="" ;; sgimpi) TESTCC=${CC:=cc}; TESTF77=${F77:=f77}; TESTCXX=${CXX:=CC}; TESTF90=${F90:=f90} AC_CHECK_LIB(mpi,MPI_Init) if test "$ac_cv_lib_mpi_MPI_Init" = "yes" ; then MPILIBNAME="mpi" fi MPIRUN=mpirun MPIBOOT="" MPIUNBOOT="" ;; *) # Find the compilers PAC_PROG_CC # We only look for the other compilers if there is no # disable for them if test "$enable_f77" != no -a "$enable_fortran" != no ; then AC_PROG_F77 fi if test "$enable_cxx" != no ; then AC_PROG_CXX fi if test "$enable_f90" != no ; then PAC_PROG_F90 fi # Set defaults for the TEST versions if not already set if test -z "$TESTCC" ; then TESTCC=${CC:=cc} fi if test -z "$TESTF77" ; then TESTF77=${F77:=f77} fi if test -z "$TESTCXX" ; then TESTCXX=${CXX:=CC} fi if test -z "$TESTF90" ; then TESTF90=${F90:=f90} fi ;; esac ]) dnl dnl/*D dnl PAC_MPI_F2C - Determine if MPI has the MPI-2 functions MPI_xxx_f2c and dnl MPI_xxx_c2f dnl dnl Output Effect: dnl Define 'HAVE_MPI_F2C' if the routines are found. dnl dnl Notes: dnl Looks only for 'MPI_Request_c2f'. dnl D*/ AC_DEFUN(PAC_MPI_F2C,[ AC_CACHE_CHECK([for MPI F2C and C2F routines], pac_cv_mpi_f2c, [ AC_TRY_LINK([#include "mpi.h"], [MPI_Request request;MPI_Fint a;a = MPI_Request_c2f(request);], pac_cv_mpi_f2c="yes",pac_cv_mpi_f2c="no") ]) if test "$pac_cv_mpi_f2c" = "yes" ; then AC_DEFINE(HAVE_MPI_F2C) fi ]) dnl dnl/*D dnl PAC_HAVE_ROMIO - make mpi.h include mpio.h if romio enabled dnl dnl Output Effect: dnl expands @HAVE_ROMIO@ in mpi.h into #include "mpio.h" dnl D*/ AC_DEFUN(PAC_HAVE_ROMIO,[ if test "$enable_romio" = "yes" ; then HAVE_ROMIO='#include "mpio.h"'; fi AC_SUBST(HAVE_ROMIO) ]) dnl dnl Macros for Fortran 90 dnl dnl We'd like to have a PAC_LANG_FORTRAN90 that worked with AC_TRY_xxx, but dnl that would require too many changes to autoconf macros. dnl AC_DEFUN(PAC_LANG_FORTRAN90, [AC_REQUIRE([PAC_PROG_F90]) define([AC_LANG], [FORTRAN90])dnl ac_ext=$pac_cv_f90_ext ac_compile='${F90-f90} -c $F90FLAGS conftest.$ac_ext 1>&AC_FD_CC' ac_link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' cross_compiling=$pac_cv_prog_f90_cross ]) dnl dnl This is an addition for AC_TRY_COMPILE, but for f90. If the current dnl language is not f90, it does a save/restore AC_DEFUN(PAC_TRY_F90_COMPILE, [AC_REQUIRE([PAC_LANG_FORTRAN90]) ifelse(AC_LANG, FORTRAN90,,[AC_LANG_SAVE PAC_LANG_FORTRAN90 define([NEED_POP],yes)]) cat > conftest.$ac_ext <&AC_FD_CC cat conftest.$ac_ext >&AC_FD_CC ifelse([$4], , , [ rm -rf conftest* $4 ])dnl fi rm -f conftest* ifelse(NEED_POP,yes,[ undefine([NEED_POP]) AC_LANG_RESTORE]) ]) dnl dnl PAC_F90_MODULE_EXT(action if found,action if not found) dnl AC_DEFUN(PAC_F90_MODULE_EXT, [AC_CACHE_CHECK([for Fortran 90 module extension], pac_cv_f90_module_ext,[ pac_cv_f90_module_case="unknown" cat >conftest.$ac_f90ext <&1 | grep -v conftest.$ac_f90ext | grep -v conftest.o` pac_MOD=`echo $pac_MOD | sed -e 's/conftest\.//g'` pac_cv_f90_module_case="lower" if test "X$pac_MOD" = "X" ; then pac_MOD=`ls CONFTEST* 2>&1 | grep -v CONFTEST.f | grep -v CONFTEST.o` pac_MOD=`echo $pac_MOD | sed -e 's/CONFTEST\.//g'` if test -n "$pac_MOD" ; then testname="CONFTEST" pac_cv_f90_module_case="upper" fi fi if test -z "$pac_MOD" ; then pac_cv_f90_module_ext="unknown" else pac_cv_f90_module_ext=$pac_MOD fi else echo "configure: failed program was:" >&AC_FD_CC cat conftest.$ac_f90ext >&AC_FD_CC pac_cv_f90_module_ext="unknown" fi rm -f conftest* ]) AC_SUBST(F90MODEXT) if test "$pac_cv_f90_module_ext" = "unknown" ; then ifelse($2,,:,[$2]) else ifelse($1,,F90MODEXT=$pac_MOD,[$1]) fi ]) dnl dnl PAC_F90_MODULE_INCFLAG AC_DEFUN(PAC_F90_MODULE_INCFLAG,[ AC_CACHE_CHECK([for Fortran 90 module include flag], pac_cv_f90_module_incflag,[ AC_REQUIRE([PAC_F90_MODULE_EXT]) cat >conftest.$ac_f90ext <&AC_FD_CC cat conftest.$ac_f90ext >&AC_FD_CC fi rm -f conftest.$ac_f90ext cat >conftest.$ac_f90ext <&AC_FD_CC && \ test -s conftest.o ; then pac_cv_f90_module_incflag="-I" elif ${F90-f90} -c $F90FLAGS -Mconf conftest.$ac_f90ext 1>&AC_FD_CC && \ test-s conftest.o ; then pac_cv_f90_module_incflag="-M" elif ${F90-f90} -c $F90FLAGS -pconf conftest.$ac_f90ext 1>&AC_FD_CC && \ test -s conftest.o ; then pac_cv_f90_module_incflag="-p" else pac_cv_f90_module_incflag="unknown" fi if test "$pac_madedir" = "yes" ; then rm -rf conf ; fi rm -f conftest* ]) AC_SUBST(F90MODINCFLAG) F90MODINCFLAG=$pac_cv_f90_module_incflag ]) AC_DEFUN(PAC_F90_MODULE,[ PAC_F90_MODULE_EXT PAC_F90_MODULE_INCFLAG ]) AC_DEFUN(PAC_F90_EXT,[ AC_CACHE_CHECK([whether Fortran 90 accepts f90 suffix], pac_cv_f90_ext_f90,[ save_ac_f90ext=$ac_f90ext ac_f90ext="f90" PAC_TRY_F90_COMPILE(,,pac_cv_f90_ext_f90="yes",pac_cv_f90_ext_f90="no") ac_f90ext=$save_ac_f90ext ]) ]) dnl dnl/*D dnl PAC_PROG_F90_INT_KIND - Determine kind parameter for an integer with dnl the specified number of bytes. dnl dnl Synopsis: dnl PAC_PROG_F90_INT_KIND(variable-to-set,number-of-bytes,[cross-size]) dnl dnl D*/ AC_DEFUN(PAC_PROG_F90_INT_KIND,[ # Set the default $1=-1 if test "$pac_cv_prog_f90_cross" = "yes" ; then $1="$3" else if test -n "$ac_f90compile" ; then AC_MSG_CHECKING([for Fortran 90 integer kind for $2-byte integers]) # Convert bytes to digits case $2 in 1) sellen=2 ;; 2) sellen=4 ;; 4) sellen=8 ;; 8) sellen=16 ;; 16) sellen=30 ;; *) sellen=8 ;; esac # Check for cached value eval testval=\$"pac_cv_prog_f90_int_kind_$sellen" if test -n "$testval" ; then AC_MSG_RESULT([$testval (cached)]) $1=$testval else # must compute rm -f conftest* cat < conftest.$ac_f90ext program main integer i i = selected_int_kind($sellen) open(8, file="conftest1.out", form="formatted") write (8,*) i close(8) stop end EOF KINDVAL="unavailable" eval "pac_cv_prog_f90_int_kind_$sellen"=-1 if AC_TRY_EVAL(ac_f90link) && test -s conftest ; then ./conftest >>config.log 2>&1 if test -s conftest1.out ; then # Because of write, there may be a leading blank. KINDVAL=`cat conftest1.out | sed 's/ //g'` eval "pac_cv_prog_f90_int_kind_$sellen"=$KINDVAL $1=$KINDVAL fi fi rm -f conftest* AC_MSG_RESULT($KINDVAL) fi # not cached fi # Has Fortran 90 fi # is not cross compiling ])dnl dnl dnl dnl Note: This checks for f95 before f90, since F95 is the more recent dnl revision of Fortran 90. efc is the Intel Fortran 77/90/95 compiler AC_DEFUN(PAC_PROG_F90,[ if test -z "$F90" ; then AC_CHECK_PROGS(F90,f95 f90 xlf90 pgf90 efc) test -z "$F90" && AC_MSG_WARN([no acceptable Fortran 90 compiler found in \$PATH]) fi if test -n "$F90" ; then PAC_PROG_F90_WORKS fi dnl Cache these so we don't need to change in and out of f90 mode ac_f90ext=$pac_cv_f90_ext ac_f90compile='${F90-f90} -c $F90FLAGS conftest.$ac_f90ext 1>&AC_FD_CC' ac_f90link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_f90ext $LIBS 1>&AC_FD_CC' # Check for problems with Intel efc compiler cat > conftest.$ac_f90ext <&1 | grep 'bfd assertion fail'` if test -n "$pac_msg" ; then pac_msg=`$F90 -o conftest $F90FLAGS $LDFLAGS conftest.$ac_f90ext -i_dynamic $LIBS 2>&1 | grep 'bfd assertion fail'` if test -z "$pac_msg" ; then LDFLAGS="-i_dynamic" ; fi # There should really be f90linker flags rather than generic ldflags. fi ]) dnl Internal routine for testing F90 dnl PAC_PROG_F90_WORKS() AC_DEFUN(PAC_PROG_F90_WORKS, [AC_MSG_CHECKING([for extension for Fortran 90 programs]) pac_cv_f90_ext="f90" cat > conftest.$pac_cv_f90_ext < conftest.$pac_cv_f90_ext <conftest.$ac_ext </dev/null ; then pac_cv_prog_f90_cross="no" else pac_cv_prog_f90_cross="yes" fi else echo "configure: failed program was:" >&AC_FD_CC cat conftest.$ac_ext >&AC_FD_CC pac_cv_prog_f90_works="no" fi rm -f conftest* AC_LANG_RESTORE AC_MSG_RESULT($pac_cv_prog_f90_works) if test $pac_cv_prog_f90_works = no; then AC_MSG_WARN([installation or configuration problem: Fortran 90 compiler cannot create executables.]) fi AC_MSG_CHECKING([whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) is a cross-compiler]) AC_MSG_RESULT($pac_cv_prog_f90_cross) cross_compiling=$pac_cv_prog_f90_cross ]) dnl dnl The following looks for F90 options to enable th specified f90 compiler dnl to work with the f77 compiler, particularly for accessing command-line dnl arguments dnl dnl We need routines to check that make works. Possible problems with dnl make include dnl dnl It is really gnumake, and contrary to the documentation on gnumake, dnl it insists on screaming everytime a directory is changed. The fix dnl is to add the argument --no-print-directory to the make dnl dnl It is really BSD 4.4 make, and can't handle 'include'. For some dnl systems, this can be fatal; there is no fix (other than removing this dnl alleged make). dnl dnl It is the OSF V3 make, and can't handle a comment in a block of target dnl code. There is no acceptable fix. dnl dnl dnl dnl dnl Find a make program if none is defined. AC_DEFUN(PAC_PROG_MAKE_PROGRAM,[true if test "X$MAKE" = "X" ; then AC_CHECK_PROGS(MAKE,make gnumake nmake pmake smake) fi ])dnl dnl/*D dnl PAC_PROG_MAKE_ECHOS_DIR - Check whether make echos all directory changes dnl dnl Synopsis: dnl PAC_PROG_MAKE_ECHOS_DIR dnl dnl Output Effect: dnl If make echos directory changes, append '--no-print-directory' to the dnl symbol 'MAKE'. If 'MAKE' is not set, chooses 'make' for 'MAKE'. dnl dnl See also: dnl PAC_PROG_MAKE dnl D*/ dnl AC_DEFUN(PAC_PROG_MAKE_ECHOS_DIR,[ AC_CACHE_CHECK([whether make echos directory changes], pac_cv_prog_make_echos_dir, [ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) /bin/rm -f conftest cat > conftest <<. SHELL=/bin/sh ALL: @(dir="`pwd`" ; cd .. ; \$(MAKE) -f "\$\$dir/conftest" SUB) SUB: @echo "success" . str="`$MAKE -f conftest 2>&1`" if test "$str" != "success" ; then str="`$MAKE --no-print-directory -f conftest 2>&1`" if test "$str" = "success" ; then pac_cv_prog_make_echos_dir="yes using --no-print-directory" else pac_cv_prog_make_echos_dir="no" echo "Unexpected output from make with program" >>config.log cat conftest >>config.log echo "str" >> config.log fi else pac_cv_prog_make_echos_dir="no" fi /bin/rm -f conftest str="" ]) if test "$pac_cv_prog_make_echos_dir" = "yes using --no-print-directory" ; then MAKE="$MAKE --no-print-directory" fi ])dnl dnl dnl/*D dnl PAC_PROG_MAKE_INCLUDE - Check whether make supports include dnl dnl Synopsis: dnl PAC_PROG_MAKE_INCLUDE([action if true],[action if false]) dnl dnl Output Effect: dnl None dnl dnl Notes: dnl This checks for makes that do not support 'include filename'. Some dnl versions of BSD 4.4 make required '#include' instead; some versions of dnl 'pmake' have the same syntax. dnl dnl See Also: dnl PAC_PROG_MAKE dnl dnl D*/ dnl AC_DEFUN(PAC_PROG_MAKE_INCLUDE,[ AC_CACHE_CHECK([whether make supports include],pac_cv_prog_make_include,[ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) /bin/rm -f conftest cat > conftest <<. ALL: @echo "success" . cat > conftest1 <<. include conftest . pac_str=`$MAKE -f conftest1 2>&1` /bin/rm -f conftest conftest1 if test "$pac_str" != "success" ; then pac_cv_prog_make_include="no" else pac_cv_prog_make_include="yes" fi ]) if test "$pac_cv_prog_make_include" = "no" ; then ifelse([$2],,:,[$2]) else ifelse([$1],,:,[$1]) fi ])dnl dnl dnl/*D dnl PAC_PROG_MAKE_ALLOWS_COMMENTS - Check whether comments are allowed in dnl shell commands in a makefile dnl dnl Synopsis: dnl PAC_PROG_MAKE_ALLOWS_COMMENTS([false text]) dnl dnl Output Effect: dnl Issues a warning message if comments are not allowed in a makefile. dnl Executes the argument if one is given. dnl dnl Notes: dnl Some versions of OSF V3 make do not all comments in action commands. dnl dnl See Also: dnl PAC_PROG_MAKE dnl D*/ dnl AC_DEFUN(PAC_PROG_MAKE_ALLOWS_COMMENTS,[ AC_CACHE_CHECK([whether make allows comments in actions], pac_cv_prog_make_allows_comments,[ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) /bin/rm -f conftest cat > conftest <<. SHELL=/bin/sh ALL: @# This is a valid comment! @echo "success" . pac_str=`$MAKE -f conftest 2>&1` /bin/rm -f conftest if test "$pac_str" != "success" ; then pac_cv_prog_make_allows_comments="no" else pac_cv_prog_make_allows_comments="yes" fi ]) if test "$pac_cv_prog_make_allows_comments" = "no" ; then AC_MSG_WARN([Your make does not allow comments in target code. Using this make may cause problems when building programs. You should consider using gnumake instead.]) ifelse([$1],,[$1]) fi ])dnl dnl dnl/*D dnl PAC_PROG_MAKE_VPATH - Check whether make supports source-code paths. dnl dnl Synopsis: dnl PAC_PROG_MAKE_VPATH dnl dnl Output Effect: dnl Sets the variable 'VPATH' to either dnl.vb dnl VPATH = .:${srcdir} dnl.ve dnl or dnl.vb dnl .PATH: . ${srcdir} dnl.ve dnl dnl Notes: dnl The test checks that the path works with implicit targets (some makes dnl support only explicit targets with 'VPATH' or 'PATH'). dnl dnl NEED TO DO: Check that $< works on explicit targets. dnl dnl See Also: dnl PAC_PROG_MAKE dnl dnl D*/ dnl AC_DEFUN(PAC_PROG_MAKE_VPATH,[ AC_SUBST(VPATH)AM_IGNORE(VPATH) AC_CACHE_CHECK([for virtual path format], pac_cv_prog_make_vpath,[ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) rm -rf conftest* mkdir conftestdir cat >conftestdir/a.c < conftest <&1 | grep 'conftestdir/a.c'` if test -n "$ac_out" ; then pac_cv_prog_make_vpath="VPATH" else rm -f conftest cat > conftest <&1 | grep 'conftestdir/a.c'` if test -n "$ac_out" ; then pac_cv_prog_make_vpath=".PATH" else pac_cv_prog_make_vpath="neither VPATH nor .PATH works" fi fi rm -rf conftest* ]) if test "$pac_cv_prog_make_vpath" = "VPATH" ; then VPATH='VPATH=.:${srcdir}' elif test "$pac_cv_prog_make_vpath" = ".PATH" ; then VPATH='.PATH: . ${srcdir}' fi ])dnl dnl dnl/*D dnl PAC_PROG_MAKE_SET_CFLAGS - Check whether make sets CFLAGS dnl dnl Synopsis: dnl PAC_PROG_MAKE_SET_CFLAGS([action if true],[action if false]) dnl dnl Output Effects: dnl Executes the first argument if 'CFLAGS' is set by 'make'; executes dnl the second argument if 'CFLAGS' is not set by 'make'. dnl dnl Notes: dnl If 'CFLAGS' is set by make, you may wish to override that choice in your dnl makefile. dnl dnl See Also: dnl PAC_PROG_MAKE dnl D*/ AC_DEFUN(PAC_PROG_MAKE_SET_CFLAGS,[ AC_CACHE_CHECK([whether make sets CFLAGS], pac_cv_prog_make_set_cflags,[ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) /bin/rm -f conftest cat > conftest <&1` /bin/rm -f conftest if test "$pac_str" = "XX" ; then pac_cv_prog_make_set_cflags="no" else pac_cv_prog_make_set_cflags="yes" fi ]) if test "$pac_cv_prog_make_set_cflags" = "no" ; then ifelse([$2],,:,[$2]) else ifelse([$1],,:,[$1]) fi ])dnl dnl/*D dnl PAC_PROG_MAKE_CLOCK_SKEW - Check whether there is a problem with dnl clock skew in suing make. dnl dnl Effect: dnl Sets the cache variable 'pac_cv_prog_make_found_clock_skew' to yes or no dnl D*/ AC_DEFUN(PAC_PROG_MAKE_CLOCK_SKEW,[ AC_CACHE_CHECK([whether clock skew breaks make], pac_cv_prog_make_found_clock_skew,[ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) rm -f conftest* cat > conftest < conftest.out 2>&1 if grep -i skew conftest >/dev/null 2>&1 ; then pac_cv_prog_make_found_clock_skew=yes else pac_cv_prog_make_found_clock_skew=no fi rm -f conftest* ]) dnl We should really do something if we detect clock skew. The question is, dnl what? if test "$pac_cv_prog_make_found_clock_skew" = "yes" ; then AC_MSG_WARN([Clock skew found by make. The configure and build may fail. Consider building in a local instead of NFS filesystem.]) fi ]) dnl dnl/*D dnl PAC_PROG_MAKE_HAS_PATTERN_RULES - Determine if the make program supports dnl pattern rules dnl dnl Synopsis: dnl PAC_PROG_MAKE_HAS_PATTERN_RULES([action if true],[action if false]) dnl dnl Output Effect: dnl Executes the first argument if patterns of the form dnl.vb dnl prefix%suffix: prefix%suffix dnl.ve dnl are supported by make (gnumake and Solaris make are known to support dnl this form of target). If patterns are not supported, executes the dnl second argument. dnl dnl See Also: dnl PAC_PROG_MAKE dnl dnl D*/ AC_DEFUN(PAC_PROG_MAKE_HAS_PATTERN_RULES,[ AC_CACHE_CHECK([whether make has pattern rules], pac_cv_prog_make_has_patterns,[ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) rm -f conftest* cat > conftestmm <\[$]@ EOF date > conftest.c if ${MAKE} -f conftestmm conftestconftest.dep 1>&AC_FD_CC 2>&1 conftest.$ac_ext </dev/null; then [$3]=no else [$3]=yes fi else echo "configure: failed program was:" >&AC_FD_CC cat conftest.$ac_ext >&AC_FD_CC [$2]=no fi rm -fr conftest*]) ]) dnl dnl pac_cross_compiling overrides all tests if set to yes. This allows dnl us to test the cross-compilation branches of the code, and to use dnl compilers that can both cross-compile and build code for the current dnl platform dnl AC_DEFUN(PAC_LANG_PUSH_COMPILERS,[ if test "X$pac_save_level" = "X" ; then pac_save_CC="$CC" pac_save_CXX="$CXX" pac_save_F77="$F77" pac_save_F90="$F90" pac_save_prog_cc_cross="$ac_cv_prog_cc_cross" pac_save_prog_f77_cross="$ac_cv_prog_f77_cross" pac_save_prog_cxx_cross="$ac_cv_prog_cxx_cross" pac_save_prog_f90_cross="$pac_cv_prog_f90_cross" if test "X$CPP" = "X" ; then AC_PROG_CPP fi pac_save_CPP="$CPP" CC="${TESTCC:=$CC}" CXX="${TESTCXX:=$CXX}" F77="${TESTF77:=$F77}" F90="${TESTF90:=$F90}" if test -z "$TESTCPP" ; then PAC_PROG_TESTCPP fi CPP="${TESTCPP:=$CPP}" pac_save_level="0" # Recompute cross_compiling values and set for the current language # This is just: AC_LANG_SAVE AC_LANG_C if test "$pac_cross_compiling" = "yes" ; then ac_cv_prog_cc_cross=yes ac_cv_prog_cc_works=yes else AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross) fi AC_LANG_RESTORE # Ignore Fortran if we aren't using it. if test -n "$F77" ; then AC_LANG_SAVE AC_LANG_FORTRAN77 if test "$pac_cross_compiling" = "yes" ; then ac_cv_prog_f77_cross=yes ac_cv_prog_f77_works=yes else AC_TRY_COMPILER(dnl [ program conftest end ], ac_cv_prog_f77_works, ac_cv_prog_f77_cross) fi AC_LANG_RESTORE fi # Ignore C++ if we aren't using it. if test -n "$CXX" ; then AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILER([int main(){return(0);}], ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross) AC_LANG_RESTORE fi # Ignore Fortran 90 if we aren't using it. if test -n "$F90" ; then AC_LANG_SAVE PAC_LANG_FORTRAN90 dnl We can't use AC_TRY_COMPILER because it doesn't know about dnl Fortran 90 if test "$pac_cross_compiling" = "yes" ; then ac_cv_prog_f90_cross=yes ac_cv_prog_f90_works=yes else cat > conftest.$ac_ext << EOF program conftest end EOF if { (eval echo configure:2324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_f90_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_f90_cross=no else ac_cv_prog_f90_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_f90_works=no fi fi pac_cv_prog_f90_cross="$ac_cv_prog_f90_cross" pac_cv_prog_f90_works="$ac_cv_prog_f90_works" rm -fr conftest* AC_LANG_RESTORE fi fi pac_save_level=`expr $pac_save_level + 1` ]) dnl/*D dnl PAC_LANG_POP_COMPILERS - Restore compilers that were displaced by dnl PAC_LANG_PUSH_COMPILERS dnl dnl Synopsis: dnl PAC_LANG_POP_COMPILERS dnl dnl Output Effects: dnl The values of 'CC', 'CXX', 'F77', 'F90', and 'CPP' are replaced with dnl their original values from the outermost call to 'PAC_LANG_PUSH_COMPILERS'. dnl dnl Calls to this macro may be nested, but only the outer-most calls have dnl any effect. dnl dnl See also: dnl PAC_LANG_PUSH_COMPILERS dnl D*/ AC_DEFUN(PAC_LANG_POP_COMPILERS,[ pac_save_level=`expr $pac_save_level - 1` if test "X$pac_save_level" = "X0" ; then CC="$pac_save_CC" CXX="$pac_save_CXX" F77="$pac_save_F77" F90="$pac_save_F90" CPP="$pac_save_CPP" ac_cv_prog_cc_cross="$pac_save_prog_cc_cross" ac_cv_prog_f77_cross="$pac_save_prog_f77_cross" ac_cv_prog_cxx_cross="$pac_save_prog_cxx_cross" pac_cv_prog_f90_cross="$pac_save_prog_f90_cross" pac_save_level="" fi ]) AC_DEFUN(PAC_PROG_TESTCPP,[ if test -z "$TESTCPP"; then AC_CACHE_VAL(pac_cv_prog_TESTCPP,[ rm -f conftest.* cat > conftest.c < Syntax Error EOF # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. TESTCPP="${TESTCC-cc} -E" ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out" if AC_TRY_EVAL(ac_try) ; then pac_cv_prog_TESTCPP="$TESTCPP" fi if test "X$pac_cv_prog_TESTCPP" = "X" ; then TESTCPP="${TESTCC-cc} -E -traditional-cpp" ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out" if AC_TRY_EVAL(ac_try) ; then pac_cv_prog_TESTCPP="$TESTCPP" fi fi if test "X$pac_cv_prog_TESTCPP" = "X" ; then TESTCPP="${TESTCC-cc} -nologo -E" ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out" if AC_TRY_EVAL(ac_try) ; then pac_cv_prog_TESTCPP="$TESTCPP" fi fi if test "X$pac_cv_prog_TESTCPP" = "X" ; then AC_PATH_PROG(TESTCPP,cpp) fi rm -f conftest.* ]) else pac_cv_prog_TESTCPP="$TESTCPP" fi ]) perftest-1.3a/configure0000775000115300004540000040522407666706437010775 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --enable-g - Turn on debugging of the package (typically adds -g to COPTIONS)" ac_help="$ac_help --enable-strict - Turn on strict compilation testing when using gcc" ac_help="$ac_help --enable-echo - Turn on echoing from within the configure script" ac_help="$ac_help --enable-strict - Turn on strict debugging with gcc" ac_help="$ac_help --enable-restrict - Check for C restrict keyword (or similar)" ac_help="$ac_help --enable-cache - Turn on configure caching" ac_help="$ac_help --enable-fortran - Build with Fortran" ac_help="$ac_help --with-mpichbuilding - Assume that MPICH is being built" ac_help="$ac_help --with-mpich=path - Assume that we are building with MPICH" ac_help="$ac_help --with-lammpi=path - Assume that we are building with LAM/MPI" ac_help="$ac_help --with-ibmmpi - Use the IBM SP implementation of MPI" ac_help="$ac_help --with-sgimpi - Use the SGI implementation of MPI" # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=mpptest.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test "X$cache_system" = "X" ; then # A default file name, just in case cache_system="config.system" if test "$cache_file" != "/dev/null" ; then # Get the directory for the cache file, if any cache_system=`echo $cache_file | sed -e 's%^\(.*/\)[^/]*%\1/config.system%'` test "x$cache_system" = "x$cache_file" && cache_system="config.system" # else # We must *not* set enable_cache to no because we need to know if # enable_cache was not set. # enable_cache=no fi fi if test -z "$real_enable_cache" ; then real_enable_cache=$enable_cache if test -z "$real_enable_cache" ; then real_enable_cache="notgiven" ; fi fi if test "X$real_enable_cache" = "Xnotgiven" ; then # check for valid cache file if test -z "$cache_system" ; then cache_system="config.system" ; fi if uname -srm >/dev/null 2>&1 ; then cleanargs=`echo "$CC $F77 $CXX $F90" | tr '"' ' '` testval="`uname -srm` $cleanargs" if test -f "$cache_system" -a -n "$testval" ; then if test "$testval" = "`cat $cache_system`" ; then real_enable_cache="yes" fi elif test ! -f "$cache_system" -a -n "$testval" ; then echo "$testval" > $cache_system # remove the cache file because it may not correspond to our # system rm -f $cache_file real_enable_cache="yes" fi fi fi if test "X$real_enable_cache" = "Xyes" -a "$cache_file" = "/dev/null" ; then real_enable_cache=no fi if test "X$real_enable_cache" = "Xyes" ; then if test -r "$cache_file" ; then echo "loading cache $cache_file" if test -w "$cache_file" ; then # Clean the cache file (ergh) rm -f confcache sed -e "s/'\\\\''//g" -e "s/'\\\\/'/" -e "s/\\\\'/'/" \ -e "s/'\\\\''//g" $cache_file > confcache if cmp -s $cache_file confcache ; then : else if test -w $cache_file ; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache if test "$DEBUG_AUTOCONF_CACHE" = "yes" ; then echo "Results of cleaned cache file:" echo "--------------------------------------------------------" cat $cache_file echo "--------------------------------------------------------" fi fi . $cache_file else echo "creating cache $cache_file" > $cache_file rm -f $cache_system cleanargs=`echo "$CC $F77 $CXX" | tr '"' ' '` testval="`uname -srm` $cleanargs" echo "$testval" > $cache_system fi else cache_file="/dev/null" fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi if test -f $CONFIG_AUX_DIR/install-sh ; then ac_aux_dir=$CONFIG_AUX_DIR else ac_aux_dir= for ac_dir in config $srcdir/config; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done fi if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in config $srcdir/config" 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:656: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 echo "configure:709: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "$*" != "X $srcdir/configure conftestfile" \ && test "$*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { echo "configure: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" 1>&2; exit 1; } fi test "$2" = conftestfile ) then # Ok. : else { echo "configure: error: newly created file is older than distributed files! Check your system clock" 1>&2; exit 1; } fi rm -f conftest* echo "$ac_t""yes" 1>&6 if test "$program_transform_name" = s,x,x,; then program_transform_name= else # Double any \ or $. echo might interpret backslashes. cat <<\EOF_SED > conftestsed s,\\,\\\\,g; s,\$,$$,g EOF_SED program_transform_name="`echo $program_transform_name|sed -f conftestsed`" rm -f conftestsed fi test "$program_prefix" != NONE && program_transform_name="s,^,${program_prefix},; $program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:766: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi PACKAGE=perftest VERSION=1.3a if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } fi cat >> confdefs.h <> confdefs.h <&6 echo "configure:812: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (aclocal --version) < /dev/null > /dev/null 2>&1; then ACLOCAL=aclocal echo "$ac_t""found" 1>&6 else ACLOCAL="$missing_dir/missing aclocal" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 echo "configure:825: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoconf --version) < /dev/null > /dev/null 2>&1; then AUTOCONF=autoconf echo "$ac_t""found" 1>&6 else AUTOCONF="$missing_dir/missing autoconf" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 echo "configure:838: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (automake --version) < /dev/null > /dev/null 2>&1; then AUTOMAKE=automake echo "$ac_t""found" 1>&6 else AUTOMAKE="$missing_dir/missing automake" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 echo "configure:851: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoheader --version) < /dev/null > /dev/null 2>&1; then AUTOHEADER=autoheader echo "$ac_t""found" 1>&6 else AUTOHEADER="$missing_dir/missing autoheader" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 echo "configure:864: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (makeinfo --version) < /dev/null > /dev/null 2>&1; then MAKEINFO=makeinfo echo "$ac_t""found" 1>&6 else MAKEINFO="$missing_dir/missing makeinfo" echo "$ac_t""missing" 1>&6 fi # Check whether --enable-g or --disable-g was given. if test "${enable_g+set}" = set; then enableval="$enable_g" : fi export COPTIONS export enable_g_simple if test -n "$enable_g" -a "$enable_g" != "no" -a \ "$enable_g_simple" != "done" ; then enable_g_simple="done" if test "$enable_g" = "g" -o "$enable_g" = "yes" ; then COPTIONS="$COPTIONS -g" fi fi # Check whether --enable-strict or --disable-strict was given. if test "${enable_strict+set}" = set; then enableval="$enable_strict" : fi export enable_strict_done export COPTIONS if test "$enable_strict_done" != "yes" ; then if test "$enable_strict" = "yes" ; then enable_strict_done="yes" if test -z "CC" ; then for ac_prog in gcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:918: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$CC" && break done if test "$CC" = "gcc" ; then COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL" fi fi elif test "$enable_strict" = "all" ; then enable_strict_done="yes" if test -z "CC" ; then for ac_prog in gcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:959: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$CC" && break done if test "$CC" = "gcc" ; then COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL -Wunused -Wshadow -Wmissing-declarations -Wno-long-long" fi fi fi fi # Check whether --enable-echo or --disable-echo was given. if test "${enable_echo+set}" = set; then enableval="$enable_echo" set -x fi # Check whether --enable-strict or --disable-strict was given. if test "${enable_strict+set}" = set; then enableval="$enable_strict" COPTIONS="$COPTIONS -Wall -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wpointer-arith -Wbad-function-cast -ansi" fi # Check whether --enable-restrict or --disable-restrict was given. if test "${enable_restrict+set}" = set; then enableval="$enable_restrict" use_restrict=$enableval else use_restrict="yes" fi # Check whether --enable-cache or --disable-cache was given. if test "${enable_cache+set}" = set; then enableval="$enable_cache" enable_cache="$enableval" else enable_cache="notgiven" fi # Check whether --enable-fortran or --disable-fortran was given. if test "${enable_fortran+set}" = set; then enableval="$enable_fortran" enable_fortran=$enableval else enable_fortran="yes" fi # # Turn off the other languages (otherwise tested for in ARG_MPI_TYPES) enable_cxx=no enable_f90=no # Check whether --with-mpichbuilding or --without-mpichbuilding was given. if test "${with_mpichbuilding+set}" = set; then withval="$with_mpichbuilding" pac_lib_mpi_is_building=$withval else pac_lib_mpi_is_building="no" fi # Check whether --with-mpich or --without-mpich was given. if test "${with_mpich+set}" = set; then withval="$with_mpich" ac_mpi_type=mpich fi # Check whether --with-lammpi or --without-lammpi was given. if test "${with_lammpi+set}" = set; then withval="$with_lammpi" ac_mpi_type=lammpi fi # Check whether --with-ibmmpi or --without-ibmmpi was given. if test "${with_ibmmpi+set}" = set; then withval="$with_ibmmpi" ac_mpi_type=ibmmpi fi # Check whether --with-sgimpi or --without-sgimpi was given. if test "${with_sgimpi+set}" = set; then withval="$with_sgimpi" ac_mpi_type=sgimpi fi if test "X$ac_mpi_type" = "X" ; then if test "Xmpich" != "X" ; then ac_mpi_type=mpich else ac_mpi_type=unknown fi fi if test "$ac_mpi_type" = "unknown" -a "$pac_lib_mpi_is_building" = "yes" ; then ac_mpi_type="mpich" fi case $ac_mpi_type in mpich) if test "X$pac_lib_mpi_is_building" != "Xyes" ; then save_PATH="$PATH" if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then # Look for commands; if not found, try adding bin to the # path if test ! -x $with_mpich/mpicc -a -x $with_mpich/bin/mpicc ; then with_mpich="$with_mpich/bin" fi PATH=$with_mpich:${PATH} fi # Extract the first word of "mpicc", so it can be a program name with args. set dummy mpicc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1110: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MPICC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MPICC" in /*) ac_cv_path_MPICC="$MPICC" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_MPICC="$MPICC" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_MPICC="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi MPICC="$ac_cv_path_MPICC" if test -n "$MPICC"; then echo "$ac_t""$MPICC" 1>&6 else echo "$ac_t""no" 1>&6 fi TESTCC=${CC-cc} CC="$MPICC" # Extract the first word of "mpif77", so it can be a program name with args. set dummy mpif77; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1147: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MPIF77'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MPIF77" in /*) ac_cv_path_MPIF77="$MPIF77" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_MPIF77="$MPIF77" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_MPIF77="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi MPIF77="$ac_cv_path_MPIF77" if test -n "$MPIF77"; then echo "$ac_t""$MPIF77" 1>&6 else echo "$ac_t""no" 1>&6 fi TESTF77=${F77-f77} F77="$MPIF77" # Extract the first word of "mpif90", so it can be a program name with args. set dummy mpif90; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1184: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MPIF90'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MPIF90" in /*) ac_cv_path_MPIF90="$MPIF90" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_MPIF90="$MPIF90" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_MPIF90="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi MPIF90="$ac_cv_path_MPIF90" if test -n "$MPIF90"; then echo "$ac_t""$MPIF90" 1>&6 else echo "$ac_t""no" 1>&6 fi TESTF90=${F90-f90} F90="$MPIF90" # Extract the first word of "mpiCC", so it can be a program name with args. set dummy mpiCC; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1221: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MPICXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MPICXX" in /*) ac_cv_path_MPICXX="$MPICXX" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_MPICXX="$MPICXX" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_MPICXX="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi MPICXX="$ac_cv_path_MPICXX" if test -n "$MPICXX"; then echo "$ac_t""$MPICXX" 1>&6 else echo "$ac_t""no" 1>&6 fi TESTCXX=${CXX-CC} CXX="$MPICXX" # We may want to restrict this to the path containing mpirun # Extract the first word of "mpirun", so it can be a program name with args. set dummy mpirun; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1259: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MPIRUN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MPIRUN" in /*) ac_cv_path_MPIRUN="$MPIRUN" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_MPIRUN="$MPIRUN" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_MPIRUN="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi MPIRUN="$ac_cv_path_MPIRUN" if test -n "$MPIRUN"; then echo "$ac_t""$MPIRUN" 1>&6 else echo "$ac_t""no" 1>&6 fi # Extract the first word of "mpichboot", so it can be a program name with args. set dummy mpichboot; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1294: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MPIBOOT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MPIBOOT" in /*) ac_cv_path_MPIBOOT="$MPIBOOT" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_MPIBOOT="$MPIBOOT" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_MPIBOOT="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi MPIBOOT="$ac_cv_path_MPIBOOT" if test -n "$MPIBOOT"; then echo "$ac_t""$MPIBOOT" 1>&6 else echo "$ac_t""no" 1>&6 fi # Extract the first word of "mpichstop", so it can be a program name with args. set dummy mpichstop; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1329: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MPIUNBOOT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MPIUNBOOT" in /*) ac_cv_path_MPIUNBOOT="$MPIUNBOOT" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_MPIUNBOOT="$MPIUNBOOT" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_MPIUNBOOT="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi MPIUNBOOT="$ac_cv_path_MPIUNBOOT" if test -n "$MPIUNBOOT"; then echo "$ac_t""$MPIUNBOOT" 1>&6 else echo "$ac_t""no" 1>&6 fi PATH="$save_PATH" MPILIBNAME="mpich" else # All of the above should have been passed in the environment! : fi ;; lammpi) save_PATH="$PATH" if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then # Look for commands; if not found, try adding bin to the path if test ! -x $with_lammpi/mpicc -a -x $with_lammpi/bin/mpicc ; then with_lammpi="$with_lammpi/bin" fi PATH=$with_lammpi:${PATH} fi # Extract the first word of "mpicc", so it can be a program name with args. set dummy mpicc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1381: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MPICC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MPICC" in /*) ac_cv_path_MPICC="$MPICC" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_MPICC="$MPICC" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_MPICC="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi MPICC="$ac_cv_path_MPICC" if test -n "$MPICC"; then echo "$ac_t""$MPICC" 1>&6 else echo "$ac_t""no" 1>&6 fi TESTCC=${CC-cc} CC="$MPICC" # Extract the first word of "mpif77", so it can be a program name with args. set dummy mpif77; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1418: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MPIF77'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MPIF77" in /*) ac_cv_path_MPIF77="$MPIF77" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_MPIF77="$MPIF77" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_MPIF77="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi MPIF77="$ac_cv_path_MPIF77" if test -n "$MPIF77"; then echo "$ac_t""$MPIF77" 1>&6 else echo "$ac_t""no" 1>&6 fi TESTF77=${F77-f77} F77="$MPIF77" # Extract the first word of "mpif90", so it can be a program name with args. set dummy mpif90; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1455: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MPIF90'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MPIF90" in /*) ac_cv_path_MPIF90="$MPIF90" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_MPIF90="$MPIF90" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_MPIF90="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi MPIF90="$ac_cv_path_MPIF90" if test -n "$MPIF90"; then echo "$ac_t""$MPIF90" 1>&6 else echo "$ac_t""no" 1>&6 fi TESTF90=${F90-f90} F90="$MPIF90" # Extract the first word of "mpiCC", so it can be a program name with args. set dummy mpiCC; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1492: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MPICXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MPICXX" in /*) ac_cv_path_MPICXX="$MPICXX" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_MPICXX="$MPICXX" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_MPICXX="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi MPICXX="$ac_cv_path_MPICXX" if test -n "$MPICXX"; then echo "$ac_t""$MPICXX" 1>&6 else echo "$ac_t""no" 1>&6 fi TESTCXX=${CXX-CC} CXX="$MPICXX" PATH="$save_PATH" MPILIBNAME="lammpi" MPIBOOT="lamboot" MPIUNBOOT="wipe" MPIRUN="mpirun" ;; ibmmpi) TESTCC=${CC-xlC}; TESTF77=${F77-xlf}; CC=mpcc; F77=mpxlf # There is no mpxlf90, but the options langlvl and free can # select the F90 version of xlf TESTF90=${F90-xlf90}; F90="mpxlf -qlanglvl=90ext -qfree=f90" MPILIBNAME="" ;; sgimpi) TESTCC=${CC:=cc}; TESTF77=${F77:=f77}; TESTCXX=${CXX:=CC}; TESTF90=${F90:=f90} echo $ac_n "checking for MPI_Init in -lmpi""... $ac_c" 1>&6 echo "configure:1545: checking for MPI_Init in -lmpi" >&5 ac_lib_var=`echo mpi'_'MPI_Init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lmpi $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo mpi | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi if test "$ac_cv_lib_mpi_MPI_Init" = "yes" ; then MPILIBNAME="mpi" fi MPIRUN=mpirun MPIBOOT="" MPIUNBOOT="" ;; *) # Find the compilers for ac_prog in cc xlC xlc pgcc icc gcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1608: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$CC" && break done test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:1639: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 1650 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:1655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:1681: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether the C compiler sets its return status correctly""... $ac_c" 1>&6 echo "configure:1686: checking whether the C compiler sets its return status correctly" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* notbroken=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* notbroken=yes fi rm -f conftest* echo "$ac_t""$notbroken" 1>&6 if test "$notbroken" = "no" ; then { echo "configure: error: installation or configuration problem: C compiler does not correctly set error code when a fatal error occurs" 1>&2; exit 1; } fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:1720: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test "$ac_cv_prog_gcc" = yes; then GCC=yes else GCC= fi # We only look for the other compilers if there is no # disable for them if test "$enable_f77" != no -a "$enable_fortran" != no ; then if test -z "$F77"; then for ac_prog in g77 f77 f2c do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1752: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_F77'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_F77="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi F77="$ac_cv_prog_F77" if test -n "$F77"; then echo "$ac_t""$F77" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$F77" && break done test -z "$F77" && { echo "configure: error: no acceptable Fortran 77 compiler found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:1785: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works" >&5 ac_ext=f ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5' ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_f77_cross cat > conftest.$ac_ext << EOF program conftest end EOF if { (eval echo configure:1798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_f77_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_f77_cross=no else ac_cv_prog_f77_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_f77_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_f77_works" 1>&6 if test $ac_cv_prog_f77_works = no; then { echo "configure: error: installation or configuration problem: Fortran 77 compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:1824: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_f77_cross" 1>&6 cross_compiling=$ac_cv_prog_f77_cross echo $ac_n "checking whether we are using GNU Fortran 77""... $ac_c" 1>&6 echo "configure:1829: checking whether we are using GNU Fortran 77" >&5 if eval "test \"`echo '$''{'ac_cv_prog_g77'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.fpp <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_g77=yes else ac_cv_prog_g77=no fi fi echo "$ac_t""$ac_cv_prog_g77" 1>&6 if test $ac_cv_prog_g77 = yes; then G77=yes ac_test_FFLAGS="${FFLAGS+set}" ac_save_FFLAGS="$FFLAGS" FFLAGS= echo $ac_n "checking whether $F77 accepts -g""... $ac_c" 1>&6 echo "configure:1853: checking whether $F77 accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_f77_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.f << EOF program conftest end EOF if test -z "`$F77 -g -c conftest.f 2>&1`"; then ac_cv_prog_f77_g=yes else ac_cv_prog_f77_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_f77_g" 1>&6 if test "$ac_test_FFLAGS" = set; then FFLAGS="$ac_save_FFLAGS" elif test $ac_cv_prog_f77_g = yes; then FFLAGS="-g -O2" else FFLAGS="-O2" fi else G77= test "${FFLAGS+set}" = set || FFLAGS="-g" fi fi if test "$enable_cxx" != no ; then for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1890: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CXX="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi CXX="$ac_cv_prog_CXX" if test -n "$CXX"; then echo "$ac_t""$CXX" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$CXX" && break done test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:1922: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF #line 1933 "configure" #include "confdefs.h" int main(){return(0);} EOF if { (eval echo configure:1938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cxx_cross=no else ac_cv_prog_cxx_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cxx_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:1964: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 echo "configure:1969: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no fi fi echo "$ac_t""$ac_cv_prog_gxx" 1>&6 if test $ac_cv_prog_gxx = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 echo "configure:1997: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.cc if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then ac_cv_prog_cxx_g=yes else ac_cv_prog_cxx_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS="$ac_save_CXXFLAGS" elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi fi if test "$enable_f90" != no ; then if test -z "$F90" ; then for ac_prog in f95 f90 xlf90 pgf90 efc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2037: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_F90'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$F90"; then ac_cv_prog_F90="$F90" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_F90="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi F90="$ac_cv_prog_F90" if test -n "$F90"; then echo "$ac_t""$F90" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$F90" && break done test -z "$F90" && echo "configure: warning: no acceptable Fortran 90 compiler found in \$PATH" 1>&2 fi if test -n "$F90" ; then echo $ac_n "checking for extension for Fortran 90 programs""... $ac_c" 1>&6 echo "configure:2070: checking for extension for Fortran 90 programs" >&5 pac_cv_f90_ext="f90" cat > conftest.$pac_cv_f90_ext <&5; (eval $ac_compile) 2>&5; } ; then echo "$ac_t""f90" 1>&6 else rm -f conftest* pac_cv_f90_ext="f" cat > conftest.$pac_cv_f90_ext <&5; (eval $ac_compile) 2>&5; } ; then echo "$ac_t""f" 1>&6 else echo "$ac_t""unknown!" 1>&6 fi fi echo $ac_n "checking whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:2093: checking whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) works" >&5 # We cannot use _LANG_FORTRAN90 here because we will usually be executing this # test in the context of _PROG_F90, which is a require on _LANG_FORTRAN90. # Instead, we insert the necessary code from _LANG_FORTRAN90 here ac_ext=$pac_cv_f90_ext ac_compile='${F90-f90} -c $F90FLAGS conftest.$ac_ext 1>&5' ac_link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$pac_cv_prog_f90_cross cat >conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeect} ; then pac_cv_prog_f90_works="yes" if (./conftest; exit) 2>/dev/null ; then pac_cv_prog_f90_cross="no" else pac_cv_prog_f90_cross="yes" fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 pac_cv_prog_f90_works="no" fi rm -f conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$pac_cv_prog_f90_works" 1>&6 if test $pac_cv_prog_f90_works = no; then echo "configure: warning: installation or configuration problem: Fortran 90 compiler cannot create executables." 1>&2 fi echo $ac_n "checking whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:2131: checking whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$pac_cv_prog_f90_cross" 1>&6 cross_compiling=$pac_cv_prog_f90_cross fi ac_f90ext=$pac_cv_f90_ext ac_f90compile='${F90-f90} -c $F90FLAGS conftest.$ac_f90ext 1>&5' ac_f90link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_f90ext $LIBS 1>&5' # Check for problems with Intel efc compiler cat > conftest.$ac_f90ext <&1 | grep 'bfd assertion fail'` if test -n "$pac_msg" ; then pac_msg=`$F90 -o conftest $F90FLAGS $LDFLAGS conftest.$ac_f90ext -i_dynamic $LIBS 2>&1 | grep 'bfd assertion fail'` if test -z "$pac_msg" ; then LDFLAGS="-i_dynamic" ; fi # There should really be f90linker flags rather than generic ldflags. fi fi # Set defaults for the TEST versions if not already set if test -z "$TESTCC" ; then TESTCC=${CC:=cc} fi if test -z "$TESTF77" ; then TESTF77=${F77:=f77} fi if test -z "$TESTCXX" ; then TESTCXX=${CXX:=CC} fi if test -z "$TESTF90" ; then TESTF90=${F90:=f90} fi ;; esac if test "$pac_lib_mpi_is_building" != "yes" ; then # Only check these if we aren't building the MPICH libraries for ac_prog in cc xlC xlc pgcc icc gcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2178: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$CC" && break done test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:2209: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 2220 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:2225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:2251: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether the C compiler sets its return status correctly""... $ac_c" 1>&6 echo "configure:2256: checking whether the C compiler sets its return status correctly" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* notbroken=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* notbroken=yes fi rm -f conftest* echo "$ac_t""$notbroken" 1>&6 if test "$notbroken" = "no" ; then { echo "configure: error: installation or configuration problem: C compiler does not correctly set error code when a fatal error occurs" 1>&2; exit 1; } fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:2290: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test "$ac_cv_prog_gcc" = yes; then GCC=yes else GCC= fi if test "$enable_fortran" = "yes" ; then if test -z "$F77"; then for ac_prog in g77 f77 f2c do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2320: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_F77'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_F77="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi F77="$ac_cv_prog_F77" if test -n "$F77"; then echo "$ac_t""$F77" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$F77" && break done test -z "$F77" && { echo "configure: error: no acceptable Fortran 77 compiler found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:2353: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works" >&5 ac_ext=f ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5' ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_f77_cross cat > conftest.$ac_ext << EOF program conftest end EOF if { (eval echo configure:2366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_f77_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_f77_cross=no else ac_cv_prog_f77_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_f77_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_f77_works" 1>&6 if test $ac_cv_prog_f77_works = no; then { echo "configure: error: installation or configuration problem: Fortran 77 compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:2392: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_f77_cross" 1>&6 cross_compiling=$ac_cv_prog_f77_cross echo $ac_n "checking whether we are using GNU Fortran 77""... $ac_c" 1>&6 echo "configure:2397: checking whether we are using GNU Fortran 77" >&5 if eval "test \"`echo '$''{'ac_cv_prog_g77'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.fpp <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_g77=yes else ac_cv_prog_g77=no fi fi echo "$ac_t""$ac_cv_prog_g77" 1>&6 if test $ac_cv_prog_g77 = yes; then G77=yes ac_test_FFLAGS="${FFLAGS+set}" ac_save_FFLAGS="$FFLAGS" FFLAGS= echo $ac_n "checking whether $F77 accepts -g""... $ac_c" 1>&6 echo "configure:2421: checking whether $F77 accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_f77_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.f << EOF program conftest end EOF if test -z "`$F77 -g -c conftest.f 2>&1`"; then ac_cv_prog_f77_g=yes else ac_cv_prog_f77_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_f77_g" 1>&6 if test "$ac_test_FFLAGS" = set; then FFLAGS="$ac_save_FFLAGS" elif test $ac_cv_prog_f77_g = yes; then FFLAGS="-g -O2" else FFLAGS="-O2" fi else G77= test "${FFLAGS+set}" = set || FFLAGS="-g" fi fi fi true if test "X$MAKE" = "X" ; then for ac_prog in make gnumake nmake pmake smake do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2462: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$MAKE"; then ac_cv_prog_MAKE="$MAKE" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_MAKE="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi MAKE="$ac_cv_prog_MAKE" if test -n "$MAKE"; then echo "$ac_t""$MAKE" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$MAKE" && break done fi echo $ac_n "checking whether clock skew breaks make""... $ac_c" 1>&6 echo "configure:2495: checking whether clock skew breaks make" >&5 if eval "test \"`echo '$''{'pac_cv_prog_make_found_clock_skew'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* cat > conftest < conftest.out 2>&1 if grep -i skew conftest >/dev/null 2>&1 ; then pac_cv_prog_make_found_clock_skew=yes else pac_cv_prog_make_found_clock_skew=no fi rm -f conftest* fi echo "$ac_t""$pac_cv_prog_make_found_clock_skew" 1>&6 if test "$pac_cv_prog_make_found_clock_skew" = "yes" ; then echo "configure: warning: Clock skew found by make. The configure and build may fail. Consider building in a local instead of NFS filesystem." 1>&2 fi echo $ac_n "checking whether make echos directory changes""... $ac_c" 1>&6 echo "configure:2524: checking whether make echos directory changes" >&5 if eval "test \"`echo '$''{'pac_cv_prog_make_echos_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else /bin/rm -f conftest cat > conftest <<. SHELL=/bin/sh ALL: @(dir="`pwd`" ; cd .. ; \$(MAKE) -f "\$\$dir/conftest" SUB) SUB: @echo "success" . str="`$MAKE -f conftest 2>&1`" if test "$str" != "success" ; then str="`$MAKE --no-print-directory -f conftest 2>&1`" if test "$str" = "success" ; then pac_cv_prog_make_echos_dir="yes using --no-print-directory" else pac_cv_prog_make_echos_dir="no" echo "Unexpected output from make with program" >>config.log cat conftest >>config.log echo "str" >> config.log fi else pac_cv_prog_make_echos_dir="no" fi /bin/rm -f conftest str="" fi echo "$ac_t""$pac_cv_prog_make_echos_dir" 1>&6 if test "$pac_cv_prog_make_echos_dir" = "yes using --no-print-directory" ; then MAKE="$MAKE --no-print-directory" fi echo $ac_n "checking whether make supports include""... $ac_c" 1>&6 echo "configure:2564: checking whether make supports include" >&5 if eval "test \"`echo '$''{'pac_cv_prog_make_include'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else /bin/rm -f conftest cat > conftest <<. ALL: @echo "success" . cat > conftest1 <<. include conftest . pac_str=`$MAKE -f conftest1 2>&1` /bin/rm -f conftest conftest1 if test "$pac_str" != "success" ; then pac_cv_prog_make_include="no" else pac_cv_prog_make_include="yes" fi fi echo "$ac_t""$pac_cv_prog_make_include" 1>&6 if test "$pac_cv_prog_make_include" = "no" ; then : else : fi echo $ac_n "checking whether make allows comments in actions""... $ac_c" 1>&6 echo "configure:2597: checking whether make allows comments in actions" >&5 if eval "test \"`echo '$''{'pac_cv_prog_make_allows_comments'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else /bin/rm -f conftest cat > conftest <<. SHELL=/bin/sh ALL: @# This is a valid comment! @echo "success" . pac_str=`$MAKE -f conftest 2>&1` /bin/rm -f conftest if test "$pac_str" != "success" ; then pac_cv_prog_make_allows_comments="no" else pac_cv_prog_make_allows_comments="yes" fi fi echo "$ac_t""$pac_cv_prog_make_allows_comments" 1>&6 if test "$pac_cv_prog_make_allows_comments" = "no" ; then echo "configure: warning: Your make does not allow comments in target code. Using this make may cause problems when building programs. You should consider using gnumake instead." 1>&2 fi echo $ac_n "checking for virtual path format""... $ac_c" 1>&6 echo "configure:2631: checking for virtual path format" >&5 if eval "test \"`echo '$''{'pac_cv_prog_make_vpath'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -rf conftest* mkdir conftestdir cat >conftestdir/a.c < conftest <&1 | grep 'conftestdir/a.c'` if test -n "$ac_out" ; then pac_cv_prog_make_vpath="VPATH" else rm -f conftest cat > conftest <&1 | grep 'conftestdir/a.c'` if test -n "$ac_out" ; then pac_cv_prog_make_vpath=".PATH" else pac_cv_prog_make_vpath="neither VPATH nor .PATH works" fi fi rm -rf conftest* fi echo "$ac_t""$pac_cv_prog_make_vpath" 1>&6 if test "$pac_cv_prog_make_vpath" = "VPATH" ; then VPATH='VPATH=.:${srcdir}' elif test "$pac_cv_prog_make_vpath" = ".PATH" ; then VPATH='.PATH: . ${srcdir}' fi echo $ac_n "checking whether make sets CFLAGS""... $ac_c" 1>&6 echo "configure:2680: checking whether make sets CFLAGS" >&5 if eval "test \"`echo '$''{'pac_cv_prog_make_set_cflags'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else /bin/rm -f conftest cat > conftest <&1` /bin/rm -f conftest if test "$pac_str" = "XX" ; then pac_cv_prog_make_set_cflags="no" else pac_cv_prog_make_set_cflags="yes" fi fi echo "$ac_t""$pac_cv_prog_make_set_cflags" 1>&6 if test "$pac_cv_prog_make_set_cflags" = "no" ; then : else SET_CFLAGS='CFLAGS=' fi if test "$pac_cv_prog_make_echos_dir" = "no" ; then echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:2711: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi else SET_MAKE="MAKE=${MAKE-make}" fi # Look for graphics programs for ac_prog in cit gnuplot do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2748: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GRAPHICS_PGM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$GRAPHICS_PGM"; then ac_cv_prog_GRAPHICS_PGM="$GRAPHICS_PGM" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_GRAPHICS_PGM="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi GRAPHICS_PGM="$ac_cv_prog_GRAPHICS_PGM" if test -n "$GRAPHICS_PGM"; then echo "$ac_t""$GRAPHICS_PGM" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$GRAPHICS_PGM" && break done test -n "$GRAPHICS_PGM" || GRAPHICS_PGM=""none"" if test "X$pac_save_level" = "X" ; then pac_save_CC="$CC" pac_save_CXX="$CXX" pac_save_F77="$F77" pac_save_F90="$F90" pac_save_prog_cc_cross="$ac_cv_prog_cc_cross" pac_save_prog_f77_cross="$ac_cv_prog_f77_cross" pac_save_prog_cxx_cross="$ac_cv_prog_cxx_cross" pac_save_prog_f90_cross="$pac_cv_prog_f90_cross" if test "X$CPP" = "X" ; then echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:2791: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2846: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 fi pac_save_CPP="$CPP" CC="${TESTCC:=$CC}" CXX="${TESTCXX:=$CXX}" F77="${TESTF77:=$F77}" F90="${TESTF90:=$F90}" if test -z "$TESTCPP" ; then if test -z "$TESTCPP"; then if eval "test \"`echo '$''{'pac_cv_prog_TESTCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest.* cat > conftest.c < Syntax Error EOF # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. TESTCPP="${TESTCC-cc} -E" ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out" if { (eval echo configure:2892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ; then pac_cv_prog_TESTCPP="$TESTCPP" fi if test "X$pac_cv_prog_TESTCPP" = "X" ; then TESTCPP="${TESTCC-cc} -E -traditional-cpp" ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out" if { (eval echo configure:2898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ; then pac_cv_prog_TESTCPP="$TESTCPP" fi fi if test "X$pac_cv_prog_TESTCPP" = "X" ; then TESTCPP="${TESTCC-cc} -nologo -E" ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out" if { (eval echo configure:2905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ; then pac_cv_prog_TESTCPP="$TESTCPP" fi fi if test "X$pac_cv_prog_TESTCPP" = "X" ; then # Extract the first word of "cpp", so it can be a program name with args. set dummy cpp; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2913: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TESTCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$TESTCPP" in /*) ac_cv_path_TESTCPP="$TESTCPP" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_TESTCPP="$TESTCPP" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_TESTCPP="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi TESTCPP="$ac_cv_path_TESTCPP" if test -n "$TESTCPP"; then echo "$ac_t""$TESTCPP" 1>&6 else echo "$ac_t""no" 1>&6 fi fi rm -f conftest.* fi else pac_cv_prog_TESTCPP="$TESTCPP" fi fi CPP="${TESTCPP:=$CPP}" pac_save_level="0" # Recompute cross_compiling values and set for the current language # This is just: ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross if test "$pac_cross_compiling" = "yes" ; then ac_cv_prog_cc_cross=yes ac_cv_prog_cc_works=yes else cat > conftest.$ac_ext << EOF #line 2973 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:2978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross # Ignore Fortran if we aren't using it. if test -n "$F77" ; then ac_ext=f ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5' ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_f77_cross if test "$pac_cross_compiling" = "yes" ; then ac_cv_prog_f77_cross=yes ac_cv_prog_f77_works=yes else cat > conftest.$ac_ext << EOF program conftest end EOF if { (eval echo configure:3018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_f77_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_f77_cross=no else ac_cv_prog_f77_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_f77_works=no fi rm -fr conftest* fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross fi # Ignore C++ if we aren't using it. if test -n "$CXX" ; then ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF #line 3053 "configure" #include "confdefs.h" int main(){return(0);} EOF if { (eval echo configure:3058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cxx_cross=no else ac_cv_prog_cxx_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cxx_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross fi # Ignore Fortran 90 if we aren't using it. if test -n "$F90" ; then ac_ext=$pac_cv_f90_ext ac_compile='${F90-f90} -c $F90FLAGS conftest.$ac_ext 1>&5' ac_link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$pac_cv_prog_f90_cross if test "$pac_cross_compiling" = "yes" ; then ac_cv_prog_f90_cross=yes ac_cv_prog_f90_works=yes else cat > conftest.$ac_ext << EOF program conftest end EOF if { (eval echo configure:2324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_f90_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_f90_cross=no else ac_cv_prog_f90_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_f90_works=no fi fi pac_cv_prog_f90_cross="$ac_cv_prog_f90_cross" pac_cv_prog_f90_works="$ac_cv_prog_f90_works" rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross fi fi pac_save_level=`expr $pac_save_level + 1` for copt in "-O4 -Ofast" "-Ofast" "-fast" "-O3" "-xO3" "-O" ; do echo $ac_n "checking that C compiler accepts option $copt""... $ac_c" 1>&6 echo "configure:3130: checking that C compiler accepts option $copt" >&5 save_CFLAGS="$CFLAGS" CFLAGS="$copt $CFLAGS" rm -f conftest.out echo 'int try(void);int try(void){return 0;}' > conftest2.c echo 'int main(void);int main(void){return 0;}' > conftest.c if ${CC-cc} $save_CFLAGS $CPPFLAGS -o conftest conftest.c $LDFLAGS >conftest.bas 2>&1 ; then if ${CC-cc} $CFLAGS $CPPFLAGS -o conftest conftest.c $LDFLAGS >conftest.out 2>&1 ; then if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking that routines compiled with $copt can be linked with ones compiled without $copt""... $ac_c" 1>&6 echo "configure:3141: checking that routines compiled with $copt can be linked with ones compiled without $copt" >&5 /bin/rm -f conftest.out /bin/rm -f conftest.bas if ${CC-cc} -c $save_CFLAGS $CPPFLAGS conftest2.c >conftest2.out 2>&1 ; then if ${CC-cc} $CFLAGS $CPPFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.bas 2>&1 ; then if ${CC-cc} $CFLAGS $CPPFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.out 2>&1 ; then if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then echo "$ac_t""yes" 1>&6 CFLAGS="$save_CFLAGS" found_opt=yes elif test -s conftest.out ; then cat conftest.out >&5 echo "$ac_t""no" 1>&6 CFLAGS="$save_CFLAGS" found_opt=no else echo "$ac_t""no" 1>&6 CFLAGS="$save_CFLAGS" found_opt=no fi else if test -s conftest.out ; then cat conftest.out >&5 fi echo "$ac_t""no" 1>&6 CFLAGS="$save_CFLAGS" found_opt=no fi else # Could not link with the option! echo "$ac_t""no" 1>&6 fi else if test -s conftest2.out ; then cat conftest.out >&5 fi echo "$ac_t""no" 1>&6 CFLAGS="$save_CFLAGS" found_opt=no fi else cat conftest.out >&5 echo "$ac_t""no" 1>&6 found_opt=no CFLAGS="$save_CFLAGS" fi else echo "$ac_t""no" 1>&6 found_opt=no if test -s conftest.out ; then cat conftest.out >&5 ; fi CFLAGS="$save_CFLAGS" fi else # Could not compile without the option! echo "$ac_t""no" 1>&6 fi rm -f conftest* if test "$found_opt" = "yes" ; then COPTIONS="$COPTIONS $copt" break fi done if test "$ac_cv_prog_gcc" = "yes" ; then for copt in "-fomit-frame-pointer" "-finline-functions" \ "-funroll-loops" ; do echo $ac_n "checking that C compiler accepts option $copt""... $ac_c" 1>&6 echo "configure:3209: checking that C compiler accepts option $copt" >&5 save_CFLAGS="$CFLAGS" CFLAGS="$copt $CFLAGS" rm -f conftest.out echo 'int try(void);int try(void){return 0;}' > conftest2.c echo 'int main(void);int main(void){return 0;}' > conftest.c if ${CC-cc} $save_CFLAGS $CPPFLAGS -o conftest conftest.c $LDFLAGS >conftest.bas 2>&1 ; then if ${CC-cc} $CFLAGS $CPPFLAGS -o conftest conftest.c $LDFLAGS >conftest.out 2>&1 ; then if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking that routines compiled with $copt can be linked with ones compiled without $copt""... $ac_c" 1>&6 echo "configure:3220: checking that routines compiled with $copt can be linked with ones compiled without $copt" >&5 /bin/rm -f conftest.out /bin/rm -f conftest.bas if ${CC-cc} -c $save_CFLAGS $CPPFLAGS conftest2.c >conftest2.out 2>&1 ; then if ${CC-cc} $CFLAGS $CPPFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.bas 2>&1 ; then if ${CC-cc} $CFLAGS $CPPFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.out 2>&1 ; then if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then echo "$ac_t""yes" 1>&6 CFLAGS="$save_CFLAGS" found_opt=yes elif test -s conftest.out ; then cat conftest.out >&5 echo "$ac_t""no" 1>&6 CFLAGS="$save_CFLAGS" found_opt=no else echo "$ac_t""no" 1>&6 CFLAGS="$save_CFLAGS" found_opt=no fi else if test -s conftest.out ; then cat conftest.out >&5 fi echo "$ac_t""no" 1>&6 CFLAGS="$save_CFLAGS" found_opt=no fi else # Could not link with the option! echo "$ac_t""no" 1>&6 fi else if test -s conftest2.out ; then cat conftest.out >&5 fi echo "$ac_t""no" 1>&6 CFLAGS="$save_CFLAGS" found_opt=no fi else cat conftest.out >&5 echo "$ac_t""no" 1>&6 found_opt=no CFLAGS="$save_CFLAGS" fi else echo "$ac_t""no" 1>&6 found_opt=no if test -s conftest.out ; then cat conftest.out >&5 ; fi CFLAGS="$save_CFLAGS" fi else # Could not compile without the option! echo "$ac_t""no" 1>&6 fi rm -f conftest* if test $found_opt = "yes" ; then COPTIONS="$COPTIONS $copt" # no break because we're trying to add them all fi done # We could also look for architecture-specific gcc options fi echo $ac_n "checking for library containing fabs""... $ac_c" 1>&6 echo "configure:3290: checking for library containing fabs" >&5 if eval "test \"`echo '$''{'ac_cv_search_fabs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_fabs="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_fabs="none required" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* test "$ac_cv_search_fabs" = "no" && for i in m; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_fabs="-l$i" break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* done LIBS="$ac_func_search_save_LIBS" fi echo "$ac_t""$ac_cv_search_fabs" 1>&6 if test "$ac_cv_search_fabs" != "no"; then test "$ac_cv_search_fabs" = "none required" || LIBS="$ac_cv_search_fabs $LIBS" else : fi if test "X$pac_lib_mpi_is_building" != "Xyes" ; then # Use CC if TESTCC is defined if test "X$pac_save_level" != "X" ; then pac_save_TESTCC="${TESTCC}" pac_save_TESTCPP="${TESTCPP}" CC="$pac_save_CC" if test "X$pac_save_CPP" != "X" ; then CPP="$pac_save_CPP" fi fi # Look for MPILIB first if it is defined echo $ac_n "checking for library containing MPI_Init""... $ac_c" 1>&6 echo "configure:3365: checking for library containing MPI_Init" >&5 if eval "test \"`echo '$''{'ac_cv_search_MPI_Init'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_MPI_Init="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_MPI_Init="none required" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* test "$ac_cv_search_MPI_Init" = "no" && for i in $MPILIB mpi mpich; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_MPI_Init="-l$i" break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* done LIBS="$ac_func_search_save_LIBS" fi echo "$ac_t""$ac_cv_search_MPI_Init" 1>&6 if test "$ac_cv_search_MPI_Init" != "no"; then test "$ac_cv_search_MPI_Init" = "none required" || LIBS="$ac_cv_search_MPI_Init $LIBS" else : fi if test "$ac_cv_search_MPI_Init" = "no" ; then { echo "configure: error: Could not find MPI library" 1>&2; exit 1; } fi ac_safe=`echo "mpi.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for mpi.h""... $ac_c" 1>&6 echo "configure:3430: checking for mpi.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat >conftest.c< int conftest() {return 0;} EOF ac_compile_for_cpp='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' if { (eval echo configure:3441: \"$ac_compile_for_cpp\") 1>&5; (eval $ac_compile_for_cpp) 2>&5; }; then eval "ac_cv_header_$ac_safe=yes" else eval "ac_cv_header_$ac_safe=no" echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 pac_have_mpi_h="yes" else echo "$ac_t""no" 1>&6 pac_have_mpi_h="no" fi if test $pac_have_mpi_h = "no" ; then { echo "configure: error: Could not find mpi.h include file" 1>&2; exit 1; } fi if test "X$pac_save_level" != "X" ; then CC="$pac_save_TESTCC" CPP="$pac_save_TESTCPP" fi fi if test "$pac_lib_mpi_is_building" = "no" ; then # Look for MPI_Put and MPI_Alloc_mem # shmalloc is needed for SGI for ac_func in MPI_Put MPI_Get do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:3476: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:3504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done echo $ac_n "checking for MPI_Alloc_mem""... $ac_c" 1>&6 echo "configure:3529: checking for MPI_Alloc_mem" >&5 if eval "test \"`echo '$''{'ac_cv_func_MPI_Alloc_mem'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char MPI_Alloc_mem(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_MPI_Alloc_mem) || defined (__stub___MPI_Alloc_mem) choke me #else MPI_Alloc_mem(); #endif ; return 0; } EOF if { (eval echo configure:3557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_MPI_Alloc_mem=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_MPI_Alloc_mem=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'MPI_Alloc_mem`\" = yes"; then echo "$ac_t""yes" 1>&6 found_alloc=1 else echo "$ac_t""no" 1>&6 found_alloc=0 fi if test "$found_alloc" != 1 -a "$ac_cv_func_MPI_Put" = "yes" ; then echo $ac_n "checking for library containing shmalloc""... $ac_c" 1>&6 echo "configure:3580: checking for library containing shmalloc" >&5 if eval "test \"`echo '$''{'ac_cv_search_shmalloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_shmalloc="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_shmalloc="none required" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* test "$ac_cv_search_shmalloc" = "no" && for i in sma; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_shmalloc="-l$i" break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* done LIBS="$ac_func_search_save_LIBS" fi echo "$ac_t""$ac_cv_search_shmalloc" 1>&6 if test "$ac_cv_search_shmalloc" != "no"; then test "$ac_cv_search_shmalloc" = "none required" || LIBS="$ac_cv_search_shmalloc $LIBS" cat >> confdefs.h <<\EOF #define HAVE_SHMALLOC 1 EOF else : fi fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo "configure:3647: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:3660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$" | grep -v "^conftest.${ac_ext}:\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF if { (eval echo configure:3727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_header_stdc=no fi rm -fr conftest* fi fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 if test $ac_cv_header_stdc = yes; then cat >> confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi for ac_hdr in sys/time.h stdlib.h string.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:3754: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat >conftest.c< int conftest() {return 0;} EOF ac_compile_for_cpp='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' if { (eval echo configure:3765: \"$ac_compile_for_cpp\") 1>&5; (eval $ac_compile_for_cpp) 2>&5; }; then eval "ac_cv_header_$ac_safe=yes" else eval "ac_cv_header_$ac_safe=no" echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 echo "configure:3789: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include int main() { struct tm *tp; ; return 0; } EOF if { (eval echo configure:3803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_time=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_header_time" 1>&6 if test $ac_cv_header_time = yes; then cat >> confdefs.h <<\EOF #define TIME_WITH_SYS_TIME 1 EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 echo "configure:3824: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF if { (eval echo configure:3837: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_struct_tm=sys/time.h fi rm -f conftest* fi echo "$ac_t""$ac_cv_struct_tm" 1>&6 if test $ac_cv_struct_tm = sys/time.h; then cat >> confdefs.h <<\EOF #define TM_IN_SYS_TIME 1 EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 echo "configure:3858: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } ; return 0; } EOF if { (eval echo configure:3912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_c_const" 1>&6 if test $ac_cv_c_const = no; then cat >> confdefs.h <<\EOF #define const EOF fi if test $use_restrict = "yes" ; then echo $ac_n "checking for restrict""... $ac_c" 1>&6 echo "configure:3935: checking for restrict" >&5 if eval "test \"`echo '$''{'pac_cv_c_restrict'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* pac_cv_c_restrict="restrict" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* pac_cv_c_restrict="no" fi rm -f conftest* if test "$pac_cv_c_restrict" = "no" ; then cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* pac_cv_c_restrict="_Restrict" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* pac_cv_c_restrict="no" fi rm -f conftest* fi if test "$pac_cv_c_restrict" = "no" ; then cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* pac_cv_c_restrict="__restrict" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* pac_cv_c_restrict="no" fi rm -f conftest* fi fi echo "$ac_t""$pac_cv_c_restrict" 1>&6 if test "$pac_cv_c_restrict" = "no" ; then restrict_val="" elif test "$pac_cv_c_restrict" != "restrict" ; then restrict_val=$pac_cv_c_restrict fi if test "$restrict_val" != "restrict" ; then cat >> confdefs.h <> confdefs.h <<\EOF #define restrict EOF fi echo $ac_n "checking for long long""... $ac_c" 1>&6 echo "configure:4021: checking for long long" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_long_long="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* have_long_long="no" fi rm -f conftest* echo "$ac_t""$have_long_long" 1>&6 if test $have_long_long = "yes" ; then cat >> confdefs.h <<\EOF #define HAVE_LONG_LONG 1 EOF fi pac_save_level=`expr $pac_save_level - 1` if test "X$pac_save_level" = "X0" ; then CC="$pac_save_CC" CXX="$pac_save_CXX" F77="$pac_save_F77" F90="$pac_save_F90" CPP="$pac_save_CPP" ac_cv_prog_cc_cross="$pac_save_prog_cc_cross" ac_cv_prog_f77_cross="$pac_save_prog_f77_cross" ac_cv_prog_cxx_cross="$pac_save_prog_cxx_cross" pac_cv_prog_f90_cross="$pac_save_prog_f90_cross" pac_save_level="" fi if test "$pac_lib_mpi_is_building" = "yes" ; then # At the very end, make sure we substitute the correct commands CC="$MPICC" if test -n "$MPIF77" ; then # Only replace F77 if MPIF77 is defined F77="$MPIF77" fi fi if test -x makeconfigure ; then AUTOCONF=./makeconfigure ; else AUTOCONF=true fi AUTOHEADER=true if test -x makeconfigure ; then : else AUTOMAKE=true fi ACLOCAL=true trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile mpptestconf.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@PACKAGE@%$PACKAGE%g s%@VERSION@%$VERSION%g s%@ACLOCAL@%$ACLOCAL%g s%@AUTOCONF@%$AUTOCONF%g s%@AUTOMAKE@%$AUTOMAKE%g s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@COPTIONS@%$COPTIONS%g s%@CC@%$CC%g s%@CXX@%$CXX%g s%@F77@%$F77%g s%@F90@%$F90%g s%@MPICC@%$MPICC%g s%@MPIF77@%$MPIF77%g s%@MPIF90@%$MPIF90%g s%@MPICXX@%$MPICXX%g s%@MPIRUN@%$MPIRUN%g s%@MPIBOOT@%$MPIBOOT%g s%@MPIUNBOOT@%$MPIUNBOOT%g s%@FOPTIONS@%$FOPTIONS%g s%@MAKE@%$MAKE%g s%@VPATH@%$VPATH%g s%@SET_CFLAGS@%$SET_CFLAGS%g s%@GRAPHICS_PGM@%$GRAPHICS_PGM%g s%@CPP@%$CPP%g s%@TESTCPP@%$TESTCPP%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac echo creating $ac_file rm -f conftest.frag conftest.in conftest.out ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF s/[\\&%]/\\&/g s%[\\$`]%\\&%g s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp s%ac_d%ac_u%gp s%ac_u%ac_e%gp EOF sed -n -f conftest.hdr confdefs.h > conftest.vals rm -f conftest.hdr # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >> conftest.vals <<\EOF s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail while : do ac_lines=`grep -c . conftest.vals` # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write a limited-size here document to conftest.frag. echo ' cat > conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS echo 'CEOF sed -f conftest.frag conftest.in > conftest.out rm -f conftest.in mv conftest.out conftest.in ' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 perftest-1.3a/configure.in0000664000115300004540000000653107666706431011367 dnl Process this file with autoconf to produce a configure script. AC_INIT(mpptest.c) AC_PREREQ(2.13) dnl needed for SHELL, added in 2.13 AC_CONFIG_AUX_DIR(config) dnl for tools needed for configure AM_INIT_AUTOMAKE(perftest,1.3a) dnl Remove any derived files just in case a VPATH build is used dnl No longer needed - AM_INIT_AUTOMAKE has an alternative test AM_CONFIG_HEADER(mpptestconf.h) AC_SUBST(COPTIONS) PAC_ARG_CC_COMMON AC_ARG_ENABLE(echo, [--enable-echo - Turn on echoing from within the configure script], set -x) AC_ARG_ENABLE(strict,[--enable-strict - Turn on strict debugging with gcc], COPTIONS="$COPTIONS -Wall -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wpointer-arith -Wbad-function-cast -ansi") AC_ARG_ENABLE(restrict, [--enable-restrict - Check for C restrict keyword (or similar)], use_restrict=$enableval,use_restrict="yes") PAC_ARG_CACHING AC_ARG_ENABLE(fortran, [--enable-fortran - Build with Fortran], enable_fortran=$enableval,enable_fortran="yes") # # Turn off the other languages (otherwise tested for in ARG_MPI_TYPES) enable_cxx=no enable_f90=no dnl Handle the case that we are configuring from within an MPICH build PAC_ARG_MPICH_BUILDING dnl Include --with options for various MPI implementations dnl The default is included to make makedist work; plus this IS part of dnl the MPICH release. PAC_ARG_MPI_TYPES(mpich) dnl Checks for programs. if test "$pac_lib_mpi_is_building" != "yes" ; then # Only check these if we aren't building the MPICH libraries PAC_PROG_CC if test "$enable_fortran" = "yes" ; then AC_PROG_F77 fi fi AC_SUBST(FOPTIONS) PAC_PROG_MAKE # Look for graphics programs AC_CHECK_PROGS(GRAPHICS_PGM,cit gnuplot,"none") dnl Push the compiler and use the test versions, if any. PAC_LANG_PUSH_COMPILERS PAC_C_OPTIMIZATION dnl Checks for libraries. AC_SEARCH_LIBS(fabs, m) PAC_LIB_MPI if test "$pac_lib_mpi_is_building" = "no" ; then # Look for MPI_Put and MPI_Alloc_mem # shmalloc is needed for SGI AC_CHECK_FUNCS(MPI_Put MPI_Get) AC_CHECK_FUNC(MPI_Alloc_mem,found_alloc=1,found_alloc=0) if test "$found_alloc" != 1 -a "$ac_cv_func_MPI_Put" = "yes" ; then dnl AC_CHECK_FUNCS(shmalloc) AC_SEARCH_LIBS(shmalloc,sma,AC_DEFINE(HAVE_SHMALLOC)) dnl else dnl AC_DEFINE(HAVE_MPI_ALLOC_MEM) fi fi dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(sys/time.h stdlib.h string.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_HEADER_TIME AC_STRUCT_TM AC_C_CONST if test $use_restrict = "yes" ; then PAC_C_RESTRICT else AC_DEFINE(restrict,) fi AC_MSG_CHECKING([for long long]) AC_TRY_COMPILE(,[long long i;],have_long_long="yes",have_long_long="no") AC_MSG_RESULT($have_long_long) if test $have_long_long = "yes" ; then AC_DEFINE(HAVE_LONG_LONG) fi dnl Checks for library functions. PAC_LANG_POP_COMPILERS if test "$pac_lib_mpi_is_building" = "yes" ; then # At the very end, make sure we substitute the correct commands CC="$MPICC" if test -n "$MPIF77" ; then # Only replace F77 if MPIF77 is defined F77="$MPIF77" fi fi dnl dnl Automake generates bogus rules for rebuilding configure. Fix them dnl up here if test -x makeconfigure ; then AUTOCONF=./makeconfigure ; else AUTOCONF=true fi AUTOHEADER=true if test -x makeconfigure ; then : else AUTOMAKE=true fi ACLOCAL=true dnl AC_OUTPUT(Makefile) perftest-1.3a/mpptestconf.h.in0000664000115300004540000000202107666706142012163 /* mpptestconf.h.in. Generated automatically from configure.in by autoheader. */ /* Define to empty if the keyword does not work. */ #undef const /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define if your declares struct tm. */ #undef TM_IN_SYS_TIME #undef HAVE_SHMALLOC #undef restrict #undef HAVE_LONG_LONG /* Define if you have the MPI_Get function. */ #undef HAVE_MPI_GET /* Define if you have the MPI_Put function. */ #undef HAVE_MPI_PUT /* Define if you have the header file. */ #undef HAVE_STDLIB_H /* Define if you have the header file. */ #undef HAVE_STRING_H /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define if you have the mpi library (-lmpi). */ #undef HAVE_LIBMPI /* Name of package */ #undef PACKAGE /* Version number of package */ #undef VERSION /* if C does not support restrict */ #undef restrict perftest-1.3a/tunepkt.c0000664000115300004540000000537506410037635010706 #include #include "mpi.h" #if HAVE_STDLIB_H || STDC_HEADERS #include #else #ifdef __STDC__ extern void *calloc(/*size_t, size_t*/); extern void free(/*void * */); #else extern char *malloc(); extern int free(); #endif #endif /* This program attempts to tune the message packet size for a given architecture. This program works ONLY with the MPICH implementation, and then only when configured with -var_pkt */ main( argc, argv ) int argc; char **argv; { int len_small, len_large, len_test, rank; double time_small, time_large; extern double RunTest(); MPI_Init( &argc, &argv ); MPI_Comm_rank( MPI_COMM_WORLD, &rank ); len_small = 0; len_large = MPID_SetPktSize( -1 ); if (MPID_SetPktSize( 0 ) != 0) { fprintf( stderr, "This version of MPICH does not allow you to change the small packet length\n"); MPI_Abort( MPI_COMM_WORLD, 1 ); } if (rank == 0) { printf( "Len\tShort\t\tLong\n" ); } while (len_large - len_small > sizeof(long)) { len_test = (len_large + len_small) / 2; MPID_SetPktSize( len_test ); time_small = RunTest( len_test ); MPID_SetPktSize( 0 ); time_large = RunTest( len_test ); if (rank == 0) { printf( "%d\t%f\t%f\n", len_test, time_small, time_large ); fflush( stdout ); } if (time_small < time_large) len_small = len_test; else if (time_small > time_large) len_large = len_test; else break; } if (rank == 0) printf( "A good value of MPID_PKT_DATA_SIZE is %d\n", len_test ); MPI_Finalize( ); return 0; } double RunTest( len ) int len; { extern double RunTestSingle(); double t1, tcur; int cnt = 15; tcur = RunTestSingle( len ); while (cnt--) { t1 = RunTestSingle( len ); if (t1 < tcur) tcur = t1; } return tcur; } double RunTestSingle( len ) int len; { int rank; int cnt, i; double t1; char *rbuffer; char *sbuffer; MPI_Status status; rbuffer = (char *)malloc( len ); sbuffer = (char *)malloc( len ); if (!rbuffer || !sbuffer) { fprintf( stderr, "Could not allocate buffers of length %d\n", len ); MPI_Abort( MPI_COMM_WORLD, 0 ); } MPI_Comm_rank( MPI_COMM_WORLD, &rank ); cnt = 25; if (rank == 0) { MPI_Recv(rbuffer,len,MPI_BYTE,MPI_ANY_SOURCE,0,MPI_COMM_WORLD,&status); t1 = MPI_Wtime(); for(i=0;i #include #define SIZE 1024 /* #define ITERATION 16384/2 */ #define ITERATION 16384/256 int main(argc, argv ) int argc; char * argv[]; { int myid, numprocs, i; MPI_Status last_mpi_status; double total_time; MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD,&numprocs); MPI_Comm_rank(MPI_COMM_WORLD,&myid); total_time = MPI_Wtime(); if (myid == 0) { void *buf; buf=malloc(SIZE); for (i=0;i #include "duff.c" int main(argc,argv) int argc; char **argv; { char *from, *to; int i; int bufsize; float bufsize1; double starttime,time1,time2,time3; MPI_Init(&argc,&argv); if (argc < 2) { printf("Usage: copytest \n"); MPI_Finalize(); return 0; } bufsize = atoi(argv[1]); bufsize1 = bufsize/1000000.0; /* Megabytes */ from = (char *) malloc(bufsize); to = (char *) malloc(bufsize); starttime = MPI_Wtime(); memcpy(to,from,bufsize); time1 = MPI_Wtime() - starttime; starttime = MPI_Wtime(); memcpy(to,from,bufsize); time2 = MPI_Wtime() - starttime; starttime = MPI_Wtime(); memcpy(to,from,bufsize); time3 = MPI_Wtime() - starttime; printf("Times to copy %d bytes (memcpy) : %f %f %f\n", bufsize,time1,time2,time3); printf("Rates for %d bytes (MB/s) : %f %f %f\n", bufsize, bufsize1/time1, bufsize1/time2, bufsize1/time3 ); starttime = MPI_Wtime(); MPIR_memcpy(to,from,bufsize); time1 = MPI_Wtime() - starttime; starttime = MPI_Wtime(); MPIR_memcpy(to,from,bufsize); time2 = MPI_Wtime() - starttime; starttime = MPI_Wtime(); MPIR_memcpy(to,from,bufsize); time3 = MPI_Wtime() - starttime; printf("Times to copy %d bytes (MPIR_memcpy) : %f %f %f\n", bufsize,time1,time2,time3); printf("Rates for %d bytes (MB/s) : %f %f %f\n", bufsize, bufsize1/time1, bufsize1/time2, bufsize1/time3 ); MPI_Finalize(); } perftest-1.3a/duff.c0000664000115300004540000000640407465572065010146 /* This is Duff's device for doing copies with an unrolled loop. This uses a little-known feature of C to handle, with a single loop, both the unrolled code and the boundary case. This is included as a macro so that we can experiment with some variations, including ones that use longer datatypes for loads and stores For best performance, this should be compiled with options to exploit aligned word accesses (for example, use load-double and store-double for 8-byte objects). On a Sun4, this is "-O4 -dalign". On an Rs6000, using xlC, try -O3 */ #define DUFFCOPY8(dest,src,n) \ switch ((n) & 0x7) {\ do {\ case 0: *dest++ = *src++;\ case 7: *dest++ = *src++;\ case 6: *dest++ = *src++;\ case 5: *dest++ = *src++;\ case 4: *dest++ = *src++;\ case 3: *dest++ = *src++;\ case 2: *dest++ = *src++;\ case 1: *dest++ = *src++;\ n -= 8;\ } while (n > 0);\ } #define DUFFCOPY4(dest,src,n) \ switch ((n) & 0x3) {\ do {\ case 0: *dest++ = *src++;\ case 3: *dest++ = *src++;\ case 2: *dest++ = *src++;\ case 1: *dest++ = *src++;\ n -= 4;\ } while (n > 0);\ } /* These type defs need to use configure-determined values for lengths */ #define INT_SIZE_4 #define DOUBLE_SIZE_8 /* 4 byte type */ #ifdef INT_SIZE_4 typedef int MPIR_int32; #elif defined(SHORT_SIZE_4) typedef short MPIR_int32; #else ERROR - no 4 byte type #endif /* 8 byte type */ #if defined(INT_SIZE_8) typedef int MPIR_dbl64; #elif defined(LONG_SIZE_8) typedef long MPIR_dbl64; #elif defined(DOUBLE_SIZE_8) typedef double MPIR_dbl64; #elif defined(FLOAT_SIZE_8) typedef float MPIR_dbl64; #else ERROR - no 8 byte type #endif /* Other typedefs ... typedef long long int MPIR_int128; */ /* Select disjoint pragma if possible */ #ifdef MPI_rs6000 #define HAVE_DISJOINT #endif /* * This is a version of memcpy that tries to use longer loads and stores, * as well as unrolled copy loops. */ MPIR_memcpy( dest, src, n ) void *dest, *src; register int n; { char *d8 = (char *)dest, *s8 = (char *)src; #ifdef HAVE_DISJOINT /* This pragma fails. */ /* #pragma disjoint (*d8,*s8) */ #endif MPI_Aint idest = (MPI_Aint)d8, isrc = (MPI_Aint)s8; /* MPIR_int128 *d128, *s128; */ /* Perform a few tests for data lengths and alignments. Two possibilities: Only handle case where data starts on appropriate alignements Handle all cases (where alignment is conformable) */ switch (n & 0x7) { case 0: /* Eight byte alignment */ if ( (idest & 0x7) == 0 && (isrc & 0x7) == 0 ) { register MPIR_dbl64 *d64, *s64; #ifdef HAVE_DISJOINT #pragma disjoint (*d64,*s64) #endif d64 = (MPIR_dbl64 *)dest; s64 = (MPIR_dbl64 *)src; n >>= 3; DUFFCOPY8( d64, s64, n ); return; } /* Otherwise, fall through and try next alignment */ case 4: /* Four byte alignment */ if ( (idest & 0x3) == 0 && (isrc & 0x3) == 0 ) { register MPIR_int32 *d32, *s32; #ifdef HAVE_DISJOINT #pragma disjoint (*d32,*s32) #endif d32 = (MPIR_int32 *)dest; s32 = (MPIR_int32 *)src; n >>= 2; DUFFCOPY8( d32, s32, n ); return; } /* Otherwise, fall through and try next alignment */ /* Could do 2 byte alignment .... */ default: /* Everything else */ DUFFCOPY8( d8, s8, n ); } } perftest-1.3a/vectest.f0000664000115300004540000000435106704450750010670 program main c include 'mpif.h' parameter (nx=16, ny=16, nz=16) integer sx, sy, sz, ex, ey, ez, sizeof integer newx, newx1, newy, newz integer ierror integer status(MPI_STATUS_SIZE) integer i, size1, size2, size3 double precision a(nx,ny,nz) double precision t1, ttmp c call MPI_Init( ierror ) c sx = 8 ex = 12 sy = 4 ey = 8 sz = 6 ez = 10 c c Example program to move data around a 3-d cube using a single c processor and derived datatypes c c See the book 'Using MPI' for an explanation c c a(sx:ex,sy:ez:k) call mpi_type_vector( ey-sy+1, ex-sx+1, nx, * MPI_DOUBLE_PRECISION, newz, ierror ) call mpi_type_commit( newz, ierror ) size1 = (ey-sy+1) * (ex-sx+1) c c a(sx:ex,j,sz:ez) call mpi_type_vector( ez-sz+1, ex-sx+1, nx*ny, * MPI_DOUBLE_PRECISION, newy, ierror ) call mpi_type_commit( newy, ierror ) size2 = (ez-sz+1) * (ex-sx+1) c c a(i,sy:ey,sz:ez) call mpi_type_vector( ey-sy+1, 1, nx, * MPI_DOUBLE_PRECISION, newx1, ierror ) call mpi_type_extent( MPI_DOUBLE_PRECISION, sizeof, ierror ) call mpi_type_hvector( ez-sz+1, 1, nx*ny*sizeof, * newx1, newx, ierror ) call mpi_type_commit( newx, ierror ) size3 = (ey-sy+1) * (ez-sz+1) c ttmp = MPI_Wtime() do 10 i=1,100 c call mpi_sendrecv( a, 1, newz, 0, 0, a(1,1,4), 1, newz, 0, 0, * MPI_COMM_WORLD, status, ierror ) c call mpi_sendrecv( a, 1, newy, 0, 0, a(1,4,1), 1, newy, 0, 0, * MPI_COMM_WORLD, status, ierror ) c call mpi_sendrecv( a, 1, newx, 0, 0, a(1,1,4), 1, newx, 0, 0, * MPI_COMM_WORLD, status, ierror ) 10 continue t1 = MPI_Wtime() - ttmp print *, 'Time to perform 100 steps = ', t1, ' secs' print *, 'Rate is ', 100 * ( size1 * size2 * size3 ) / t1, * ' dbl/sec' c call mpi_type_free( newx, ierror ) call mpi_type_free( newy, ierror ) call mpi_type_free( newz, ierror ) call mpi_type_free( newx1, ierror ) c call MPI_Finalize( ierror ) end perftest-1.3a/stress.c0000664000115300004540000004113007210032457010520 /* * This code was generated from an older version by an automatic tool; * it still needs to be cleaned up. */ int __NUMNODES, __MYPROCID ; #ifdef HAVE_STDLIB_H #include #endif #include #include #include #include #include #include "getopts.h" #include "mpi.h" extern int __NUMNODES, __MYPROCID; /* Prototypes */ void SetBuffer( unsigned long *, int, int ); void PrintHelp( char ** ); int ErrTest( MPI_Status *status, int partner, int bufsize, unsigned long *buffer, int pattern ); int CheckBuffer( unsigned long *buf, int size, int pattern ); #define STRESS_PRINT_INTERVAL 60 /* This is a simple program to stress the communications performance of a parallel machine. The program tcomm does a more exhaustive test of the individual links. In order to have "safe(0,0)" versions of these for the blocking case, we need to order the sends and receives so that there is always a consumer of messages. */ int EachToAll( int, int ), EachToAllNB( int, int ), AllToAll( int, int ), AllToAllNB( int, int ), AllToAllPhased( int, int ); #define NPATTERNS 12 static unsigned long Patterns[12] = { 0xffffffff, 0xaaaaaaaa, 0x88888888, 0x80808080, 0x80008000, 0x80000000, 0x00000000, 0x55555555, 0x77777777, 0x7f7f7f7f, 0x7fff7fff, 0x7fffffff }; static double bytes_sent; /* Set needs_newline to 1 if flushes without newlines don't work (IBM SP) */ static int needs_newline = 0; typedef enum { Blocking, NonBlocking } Protocol; void BigFlush( FILE *fp, int lastnl ) { if (needs_newline && !lastnl) fputs( "\n", fp ); fflush( fp ); } int main( int argc, char *argv[] ) { int (* f)( int, int ); int size; unsigned long pattern; int first,last,incr, svals[3]; Protocol protocol = Blocking; int toall = 0, isphased = 0; FILE *fp = stdout; int err, curerr; struct timeval endtime, currenttime, nextprint, starttime; char ttime[50]; const char *test_type_msg = 0; int BeVerbose = 0; int Quiet = 0; int loopcount; double bytes_so_far; MPI_Init( &argc, &argv ); MPI_Comm_size( MPI_COMM_WORLD, &__NUMNODES ); MPI_Comm_rank( MPI_COMM_WORLD, &__MYPROCID ); if (SYArgHasName( &argc, argv, 1, "-help" )) { if (__MYPROCID == 0) { PrintHelp( argv ); } MPI_Finalize(); return 0; } if (__NUMNODES < 2) { fprintf( stderr, "Must run stress with at least 2 nodes\n" ); return 1; } f = EachToAll; svals[0] = 32; svals[1] = 1024; svals[2] = 32; SYGetDayTime( &endtime ); SYGetDayTime( ¤ttime ); starttime = currenttime; nextprint = currenttime; if (SYArgHasName( &argc, argv, 1, "-async" )) protocol = NonBlocking; if (SYArgHasName( &argc, argv, 1, "-sync" )) protocol = Blocking; toall = SYArgHasName( &argc, argv, 1, "-all" ); SYArgGetIntVec( &argc, argv, 1, "-size", 3, svals ); isphased = SYArgHasName( &argc, argv, 1, "-phased" ); if (SYArgGetString( &argc, argv, 1, "-ttime", ttime, 50 )) { endtime.tv_sec = SYhhmmtoSec( ttime ) + currenttime.tv_sec; } /* Options for output control */ if (SYArgHasName( &argc, argv, 1, "-needsnewline" )) needs_newline = 1; BeVerbose = SYArgHasName( &argc, argv, 1, "-verbose" ); Quiet = SYArgHasName( &argc, argv, 1, "-quiet" ); /* Determine the test */ f = EachToAll; switch( protocol ) { case NonBlocking: if (toall) { f = AllToAllNB; test_type_msg = "All to All non-blocking\n"; } else { f = EachToAllNB; test_type_msg = "Each to all non-blocking\n"; } break; case Blocking: if (toall) { if (isphased) { f = AllToAllPhased; test_type_msg = "All to All phased\n"; } else { f = AllToAll; test_type_msg = "All to All (requires buffering)\n"; } } else { f = EachToAll; test_type_msg = "Each to All\n"; } break; } first = svals[0]; last = svals[1]; incr = svals[2]; if (__MYPROCID == 0) fputs( test_type_msg, stdout ); /* Disable resource checking */ MPI_Bcast(&endtime.tv_sec, sizeof(int), MPI_BYTE, 0, MPI_COMM_WORLD ); err = 0; loopcount = 0; bytes_sent= 0.0; BigFlush( stdout, 1 ); do { for (pattern=0; pattern<=NPATTERNS; pattern++) { for (size=first; size<=last; size+=incr) { if (__MYPROCID == 0 && !Quiet) { fprintf( fp, "." ); BigFlush( fp, 0 ); } if (__MYPROCID == 0 && BeVerbose) { fprintf( fp, "Running size = %d longs with pattern %lx\n", size, (pattern < NPATTERNS) ? Patterns[pattern] : pattern ); BigFlush( fp, 1 ); } curerr = (*f)( pattern, size ); err += curerr; if (curerr > 0) { fprintf( fp, "[%d] Error running size = %d longs with pattern %lx\n", __MYPROCID, size, (pattern < NPATTERNS) ? Patterns[pattern] : pattern ); BigFlush( fp, 1 ); } } if (__MYPROCID == 0) { if (Quiet) { if (Quiet++ > 70) { fputs( "+\n", fp ); Quiet=1; } else { fputs( "+", fp ); } BigFlush( fp, 1 ); } else { fputs( "+\n", fp ); BigFlush( fp, 1 ); } } } loopcount++; /* Make sure that everyone will do the same test */ MPI_Allreduce(&err, &size, 1, MPI_INT,MPI_SUM,MPI_COMM_WORLD ); err = size; SYGetDayTime( ¤ttime ); MPI_Bcast(¤ttime.tv_sec, sizeof(int), MPI_BYTE, 0, MPI_COMM_WORLD ); MPI_Allreduce(&bytes_sent, &bytes_so_far, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD ); if (__MYPROCID == 0 && nextprint.tv_sec <= currenttime.tv_sec) { char *str, *p; char timebuf[100]; double rate, delta_t; /* Exercise care in case difference in times is zero */ delta_t = 1.0e6 * (currenttime.tv_sec - starttime.tv_sec) + (currenttime.tv_usec - starttime.tv_usec); if (delta_t > 0.0) rate = bytes_so_far / delta_t; else rate = 0.0; nextprint.tv_sec = currenttime.tv_sec + STRESS_PRINT_INTERVAL; str = ctime(¤ttime.tv_sec); /* Copy str into a buffer, deleting the trailing newline */ p = timebuf; while (*str && *str != '\n') *p++ = *str++; *p = 0; fprintf( stdout, "stress runs to %s (%d) [%f MB/s aggregate]\n", timebuf, loopcount, rate ); BigFlush( stdout, 1 ); } } while (err == 0 && currenttime.tv_sec <= endtime.tv_sec ); if (__MYPROCID == 0) { fprintf( stdout, "Stress completed %d tests\n", loopcount ); fprintf( stdout, "%e bytes sent\n", bytes_so_far ); } MPI_Finalize(); return 0; } int EachToAll( int pattern, int size ) { int sender, dest, tag, err=0, bufmsize, bufsize; unsigned long *buffer; MPI_Status status; buffer = (unsigned long *)malloc((unsigned)(size * sizeof(long) )); if (!buffer)return 0;; bufsize = size * sizeof(long); for (sender=0; sender < __NUMNODES; sender++) { tag = sender; if (__MYPROCID == sender) { for (dest=0; dest < __NUMNODES; dest++) { if (sender != dest) { SetBuffer( buffer, size, pattern ); MPI_Send(buffer,bufsize,MPI_BYTE,dest,tag,MPI_COMM_WORLD); bytes_sent += bufsize; } } } else { bufmsize = bufsize; MPI_Recv(buffer,bufmsize,MPI_BYTE,MPI_ANY_SOURCE,tag, MPI_COMM_WORLD,&status); err += ErrTest( &status, sender, bufsize, buffer, pattern ); } } free(buffer ); return err; } /* Each to all nonblocking In sequence, starting from process 0, Process "sender" sends buffer + i*size to process i, except for itself, with tag i All processes, except for "sender", receive a */ int EachToAllNB( int pattern, int size ) { int sender, dest, err=0, bufsize, i; unsigned long *sbuffer, *rbuffer; MPI_Request *sid, *rid; MPI_Status status; int mysize, myrank, recvlen; MPI_Comm_size( MPI_COMM_WORLD, &mysize ); MPI_Comm_rank( MPI_COMM_WORLD, &myrank ); sbuffer = (unsigned long *)malloc((unsigned)(mysize * size * sizeof(long) )); if (!sbuffer)return 0; rbuffer = (unsigned long *)malloc((unsigned)(mysize * size * sizeof(long) )); if (!rbuffer)return 0; sid = (MPI_Request *)malloc((unsigned)(mysize * sizeof(MPI_Request) )); if (!sid)return 0; rid = (MPI_Request *)malloc((unsigned)(mysize * sizeof(MPI_Request) )); if (!rid)return 0; bufsize = size * sizeof(long); /* Send a buffer to everyone */ sid[myrank] = MPI_REQUEST_NULL; for (dest = 0; dest < mysize; dest++) { if (myrank == dest) continue; SetBuffer( sbuffer+dest*size, size, pattern ); MPI_Isend( sbuffer+dest*size, bufsize, MPI_BYTE, dest, myrank, MPI_COMM_WORLD, &sid[dest] ); bytes_sent += bufsize; } /* Receive from everyone */ rid[myrank] = MPI_REQUEST_NULL; for (sender = 0; sender < mysize; sender++) { if (myrank == sender) continue; MPI_Irecv( rbuffer+sender*size, bufsize, MPI_BYTE, sender, sender, MPI_COMM_WORLD, &rid[sender] ); } /* Complete all communication */ /* This should be changed to use an MPI_Waitall */ for (i=0; i= np) return 0; buffer = (unsigned long *)malloc((unsigned)(size * sizeof(long) )); if (!buffer)return 0;; bufsize = size * sizeof(long); for (d=1; d<=np/2; d++) { idx = mytid / d; to = (mytid + d) % np; from = (mytid + np - d) % np; if (idx & 0x1) { bufmsize = bufsize; MPI_Recv(buffer,bufmsize,MPI_BYTE,MPI_ANY_SOURCE,from, MPI_COMM_WORLD,&status); err += ErrTest( &status, from, bufsize, buffer, pattern ); SetBuffer( buffer, size, pattern ); MPI_Send(buffer,bufsize,MPI_BYTE,to,mytid,MPI_COMM_WORLD); bytes_sent += bufsize; MPI_Send(buffer,bufsize,MPI_BYTE,from,mytid,MPI_COMM_WORLD); bytes_sent += bufsize; bufmsize = bufsize; MPI_Recv(buffer,bufmsize,MPI_BYTE,MPI_ANY_SOURCE,to, MPI_COMM_WORLD,&status); err += ErrTest( &status, to, bufsize, buffer, pattern ); } else { SetBuffer( buffer, size, pattern ); MPI_Send(buffer,bufsize,MPI_BYTE,to,mytid,MPI_COMM_WORLD); bytes_sent += bufsize; bufmsize = bufsize; MPI_Recv(buffer,bufmsize,MPI_BYTE,MPI_ANY_SOURCE,from, MPI_COMM_WORLD,&status); err += ErrTest( &status, from, bufsize, buffer, pattern ); bufmsize = bufsize; MPI_Recv(buffer,bufmsize,MPI_BYTE,MPI_ANY_SOURCE,to, MPI_COMM_WORLD,&status); err += ErrTest( &status, to, bufsize, buffer, pattern ); SetBuffer( buffer, size, pattern ); MPI_Send(buffer,bufsize,MPI_BYTE,from,mytid,MPI_COMM_WORLD); bytes_sent += bufsize; } } free(buffer ); return err; } /*--------------------------------------------------------------------------- These routines set and check the buffers by inserting the specified pattern and checking it. --------------------------------------------------------------------------- */ void SetBuffer( unsigned long *buf, int size, int pattern ) { unsigned long val; int i; if (pattern < NPATTERNS) { val = Patterns[pattern]; for (i=0; iMPI_SOURCE; MPI_Get_count( status, MPI_BYTE, &actsize ); if (from != partner) { fprintf( stderr, "Message from %d should be from %d\n", from, partner ); err++; } if (actsize != bufsize) { fprintf( stderr, "Message from %d is wrong size (%d != %d)\n", partner, actsize, bufsize ); err++; } if (CheckBuffer( buffer, (int)(actsize / sizeof(long)), pattern )) { fprintf( stderr, "Message from %d is corrupt\n", partner ); err++; } return err; } void PrintHelp( char *argv[] ) { fprintf( stderr, "%s - stress test communication\n", argv[0] ); fprintf( stderr, "[-sync | -async [-size start end stride]\n\ Stress communication links by various methods. The tests are \n\ combinations of\n\ Protocol: \n\ -sync Blocking sends/receives (default)\n\ -async NonBlocking sends/receives\n\ -all AllToAll instead of EachToAll (requires significant buffering\n\ and should only be used with -async)\n\ -phased Use ordered sends/receives for systems will little buffering\n\ \n" ); fprintf( stderr, " Message sizes:\n\ -size start end stride (default 0 1024 32)\n\ Messages of length (start + i*stride) for i=0,1,... until\n\ the length is greater than end.\n\ \n\ Number of tests\n\ -ttime hh:mm Total time to run test (for AT LEAST this long)\n\ (use 0:01 for 1 minute)\n\ \n" ); fprintf( stderr, "\ Output control\n\ -needsnewline Output a new line after each output (needed for systems\n\ that do not flush output written to stdout)\n\ -verbose Describe test for each pattern\n\ -quiet Turn off most output\n" ); fprintf( stderr, "\ -help This information\n" ); fprintf( stderr, "\ %s should be run with an even number of processes; use all available\n\ processes for the most extensive testing\n", argv[0] ? argv[0] : "stress" ); } perftest-1.3a/daytime.c0000664000115300004540000000050107465572001010634 #include #include #include /*I I*/ long SYhhmmtoSec( s ) char *s; { struct tm TM; sscanf( s, "%d:%d", &TM.tm_hour, &TM.tm_min ); return 60 * (TM.tm_min + 60 * TM.tm_hour); } void SYGetDayTime( tp ) struct timeval *tp; { gettimeofday( tp, (struct timezone *)0 ); } perftest-1.3a/getopts.c0000664000115300004540000001472307135121456010676 /* This file contains routines for processoing options of the form -name . In order to simplify processing by other handlers, the routines eliminate the values from the argument string by compressing it. This is an old file, and is included to simplify the use of the test programs */ #include "mpptestconf.h" #ifdef HAVE_STDLIB_H #include #else extern double atof(const char *); #endif #include "getopts.h" #include #include /*@C SYArgSqueeze - Remove all null arguments from an arg vector; update the number of arguments. @*/ void SYArgSqueeze( int *Argc, char **argv ) { int argc, i, j; /* Compress out the eliminated args */ argc = *Argc; j = 0; i = 0; while (j < argc) { while (argv[j] == 0 && j < argc) j++; if (j < argc) argv[i++] = argv[j++]; } /* Back off the last value if it is null */ if (!argv[i-1]) i--; *Argc = i; } /*@C SYArgFindName - Find a name in an argument list. Input Parameters: + argc - number of arguments . argv - argument vector - name - name to find Returns: index in argv of name; -1 if name is not in argv @*/ int SYArgFindName( int argc, char **argv, char *name ) { int i; for (i=0; i= *Argc) { fprintf(stderr,"Error: %s\n","Missing value for argument" ); return 0; } p = argv[idx+1]; /* Check for hexidecimal value */ if (((int)strlen(p) > 1) && p[0] == '0' && p[1] == 'x') { sscanf( p, "%i", val ); } else { if ((int)strlen(p) > 1 && p[0] == '-' && p[1] >= 'A' && p[1] <= 'z') { fprintf(stderr,"Error: %s\n","Missing value for argument" ); return 0; } *val = atoi( p ); } if (rflag) { argv[idx] = 0; argv[idx+1] = 0; SYArgSqueeze( Argc, argv ); } return 1; } /*@C SYArgGetDouble - Get the value (double) of a named parameter. Input Parameters: + Argc - pointer to argument count . argv - argument vector . rflag - if true, remove the argument and its value from argv - val - pointer to value (will be set only if found) Returns: 1 on success @*/ int SYArgGetDouble( int *Argc, char **argv, int rflag, char *name, double *val ) { int idx; idx = SYArgFindName( *Argc, argv, name ); if (idx < 0) return 0; if (idx + 1 >= *Argc) { fprintf(stderr,"Error: %s\n","Missing value for argument" ); return 0; } *val = atof( argv[idx+1] ); if (rflag) { argv[idx] = 0; argv[idx+1] = 0; SYArgSqueeze( Argc, argv ); } return 1; } /*@C SYArgGetString - Get the value (string) of a named parameter. Input Parameters: + Argc - pointer to argument count . argv - argument vector . rflag - if true, remove the argument and its value from argv . val - pointer to buffer to hold value (will be set only if found). - vallen- length of val Returns: 1 on success @*/ int SYArgGetString( int *Argc, char **argv, int rflag, char *name, char *val, int vallen ) { int idx; idx = SYArgFindName( *Argc, argv, name ); if (idx < 0) return 0; if (idx + 1 >= *Argc) { fprintf(stderr,"Error: %s\n","Missing value for argument" ); return 0; } strncpy( val, argv[idx+1], vallen ); if (rflag) { argv[idx] = 0; argv[idx+1] = 0; SYArgSqueeze( Argc, argv ); } return 1; } /*@C SYArgHasName - Return 1 if name is in argument list Input Parameters: + Argc - pointer to argument count . argv - argument vector . rflag - if true, remove the argument and its value from argv - name - name to search for Returns: 1 on success @*/ int SYArgHasName( int *Argc, char **argv, int rflag, char *name ) { int idx; idx = SYArgFindName( *Argc, argv, name ); if (idx < 0) return 0; if (rflag) { argv[idx] = 0; SYArgSqueeze( Argc, argv ); } return 1; } /*@C SYArgGetIntVec - Get the value (integers) of a named parameter. Input Parameters: + Argc - pointer to argument count . argv - argument vector . rflag - if true, remove the argument and its value from argv . n - number of values to read - val - pointer to value (will be set only if found) Note: The form of input is "-name n1 n2 n3 ..." Returns: 1 on success @*/ int SYArgGetIntVec( int *Argc, char **argv, int rflag, char *name, int n, int *val ) { int idx, i; idx = SYArgFindName( *Argc, argv, name ); if (idx < 0) return 0; /* Fail if there aren't enough values */ if (idx + n + 1 > *Argc) { fprintf(stderr,"Error: %s\n","Not enough values for vector of integers"); return 0; } for (i=0; i *Argc) { fprintf(stderr,"Error: %s\n","Not enough values for vector of integers"); return 0; } p = argv[idx + 1]; i = 0; while (i + 1 < n && p && *p) { /* Find next comma or end of value */ pcomma = strchr( p, ',' ); if (pcomma) { pcomma[0] = 0; pcomma++; } val[i++] = atoi( p ); p = pcomma; } if (rflag) { argv[idx] = 0; argv[idx+1] = 0; SYArgSqueeze( Argc, argv ); } return i; } perftest-1.3a/ctest.c0000664000115300004540000000500007465572001010321 /* This file shows why you can't use simple timers to time latency in a single call. It does this by measuring the variation in the results of the timer call used in the Dongarra so-called benchmark. */ #include "mpi.h" #include #include #define MAX_TIMES 16386 static double times[MAX_TIMES]; int main( argc, argv ) int argc; char **argv; { int i; int ntest = MAX_TIMES; double minsep, maxsep, avesep, sep, sd, deltasep, mult; int citoutput = 1, nmatch; MPI_Init( &argc, &argv ); /* Warm up */ for (i=0; i maxsep) maxsep = sep; avesep += sep; } avesep /= (ntest-1); /* Compute standard deviation of separations in a relatively stable way */ sd = 0.0; for (i=1; i minsep && sep < deltasep) deltasep = sep; } deltasep -= minsep; /* Now, find out how many separations are multiples of deltasep */ nmatch = 0; for (i=1; i ntest/4) { printf( "#Apparent resolution of clock is: %6.2f usec\n", deltasep * 1.0e6 ); } printf( "# This program should be run multiple times for better understanding\n" ); /* Print C.It graphics stuff if requested */ if (citoutput) { for (i=1; i #include #include /* Tag values */ #define YOUR_TURN 1 #define RATE_VAL 2 #define DATA_VAL 3 #define TIME_VAL 4 #define NAME_VAL 5 /* Run times and tolerances */ #define GOAL_SEC 0.5 #define TOLERANCE 0.3 #define MSG_LEN 65536 double GetRate(); void FindClusters(); int main( argc, argv ) int argc; char **argv; { int world_rank, size; int i, j; double rate; MPI_Status status; double *ratematrix; char myname[MPI_MAX_PROCESSOR_NAME]; char **sysnames; int resultlen; MPI_Init( &argc, &argv ); MPI_Comm_rank( MPI_COMM_WORLD, &world_rank ); MPI_Comm_size( MPI_COMM_WORLD, &size ); /* Gather the data. Rank 0 tells everyone what to do, then interacts with everyone last. */ if (world_rank == 0) { ratematrix = (double *)malloc( size * size * sizeof(double) ); if (!ratematrix) { fprintf( stderr, "Can not allocate rate matrix for %d procs\n", size ); MPI_Abort( MPI_COMM_WORLD, 1 ); } /* Get the names of all of the systems */ sysnames = (char **)malloc( size * sizeof(char *) ); if (!sysnames) { fprintf( stderr, "Can not allocate name matrix for %d procs\n", size ); MPI_Abort( MPI_COMM_WORLD, 1 ); } sysnames[0] = myname; MPI_Get_processor_name( myname, &resultlen ); for (i=1; i world_rank) { MPI_Send( &rate, 1, MPI_DOUBLE, 0, RATE_VAL, MPI_COMM_WORLD ); } } while (j != 0); } /* Produce the final report */ if (world_rank == 0) { FindClusters( ratematrix, size, sysnames ); free( ratematrix ); for (i=1; i 0.0) { cnt = GOAL_SEC/t; if (cnt <= 0) cnt = 1; break; } cnt *= 2; } while(1); /* Do the test several times, and take the max value */ rtest = 10000000; for (testnum = 0; testnum < 5; testnum++) { MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, DATA_VAL, MPI_BOTTOM, 0, MPI_INT, partner, DATA_VAL, comm, &status ); tstart = MPI_Wtime(); for (i=0; i 0.0) rtest = t; } if (t > 0) { rate = cnt * 2 * len * sizeof(int) / t; } free( sbuf ); free( rbuf ); return rate; } /* */ void FindClusters( ratematrix, size, sysnames ) double *ratematrix; int size; char **sysnames; { int i, j, k; int *members, nclusters = 0; int *thiscluster, clustersize; int fastloc; double *internal_rate, /* LOWEST rate to members accepted */ *external_rate; /* HIGHEST rate to rejected member */ double i_rate, x_rate; /* Temps for getting these values */ double rtest; /* Use for temp rate value */ double maxrate; /* Initial cluster membership */ members = (int *)malloc( size * sizeof(int ) ); thiscluster = (int *)malloc( size * sizeof(int ) ); internal_rate = (double *)malloc( size * sizeof(double) ); external_rate = (double *)malloc( size * sizeof(double) ); for (i=0; i= 0) continue; for (j=0; j= 0 || i == j) continue; if (ratematrix[i+j*size] > maxrate) { maxrate = ratematrix[i+j*size]; fastloc = j; } } } if (maxrate == 0) break; /* Find all systems not yet in a cluster that have the same rate to all members of this cluster */ clustersize = 0; members[fastloc] = nclusters; thiscluster[clustersize++] = fastloc; for (i=0; i= 0) { /* Should we look at x_rate? */ continue; } for (j=0; j x_rate) x_rate = rtest; } } i_rate = maxrate; for (i=0; i #include #ifdef HAVE_STDLIB_H #include #endif /* #define DEBUG */ /* Forward references */ void OrderNbrs( int, int * ), TokenTestSync( int, double *, int, int, int ), TokenTestASync( int, double *, int, int, int ), GenerateReport( int *, int, double *, double, int, int, int *, int ), DrawHistogram( double *, int, int, FILE *, double, double, int ); #ifdef DRAW void DrawDanceHall(), DrawMesh(), DrawGRHistogram(); #endif double RemoveOutliers( double *, int, double, double, double, double ); int *CollectData( int, int *, int * ); void Error( const char * ); void SYIsort( register int, register int * ); #define MAX_NBRS 1024 #ifdef DRAW static GRctx *gctx = 0; #endif int main( int argc, char *argv[] ) { double *times; int nnbrs, nbrs[MAX_NBRS], mtype, badnbrs[MAX_NBRS]; int len, reps, nbr, sval[3], ctype, myid; double rtol; int k, do_graph = 0, nx = 0, ndim[2]; int mysize; MPI_Init( &argc, &argv ); MPI_Comm_rank( MPI_COMM_WORLD, &myid ); MPI_Comm_size( MPI_COMM_WORLD, &mysize ); /* Get test parameters */ if (SYArgHasName( &argc, argv, 1, "-help" )) { if (myid == 0) { fprintf( stderr, "%s -size len max incr", argv[0] ); fprintf( stderr, "\ -rtol -reps -async -force\n\ -nx n\n\ -mesh nx ny Use 2d mesh topology\n\ -all Use complete connection topology\n" ); #ifdef DRAW fprintf( stderr, "\ -graph Draw graph of communication test\n" ); #endif } MPI_Finalize(); return 0; } rtol = 0.05; reps = 100; ctype = 0; sval[0] = 64; sval[1] = 64; sval[2] = 64; SYArgGetDouble( &argc, argv, 1, "-rtol", &rtol ); SYArgGetInt( &argc, argv, 1, "-reps", &reps ); SYArgGetIntVec( &argc, argv, 1, "-size", 3, sval ); if (SYArgHasName( &argc, argv, 1, "-async" )) ctype = 1; SYArgGetInt( &argc, argv, 1, "-nx", &nx ); #ifdef DRAW do_graph = SYArgHasName( &argc, argv, 1, "-graph" ); if (do_graph && PImytid == 0) { /* Use "-grfname name" for output graphics file */ gctx = GRCreateFromArgsNoX( &argc, argv ); } #endif /* Get the neighbors */ if (SYArgHasName( &argc, argv, 1, "-all" )) { nnbrs = 0; for (k=0; k myid) ? myid : nbrs[nbr]; switch (ctype) { case 0: TokenTestSync( nbrs[nbr], times + nbr, mtype, len, reps ); break; case 1: TokenTestASync( nbrs[nbr], times + nbr, mtype, len, reps ); break; default: Error( "Unknown ctype" ); break; } } /* Generate report */ GenerateReport( nbrs, nnbrs, times, rtol, len, reps, badnbrs, do_graph ); #ifdef DRAW if (do_graph) { if (nx == 0) DrawDanceHall( gctx, nbrs, nnbrs, times, rtol, badnbrs ); else DrawMesh( gctx, nbrs, nnbrs, times, rtol, badnbrs, nx ); } #endif } free( times ); /* This won't work for batch jobs (like EUI-H...) */ #ifdef DRAW if (do_graph && myid == 0) { GRClose( gctx ); } #endif MPI_Finalize(); return 0; } /* To get the timing right, the low processor sends to the high processor to start the test, then the timing starts */ void TokenTestSync( int nbr, double *time, int phase, int len, int reps ) { int myid, i; double t1, t2; char *sbuf, *rbuf; MPI_Status status; MPI_Comm_rank( MPI_COMM_WORLD, &myid ); rbuf = (char *)malloc( len ); if (!rbuf) Error("malloc failed"); sbuf = (char *)malloc( len ); if (!sbuf) Error("malloc failed"); #ifdef DEBUG printf( "[%d] exchanging with %d in phase %d\n", myid, nbr, phase ); fflush(stdout); #endif if (myid < nbr) { MPI_Send( sbuf, 0, MPI_BYTE, nbr, phase, MPI_COMM_WORLD ); MPI_Recv( rbuf, len, MPI_BYTE, nbr, phase, MPI_COMM_WORLD, &status ); t1 = MPI_Wtime(); for (i=0; i average, - if < average) */ void GenerateReport( int *nbrs, int nnbrs, double *times, double rtol, int len, int reps, int *badnbrs, int do_graph ) { int i, nlinks, j; int cnt = 0; double rlow, rhigh; double mintime, maxtime, avetime, wtime; char phy_name[MPI_MAX_PROCESSOR_NAME]; int namelen; int nslow = 0; /* This is a simple list of the 5 slowest links */ BadList slowest[5]; int kk, jj; int myid, mysize; MPI_Comm_rank( MPI_COMM_WORLD, &myid ); MPI_Comm_size( MPI_COMM_WORLD, &mysize ); /* Get some information on the global times. We are assuming that all neighbors should have the same speed of links */ maxtime = times[0]; mintime = times[0]; avetime = times[0]; for (i=1; i maxtime) maxtime = times[i]; else if (times[i] < mintime) mintime = times[i]; } wtime = maxtime; MPI_Allreduce( &wtime, &maxtime, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD ); wtime = mintime; MPI_Allreduce( &wtime, &mintime, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD ); wtime = avetime; MPI_Allreduce( &wtime, &avetime, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD ); MPI_Allreduce( &nnbrs, &nlinks, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD ); avetime /= nlinks; for (i=0; i= rtol * avetime) { /* Compute a new average */ avetime = RemoveOutliers( times, nnbrs, mintime, maxtime, 2*rtol, avetime ); /* Somebody is bad */ rlow = avetime * (1.0 - rtol); rhigh = avetime * (1.0 + rtol); if (myid == 0) { printf( "%cNode[ PhysNode ] Nbr Time AverageTime %%Diff\n", do_graph ? '#' : ' ' ); fflush( stdout ); } /* This begins a sequential section; all processes execute in rank order */ /* MPE_Seq_begin( MPI_COMM_WORLD, 1 );*/ if (myid > 0) { MPI_Status status; MPI_Recv( MPI_BOTTOM, 0, MPI_BYTE, myid-1, 57, MPI_COMM_WORLD, &status ); } j = myid; /* If we could pass a data-value with the token, we could pass the error count along. If we were the first one, we could issue an error message. */ for (i = 0; i < nnbrs; i++) { if (times[i] < rlow || times[i] > rhigh) { cnt ++; printf( "%c%4d[%12.12s] %3d %12.2e %12.2e %12.2e\n", do_graph ? '#' : ' ', j, phy_name, nbrs[i], times[i], avetime, 100.0*(times[i] - avetime)/avetime ); fflush( stdout ); badnbrs[i] = (times[i] < rlow) ? -1 : 1; } /* Update the list of slowest links */ if (nslow < 5) { /* See if we should insert it into the middle ... */ for (kk=0; kkkk; jj--) slowest[jj] = slowest[jj-1]; slowest[kk].id = j; slowest[kk].partner = nbrs[i]; slowest[kk].time = times[i]; break; } } if (kk == nslow) { slowest[kk].id = j; slowest[kk].partner = nbrs[i]; slowest[kk].time = times[i]; } nslow++; } else if (times[i] > slowest[nslow-1].time) { for (kk=0; kkkk; jj--) slowest[jj] = slowest[jj-1]; slowest[kk].id = j; slowest[kk].partner = nbrs[i]; slowest[kk].time = times[i]; break; } } } } } /* MPE_Seq_end( MPI_COMM_WORLD, 1 ); */ if (myid < mysize - 1) { MPI_Send( MPI_BOTTOM, 0, MPI_BYTE, myid+1, 57, MPI_COMM_WORLD ); } i = cnt; MPI_Allreduce( &i, &cnt, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD ); if (myid == 0) { if (do_graph) printf( "#" ); if (cnt == 0) printf( "All links within range\n" ); else printf( "%d links are out-of-range\n", cnt ); if (do_graph) printf( "#" ); printf( "For message size = %d, Average rate = %.0f bytes/sec\n", len, 2.0 * (double)(len * reps) / avetime ); } if (cnt) { int nbin = 40; while (nbin > nlinks * 2) nbin /= 2; if (myid == 0) { printf( "\n%cHistogram by time on each link\n", do_graph ? '#' : ' ' ); printf( "%c(Number of links in each bin by time)\n", do_graph ? '#' : ' ' ); } DrawHistogram( times, nnbrs, nbin, stdout, mintime, maxtime, do_graph ); #ifdef DRAW if (do_graph) DrawGRHistogram( gctx, times, nnbrs, mintime, maxtime ); #endif } /* Data for a plot of processors versus time would also be interesting, perhaps to an auxillery file */ /* Also useful to do a short list of the physical nodes involved in the SLOWEST links, the help assimilate the information */ #ifdef FOO /* still need to get the top 5 over the machine... */ for (j=0; j<=PInumtids; j++) { if (PIgtoken(PSAllProcs,j)) { for (kk=0; kk= 0 && ((myid & mask) ^ (nbrs[i] & mask)) && myid > nbrs[i]) { /* Masters */ newnbrs[cnt++] = nbrs[i]; nbrs[i] = -1; } } for (i=0; i= 0 && ((myid & mask) ^ (nbrs[i] & mask))) { /* Slaves */ newnbrs[cnt++] = nbrs[i]; nbrs[i] = -1; } } mask <<= 1; } memcpy( nbrs, newnbrs, nnbrs*sizeof(int) ); free(newnbrs); } /* Draw a histogram on FILE fp using (double) data and nbin bins The values in data are bined between dmin and dmax */ void DrawHistogram( double *data, int n, int nbin, FILE *fp, double dmin, double dmax, int do_graph ) { char *line; int *bins, *work; int i, j, ib; int maxcnt; int myid; MPI_Comm_rank( MPI_COMM_WORLD, &myid ); bins = (int *)malloc( nbin * 2 * sizeof(int) ); work = bins + nbin; line = (char *)malloc( nbin + 3 ); if (!bins || !line) Error( "malloc failed" ); for (i=0; i maxcnt) maxcnt = bins[i]; } line[0] = '|'; line[nbin+1] = '|'; line[nbin+2] = 0; for (j=maxcnt; j>0; j--) { for (i=0; i rtol * newave) { /* Keep track of the largest deviation */ if (maxdev == -1 || fabs( times[i] - newave ) > curdev) { maxdev = i; curdev = fabs( times[i] - newave ); } } if (fabs( times[i] - newave ) < rtol * newave ) { cnt++; sum += times[i]; } } MPI_Allreduce( &curdev, &glodev, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD ); if (maxdev >= 0 && curdev >= 0.95 * glodev) { #ifdef DEBUG printf( "Discarding outlier (%d)\n", myid ); fflush( stdout ); #endif discard[maxdev] = 1; } /* compute a new average */ sum2 = 0.0; cnt2 = 0; for (i=0; i 0) newave = sum2 / cnt2; /* printf( "New average is %f\n", newave ); */ work = sum; MPI_Allreduce( &work, &sum, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD ); i = cnt; MPI_Allreduce( &i, &cnt, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD ); if (glodev == 0.0) { /* We didn't find anyone to remove, so we'll expand the limits */ /* If cnt is STILL 0, EVERYTHING was an outlier, so we prepare to try again with twice the tolerance */ rtol *= 2.0; } } free( discard ); return sum / cnt; } /* The following code (not yet written) is a first attempt to help generate graphical output for the output from this routine. The idea is If the topology is known and has limited connectivity (i.e., mesh), then draw it. For this, we need to know our location in the mesh. If the topology is not known or is highly connected, generate one of two plots: for each node, a separate plot of all connections a "dance hall" diagram. The graphs should draw in-range lines as dotted and out-of-range lines as solids Note that since the data is distributed, these are parallel routines. */ #ifdef DRAW /* type == 0 for in range, 1 otherwise */ void DrawConnection( gctx, fromx, fromy, tox, toy, type ) GRctx *gctx; int fromx, fromy, tox, toy, type; { GRStyle style; if (type == 0) { style.line_style = GRSOLID; style.color = GRBLACK; } else if (type < 0) { style.line_style = GRDOTS; style.color = GRGREEN; } else { style.line_style = GRDASH; style.color = GRRED; } GRDrawLine( gctx, (double)fromx, (double)fromy, (double)tox, (double)toy, &style ); } void DrawNode( gctx, xc, yc, num ) GRctx *gctx; int xc, yc, num; { char snum[5]; GRStyle style; style.line_style = GRSOLID; style.color = GRBLACK; GRDrawRectangle( gctx, (double) (xc - 2), (double) (xc + 2), (double) (yc - 2), (double) (yc + 2), &style ); sprintf( snum, "%d", num ); GRDrawText( gctx, (double)xc, (double)yc, snum, 10, GRCENTER ); } /* Draw a dance-hall diagram (all processors on bottom and top) This uses a single program (the root) to draw, avoiding problems with multiple writers and connections */ void DrawDanceHall( gctx, nbrs, nnbrs, times, rtol, badnbrs ) GRctx *gctx; int *nbrs, nnbrs, *badnbrs; double *times, rtol; { int i, j, k, *icol; if (PImytid == 0) { GRStartPage( gctx ); GRSetLimits( gctx, -3.0, (double)(PInumtids * 5), -1.0, 15.0 ); GRDrawAxis( gctx, 0 ); } /* The approach is for each node to wait until node 0 tells them to go ahead, then they send a single record of the form nnbrs(to,link)*; To speed the collection, PIgcol is used */ /* Draw the nodes */ if (PImytid == 0) { for (i=0; i ito) DrawConnection( gctx, ito*5+2, jto*5 - 1, ifrom*5-2, jfrom*5 - 1, icol[2*k+3] ); else DrawConnection( gctx, ifrom*5+2, jfrom*5 + 1, ito*5-2, jto*5 + 1, icol[2*k+3] ); } else if (jfrom < jto) DrawConnection( gctx, ifrom*5+1, jfrom*5 + 2, ito*5+1, jto*5 - 2, icol[2*k+3] ); else DrawConnection( gctx, ito*5 - 1, jto*5 + 2, ifrom*5 - 1, jfrom*5 - 2, icol[2*k+3] ); } icol += icol[0] * 2 + 2; } } } void DrawOneToAll( ) { Error( "Draw one to all not implemented" ); } #endif int *CollectData( int nnbrs, int *nbrs, int *badnbrs ) { int *icol, *lcol, k, nlinks, iwork, glen, *gcol, *displs; int mysize, myid; MPI_Comm_size( MPI_COMM_WORLD, &mysize ); MPI_Comm_rank( MPI_COMM_WORLD, &myid ); /* Get the number of links */ MPI_Allreduce( &nnbrs, &nlinks, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD ); /* Allocate storage */ icol = (int *)malloc( mysize * sizeof(int) ); lcol = (int *)malloc( (nnbrs * 2 + 2) * sizeof(int) ); gcol = (int *)malloc( (nlinks * 2 + 2 * mysize) * sizeof(int) ); displs = (int *)malloc( mysize * sizeof(int) ); if (!icol || !lcol || !gcol || !displs) Error( "malloc failed" ); lcol[0] = nnbrs; lcol[1] = myid; for (k=0; k 0) { for (i=0; i<=PInumtids; i++) { if (PIgtoken( procset, i )) { PIbsend( 11, data, n * sizeof(double), 0, MSG_DBL ); } } } else { gdata = (double *)MALLOC( nnbrs * sizeof(double) ); off = 0; for (i=0; i<=PInumtids; i++) { PIgtoken( procset, i ); if (i > 0 && i < PInumtids) { PIbrecv( 11, gdata+off, (nnbrs-off) * sizeof(double), MSG_DBL ); off += PIsize() / sizeof(double); } else if (i == 0) { for (j=0; j i[j]) { SWAP(i[k],i[j],tmp); ik = i[k]; } } } } else SYiIqsort(i,n-1); } /* A simple version of quicksort; taken from Kernighan and Ritchie, page 87. Assumes 0 origin for v, number of elements = right+1 (right is index of right-most member). */ void SYiIqsort( register int *v, register int right) { int tmp; register int i, vl, last; if (right <= 1) { if (right == 1) { if (v[0] > v[1]) SWAP(v[0],v[1],tmp); } return; } SWAP(v[0],v[right/2],tmp); vl = v[0]; last = 0; for ( i=1; i<=right; i++ ) { if (v[i] < vl ) {last++; SWAP(v[last],v[i],tmp);} } SWAP(v[0],v[last],tmp); SYiIqsort(v,last-1); SYiIqsort(v+last+1,right-(last+1)); } perftest-1.3a/mpe_seq.c0000664000115300004540000000555707465572065010663 #include "mpi.h" #include "mpptest.h" #include #ifdef HAVE_STDLIB_H #include #else extern void *malloc(); #endif static int MPE_Seq_keyval = MPI_KEYVAL_INVALID; /* MPE_Seq_begin - Begins a sequential section of code. Input Parameters: + comm - Communicator to sequentialize. - ng - Number in group. This many processes are allowed to execute at the same time. Usually one. Notes: MPE_Seq_begin and MPE_Seq_end provide a way to force a section of code to be executed by the processes in rank order. Typically, this is done with $ MPE_Seq_begin( comm, 1 ); $ $ MPE_Seq_end( comm, 1 ); $ Often, the sequential code contains output statements (e.g., printf) to be executed. Note that you may need to flush the I/O buffers before calling MPE_Seq_end; also note that some systems do not propagate I/O in any order to the controling terminal (in other words, even if you flush the output, you may not get the data in the order that you want). */ void MPE_Seq_begin( MPI_Comm comm, int ng ) { int lidx, np; int flag; MPI_Comm local_comm; MPI_Status status; /* Get the private communicator for the sequential operations */ if (MPE_Seq_keyval == MPI_KEYVAL_INVALID) { MPI_Keyval_create( MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN, &MPE_Seq_keyval, NULL ); } MPI_Attr_get( comm, MPE_Seq_keyval, (void *)&local_comm, &flag ); if (!flag) { /* This expects a communicator to be a pointer */ MPI_Comm_dup( comm, &local_comm ); MPI_Attr_put( comm, MPE_Seq_keyval, (void *)local_comm ); } MPI_Comm_rank( comm, &lidx ); MPI_Comm_size( comm, &np ); if (lidx != 0) { MPI_Recv( NULL, 0, MPI_INT, lidx-1, 0, local_comm, &status ); } /* Send to the next process in the group unless we are the last process in the processor set */ if ( (lidx % ng) < ng - 1 && lidx != np - 1) { MPI_Send( NULL, 0, MPI_INT, lidx + 1, 0, local_comm ); } } /*@ MPE_Seq_end - Ends a sequential section of code. Input Parameters: + comm - Communicator to sequentialize. - ng - Number in group. This many processes are allowed to execute at the same time. Usually one. Notes: See MPE_Seq_begin for more details. @*/ void MPE_Seq_end( MPI_Comm comm, int ng ) { int lidx, np, flag; MPI_Status status; MPI_Comm local_comm; MPI_Comm_rank( comm, &lidx ); MPI_Comm_size( comm, &np ); MPI_Attr_get( comm, MPE_Seq_keyval, (void *)&local_comm, &flag ); if (!flag) MPI_Abort( comm, MPI_ERR_UNKNOWN ); /* Send to the first process in the next group OR to the first process in the processor set */ if ( (lidx % ng) == ng - 1 || lidx == np - 1) { MPI_Send( NULL, 0, MPI_INT, (lidx + 1) % np, 0, local_comm ); } if (lidx == 0) { MPI_Recv( NULL, 0, MPI_INT, np-1, 0, local_comm, &status ); } } perftest-1.3a/mpptest.c0000664000115300004540000010007607666705720010715 /*D mpptest - Measure the communications performance of a message-passing system Details: The greatest challange in performing these experiments in making the results reproducible. On many (most?) systems, there are various events that perturb timings; these can occur on the scale of 10's of milliseconds. To attempt to remove the effect of these events, we make multiple tests, taking the minimum of many tests, each of which gives an average time. To reduce the effect of transient perturbations, the entire sequence of tests is run several times, taking the best (fastest) time on each test. Finally, a post-processing step retests any anomolies, defined as single peaks peaks that are significantly greater than the surrounding times (using a locally linear-fit model). D*/ /* This code is a major re-write of an older version that was generated automatically from an older Chameleon program. Previous versions worked with a wide variety of message-passing systems. */ #include #include #ifndef HUGE_VAL #define HUGE_VAL 10.0e38 #endif #include "mpi.h" #include "mpptest.h" #include "getopts.h" int __NUMNODES, __MYPROCID; #if HAVE_STDLIB_H #include #endif #ifndef DEFAULT_AVG #define DEFAULT_AVG 50 #endif #include /* Forward declarations */ void PrintHelp( char *[] ); /* This is a simple program to test the communications performance of a parallel machine. */ /* If doinfo is 0, don't write out the various text lines */ static int doinfo = 1; /* Scaling of time and rate */ static double TimeScale = 1.0; static double RateScale = 1.0; /* The maximum of the MPI_Wtick values for all processes */ static double gwtick; /* This is the number of times to run a test, taking as time the minimum achieve timing. (NOT CURRENTLY IMPLEMENTED) This uses an adaptive approach that also stops when minThreshTest values are within a few percent of the current minimum n_avg - number of iterations used to average the time for a test n_rep - number of repititions of a test, used to sample test average to avoid transient effects */ static int minreps = 30; /* n_stable is the number of tests that must not (significantly, see repsThresh) change the results before mpptest will decide that no further tests are required */ static int n_stable; static double repsThresh = 0.05; /* n_smooth is the number of passes over the data that will be taken to smooth out any anomolies, defined as times that deviate significantly from a linear progression */ static int n_smooth = 5; char protocol_name[256]; /* We would also like to adaptively modify the number of repetitions to meet a time estimate (later, we'd like to meet a statistical estimate). One relatively easy way to do this is to use a linear estimate (either extrapolation or interpolation) based on 2 other computations. That is, if the goal time is T and the measured tuples (time,reps,len) are, the formula for the local time is s + r n, where r = (time2/reps2 - time1/reps1) / (len2 - len1) s = time1/reps1 - r * len1 Then the appropriate number of repititions to use is Tgoal / (s + r * len) = reps */ static double Tgoal = 1.0; /* If less than Tgoalmin is spent, increase the number of tests to average */ static double TgoalMin = 0.5; static int autoavg = 0; /* This structure allows a collection of arbitray sizes to be specified */ #define MAX_SIZE_LIST 256 static int sizelist[MAX_SIZE_LIST]; static int nsizes = 0; /* We wish to control the TOTAL amount of time that the test takes. We could do this with gettimeofday or clock or something, but fortunately the MPI timer is an elapsed timer */ static double max_run_time = 15.0*60.0; static double start_time = 0.0; /* All test data is contained in an array of values. Because we may adaptively choose the message lengths, provision is made to maintain the list elements in an array, and for many processing tasks (output, smoothing) only the list version is used. */ /* These are used to contain results for a single test */ typedef struct _TwinResults { double t, /* min of the observations (per loop) */ max_time, /* max of the observations (per loop) */ sum_time; /* sum of all of the observations */ int len; /* length of the message for this test */ int ntests; /* number of observations */ int n_avg; /* number of times to run a test to get average time */ int new_min_found; /* true if a new minimum was found */ int n_loop; /* number of times the timing loop was run and accepted */ struct _TwinResults *next, *prev; } TwinResults; TwinResults *AllocResultsArray( int ); void FreeResults( TwinResults * ); void SetResultsForStrided( int first, int last, int incr, TwinResults *twin ); void SetResultsForList( int sizelist[], int nsizes, TwinResults *twin ); void SetRepsForList( TwinResults *, int ); int RunTest( TwinResults *, double (*)(int,int,void *), void *, double ); int RunTestList( TwinResults *, double (*)(int,int,void*), void* ); int SmoothList( TwinResults *, double (*)(int,int,void *), void * ); int RefineTestList( TwinResults *, double (*)(int,int,void *),void *, int, double ); void OutputTestList( TwinResults *, void *, int, int, int ); double LinearTimeEst( TwinResults *, double ); double LinearTimeEstBase( TwinResults *, TwinResults *, TwinResults*, double ); TwinResults *InsertElm( TwinResults *, TwinResults * ); /* Initialize the results array of a given list of data */ /* This structure is used to provice information for the automatic message-length routines */ typedef struct { double (*f)( int, int, void * ); int reps, proc1, proc2; void *msgctx; /* Here is where we should put "recent" timing data used to estimate the values of reps */ double t1, t2; int len1, len2; } TwinTest; int main( int argc, char *argv[] ) { int dist; double (* BasicCommTest)( int, int, void * ) = 0; void *MsgCtx = 0; /* This is the context of the message-passing operation */ void *outctx; void (*ChangeDist)( int, PairData ) = 0; int n_avg, proc1, proc2, distance_flag, distance; int first,last,incr, svals[3]; int autosize = 0, autodx=0; /* Set autodx and autorel to default values to placate some compilers */ double autorel=0.0; double wtick; char units[32]; /* Name of units of length */ MPI_Init( &argc, &argv ); MPI_Comm_size( MPI_COMM_WORLD, &__NUMNODES ); MPI_Comm_rank( MPI_COMM_WORLD, &__MYPROCID ); /* Get the maximum clock grain */ wtick = MPI_Wtick(); MPI_Allreduce( &wtick, &gwtick, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD ); /* Set the default test name and labels */ strcpy( protocol_name, "blocking" ); strcpy( units, "(bytes)" ); if (SYArgHasName( &argc, argv, 1, "-help" )) { if (__MYPROCID == 0) PrintHelp( argv ); MPI_Finalize(); return 0; } if (__NUMNODES < 2 && !SYArgHasName( &argc, argv, 0, "-memcpy" )) { fprintf( stderr, "Must run mpptest with at least 2 nodes\n" ); MPI_Finalize(); return 1; } /* Get the output context */ outctx = SetupGraph( &argc, argv ); if (SYArgHasName( &argc, argv, 1, "-noinfo" )) doinfo = 0; /* Proc1 *must* be 0 because of the way other data is collected */ proc1 = 0; proc2 = __NUMNODES-1; distance_flag = 0; if (SYArgHasName( &argc, argv, 0, "-logscale" )) { svals[0] = sizeof(int); svals[1] = 131072; /* 128k */ svals[2] = 32; } else { svals[0] = 0; svals[1] = 1024; svals[2] = 32; } if (SYArgHasName( &argc, argv, 1, "-distance" )) distance_flag++; SYArgGetIntVec( &argc, argv, 1, "-size", 3, svals ); nsizes = SYArgGetIntList( &argc, argv, 1, "-sizelist", MAX_SIZE_LIST, sizelist ); if (SYArgHasName( &argc, argv, 1, "-logscale" )) { /* Use the sizelist field to specify a collection of power of two sizes. This is a temporary hack until we have something better. You can use the -size argument to set min and max values (the stride is ignored) */ int k; nsizes = 0; if (svals[0] == 0) { sizelist[nsizes++] = 0; k = 4; } else { k = svals[0]; } while( k <= svals[1] && nsizes < MAX_SIZE_LIST ) { sizelist[nsizes++] = k; k *= 2; } /* Need to tell graphics package to use log/log scale */ DataScale( outctx, 1 ); } /* Get the number of tests to average over */ n_avg = DEFAULT_AVG; if (SYArgHasName( &argc, argv, 1, "-autoavg" )) { autoavg = 1; n_avg = 5; /* Set a new default. This can be overridden */ } SYArgGetInt( &argc, argv, 1, "-n_avg", &n_avg ); /* was -reps */ if (SYArgGetDouble( &argc, argv, 1, "-tgoal", &Tgoal )) { if (TgoalMin > 0.1 * Tgoal) TgoalMin = 0.1 * Tgoal; } SYArgGetDouble( &argc, argv, 1, "-rthresh", &repsThresh ); SYArgGetInt( &argc, argv, 1, "-sample_reps", &minreps ); n_stable = minreps; SYArgGetInt( &argc, argv, 1, "-n_stable", &n_stable ); SYArgGetDouble( &argc, argv, 1, "-max_run_time", &max_run_time ); if (SYArgHasName( &argc, argv, 1, "-quick" ) || SYArgHasName( &argc, argv, 1, "-fast" )) { /* This is a short cut for -autoavg -n_stable 5 */ autoavg = 1; n_avg = 5; n_stable = 5; } autosize = SYArgHasName( &argc, argv, 1, "-auto" ); if (autosize) { autodx = 4; SYArgGetInt( &argc, argv, 1, "-autodx", &autodx ); autorel = 0.02; SYArgGetDouble( &argc, argv, 1, "-autorel", &autorel ); } /* Pick the general test based on the presence of an -gop, -overlap, -bisect or no arg */ SetPattern( &argc, argv ); if (SYArgHasName( &argc, argv, 1, "-gop")) { /* we need to fix this cast eventually */ BasicCommTest = (double (*)(int,int,void*)) GetGOPFunction( &argc, argv, protocol_name, units ); MsgCtx = GOPInit( &argc, argv ); } else if (SYArgHasName( &argc, argv, 1, "-halo" )) { int local_partners, max_partners; BasicCommTest = GetHaloFunction( &argc, argv, &MsgCtx, protocol_name ); TimeScale = 1.0; /* Halo time, not half round trip */ local_partners = GetHaloPartners( MsgCtx ); MPI_Allreduce( &local_partners, &max_partners, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD ); RateScale = (double) max_partners; /* Since each sends len data */ /* I.e., gives total rate per byte */ } else if (SYArgHasName( &argc, argv, 1, "-bisect" )) { BasicCommTest = GetPairFunction( &argc, argv, protocol_name ); dist = 1; SYArgGetInt( &argc, argv, 1, "-bisectdist", &dist ); MsgCtx = BisectInit( dist ); ChangeDist = BisectChange; strcat( protocol_name, "-bisect" ); if (SYArgHasName( &argc, argv, 1, "-debug" )) PrintPairInfo( MsgCtx ); TimeScale = 0.5; RateScale = (double) __NUMNODES; /* * (2 * 0.5) */ } else if (SYArgHasName( &argc, argv, 1, "-overlap" )) { int MsgSize; char cbuf[32]; if (SYArgHasName( &argc, argv, 1, "-sync" )) { BasicCommTest = round_trip_b_overlap; strcpy( protocol_name, "blocking" ); } else { /* Assume -async */ BasicCommTest = round_trip_nb_overlap; strcpy( protocol_name, "nonblocking" ); } MsgSize = 0; SYArgGetInt( &argc, argv, 1, "-overlapmsgsize", &MsgSize ); MsgCtx = OverlapInit( proc1, proc2, MsgSize ); /* Compute floating point lengths if requested */ if (SYArgHasName( &argc, argv, 1, "-overlapauto")) { OverlapSizes( MsgSize >= 0 ? MsgSize : 0, svals, MsgCtx ); } strcat( protocol_name, "-overlap" ); if (MsgSize >= 0) { sprintf( cbuf, "-%d bytes", MsgSize ); } else { strcpy( cbuf, "-no msgs" ); } strcat( protocol_name, cbuf ); TimeScale = 0.5; RateScale = 2.0; } else if (SYArgHasName( &argc, argv, 1, "-memcpy" )) { int use_vector = 0; MsgCtx = 0; ChangeDist = 0; TimeScale = 1.0; RateScale = 1.0; use_vector = SYArgHasName( &argc, argv, 1, "-vector" ); /* memcpy_rate_int, memcpy_rate_double */ if (SYArgHasName( &argc, argv, 1, "-int" )) { if (use_vector) { } else { BasicCommTest = memcpy_rate_int; strcpy( protocol_name, "memcpy-int" ); } } else if (SYArgHasName( &argc, argv, 1, "-double" )) { if (use_vector) { BasicCommTest = memcpy_rate_double_vector; strcpy( protocol_name, "memcpy-double-vector" ); } else { BasicCommTest = memcpy_rate_double; strcpy( protocol_name, "memcpy-double" ); } } #ifdef HAVE_LONG_LONG else if (SYArgHasName( &argc, argv, 1, "-longlong" )) { if (use_vector) { BasicCommTest = memcpy_rate_long_long_vector; strcpy( protocol_name, "memcpy-longlong-vector" ); } else { BasicCommTest = memcpy_rate_long_long; strcpy( protocol_name, "memcpy-longlong" ); } } #endif else { BasicCommTest = memcpy_rate; strcpy( protocol_name, "memcpy" ); } } else { /* Pair by default */ BasicCommTest = GetPairFunction( &argc, argv, protocol_name ); MsgCtx = PairInit( proc1, proc2 ); ChangeDist = PairChange; if (SYArgHasName( &argc, argv, 1, "-debug" )) PrintPairInfo( MsgCtx ); TimeScale = 0.5; RateScale = 2.0; } first = svals[0]; last = svals[1]; incr = svals[2]; if (incr == 0) incr = 1; /* Finally, we are ready to run the tests. We want to report times as the times for a single link, and rates as the aggregate rate. To do this, we need to know how to scale both the times and the rates. Times: scaled by the number of one-way trips measured by the base testing code. This is often 2 trips, or a scaling of 1/2. Rates: scaled by the number of simultaneous participants (as well as the scaling in times). Compute the rates based on the updated time, then multiply by the number of participants. Note that, for a single sender, time and rate are inversely proportional (that is, if TimeScale is 0.5, RateScale is 2.0). */ start_time = MPI_Wtime(); /* If the distance flag is set, we look at a range of distances. Otherwise, we just use the first and last processor */ if (doinfo && __MYPROCID == 0) { HeaderGraph( outctx, protocol_name, (char *)0, units ); } if(distance_flag) { for(distance=1;distance last, just as you'd expect) . proc1,proc2 - processors to participate in communication. Note that all processors must call because we use global operations to manage some operations, and we want to avoid using process-subset operations (supported in Chameleon) to simplify porting this code . CommTest - Routine to call to run a basic test. This routine returns the time that the test took in seconds. . outctx - Pointer to output context . autosize - If true, the actual sizes are picked automatically. That is instead of using first, first + incr, ... , the routine choses values of len such that first <= len <= last and other properties, given by autodx and autorel, are satisfied. . autodx - Parameter for TST1dauto, used to set minimum distance between test sizes. 4 (for 4 bytes) is good for small values of last . autorel - Relative error tolerance used by TST1dauto in determining the message sizes used. . msgctx - Context to pass through to operation routine */ void time_function( int n_avg, int first, int last, int incr, int proc1, int proc2, double (*CommTest)(int,int,void*), void *outctx, int autosize, int autodx, double autorel, void *msgctx) { int distance, myproc; int n_without_change; /* Number of times through the list without changes */ myproc = __MYPROCID; distance = ((proc1)<(proc2)?(proc2)-(proc1):(proc1)-(proc2)); /* Run test, using either the simple direct test or the automatic length test */ if (autosize) { TwinResults *twin; int k; twin = AllocResultsArray( 1024 ); SetResultsForStrided( first, last, (last-first)/8, twin ); /* Run tests */ SetRepsForList( twin, n_avg ); for (k=0; k n_stable) { #ifdef DEBUG_AUTO printf( "Breaking because stable results reached\n" ); #endif break; } } for (k=1; kn_avg, twin_p->len, msgctx ); /* t is the time over all (n_avg tests) */ /* Make sure that everyone has the same time value so that they'll make the same decisions. */ MPI_Bcast( &t, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD ); CheckTimeLimit(); #ifdef DEBUG_AUTO printf( "test(%d) for %d iterations took %f time\n", twin_p->len, twin_p->n_avg, t ); #endif /* Accept times only if they are much longer than the clock resolution */ if (t > 100*wtick) { twin_p->n_loop++; twin_p->sum_time += t; twin_p->ntests += twin_p->n_avg; /* Now, convert t to a per-loop time */ t = t / twin_p->n_avg; if (t < twin_p->t) { twin_p->t = t; /* This could set only when t < (1-repsThresh) (previous value) */ twin_p->new_min_found = 1; } else twin_p->new_min_found = 0; if (t > twin_p->max_time) twin_p->max_time = t; return 1; } return 0; } /* For each message length in the list, run the experiement CommTest. Return the number of records that were updated */ int RunTestList( TwinResults *twin_p, double (*CommTest)(int,int,void *), void *msgctx ) { int n_trials; /* Used to bound the number of retries when total time is too small relative to gwtick */ int n_updated = 0; /* Number of fields that were updated with a new minimum */ while (twin_p) { n_trials = 0; while (n_trials++ < 10 && !RunTest( twin_p, CommTest, msgctx, gwtick )) { /* This run failed to pass the test on wtick (time too short). Update the #n_avg and try again Special needs: must ensure that all processes are informed */ twin_p->n_avg *= 2; } if (twin_p->new_min_found) n_updated++; twin_p = twin_p->next; } #ifdef DEBUG_AUTO printf( "Found %d new minimums\n", n_updated ); #endif return n_updated; } /* This estimates the time at twin_p using a linear interpolation from the surrounding entries */ double LinearTimeEst( TwinResults *twin_p, double min_dx ) { return LinearTimeEstBase( twin_p->prev, twin_p, twin_p->next, min_dx ); } double LinearTimeEstBase( TwinResults *prev, TwinResults *cur, TwinResults *next, double min_dx ) { double t_prev, t_next, t_est, dn_prev, dn_next; /* Look at adjacent times */ if (prev) { t_prev = prev->t; dn_prev = cur->len - prev->len; } else { t_prev = cur->t; dn_prev = min_dx; } if (next) { t_next = next->t; dn_next = next->len - cur->len; } else { t_next = cur->t; dn_next = min_dx; } /* Compute linear estimate, adjusting for the possibly unequal interval sizes, at twin_p->len. */ t_est = t_prev + (dn_prev/(dn_next + dn_prev))*(t_next-t_prev); return t_est; } /* Add an entry to the list half way (in length) betwen prev and next */ TwinResults *InsertElm( TwinResults *prev, TwinResults *next ) { TwinResults *tnew; tnew = twin_avail; twin_avail = twin_avail->next; if (!twin_avail) { /* Now we have a problem. I'm going to generate an error message and exit */ fprintf( stderr, "Exhausted memory for results while refining test interval\n\ Rerun with a smaller interval or without the -auto option\n" ); fflush( stderr ); MPI_Abort( MPI_COMM_WORLD, 1 ); } twin_avail->prev = 0; tnew->next = next; tnew->prev = prev; prev->next = tnew; next->prev = tnew; tnew->len = (prev->len + next->len) / 2; tnew->n_avg = next->n_avg; tnew->t = HUGE_VAL; #ifdef DEBUG_AUTO printf( "%d running test with n_avg=%d, len=%d\n", __MYPROCID, tnew->n_avg, (int)tnew->len );fflush(stdout); #endif return tnew; } /* This is a breadth-first refinement approach. Each call to this routine adds one level of refinement. */ int RefineTestList( TwinResults *twin, double (*CommTest)(int,int,void*), void *msgctx, int min_dx, double autorel ) { double t_offset, t_center; double abstol = 1.0e-10; int do_refine, n_refined = 0; int n_loop, k; TwinResults *twin_p = twin, *tprev, *tnext; /* There is a dummy empty entry at the end of the list */ if (!twin_avail->next) return 0; if (min_dx < 1) min_dx = 1; /* We find the next pointer and set the current and previous from that to ensure that we only look at values that were already computed, not the newly inserted values */ tprev = 0; n_loop = 0; while (twin_p && twin_avail) { if (twin_p->n_loop > n_loop) n_loop = twin_p->n_loop; tnext = twin_p->next; /* Compute error estimate, adjusting for the possibly unequal interval sizes. t_center is the linear interpolation at tnew_p->len, t_offset is the difference with the computed value */ t_center = LinearTimeEstBase( tprev, twin_p, tnext, min_dx ); t_offset = fabs(twin_p->t - t_center); do_refine = t_offset > (autorel * t_center + abstol); MPI_Bcast( &do_refine, 1, MPI_INT, 0, MPI_COMM_WORLD ); if (do_refine) { #ifdef DEBUG_AUTO printf( "Refining at %d because predicted time %f far from %f\n", twin_p->len, t_center, twin_p->t ); #endif /* update the list by refining both segments */ if (twin_p->prev && twin_avail && min_dx < twin_p->len - twin_p->prev->len) { (void)InsertElm( twin_p->prev, twin_p ); n_refined ++; } if (twin_p->next && twin_avail && min_dx < twin_p->next->len - twin_p->len) { (void)InsertElm( twin_p, twin_p->next ); n_refined ++; } } tprev = twin_p; twin_p = tnext; } MPI_Bcast( &n_refined, 1, MPI_INT, 0, MPI_COMM_WORLD ); MPI_Bcast( &n_loop, 1, MPI_INT, 0, MPI_COMM_WORLD ); /* Now, catch up the inserted elements with the rest of the results */ for (k=0; kn_loop < n_loop) { int n_trials = 0; while (n_trials++ < 5 && !RunTest( twin_p, CommTest, msgctx, gwtick )) { twin_p->n_avg *= 2; } } twin_p = twin_p->next; } } return n_refined; } /* Initialize the number of tests to run over which the average time is computed. */ void SetRepsForList( TwinResults *twin_p, int n_avg ) { while (twin_p) { twin_p->n_avg = n_avg; twin_p = twin_p->next; } } /* Smooth the entries in the list by looking for anomolous results and rerunning those tests */ int SmoothList( TwinResults *twin, double (*CommTest)(int,int,void*), void *msgctx ) { double t_est; int do_test; TwinResults *twin_p = twin; int n_smoothed = 0; while (twin_p) { /* Look at adjacent times */ if (__MYPROCID == 0) { t_est = LinearTimeEst( twin_p, 4.0 ); do_test = (twin_p->t > 1.1 * t_est); } MPI_Bcast( &do_test, 1, MPI_INT, 0, MPI_COMM_WORLD ); if (do_test) { n_smoothed += RunTest( twin_p, CommTest, msgctx, gwtick ); } twin_p = twin_p->next; } MPI_Bcast( &n_smoothed, 1, MPI_INT, 0, MPI_COMM_WORLD ); return n_smoothed; } /* Output the results using the chosen graphics output package */ void OutputTestList( TwinResults *twin, void *outctx, int proc1, int proc2, int distance ) { TwinResults *twin_p = twin; double rate; while (twin_p) { if (twin_p->n_loop < 1 || twin_p->ntests < 1) { /* Skip any tests that we could not successfully run */ twin_p = twin_p->next; continue; } /* Compute final quantities */ if (twin_p->t > 0) rate = ((double)twin_p->len) / twin_p->t; else rate = 0.0; DataoutGraph( outctx, proc1, proc2, distance, (int)twin_p->len, twin_p->t * TimeScale, twin_p->t * TimeScale, rate * RateScale, twin_p->sum_time / twin_p->ntests * TimeScale, twin_p->max_time * TimeScale ); twin_p = twin_p->next; } } void CheckTimeLimit( void ) { /* Check for max time exceeded */ if (__MYPROCID == 0 && MPI_Wtime() - start_time > max_run_time) { fprintf( stderr, "Exceeded %f seconds, aborting\n", max_run_time ); MPI_Abort( MPI_COMM_WORLD, 1 ); } } perftest-1.3a/gopf.c0000664000115300004540000003410607666706043010153 #include #include "mpi.h" #include "mpptest.h" #include "getopts.h" #if HAVE_STDLIB_H #include #endif #include /***************************************************************************** Each collection of test routines contains: Initialization function (returns pointer to context to pass back to test functions Routine to return test function (and set parameters) based on command-line arguments Routine to output "help" text *****************************************************************************/ /* Forward ref prototypes */ void *malloc_check(size_t sz); double measure_latency(int reps, int root_proc, int proc, int my_pid); double measure_oper_latency_in_bcast(int len, int reps, int root_proc, int proc, int my_pid); /***************************************************************************** Here are the test functions for the collective (global) operations This is designed to allow testing of both "native" (vendor-supplied) and Chameleon collective operations. Note that Chameleon supports subsets of processes, which most vendor (non-MPI) systems do not. *****************************************************************************/ /* Allocate another item to ensure that nitem of 0 works */ #define GETMEM(type,nitem,p) {\ p = (type *)malloc((unsigned)((nitem+1) * sizeof(type) )) ;\ if (!p)return 0;;} #define SETMEM(nitem,p) {int _i; for (_i=0; _ipset = MPI_COMM_WORLD; new->src = 0; if (SYArgGetString( argc, argv, 1, "-pset", psetname, 50 )) { int range[3]; MPI_Group group, world_group; sscanf( psetname, "%d-%d", &range[0], &range[1] ); range[2] = 1; MPI_Comm_group( MPI_COMM_WORLD, &world_group ); MPI_Group_range_incl( world_group, 1, &range, &group ); MPI_Group_free( &world_group ); MPI_Comm_create( MPI_COMM_WORLD, group, &new->pset ); MPI_Group_free( &group ); } return new; } typedef enum { GDOUBLE, GFLOAT, GINT, GCHAR } GDatatype; typedef enum { GOPSUM, GOPMIN, GOPMAX, GOPSYNC, GOPBCAST, GOPBCASTALT, GOPCOL, GOPCOLX } GOperation; double TestGDSum( int, int, GOPctx * ), TestGISum( int, int, GOPctx * ), TestGCol( int, int, GOPctx * ), TestGColx( int, int, GOPctx * ), TestGScat( int, int, GOPctx * ), TestGScatAlt( int, int, GOPctx * ), TestGSync( int, int, GOPctx * ); double TestGDSumGlob( int, int, GOPctx * ), TestGISumGlob( int, int, GOPctx * ), TestGColGlob( int, int, GOPctx * ), TestGColxGlob( int, int, GOPctx * ), TestGScatGlob( int, int, GOPctx * ), TestGSyncGlob( int, int, GOPctx * ); /* Determine the function from the arguments */ double ((*GetGOPFunction( int *argc, char *argv[], char *test_name, char *units )) (int,int,void*)) { GOperation op = GOPSYNC; GDatatype dtype = GDOUBLE; double (*f)(int,int,GOPctx *); /* Default choice */ strcpy( test_name, "sync" ); /* Get information on the actual problem to run */ /* Choose the operations */ if (SYArgHasName( argc, argv, 1, "-dsum" )) { op = GOPSUM; dtype = GDOUBLE; strcpy( test_name, "dsum" ); strcpy( units, "(doubles)" ); } if (SYArgHasName( argc, argv, 1, "-isum" )) { op = GOPSUM; dtype = GINT; strcpy( test_name, "isum" ); strcpy( units, "(ints)" ); } if (SYArgHasName( argc, argv, 1, "-sync" )) { op = GOPSYNC; strcpy( test_name, "sync" ); } if (SYArgHasName( argc, argv, 1, "-scatter" ) || SYArgHasName( argc, argv, 1, "-bcast" )) { op = GOPBCAST; dtype = GINT; strcpy( test_name, "scatter" ); strcpy( units, "(ints)" ); } if (SYArgHasName( argc, argv, 1, "-bcastalt" )) { op = GOPBCASTALT; dtype = GINT; strcpy( test_name, "Bcast (alternate)" ); strcpy( units, "(ints)" ); } if (SYArgHasName( argc, argv, 1, "-col" )) { op = GOPCOL; dtype = GINT; strcpy( test_name, "col" ); strcpy( units, "(ints)" ); } if (SYArgHasName( argc, argv, 1, "-colx" )) { op = GOPCOLX; dtype = GINT; strcpy( test_name, "colx" ); strcpy( units, "(ints)" ); } if (SYArgHasName( argc, argv, 1, "-colxex" )) { op = GOPCOLX; dtype = GINT; strcpy( test_name, "colxex" ); strcpy( units, "(ints)" ); } /* Convert operation and dtype to routine */ f = 0; switch (op) { case GOPSUM: switch (dtype) { case GDOUBLE: f = TestGDSum; break; case GINT: f = TestGISum; break; default: break; } break; case GOPMIN: case GOPMAX: f = 0; break; case GOPCOL: f = TestGCol; break; case GOPCOLX: f = TestGColx; break; case GOPBCAST: f = TestGScat; break; case GOPBCASTALT: f = TestGScatAlt; break; case GOPSYNC: f = TestGSync; break; } return (double (*)(int,int,void *)) f; } void PrintGOPHelp( void ) { fprintf( stderr, "\nCollective Tests:\n" ); fprintf( stderr, "-dsum : reduction (double precision)\n" ); fprintf( stderr, "-isum : reduction (integer)\n" ); fprintf( stderr, "-sync : synchronization (MPI_Barrier)\n" ); fprintf( stderr, "-colx : collect with known sizes\n" ); fprintf( stderr, "-colxex : collect with known sizes with exchange alg.\n" ); fprintf( stderr, "-scatter : scatter\n" ); fprintf( stderr, "-bcast : another name for -scatter\n" ); fprintf( stderr, "-bcastalt : -bcast with a different measurement approach\n" ); /* NOT YET IMPLEMENTED fprintf( stderr, "\nCollective test control:\n" ); fprintf( stderr, "-pset n-m : processor set consisting of nodes n to m" ); */ } /***************************************************************************** Here are the actual routines *****************************************************************************/ /* First are the Chameleon versions */ double TestGDSum( int reps, int len, GOPctx *ctx ) { int i; double *lval, *work, time; double t0, t1; GETMEM(double,len,lval); GETMEM(double,len,work); SETMEM(len,lval); SETMEM(len,work); MPI_Allreduce(lval, work, len, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD ); MPI_Barrier(MPI_COMM_WORLD ); t0=MPI_Wtime(); for (i=0; i= comm_size) root = 0; } t1=MPI_Wtime(); MPI_Barrier(MPI_COMM_WORLD ); time = t1-t0; MPI_Bcast(&time, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD ); free(lval ); return time; } double TestGColx( reps, len, ctx ) int reps, len; GOPctx *ctx; { fprintf( stderr, "gcolx not supported\n" ); MPI_Abort( MPI_COMM_WORLD, 1 ); return -1.0; } double TestGCol( reps, len, ctx ) int reps, len; GOPctx *ctx; { fprintf( stderr, "gcol not supported\n" ); MPI_Abort( MPI_COMM_WORLD, 1 ); return -1.0; } double TestGSync( int reps, int len, GOPctx *ctx ) { int i; double time; double t0, t1; MPI_Barrier(MPI_COMM_WORLD ); t0=MPI_Wtime(); for (i=0; isrc == proc ) continue; /* step 1: for each process, measure empty-message 1-way * latency between root and process_i (root_latency array) */ if ( first_time ) root_latency[proc] = measure_latency(reps, ctx->src, proc, my_pid); /* step 2: for each process, designating each one as ACKer one * at a time, measure the operation latency (oper_lat array) * OL_i of broadcast as ACKer */ oper_lat[proc] = measure_oper_latency_in_bcast(len, reps, ctx->src, proc, my_pid); this_time = oper_lat[proc] - root_latency[proc] / 2.; if ( time < this_time ) time = this_time; } free(oper_lat); free(lower_bound); /* "root_latency" can never be freed from memory... */ MPI_Bcast(&time, 1, MPI_DOUBLE, ctx->src, MPI_COMM_WORLD); return time; } perftest-1.3a/grph.c0000664000115300004540000004614007666706104010157 #include #include "mpi.h" extern int __NUMNODES, __MYPROCID; #include "mpptest.h" #include "getopts.h" #if HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif /* This file contains routines to generate output from the mpptest programs */ /* In order to simplify the generation of graphs of multiple data sets, we want to allow the generated cit code to contain the necessary window selection commands. To do this, we add arguments for -wx i n windows in x, my # and total # -wy i n windows in y, my # and total # -lastwindow generate the wait/new page. */ typedef enum { GRF_X, GRF_EPS, GRF_PS, GRF_GIF } OutputForm; struct _GraphData { FILE *fp, *fpdata; char *fname2; void (*header)( GraphData, char *, char *, char *); void (*dataout)( GraphData, int, int, int, int, double, double, double, double, double ); void (*draw)( GraphData, int, int, double, double ); void (*endpage)( GraphData ); /* For collective operations */ void (*headergop)( GraphData, char *, char *, char * ); void (*dataoutgop)( GraphData, int, double, double, double, double, double ); void (*drawgop)( GraphData, int, int, double, double, int, int *); void (*endgraph)( GraphData ); /* Information about the graph */ int wxi, wxn, wyi, wyn, is_lastwindow; int givedy; int do_rate; int do_fit; int is_log; char *title; OutputForm output_type; }; /* Forward refs */ void HeaderCIt( GraphData ctx, char *protocol_name, char *title_string, char *units ); void HeaderForGopCIt( GraphData ctx, char *test_name, char *title_string, char *units ); void DrawCIt( GraphData ctx, int first, int last, double s, double r ); void DrawGopCIt( GraphData ctx, int first, int last, double s, double r, int nsizes, int *sizelist ); void EndPageCIt( GraphData ctx ); void HeaderGnuplot( GraphData ctx, char *protocol_name, char *title_string, char *units ); void HeaderForGopGnuplot( GraphData ctx, char *protocol_name, char *title_string, char *units ); void DrawGnuplot( GraphData ctx, int first, int last, double s, double r ); void DrawGopGnuplot( GraphData ctx, int first, int last, double s, double r, int nsizes, int *sizelist ); void EndPageGnuplot( GraphData ctx ); void ChangeToRate( GraphData, int ); void EndGraphCIt( GraphData ); void EndGraphGnuplot( GraphData ); void PrintGraphHelp( void ) { fprintf( stderr, "\n\ Output\n\ -cit Generate data for CIt (default)\n\ -gnuplot Generate data for GNUPLOT\n\ -gnuploteps Generate data for GNUPLOT in Encapsulated Postscript\n\ -gnuplotps Generate data for GNUPLOT in Postscript\n\ -givedy Give the range of data measurements\n\ -rate Generate rate instead of time\n\ -fname filename (default is stdout)\n\ (opened for append, not truncated)\n\ -noinfo Do not generate plotter command lines or rate estimate\n\ -wx i n windows in x, my # and total #\n\ -wy i n windows in y, my # and total #\n\ -title string Use string as the title instead of the default title\n\ -lastwindow generate the wait/new page (always for 1 window)\n" ); } void HeaderCIt( GraphData ctx, char *protocol_name, char *title_string, char *units ) { char archname[20], hostname[256], date[30], *p; int dummy; if (!ctx) return; fprintf( ctx->fp, "set default\nset font variable\n" ); fprintf( ctx->fp, "set curve window y 0.15 0.90\n" ); if (ctx->wxn > 1 || ctx->wyn > 1) fprintf( ctx->fp, "set window x %d %d y %d %d\n", ctx->wxi, ctx->wxn, ctx->wyi, ctx->wyn ); if (ctx->givedy) { /*fprintf( ctx->fp, "set order d d d x y d d d\n" )*/; } else { if (ctx->do_rate) fputs( "set order d d d x d y\n", ctx->fp ); else fprintf( ctx->fp, "set order d d d x y d\n" ); } if (ctx->is_log) fprintf( ctx->fp, "set scale x log y log\n" ); if (ctx->do_rate) fprintf( ctx->fp, "title left 'Rate (MB/sec)', bottom 'Size %s',\n", units ); else fprintf( ctx->fp, "title left 'time (us)', bottom 'Size %s',\n", units ); strcpy(archname,"MPI" ); MPI_Get_processor_name(hostname,&dummy); /* Must remove ' from hostname */ p = hostname; while (*p) { if (*p == '\'') *p = ' '; p++; } strcpy(date , "Not available" ); if (ctx->title) { /* Eventually could replace %D with date, %H with hostname */ fprintf( ctx->fp, "top '%s'\n", ctx->title ); } else { /* For systems without a date routine, just leave off the data */ if (!date[0] || strcmp( "Not available", date ) == 0) { fprintf( ctx->fp, " top 'Comm Perf for %s (%s)',\n 'type = %s'\n", archname, hostname, protocol_name ); } else { fprintf( ctx->fp, " top 'Comm Perf for %s (%s)',\n 'on %s',\n 'type = %s'\n", archname, hostname, date, protocol_name ); } } fprintf( ctx->fp, "\n#p0\tp1\tdist\tlen\tave time (us)\trate\n"); fflush( ctx->fp ); } void HeaderForGopCIt( GraphData ctx, char *test_name, char *title_string, char *units ) { char archname[20], hostname[256], date[30], *p; int dummy; if (!ctx) return; fprintf( ctx->fp, "set default\nset font variable\n" ); fprintf( ctx->fp, "set curve window y 0.15 0.90\n" ); if (ctx->wxn > 1 || ctx->wyn > 1) fprintf( ctx->fp, "set window x %d %d y %d %d\n", ctx->wxi, ctx->wxn, ctx->wyi, ctx->wyn ); fprintf( ctx->fp, "title left 'time (us)', bottom 'Processes',\n" ); strcpy(archname,"MPI" ); MPI_Get_processor_name(hostname,&dummy); /* Must remove ' from hostname */ p = hostname; while (*p) { if (*p == '\'') *p = ' '; p++; } strcpy(date , "Not available" ); if (ctx->title) { /* Eventually could replace %D with date, %H with hostname */ fprintf( ctx->fp, "top '%s'\n", ctx->title ); } else { /* For systems without a date routine, just leave off the data */ if (!date[0] || strcmp( "Not available", date ) == 0) { fprintf( ctx->fp, " top 'Comm Perf for %s (%s)',\n 'type = %s'\n", archname, hostname, test_name ); } else { fprintf( ctx->fp, " top 'Comm Perf for %s (%s)',\n 'on %s',\n 'type = %s'\n", archname, hostname, date, test_name ); } } fprintf( ctx->fp, "\n#np time (us) for various sizes\n"); fflush( ctx->fp ); } /* Time in usec */ void DataoutGraph( GraphData ctx, int proc1, int proc2, int distance, int len, double t, double mean_time, double rate, double tmean, double tmax ) { if (!ctx) return; if(ctx->givedy) fprintf( ctx->fpdata, "%d\t%d\t%d\t%d\t%f\t%.2f\t%f\t%f\n", proc1, proc2, distance, len, tmean * 1.0e6, rate, mean_time*1.0e6, tmax * 1.0e6 ); else { /* Update to use e3 or e6 for rate */ fprintf( ctx->fpdata, "%d\t%d\t%d\t%d\t%f\t", proc1, proc2, distance, len, mean_time*1.0e6 ); if (rate > 1.0e6) { fprintf( ctx->fpdata, "%.3fe+6\n", rate * 1.0e-6 ); } else if (rate > 1.0e3) { fprintf( ctx->fpdata, "%.3fe+3\n", rate * 1.0e-3 ); } else { fprintf( ctx->fpdata, "%.2f\n", rate ); } } } void DataoutGraphForGop( GraphData ctx, int len, double t, double mean_time, double rate, double tmean, double tmax ) { if (!ctx) return; fprintf( ctx->fpdata, "%f ", mean_time*1.0e6 ); fflush( ctx->fpdata ); } void DataendForGop( GraphData ctx ) { if (!ctx) return; fprintf( ctx->fpdata, "\n" ); } void DatabeginForGop( GraphData ctx, int np ) { if (!ctx) return; fprintf( ctx->fpdata, "%d ", np ); } void RateoutputGraph( GraphData ctx, double sumlen, double sumtime, double sumlentime, double sumlen2, double sumtime2, int ntest, double *S, double *R ) { double s, r; double variance = 0.0; if (!ctx) return; PIComputeRate( sumlen, sumtime, sumlentime, sumlen2, ntest, &s, &r ); s = s * 0.5; r = r * 0.5; /* Do we need to wait until AFTER the variance to scale s, r ? */ if (ntest > 1) { variance = (1.0 / (ntest - 1.0)) * (sumtime2 - 2.0 * s * sumtime - 2.0 * r * sumlentime + ntest * s * s + 2.0 * r * sumlen + r * r * sumlen2 ); } if (ctx->do_fit) { fprintf( ctx->fp, "# Model complexity is (%e + n * %e)\n", s, r ); fprintf( ctx->fp, "# startup = " ); if (s > 1.0e-3) fprintf( ctx->fp, "%.2f msec ", s * 1.0e3 ); else fprintf( ctx->fp, "%.2f usec ", s * 1.0e6 ); fprintf( ctx->fp, "and transfer rate = " ); if (r > 1.e-6) fprintf( ctx->fp, "%.2f Kbytes/sec\n", 1.0e-3 / r ); else fprintf( ctx->fp, "%.2f Mbytes/sec\n", 1.0e-6 / r ); if (ntest > 1) fprintf( ctx->fp, "# Variance in fit = %f (smaller is better)\n", variance ); } *S = s; *R = r; } void DrawCIt( GraphData ctx, int first, int last, double s, double r ) { if (!ctx) return; /* Convert to one-way performance */ if (ctx->givedy) { fprintf( ctx->fp, "set order d d d x y d d d\n" ); if (ctx->do_rate) fputs( "set change y 'x * 1.0e-6'\n", ctx->fp ); fprintf( ctx->fp, "plot\n" ); fprintf( ctx->fp, "set order d d d x d d y d\n" ); if (ctx->do_rate) fputs( "set change y 'x * 1.0e-6'\n", ctx->fp ); fprintf( ctx->fp, "join\n" ); fprintf( ctx->fp, "set order d d d x d d d y\n" ); if (ctx->do_rate) fputs( "set change y 'x * 1.0e-6'\n", ctx->fp ); fprintf( ctx->fp, "join\n" ); } else { if (ctx->do_rate) fputs( "set change y 'x * 1.0e-6'\n", ctx->fp ); fprintf( ctx->fp, "plot square\njoin\n" ); } /* fit some times fails in Gnuplot; use the s and r parmeters instead */ /* fit '1'+'x'\njoin dots\n */ if (!ctx->do_rate && ctx->do_fit) { fprintf( ctx->fp, "set function x %d %d '%f+%f*x'\n", first, last, s*1.0e6, r*1.0e6 ); fprintf( ctx->fp, "join dots\n" ); } } void DrawGopCIt( GraphData ctx, int first, int last, double s, double r, int nsizes, int *sizelist ) { int i, j; if (!ctx) return; /* Do this in reverse order to help keep the scales correct */ fprintf( ctx->fp, "set limits ymin 0\n" ); for (i=nsizes-1; i>=0; i--) { fprintf( ctx->fp, "set order x" ); for (j=0; jfp, " d" ); fprintf( ctx->fp, " y" ); for (j=i+1; jfp, " d" ); fprintf( ctx->fp, "\nplot square\njoin '%d'\n", sizelist[i] ); } } /* Redisplay using rate instead of time (not used yet) */ void ChangeToRate( GraphData ctx, int n_particip ) { if (!ctx) return; fprintf( ctx->fp, "set order d d d x d d y\njoin\n" ); } /* Generate an end-of-page */ void EndPageCIt( GraphData ctx ) { if (!ctx) return; if (ctx->is_lastwindow) fprintf( ctx->fp, "wait\nnew page\n" ); } /* GNUplot output */ void HeaderGnuplot( GraphData ctx, char *protocol_name, char *title_string, char *units ) { char archname[20], hostname[256], date[30], *p; int dummy; if (!ctx) return; switch (ctx->output_type) { case GRF_EPS: fprintf( ctx->fp, "set terminal postscript eps\n" ); break; case GRF_PS: fprintf( ctx->fp, "set terminal postscript\n" ); break; case GRF_GIF: fprintf( ctx->fp, "set terminal gif\n" ); break; case GRF_X: /* Default behavior */ break; } fprintf( ctx->fp, "set xlabel \"Size %s\"\n", units ); fprintf( ctx->fp, "set ylabel \"time (us)\"\n" ); if (ctx->is_log) fprintf( ctx->fp, "set logscale xy\n" ); strcpy(archname,"MPI" ); MPI_Get_processor_name(hostname,&dummy); /* Must remove ' from hostname */ p = hostname; while (*p) { if (*p == '\'') *p = ' '; p++; } strcpy(date , "Not available" ); if (!date[0] || strcmp( "Not available", date ) == 0) { fprintf( ctx->fp, "set title \"Comm Perf for %s (%s) type %s\"\n", archname, hostname, protocol_name ); } else { fprintf( ctx->fp, "set title \"Comm Perf for %s (%s) on %s type %s\"\n", archname, hostname, date, protocol_name ); } fprintf( ctx->fpdata, "\n#p0\tp1\tdist\tlen\tave time (us)\trate\n"); fflush( ctx->fp ); } void HeaderForGopGnuplot( GraphData ctx, char *protocol_name, char *title_string, char *units ) { char archname[20], hostname[256], date[30], *p; int dummy; if (!ctx) return; fprintf( ctx->fp, "set xlabel \"Processes\"\n" ); fprintf( ctx->fp, "set ylabel \"time (us)\"\n" ); strcpy(archname,"MPI" ); MPI_Get_processor_name(hostname,&dummy); /* Must remove ' from hostname */ p = hostname; while (*p) { if (*p == '\'') *p = ' '; p++; } strcpy(date , "Not available" ); if (!date[0] || strcmp( "Not available", date ) == 0) { fprintf( ctx->fp, "set title \"Comm Perf for %s (%s) type %s\"\n", archname, hostname, protocol_name ); } else { fprintf( ctx->fp, "set title \"Comm Perf for %s (%s) on %s type %s\"\n", archname, hostname, date, protocol_name ); } fprintf( ctx->fpdata, "\n#np time (us) for various sizes\n"); fflush( ctx->fp ); } void DrawGnuplot( GraphData ctx, int first, int last, double s, double r ) { if (!ctx) return; if (ctx->givedy) { fprintf( ctx->fp, "plot '%s' using 4:5:7:8 notitle with errorbars", ctx->fname2 ); } else { fprintf( ctx->fp, "plot '%s' using 4:5 notitle with ", ctx->fname2 ); /* Where is the configure test for this? */ #ifdef GNUVERSION_HAS_BOXES fprintf( ctx->fp, "boxes,\\\n\ '%s' using 4:7 with lines", ctx->fname2 ); #else fprintf( ctx->fp, "lines" ); #endif } if (r > 0.0) { fprintf( ctx->fp, ",\\\n%f+%f*x with dots\n", s*1.0e6, r*1.0e6 ); } else { fprintf( ctx->fp, "\n" ); } } void DrawGopGnuplot( GraphData ctx, int first, int last, double s, double r, int nsizes, int *sizelist ) { int i; if (!ctx) return; fprintf( ctx->fp, "plot " ); for (i=0; ifp, "'%s' using 1:%d title '%d' with boxes%s\n\ '%s' using 1:%d with lines,\\\n", ctx->fname2, i+2, sizelist[i], ctx->fname2, i+2, (i == nsizes-1) ? "" : ",\\" ); #else fprintf( ctx->fp, "'%s' using 1:%d title '%d' with lines%s\n", ctx->fname2, i+2, sizelist[i], (i == nsizes-1) ? "" : ",\\" ); #endif } } /* Generate an end-of-page */ void EndPageGnuplot( GraphData ctx ) { if (!ctx) return; if (ctx->is_lastwindow) { if (ctx->output_type == GRF_X) fprintf( ctx->fp, "pause -1 \"Press to continue\"\nclear\n" ); else fprintf( ctx->fp, "exit\n" ); } } /* Common operations */ void HeaderGraph( GraphData ctx, char *protocol_name, char *title_string, char *units ) { if (!ctx) return; (*ctx->header)( ctx, protocol_name, title_string, units ); } void HeaderForGopGraph( GraphData ctx, char *protocol_name, char *title_string, char *units ) { if (!ctx) return; (*ctx->headergop)( ctx, protocol_name, title_string, units ); } void DrawGraph( GraphData ctx, int first, int last, double s, double r ) { if (!ctx) return; (*ctx->draw)( ctx, first, last, s, r ) ; } void DrawGraphGop( GraphData ctx, int first, int last, double s, double r, int nsizes, int *sizelist ) { if (!ctx) return; (*ctx->drawgop)( ctx, first, last, s, r, nsizes, sizelist ) ; } void EndPageGraph( GraphData ctx ) { if (!ctx) return; (*ctx->endpage)( ctx ); } #define MAX_TSTRING 1024 /* Common create */ GraphData SetupGraph( int *argc, char *argv[] ) { GraphData new; char filename[1024]; int wsize[2]; int isgnu; int givedy; static char tstring[MAX_TSTRING]; OutputForm output_type = GRF_X; new = (GraphData)malloc(sizeof(struct _GraphData)); if (!new)return 0;; filename[0] = 0; /* Set default. The gnuplot isn't as nice (separate file for data) */ isgnu = 0; #ifdef FOO #if GRAPHICS_PGM == gnuplot isgnu = 1; #else isgnu = 0; #endif #endif if (SYArgHasName( argc, argv, 1, "-gnuplot" )) isgnu = 1; if (SYArgHasName( argc, argv, 1, "-cit" )) isgnu = 0; if (!isgnu) { if ((isgnu = SYArgHasName( argc, argv, 1, "-gnuploteps" ))) { output_type = GRF_EPS; }; } if (!isgnu) { if ((isgnu = SYArgHasName( argc, argv, 1, "-gnuplotps" ))) { output_type = GRF_PS; }; } if (!isgnu) { if ((isgnu = SYArgHasName( argc, argv, 1, "-gnuplotgif" ))) { output_type = GRF_GIF; }; } if (SYArgHasName( argc, argv, 1, "-cit" )) isgnu = 0; if (SYArgGetString( argc, argv, 1, "-fname", filename, 1024 ) && __MYPROCID == 0) { new->fp = fopen( filename, "a" ); if (!new->fp) { fprintf( stderr, "Could not open file %s\n", filename ); return 0; } } else new->fp = stdout; givedy = SYArgHasName( argc, argv, 1, "-givedy" ); new->do_rate = SYArgHasName( argc, argv, 1, "-rate" ); new->do_fit = SYArgHasName( argc, argv, 1, "-fit" ); if (SYArgGetString( argc, argv, 1, "-title", tstring, MAX_TSTRING )) new->title = tstring; else new->title = 0; /* Graphics layout */ new->wxi = 1; new->wxn = 1; new->wyi = 1; new->wyn = 1; new->givedy = givedy; if (SYArgGetIntVec( argc, argv, 1, "-wx", 2, wsize )) { new->wxi = wsize[0]; new->wxn = wsize[1]; } if (SYArgGetIntVec( argc, argv, 1, "-wy", 2, wsize )) { new->wyi = wsize[0]; new->wyn = wsize[1]; } new->is_lastwindow = SYArgHasName( argc, argv, 1, "-lastwindow" ); if (new->wxn == 1 && new->wyn == 1) new->is_lastwindow = 1; /* Scaling type */ new->is_log = 0; new->output_type = output_type; if (!isgnu) { new->header = HeaderCIt; new->dataout = DataoutGraph; new->headergop = HeaderForGopCIt; new->dataoutgop = DataoutGraphForGop; new->draw = DrawCIt; new->drawgop = DrawGopCIt; new->endpage = EndPageCIt; new->endgraph = EndGraphCIt; new->fpdata = new->fp; new->fname2 = 0; } else { char filename2[256]; new->header = HeaderGnuplot; new->dataout = DataoutGraph; new->headergop = HeaderForGopGnuplot; new->dataoutgop = DataoutGraphForGop; new->draw = DrawGnuplot; new->drawgop = DrawGopGnuplot; new->endpage = EndPageGnuplot; new->endgraph = EndGraphGnuplot; if (filename[0]) { /* Try to remove the extension, if any, from the filename */ char *p; strcpy( filename2, filename ); p = filename2 + strlen(filename2) - 1; while (p > filename2 && *p != '.') p--; if (p > filename2) strcpy( p, ".gpl" ); else strcat( filename2, ".gpl" ); } else { strcpy( filename2, "mppout.gpl" ); } if (__MYPROCID == 0) { new->fpdata = fopen( filename2, "a" ); if (!new->fpdata) { fprintf( stderr, "Could not open file %s\n\ used for holding data for GNUPLOT\n", filename2 ); return 0; } } else new->fpdata = 0; new->fname2 = (char *)malloc((unsigned)(strlen(filename2 ) + 1 )); strcpy( new->fname2, filename2 ); } return new; } void DataScale( GraphData ctx, int isLog ) { if (!ctx) return; ctx->is_log = isLog; } void EndGraph( GraphData ctx ) { if (!ctx) return; (*ctx->endgraph)( ctx ); } void EndGraphCIt( GraphData ctx ) { if (!ctx) return; if (ctx->fp && ctx->fp != stdout) fclose( ctx->fp ); } void EndGraphGnuplot( GraphData ctx ) { if (!ctx) return; if (ctx->fpdata) fclose( ctx->fpdata ); if (ctx->fp && ctx->fp != stdout) fclose( ctx->fp ); } perftest-1.3a/ovlap.c0000664000115300004540000002163507040715201010322 #include #include "mpi.h" #include "mpptest.h" extern int __NUMNODES, __MYPROCID; #if HAVE_STDLIB_H #include #endif /***************************************************************************** These routines attempt to overlap computation with communication. Only round trip available. Note that even blocking operations may have effective overlap, since all "blocking" refers to is the state of the buffer, not whether the message has been delivered. Modeling of the overlap This is much more difficult that modeling the send and receive, in part because two operations can be taking place at the same time. The easiest model assumes that the computation takes place only when the communication would be waiting. In this case, the computation is free until it uses up the idle time, when it switches to the "usual" cost of a floating point computation. This model, for fixed message length n, has constant time for m < Mcrit, and slope given by the floating point speed for the operation. for m > Mcrit. A more realistic model assumes that both operations impact the other, without requiring that the sum of the times have any particular relationship. For example, the loads and stores of the two operations may take place in each others memory-miss cycles, possible causing both to slow down a little. In this model, there are two positive slopes for the time, with a change at m == Mcrit (that is, at a time when the floating point operation has not finished by the time that the message has been completely sent). *****************************************************************************/ void SetupOverlap( int, OverlapData *), OverlapComputation( int, OverlapData *); void *OverlapInit( int proc1, int proc2, int size ) { OverlapData *new; new = (OverlapData *)malloc(sizeof(OverlapData)); if (!new) return 0;; new->proc1 = proc1; new->proc2 = proc2; new->MsgSize = size; new->Overlap1 = 0; new->Overlap2 = 0; new->OverlapSize = 0; new->OverlapLen = 0; new->OverlapPos = 0; return new; } /* Compute floating point lengths adaptively */ void OverlapSizes( int msgsize, int svals[3], void *vctx ) { double time_msg, time_float, tmp; int float_len; int saved_msgsize; OverlapData *ctx = (OverlapData *)vctx; if (msgsize < 0) { return; } saved_msgsize = ctx->MsgSize; ctx->MsgSize = msgsize; /* First, estimate the time to send a message */ time_msg = round_trip_b_overlap(100,0,ctx) / 100.0; MPI_Allreduce(&time_msg, &tmp, 1, MPI_DOUBLE,MPI_MAX,MPI_COMM_WORLD ); memcpy(&time_msg,&tmp,(1)*sizeof(double));; /* printf( "Time_msg is %f\n", time_msg ); */ float_len = msgsize; if (float_len <= 0) float_len = 32; /* Include the time of the message in the test... */ do { float_len *= 2; time_float = round_trip_b_overlap(100,float_len,ctx) / 100.0; MPI_Allreduce(&time_float, &tmp, 1, MPI_DOUBLE,MPI_MAX,MPI_COMM_WORLD ); memcpy(&time_float,&tmp,(1)*sizeof(double));; /* printf( "Time_float(%d) is %f\n", float_len, time_float ); */ } while (time_float < 2 * time_msg); svals[1] = float_len; svals[2] = (float_len - svals[0]) / 64; ctx->MsgSize = saved_msgsize; } /* Nonblocking round trip with overlap. Note: unlike the round_trip routines, the "length" in this routine is the number of floating point operations. */ double round_trip_nb_overlap( int reps, int len, void *vctx) { double elapsed_time; OverlapData *ctx = (OverlapData *)vctx; int i,myproc, proc1=ctx->proc1,proc2=ctx->proc2,MsgSize=ctx->MsgSize; char *rbuffer,*sbuffer; double t0, t1; MPI_Request rid, sid; MPI_Status status; /* If the MsgSize is negative, just do the floating point computation. This allows us to test for cache effects independant of the message passing code. */ if (MsgSize < 0) { SetupOverlap(len,ctx); elapsed_time = 0; t0=MPI_Wtime(); for(i=0;iproc1,proc2=ctx->proc2,MsgSize=ctx->MsgSize; char *rbuffer,*sbuffer; MPI_Status status; double t0, t1; /* If the MsgSize is negative, just do the floating point computation. This allows us to test for cache effects independant of the message passing code. */ if (MsgSize < 0) { SetupOverlap(len,ctx); elapsed_time = 0; t0=MPI_Wtime(); for(i=0;iOverlap1) { free(ctx->Overlap1); free(ctx->Overlap2); ctx->Overlap1 = 0; ctx->Overlap2 = 0; } /* Convert len to words */ ctx->OverlapSize = len / sizeof(double); if (ctx->OverlapSize > 0) { /* Set len to exceed most cache sizes */ ctx->OverlapLen = ctx->OverlapSize; if (ctx->OverlapLen < 65536) ctx->OverlapLen = 65536; ctx->Overlap1 = (double *)malloc((unsigned)(ctx->OverlapLen * sizeof(double) )); ctx->Overlap2 = (double *)malloc((unsigned)(ctx->OverlapLen * sizeof(double) )); if (!ctx->Overlap1 || !ctx->Overlap2) { ctx->Overlap1 = 0; ctx->Overlap2 = 0; fprintf( stderr, "Error allocating space in SetupOverlap (2x%d bytes)\n", (int)(ctx->OverlapLen * sizeof(double)) ); MPI_Abort( MPI_COMM_WORLD, 1 ); } } else ctx->OverlapLen = 0; p1 = ctx->Overlap1; p2 = ctx->Overlap2; for (i=0; iOverlapLen; i++) { p1[i] = 1.0; p2[i] = 1.0; } ctx->OverlapPos = 0; } void OverlapComputation( int len, OverlapData *ctx ) { int i, n; double temp, *p1 = ctx->Overlap1, *p2 = ctx->Overlap2; n = ctx->OverlapSize; if (n == 0) return; ctx->Overlap1[0] = 0.0; temp = 0.0; /* Cycle through the memory to reduce cache effects */ if (n + ctx->OverlapPos >= ctx->OverlapLen) ctx->OverlapPos = 0; p1 += ctx->OverlapPos; p2 += ctx->OverlapPos; ctx->OverlapPos += ctx->OverlapSize; for (i=0;iOverlap1[0] = temp; } perftest-1.3a/pair.c0000664000115300004540000013750007666705746010166 #include #include "mpi.h" #include "mpptest.h" #include "getopts.h" #if HAVE_STDLIB_H #include #endif #if defined(HAVE_SHMALLOC) && !defined(HAVE_MPI_ALLOC_MEM) #include #endif #include /***************************************************************************** Each collection of test routines contains: Initialization function (returns pointer to context to pass back to test functions Routine to change "distance" Routine to return test function (and set parameters) based on command-line arguments Routine to output "help" text *****************************************************************************/ /***************************************************************************** Here begin the test functions. These all have the same format: double NAME(reps, len, ctx) Input Parameters: . reps - number of times to perform operation . len - length of message (in bytes) . ctx - Pointer to structure containing ranks of participating processes Return value: Elapsed time for operation (not Elapsed time/reps), in seconds. These are organized as: head-to-head (each process sends to the other). The blocking version can deadlock on systems with small amounts of buffering. round-trip (a single message is sent back and fourth between two nodes) In order to test both single and multiple senders and receivers, the destination (partner) node is also set, and whether the node is a master or a slave (it may also be a bystander) *****************************************************************************/ #include "mpptest.h" #ifdef VARIABLE_TAG #define MSG_TAG(iter) iter #else #define MSG_TAG(iter) 1 #endif struct _PairData { int proc1, proc2; int source, destination, /* Source and destination. May be the same as partner (for pair) or different (for ring) */ partner; /* = source = destination if same */ int is_master, is_slave; }; static int CacheSize = 1048576; void PairChange( int, PairData); void ConfirmTest( int, int, PairData ); PairData PairInit( int proc1, int proc2 ) { PairData new; new = (PairData)malloc(sizeof(struct _PairData)); if (!new)return 0;; PairChange( 1, new ); return new; } void PairChange( int distance, PairData ctx ) { int proc2; if (__MYPROCID == 0) { proc2 = GetNeighbor( 0, distance, 1 ); } else { proc2 = GetNeighbor( __MYPROCID, distance, 0 ); if (proc2 == 0) { /* Then I'm the slave for the root */ proc2 = __MYPROCID; } else { proc2 = NO_NBR; } } ctx->proc1 = 0; ctx->proc2 = proc2; ctx->is_master = __MYPROCID == ctx->proc1; ctx->is_slave = __MYPROCID == proc2; if (ctx->is_master) { ctx->partner = proc2; ctx->destination = proc2; ctx->source = proc2; } else if (ctx->is_slave) { ctx->partner = ctx->proc1; ctx->destination = ctx->proc1; ctx->source = ctx->proc1; } else { ctx->partner = NO_NBR; ctx->source = NO_NBR; ctx->destination = NO_NBR; } } /* Bisection test can be done by involving all processes in the communication. In order to insure that we generate a valid pattern, I create an array with an entry for each processor. Starting from position zero, I mark masters, slaves, and ununsed. Each new entry is marked as a master, with the destination partner marked as a slave. */ PairData BisectInit( int distance ) { PairData new; new = (PairData)malloc(sizeof(struct _PairData)); if (!new)return 0;; BisectChange( distance, new ); return new; } void BisectChange( int distance, PairData ctx ) { int i, np; int *marks, curpos; int partner; np = __NUMNODES; marks = (int *)malloc((unsigned)(np * sizeof(int) )); if (!marks) MPI_Abort( MPI_COMM_WORLD, 1 ); for (i=0; iproc1 = NO_NBR; ctx->proc2 = NO_NBR; ctx->is_master = marks[__MYPROCID] == 1; ctx->is_slave = marks[__MYPROCID] == 2; if (ctx->is_master) { ctx->partner = GetNeighbor( __MYPROCID, distance, 1 ); ctx->destination = ctx->partner; ctx->source = ctx->partner; } else if (ctx->is_slave) { ctx->partner = GetNeighbor( __MYPROCID, distance, 0 ); ctx->destination = ctx->partner; ctx->source = ctx->partner; } else { ctx->partner = NO_NBR; ctx->destination = NO_NBR; ctx->source = NO_NBR; } free(marks); } /* Print information on the ctx */ void PrintPairInfo( PairData ctx ) { MPE_Seq_begin(MPI_COMM_WORLD,1 ); fprintf( stdout, "[%d] sending to %d, %s\n", __MYPROCID, ctx->partner, (ctx->is_master || ctx->is_slave) ? ( ctx->is_master ? "Master" : "Slave" ) : "Bystander" ); fflush( stdout ); MPE_Seq_end(MPI_COMM_WORLD,1 ); } typedef enum { HEADtoHEAD, ROUNDTRIP } CommType; typedef enum { Blocking, NonBlocking, ReadyReceiver, MPISynchronous, Persistant, Vector, VectorType, Put, Get } Protocol; typedef enum { SpecifiedSource, AnySource } SourceType; static SourceType source_type = AnySource; static int MsgPending = 0; double exchange_forcetype( int, int, PairData ); double exchange_async( int, int, PairData ); double exchange_sync( int, int, PairData ); double exchange_ssend( int, int, PairData ); double round_trip_sync( int, int, PairData ); double round_trip_force( int, int, PairData ); double round_trip_async( int, int, PairData ); double round_trip_ssend( int, int, PairData ); double round_trip_persis( int, int, PairData ); double round_trip_vector( int, int, PairData ); double round_trip_vectortype( int, int, PairData ); double round_trip_nc_sync( int, int, PairData ); double round_trip_nc_force( int, int, PairData ); double round_trip_nc_async( int, int, PairData ); #if ! defined(HAVE_MPI_PUT) #define round_trip_put 0 #define round_trip_nc_put 0 #define exchange_put 0 #else double exchange_put( int, int, PairData ); double round_trip_put( int, int, PairData ); double round_trip_nc_put( int, int, PairData ); #endif #if ! defined(HAVE_MPI_GET) #define round_trip_get 0 #define round_trip_nc_get 0 #define exchange_get 0 #else double exchange_get( int, int, PairData ); double round_trip_get( int, int, PairData ); double round_trip_nc_get( int, int, PairData ); #endif static void SetupTest( int ); static void FinishTest( void ); /* Determine the timing function */ double ((*GetPairFunction( int *argc, char *argv[], char *protocol_name )) ( int, int, void * )) { CommType comm_type = ROUNDTRIP; Protocol protocol = Blocking; double (*f)(int,int,PairData); int use_cache; f = round_trip_sync; if (SYArgHasName( argc, argv, 1, "-force" )) { protocol = ReadyReceiver; strcpy( protocol_name, "ready receiver" ); } if (SYArgHasName( argc, argv, 1, "-async" )) { protocol = NonBlocking; strcpy( protocol_name, "nonblocking" ); } if (SYArgHasName( argc, argv, 1, "-sync" )) { protocol = Blocking; strcpy( protocol_name, "blocking" ); } if (SYArgHasName( argc, argv, 1, "-ssend" )) { protocol = MPISynchronous; strcpy( protocol_name, "Ssend" ); } if (SYArgHasName( argc, argv, 1, "-put" )) { protocol = Put; strcpy( protocol_name, "MPI_Put" ); } if (SYArgHasName( argc, argv, 1, "-get" )) { protocol = Get; strcpy( protocol_name, "MPI_Get" ); } if (SYArgHasName( argc, argv, 1, "-persistant" )) { protocol = Persistant; strcpy( protocol_name, "persistant" ); } if (SYArgHasName( argc, argv, 1, "-vector" )) { int stride; protocol = Vector; strcpy( protocol_name, "vector" ); if (SYArgGetInt( argc, argv, 1, "-vstride", &stride )) set_vector_stride( stride ); } if (SYArgHasName( argc, argv, 1, "-vectortype" )) { int stride; protocol = VectorType; strcpy( protocol_name, "type_vector" ); if (SYArgGetInt( argc, argv, 1, "-vstride", &stride )) set_vector_stride( stride ); } if (SYArgHasName( argc, argv, 1, "-anysource" )) { source_type = AnySource; } if (SYArgHasName( argc, argv, 1, "-specified" )) { source_type = SpecifiedSource; strcat( protocol_name, "(specified source)" ); } if (SYArgHasName( argc, argv, 1, "-pending" )) { MsgPending = 1; strcat( protocol_name, "(pending recvs)" ); } use_cache = SYArgGetInt( argc, argv, 1, "-cachesize", &CacheSize ); if (SYArgHasName( argc, argv, 1, "-head" )) comm_type = HEADtoHEAD; if (SYArgHasName( argc, argv, 1, "-roundtrip" )) comm_type = ROUNDTRIP; if (comm_type == ROUNDTRIP) { if (use_cache) { switch( protocol ) { case ReadyReceiver: f = round_trip_nc_force; break; case NonBlocking: f = round_trip_nc_async; break; case Blocking: f = round_trip_nc_sync; break; case Put: f = round_trip_nc_put; break; case Get: f = round_trip_nc_get; break; /* Rolling through the cache means using different buffers for each op; not doable with persistent requests */ case Persistant: f = 0; break; case Vector: f = 0; break; case VectorType: f = 0; break; default: f = 0; break; } } else { switch( protocol ) { case ReadyReceiver: f = round_trip_force; break; case NonBlocking: f = round_trip_async; break; case Blocking: f = round_trip_sync; break; case MPISynchronous:f = round_trip_ssend; break; case Put: f = round_trip_put; break; case Get: f = round_trip_get; break; case Persistant: f = round_trip_persis; break; case Vector: f = round_trip_vector; break; case VectorType: f = round_trip_vectortype; break; } } } else { switch( protocol ) { case ReadyReceiver: f = exchange_forcetype; break; case NonBlocking: f = exchange_async; break; case Blocking: f = exchange_sync; break; case MPISynchronous:f = exchange_ssend; break; case Put: f = exchange_put; break; case Get: f = exchange_get; break; case Persistant: f = 0; break; case Vector: f = 0; break; case VectorType: f = 0; break; } } if (!f) { fprintf( stderr, "Option %s not supported\n", protocol_name ); MPI_Abort( MPI_COMM_WORLD, 1 ); } return (double (*)(int,int,void*)) f; } /***************************************************************************** Here are the actual routines *****************************************************************************/ /* Blocking exchange (head-to-head) */ double exchange_sync( int reps, int len, PairData ctx) { double elapsed_time; int i, to = ctx->destination, from = ctx->source; int recv_from; char *sbuffer, *rbuffer; double t0, t1; MPI_Status status; sbuffer = (char *)malloc(len); rbuffer = (char *)malloc(len); memset( sbuffer, 0, len ); memset( rbuffer, 0, len ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;idestination, from = ctx->source; int recv_from; MPI_Request msg_id; char *sbuffer,*rbuffer; double t0, t1; MPI_Status status; sbuffer = (char *)malloc(len); rbuffer = (char *)malloc(len); memset( sbuffer, 0, len ); memset( rbuffer, 0, len ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;idestination, from = ctx->source; int recv_from; MPI_Request msg_id; char *sbuffer,*rbuffer; double t0, t1; MPI_Status status; sbuffer = (char *)malloc(len); rbuffer = (char *)malloc(len); memset( sbuffer, 0, len ); memset( rbuffer, 0, len ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;idestination, from = ctx->source; int recv_from; MPI_Request msg_id; MPI_Status status; char *sbuffer,*rbuffer; double t0, t1; sbuffer = (char *)malloc(len); rbuffer = (char *)malloc(len); memset( sbuffer, 0, len ); memset( rbuffer, 0, len ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,3,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send(sbuffer,len,MPI_BYTE,from,3,MPI_COMM_WORLD); for(i=0;idestination, from = ctx->source; int recv_from; char *rbuffer,*sbuffer; MPI_Status status; double t0, t1; sbuffer = (char *)malloc(len); rbuffer = (char *)malloc(len); memset( sbuffer, 0, len ); memset( rbuffer, 0, len ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;idestination, from = ctx->source; int recv_from; char *rbuffer,*sbuffer; MPI_Status status; double t0, t1; sbuffer = (char *)malloc(len); rbuffer = (char *)malloc(len); memset( sbuffer, 0, len ); memset( rbuffer, 0, len ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;idestination, from = ctx->source; int recv_from; char *rbuffer,*sbuffer; double t0, t1; MPI_Request rid; MPI_Status status; sbuffer = (char *)malloc(len); rbuffer = (char *)malloc(len); memset( sbuffer, 0, len ); memset( rbuffer, 0, len ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Irecv(rbuffer,len,MPI_BYTE,recv_from,MSG_TAG(i), MPI_COMM_WORLD,&(rid)); MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;idestination, from = ctx->source; int recv_from; char *rbuffer,*sbuffer; MPI_Status status; double t0, t1; MPI_Request rid; sbuffer = (char *)malloc(len); rbuffer = (char *)malloc(len); memset( sbuffer, 0, len ); memset( rbuffer, 0, len ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Irecv(rbuffer,len,MPI_BYTE,recv_from,MSG_TAG(i), MPI_COMM_WORLD,&(rid)); MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;idestination, from = ctx->source; int recv_from; char *rbuffer,*sbuffer; double t0, t1; MPI_Request sid, rid, rq[2]; MPI_Status status, statuses[2]; sbuffer = (char *)malloc(len); rbuffer = (char *)malloc(len); memset( sbuffer, 0, len ); memset( rbuffer, 0, len ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send_init( sbuffer, len, MPI_BYTE, to, 1, MPI_COMM_WORLD, &sid ); MPI_Recv_init( rbuffer, len, MPI_BYTE, recv_from, 1, MPI_COMM_WORLD, &rid ); rq[0] = rid; rq[1] = sid; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = from; MPI_Send_init( sbuffer, len, MPI_BYTE, from, 1, MPI_COMM_WORLD, &sid ); MPI_Recv_init( rbuffer, len, MPI_BYTE, recv_from, 1, MPI_COMM_WORLD, &rid ); rq[0] = rid; rq[1] = sid; MPI_Start( &rid ); MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;idestination, from = ctx->source; int recv_from; unsigned datalen; double *rbuffer,*sbuffer; double t0, t1; MPI_Datatype vec, types[2]; int blens[2]; MPI_Aint displs[2]; MPI_Status status; MPI_Comm comm; int alloc_len; /* Adjust len to be in bytes */ len = len / sizeof(double); alloc_len = len; if (len == 0) alloc_len++; comm = MPI_COMM_WORLD; blens[0] = 1; displs[0] = 0; types[0] = MPI_DOUBLE; blens[1] = 1; displs[1] = VectorStride * sizeof(double); types[1] = MPI_UB; MPI_Type_struct( 2, blens, displs, types, &vec ); MPI_Type_commit( &vec ); datalen = VectorStride * alloc_len * sizeof(double); sbuffer = (double *)malloc(datalen); rbuffer = (double *)malloc(datalen); if (!sbuffer)return 0; if (!rbuffer)return 0; memset( sbuffer, 0, datalen ); memset( rbuffer, 0, datalen ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv( rbuffer, len, vec, recv_from, 0, comm, &status ); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send( sbuffer, len, vec, from, 0, comm ); for(i=0;idestination, from = ctx->source; int recv_from; unsigned datalen; double *rbuffer,*sbuffer; double t0, t1; MPI_Datatype vec; MPI_Status status; MPI_Comm comm; int alloc_len; /* Adjust len to be in doubles */ len = len / sizeof(double); alloc_len = len; if (len == 0) alloc_len++; comm = MPI_COMM_WORLD; MPI_Type_vector( len, 1, VectorStride, MPI_DOUBLE, &vec ); MPI_Type_commit( &vec ); datalen = VectorStride * alloc_len * sizeof(double); sbuffer = (double *)malloc(datalen); rbuffer = (double *)malloc(datalen); if (!sbuffer)return 0; if (!rbuffer)return 0; memset( sbuffer, 0, datalen ); memset( rbuffer, 0, datalen ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv( rbuffer, 1, vec, recv_from, 0, comm, &status ); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send( sbuffer, 1, vec, from, 0, comm ); for(i=0;idestination, from = ctx->source; int recv_from; char *rbuffer,*sbuffer, *rp, *sp, *rlast, *slast; MPI_Status status; double t0, t1; sbuffer = (char *)malloc((unsigned)(2 * CacheSize )); slast = sbuffer + 2 * CacheSize - len; rbuffer = (char *)malloc((unsigned)(2 * CacheSize )); rlast = rbuffer + 2 * CacheSize - len; if (!sbuffer || !rbuffer) { fprintf( stderr, "Could not allocate %d bytes\n", 4 * CacheSize ); exit(1 ); } memset( sbuffer, 0, 2*CacheSize ); memset( rbuffer, 0, 2*CacheSize ); sp = sbuffer; rp = rbuffer; SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;i slast) sp = sbuffer; if (rp > rlast) rp = rbuffer; } t1=MPI_Wtime(); elapsed_time = t1 -t0; } if(ctx->is_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;i slast) sp = sbuffer; if (rp > rlast) rp = rbuffer; } } FinishTest(); free(sbuffer ); free(rbuffer ); return(elapsed_time); } /* Ready-receiver round trip */ double round_trip_nc_force( int reps, int len, PairData ctx) { double elapsed_time; int i, to = ctx->destination, from = ctx->source; int recv_from; char *rbuffer,*sbuffer, *rp, *sp, *rlast, *slast; double t0, t1; MPI_Request rid; MPI_Status status; sbuffer = (char *)malloc((unsigned)(2 * CacheSize )); slast = sbuffer + 2 * CacheSize - len; rbuffer = (char *)malloc((unsigned)(2 * CacheSize )); rlast = rbuffer + 2 * CacheSize - len; if (!sbuffer || !rbuffer) { fprintf( stderr, "Could not allocate %d bytes\n", 4 * CacheSize ); exit(1 ); } sp = sbuffer; rp = rbuffer; memset( sbuffer, 0, 2*CacheSize ); memset( rbuffer, 0, 2*CacheSize ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;i slast) sp = sbuffer; if (rp > rlast) rp = rbuffer; } t1=MPI_Wtime(); elapsed_time = t1 -t0; } if(ctx->is_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Irecv(rbuffer,len,MPI_BYTE,recv_from,MSG_TAG(i), MPI_COMM_WORLD,&(rid)); MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;i rlast) rp = rbuffer; MPI_Irecv(rp,len,MPI_BYTE,recv_from,MSG_TAG(i), MPI_COMM_WORLD,&(rid)); MPI_Rsend(sp,len,MPI_BYTE,to,MSG_TAG(i),MPI_COMM_WORLD); sp += len; if (sp > slast) sp = sbuffer; } MPI_Wait(&(rid),&status); MPI_Rsend(sp,len,MPI_BYTE,to,MSG_TAG(i),MPI_COMM_WORLD); } FinishTest(); free(sbuffer ); free(rbuffer ); return(elapsed_time); } /* Nonblocking round trip */ double round_trip_nc_async( int reps, int len, PairData ctx) { double elapsed_time; int i, to = ctx->destination, from = ctx->source; int recv_from; char *rbuffer,*sbuffer, *rp, *sp, *rlast, *slast; double t0, t1; MPI_Request rid; MPI_Status status; sbuffer = (char *)malloc((unsigned)(2 * CacheSize )); slast = sbuffer + 2 * CacheSize - len; rbuffer = (char *)malloc((unsigned)(2 * CacheSize )); rlast = rbuffer + 2 * CacheSize - len; if (!sbuffer || !rbuffer) { fprintf( stderr, "Could not allocate %d bytes\n", 4 * CacheSize ); exit(1 ); } sp = sbuffer; rp = rbuffer; memset( sbuffer, 0, 2*CacheSize ); memset( rbuffer, 0, 2*CacheSize ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;i slast) sp = sbuffer; if (rp > rlast) rp = rbuffer; } t1=MPI_Wtime(); elapsed_time = t1 -t0; } if(ctx->is_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Irecv(rbuffer,len,MPI_BYTE,recv_from,MSG_TAG(i), MPI_COMM_WORLD,&(rid)); MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;i rlast) rp = rbuffer; MPI_Irecv(rp,len,MPI_BYTE,recv_from,MSG_TAG(i), MPI_COMM_WORLD,&(rid)); MPI_Send(sp,len,MPI_BYTE,to,MSG_TAG(i),MPI_COMM_WORLD); sp += len; if (sp > slast) sp = sbuffer; } MPI_Wait(&(rid),&status); MPI_Send(sp,len,MPI_BYTE,to,MSG_TAG(i),MPI_COMM_WORLD); } FinishTest(); free(sbuffer ); free(rbuffer ); return(elapsed_time); } #ifdef HAVE_MPI_PUT double exchange_put( int reps, int len, PairData ctx) { double elapsed_time; int i, to = ctx->destination, from = ctx->source; int recv_from; char *sbuffer,*rbuffer; double t0, t1; MPI_Status status; MPI_Win win; int alloc_len; alloc_len = len; if (alloc_len == 0) alloc_len = sizeof(double); #if defined(HAVE_SHMALLOC) && !defined(HAVE_MPI_ALLOC_MEM) sbuffer = (char *)shmalloc((unsigned)(alloc_len)); rbuffer = (char *)shmalloc((unsigned)(alloc_len)); #else sbuffer = (char *)malloc((unsigned)(alloc_len)); rbuffer = (char *)malloc((unsigned)(alloc_len)); #endif if (!sbuffer || !rbuffer) { fprintf( stderr, "Could not allocate %d bytes\n", alloc_len ); exit(1 ); } memset( sbuffer, 0, alloc_len ); memset( rbuffer, 0, alloc_len ); MPI_Win_create( rbuffer, len, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;idestination, from = ctx->source; int recv_from; char *rbuffer,*sbuffer; double t0, t1; MPI_Win win; MPI_Status status; int alloc_len; alloc_len = len; if (alloc_len == 0) alloc_len = sizeof(double); #if defined(HAVE_SHMALLOC) && !defined(HAVE_MPI_ALLOC_MEM) sbuffer = (char *)shmalloc((unsigned)(alloc_len)); rbuffer = (char *)shmalloc((unsigned)(alloc_len)); #else sbuffer = (char *)malloc((unsigned)(alloc_len)); rbuffer = (char *)malloc((unsigned)(alloc_len)); #endif if (!sbuffer || !rbuffer) { fprintf( stderr, "Could not allocate %d bytes\n", alloc_len ); exit(1 ); } memset( sbuffer, 0, alloc_len ); memset( rbuffer, 0, alloc_len ); MPI_Win_create( rbuffer, len, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;idestination, from = ctx->source; int recv_from; char *rbuffer,*sbuffer, *rp, *sp, *rlast, *slast; double t0, t1; MPI_Win win; MPI_Status status; #if defined(HAVE_SHMALLOC) && !defined(HAVE_MPI_ALLOC_MEM) sbuffer = (char *)shmalloc((unsigned)(2 * CacheSize )); rbuffer = (char *)shmalloc((unsigned)(2 * CacheSize )); #else sbuffer = (char *)malloc((unsigned)(2 * CacheSize )); rbuffer = (char *)malloc((unsigned)(2 * CacheSize )); #endif slast = sbuffer + 2 * CacheSize - len; rlast = rbuffer + 2 * CacheSize - len; if (!sbuffer || !rbuffer) { fprintf( stderr, "Could not allocate %d bytes\n", 4 * CacheSize ); exit(1 ); } sp = sbuffer; rp = rbuffer; memset( sbuffer, 0, 2*CacheSize ); memset( rbuffer, 0, 2*CacheSize ); MPI_Win_create( rbuffer, len, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;i slast) sp = sbuffer; if (rp > rlast) rp = rbuffer; } t1=MPI_Wtime(); elapsed_time = t1 -t0; } else if(ctx->is_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;i slast) sp = sbuffer; if (rp > rlast) rp = rbuffer; } } else { for(i=0;idestination, from = ctx->source; int recv_from; char *sbuffer,*rbuffer; double t0, t1; MPI_Status status; MPI_Win win; int alloc_len; alloc_len = len; if (alloc_len == 0) alloc_len = sizeof(double); #if defined(HAVE_SHMALLOC) && !defined(HAVE_MPI_ALLOC_MEM) sbuffer = (char *)shmalloc((unsigned)(alloc_len)); rbuffer = (char *)shmalloc((unsigned)(alloc_len)); #else sbuffer = (char *)malloc((unsigned)(alloc_len)); rbuffer = (char *)malloc((unsigned)(alloc_len)); #endif if (!sbuffer || !rbuffer) { fprintf( stderr, "Could not allocate %d bytes\n", alloc_len ); exit(1 ); } memset( sbuffer, 0, alloc_len ); memset( rbuffer, 0, alloc_len ); MPI_Win_create( rbuffer, len, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;idestination, from = ctx->source; int recv_from; char *rbuffer,*sbuffer; double t0, t1; MPI_Win win; MPI_Status status; int alloc_len; alloc_len = len; if (alloc_len == 0) alloc_len = sizeof(double); #if defined(HAVE_SHMALLOC) && !defined(HAVE_MPI_ALLOC_MEM) sbuffer = (char *)shmalloc((unsigned)(alloc_len)); rbuffer = (char *)shmalloc((unsigned)(alloc_len)); #else sbuffer = (char *)malloc((unsigned)(alloc_len)); rbuffer = (char *)malloc((unsigned)(alloc_len)); #endif if (!sbuffer || !rbuffer) { fprintf( stderr, "Could not allocate %d bytes\n", alloc_len ); exit(1 ); } memset( sbuffer, 0, alloc_len ); memset( rbuffer, 0, alloc_len ); MPI_Win_create( rbuffer, len, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;iis_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;idestination, from = ctx->source; int recv_from; char *rbuffer,*sbuffer, *rp, *sp, *rlast, *slast; double t0, t1; MPI_Win win; MPI_Status status; #if defined(HAVE_SHMALLOC) && !defined(HAVE_MPI_ALLOC_MEM) sbuffer = (char *)shmalloc((unsigned)(2 * CacheSize )); rbuffer = (char *)shmalloc((unsigned)(2 * CacheSize )); #else sbuffer = (char *)malloc((unsigned)(2 * CacheSize )); rbuffer = (char *)malloc((unsigned)(2 * CacheSize )); #endif slast = sbuffer + 2 * CacheSize - len; rlast = rbuffer + 2 * CacheSize - len; if (!sbuffer || !rbuffer) { fprintf( stderr, "Could not allocate %d bytes\n", 4 * CacheSize ); exit(1 ); } sp = sbuffer; rp = rbuffer; memset( sbuffer, 0, 2*CacheSize ); memset( rbuffer, 0, 2*CacheSize ); MPI_Win_create( rbuffer, len, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win ); SetupTest( from ); ConfirmTest( reps, len, ctx ); elapsed_time = 0; if(ctx->is_master){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Recv(rbuffer,len,MPI_BYTE,recv_from,0,MPI_COMM_WORLD,&status); t0=MPI_Wtime(); for(i=0;i slast) sp = sbuffer; if (rp > rlast) rp = rbuffer; } t1=MPI_Wtime(); elapsed_time = t1 -t0; } else if(ctx->is_slave){ recv_from = MPI_ANY_SOURCE; if (source_type == SpecifiedSource) recv_from = to; MPI_Send(sbuffer,len,MPI_BYTE,from,0,MPI_COMM_WORLD); for(i=0;i slast) sp = sbuffer; if (rp > rlast) rp = rbuffer; } } else { for(i=0;iis_master) { MPI_Recv( msginfo, 2, MPI_INT, ctx->destination, 9999, MPI_COMM_WORLD, &status ); if (msginfo[0] != reps) { fprintf( stderr, "Expected %d but partner has %d for reps\n", reps, msginfo[0] ); err++; } if (msginfo[1] != len) { fprintf( stderr, "Expected %d but partner has %d for len\n", len, msginfo[1] ); err++; } if (err) { fflush( stderr ); MPI_Abort( MPI_COMM_WORLD, 1 ); } } else if (ctx->is_slave) { msginfo[0] = reps; msginfo[1] = len; MPI_Send( msginfo, 2, MPI_INT, ctx->source, 9999, MPI_COMM_WORLD ); } } perftest-1.3a/pattern.c0000664000115300004540000000412307135121567010662 #include #include "mpi.h" #include "mpptest.h" #include "getopts.h" /* This file contains routines to choose the "partners" given a distance or index. */ enum { RING, DOUBLE, HYPERCUBE, SHIFT } Pattern; void SetPattern( argc, argv ) int *argc; char **argv; { Pattern = RING; if (SYArgHasName( argc, argv, 1, "-nbrring" )) Pattern = RING; if (SYArgHasName( argc, argv, 1, "-nbrdbl" )) Pattern = DOUBLE; if (SYArgHasName( argc, argv, 1, "-nbrhc" )) Pattern = HYPERCUBE; if (SYArgHasName( argc, argv, 1, "-nbrshift" )) Pattern = SHIFT; } int GetMaxIndex( void ) { int i, cnt; switch (Pattern) { case RING: case SHIFT: return __NUMNODES-1; case DOUBLE: case HYPERCUBE: i = 1; cnt = 1; while (i < __NUMNODES) { i <<= 1; cnt++; } return cnt; } return 0; } /* For operations that do not involve pair operations, we need to separate the source and destination */ int GetDestination( int loc, int index, int is_master ) { if (Pattern == SHIFT) return (loc + index) % __NUMNODES; return GetNeighbor( loc, index, is_master ); } int GetSource( int loc, int index, int is_master ) { if (Pattern == SHIFT) return (loc - index + __NUMNODES) % __NUMNODES; return GetNeighbor( loc, index, is_master ); } /* Exchange operations (partner is both source and destination) */ int GetNeighbor( int loc, int index, int is_master ) { int np = __NUMNODES; switch (Pattern) { case RING: if (is_master) return (loc + index) % np; return (loc + np - index) % np; case DOUBLE: if (is_master) return (loc + (1 << (index-1))) % np; return (loc - (1 << (index-1)) + np) % np; case HYPERCUBE: return loc ^ (1 << (index-1)); default: fprintf( stderr, "Unknown or unsupported pattern\n" ); } return loc; } void PrintPatternHelp( void ) { fprintf( stderr, "\n\ Pattern (Neighbor) choices:\n\ -nbrring - neighbors are +/- distance\n\ -nbrdbl - neighbors are +/- 2**distance\n\ -nbrhc - neighbors are hypercube\n\ -nbrshift - neighbors are + distance (wrapped)\n\ " ); } perftest-1.3a/rate.c0000664000115300004540000000437707135117201010141 void PIComputeRate( double sumlen, double sumtime, double sumlentime, double sumlen2, int ntest, double *s, double *r ); /* This file contains very simple code for estimating the parameters in the simple (s + rn) model of communication. It does this using the NORMAL equations for the least-squares problem; this method has a number of disadvantages including numerical instability when the number of observations is large or the normal equation matrix nearly singular. Another problem is that the least squares problem gives different answers depending on how the system is weighted. For example, another weighting (different than the one used here) weights the rows of the matrix by the inverse of the right-hand-side. The advantage of this approach is that it needs only a few, easily (if subject to numerical errors during accumulation) acquired values */ /* PIComputeRate - Computes the communication rate given timing information Input Parameters: + sumlen - Sum of the lengths of the messages sent . sumtime - Sum of the time to send the messages . sumlentime - Sum of the product of the message lengths and the times to send those messages . sumlen2 - Sum of the squares of the lengths of the messages - ntest - Number of messages sent Output Parameters: + s - latency - r - transfer rate Notes: This code computes a fit to the model (s + r n) for communications between two processors. The method used is reasonable reliable for small values of ntest. If there is insufficient data to compute s and r, both are set to zero. This code does not check that the assumed model (s + r n) is a good choice. The length sums are doubles rather than ints to provide a "long long" type (think of them as 53 bit integers). */ void PIComputeRate( double sumlen, double sumtime, double sumlentime, double sumlen2, int ntest, double *s, double *r ) { double R, S; R = sumlen * sumlen - ntest * sumlen2; if (R == 0.0) { *s = *r = 0.0; return; } R = (sumlen * sumtime - ntest * sumlentime) / R; S = (sumtime - R * sumlen) / ntest; if (S < 0 || R < 0) { S = 0.0; R = sumlentime / sumlen2; } *r = R; *s = S; } perftest-1.3a/copy.c0000664000115300004540000000774607465571716010210 #include #include "mpi.h" #include "mpptest.h" #if HAVE_STDLIB_H #include #endif /* Test of single process memcpy. ctx is ignored for this test. Note that the test is run *once* before it is timed. This is very important to ensure that all of the data is paged in and ready to go. Without this, a large number of repititions are needed to ensure that any "cold-start" cost is averaged out (almost) across many operations (i.e., you need a large value of reps otherwise). */ double memcpy_rate(int reps, int len, void *ctx) { double elapsed_time; int i; char *sbuffer,*rbuffer; double t0; sbuffer = (char *)malloc(len+4); rbuffer = (char *)malloc(len+4); memcpy( rbuffer, sbuffer, len ); t0 = MPI_Wtime(); for(i=0;i #include "mpi.h" #include "mpptest.h" #include "getopts.h" /* For sqrt */ #include #if HAVE_STDLIB_H #include #endif /* * This file provides a communication pattern similar to "halo" or ghost * cell exchanges. * */ /* Local structure */ #define MAX_PARTNERS 64 typedef enum { WAITALL, WAITANY } HaloWaitKind; typedef struct _HaloData { int n_partners; int partners[MAX_PARTNERS]; HaloWaitKind kind; int debug_flag; } HaloData; static void halo_set_buffers( int len, HaloData *ctx, char *sbuffer[], char *rbuffer[] ); static void halo_free_buffers( HaloData *ctx, char *sbuffer[], char *rbuffer[] ); double halo_nb( int reps, int len, HaloData *ctx ); #ifdef HAVE_MPI_PUT double halo_put( int reps, int len, HaloData *ctx ); #endif int HaloSent( int, HaloData * ); /* Set up the initial buffers */ static void halo_set_buffers( int len, HaloData *ctx, char *sbuffer[], char *rbuffer[] ) { int i; if (ctx->debug_flag) { int rank; MPI_Comm_rank( MPI_COMM_WORLD, &rank ); printf( "[%d] len = %d, npartners = %d:", rank, len, ctx->n_partners ); for (i=0; in_partners; i++) { printf( ",%d", ctx->partners[i] ); } puts( "" ); fflush( stdout ); } /* Allocate send and receive buffers */ if (len == 0) len += sizeof(int); for (i=0; in_partners; i++) { sbuffer[i] = (char *)malloc( len ); rbuffer[i] = (char *)malloc( len ); if (!sbuffer[i] || !rbuffer[i]) { fprintf( stderr, "Could not allocate %d bytes\n", len ); MPI_Abort( MPI_COMM_WORLD, 1 ); } memset( sbuffer[i], -1, len ); memset( rbuffer[i], 0, len ); } } static void halo_free_buffers( HaloData *ctx, char *sbuffer[], char *rbuffer[] ) { int i; for (i=0; in_partners; i++) { free(sbuffer[i]); free(rbuffer[i]); } } double halo_nb( int reps, int len, HaloData *ctx ) { double elapsed_time; int i, j, n_partners, n2_partners; double t0, t1; MPI_Request req[2*MAX_PARTNERS], *rq; MPI_Status status[2*MAX_PARTNERS]; char *(sbuffer[MAX_PARTNERS]), *(rbuffer[MAX_PARTNERS]); halo_set_buffers( len, ctx, sbuffer, rbuffer ); elapsed_time = 0; n_partners = ctx->n_partners; n2_partners = 2 * n_partners; MPI_Barrier( MPI_COMM_WORLD ); t0 = MPI_Wtime(); for(i=0;ipartners[j], i, MPI_COMM_WORLD, rq++ ); MPI_Isend( sbuffer[j], len, MPI_BYTE, ctx->partners[j], i, MPI_COMM_WORLD, rq++ ); } if (ctx->kind == WAITALL) MPI_Waitall( n2_partners, req, status ); else { int idx; for (j=0; jn_partners; if (alloc_len == 0) alloc_len = sizeof(double); #if defined(HAVE_SHMALLOC) && !defined(HAVE_MPI_ALLOC_MEM) sbuffer = (char *)shmalloc((unsigned)(alloc_len)); rbuffer = (char *)shmalloc((unsigned)(alloc_len)); #else sbuffer = (char *)malloc((unsigned)(alloc_len)); rbuffer = (char *)malloc((unsigned)(alloc_len)); #endif if (!sbuffer || !rbuffer) { fprintf( stderr, "Could not allocate %d bytes\n", alloc_len ); exit(1 ); } MPI_Win_create( rbuffer, alloc_len, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win ); memset( sbuffer, 0, alloc_len ); memset( rbuffer, 0, alloc_len ); elapsed_time = 0; n_partners = ctx->n_partners; MPI_Barrier( MPI_COMM_WORLD ); MPI_Win_fence( 0, win ); t0 = MPI_Wtime(); for(i=0;ipartners[j] != MPI_PROC_NULL) { /* Fix for broken MPI implementations */ MPI_Put( sbuffer+offset, len, MPI_BYTE, ctx->partners[j], offset, len, MPI_BYTE, win ); } offset += len; } MPI_Win_fence( 0, win ); } t1 = MPI_Wtime(); elapsed_time = t1 - t0; /* Use the max since in the non-periodic case, not all processes have the same number of partners (and rate is scaled by max # or partners) */ MPI_Allreduce( &elapsed_time, &t1, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD ); t1 = elapsed_time; #if defined(HAVE_SHMALLOC) && !defined(HAVE_MPI_ALLOC_MEM) shfree( sbuffer ); shfree( rbuffer ); #else free(sbuffer ); free(rbuffer ); #endif MPI_Win_free( &win ); return(elapsed_time); } #endif TimeFunction GetHaloFunction( int *argc_p, char *argv[], void *MsgCtx, char *title ) { HaloData *new; int rank, size; int i, s1; int is_periodic; new = (HaloData *)malloc( sizeof(HaloData) ); if (!new) return 0; new->n_partners = 2; SYArgGetInt( argc_p, argv, 1, "-npartner", &new->n_partners ); is_periodic = SYArgHasName( argc_p, argv, 1, "-periodic" ); if (new->n_partners > MAX_PARTNERS) { fprintf( stderr, "Too many halo partners specified (%d); max is %d\n", new->n_partners, MAX_PARTNERS ); } new->debug_flag = SYArgHasName( argc_p, argv, 0, "-debug" ); new->kind = WAITALL; if (SYArgHasName( argc_p, argv, 1, "-waitany" )) { new->kind = WAITANY; sprintf( title, "halo exchange (%d) - waitany", new->n_partners ); } #ifdef HAVE_MPI_PUT else if (SYArgHasName( argc_p, argv, 0, "-put" )) { sprintf( title, "halo exchange (%d) - put/fence", new->n_partners ); } #endif else { sprintf( title, "halo exchange (%d) - waitall", new->n_partners ); } /* Compute partners. We assume only exchanges here. We use a simple rule to compute partners: we use rank (+-) 1, (+-)sqrt(size), (+-) sqrt(size) (+-)1, */ MPI_Comm_size( MPI_COMM_WORLD, &size ); MPI_Comm_rank( MPI_COMM_WORLD, &rank ); /* This will work as long as # partners is a multiple of 2 */ if (new->n_partners > 1 && (new->n_partners & 0x1)) { fprintf( stderr, "Number of partners must be even\n" ); return 0; } if (new->n_partners == 1) { if (rank & 0x1) new->partners[0] = rank - 1; else new->partners[0] = rank + 1; if (is_periodic) { if (new->partners[0] >= size) new->partners[0] -= size; else if (new->partners[0] < 0) new->partners[0] += size; } else { if (new->partners[0] >= size) new->partners[0] = MPI_PROC_NULL; else if (new->partners[0] < 0) new->partners[0] = MPI_PROC_NULL; } } else { /* First, load up partners with the distance to the partner */ new->partners[0] = 1; new->partners[1] = -1; s1 = sqrt((double)size); new->partners[2] = s1; new->partners[3] = -s1; new->partners[4] = s1 + 1; new->partners[5] = s1 - 1; new->partners[6] = -s1 + 1; new->partners[7] = -s1 - 1; for (i=0; in_partners; i++) { if (is_periodic) new->partners[i] = (rank + new->partners[i] + size) % size; else { int partner; partner = rank + new->partners[i]; if (partner >= size || partner < 0) partner = MPI_PROC_NULL; new->partners[i] = partner; } } } *(void **)MsgCtx = (void *)new; #ifdef HAVE_MPI_PUT if (SYArgHasName( argc_p, argv, 1, "-put" )) { return (TimeFunction) halo_put; } #endif return (TimeFunction) halo_nb; } /* This also needs a function to compute the amount of communication */ int HaloSent( int len, HaloData *ctx ) { int i, totlen = 0; /* This needs to be adjusted for partners that are PROC_NULL */ for (i=0; in_partners; i++) { if (ctx->partners[i] != MPI_PROC_NULL) totlen += len; } return totlen; } /* This also needs a function to compute the amount of communication */ int GetHaloPartners( void *ctx ) { int i, totlen = 0; HaloData *hctx = (HaloData *)ctx; /* This needs to be adjusted for partners that are PROC_NULL */ for (i=0; in_partners; i++) { if (hctx->partners[i] != MPI_PROC_NULL) totlen ++; } return totlen; } void PrintHaloHelp( void ) { fprintf( stderr, "\ Special options for -halo:\n\ -npartner n - Specify the number of partners\n\ -waitany - Use a loop over waitany instead of a single waitall\n\ -periodic - Use periodic mesh partners\n\ -debug - Provide some debugging information\n\ " ); } perftest-1.3a/goptest.c0000664000115300004540000003235707465572065010715 int __NUMNODES, __MYPROCID ; /* This program is intended to be used in testing the SCALABILITY of the collective operations as a function of the number of processes; mpptest looks at the SIZE of the messages. */ #include #include "mpi.h" #include "mpptest.h" #include "getopts.h" extern int __NUMNODES, __MYPROCID; #if HAVE_STDLIB_H #include #endif #ifndef DEFAULT_REPS #define DEFAULT_REPS 50 #endif double (*GetGOPFunction(int*, char *[], char *, char *))(int,int,void *); void RunAGOPTest( int len, int *Len1, int *Len2, double *T1, double *T2, int *reps, double (*f)(int,int,void*), int myproc, void *outctx, void *msgctx ); void time_gop_function( int reps, int first, int last, int incr, double (*f)(int,int,void*), void *outctx, void *msgctx); double RunSingleGOPTest( double (*f)(int,int,void*), int reps, int len, void *msgctx ); int PrintHelp( char *argv[] ); int ComputeGoodReps( double t1, int len1, double t2, int len2, int len ); int GetRepititions( double, double, int, int, int, int ); /* These statics (globals) are used to estimate the parameters in the basic (s + rn) complexity model */ static double sumtime = 0.0, sumlentime = 0.0; static double sumlen = 0, sumlen2 = 0; static double sumtime2 = 0.0; static int ntest = 0; /* If doinfo is 0, don't write out the various text lines */ static int doinfo = 1; /* Having separate head and tail commands allows us to make multiple runs and concatenate the output */ static int doheader = 1; static int dotail = 1; /* Scaling of time and rate */ static double TimeScale = 1.0; static double RateScale = 1.0; /* This is the number of times to run a test, taking as time the minimum achieve timing. This uses an adaptive approach that also stops when minThreshTest values are within a few percent of the current minimum */ static int minreps = 30; static int minThreshTest = 3; static double repsThresh = 0.05; static int NatThresh = 3; char test_name[256]; /* We would also like to adaptively modify the number of repetitions to meet a time estimate (later, we'd like to meet a statistical estimate). One relatively easy way to do this is to use a linear estimate (either extrapolation or interpolation) based on 2 other computations. That is, if the goal time is T and the measured tuples (time,reps,len) are, the formula for the local time is s + r n, where r = (time2/reps2 - time1/reps1) / (len2 - len1) s = time1/reps1 - r * len1 Then the appropriate number of repititions to use is Tgoal / (s + r * len) = reps */ static double Tgoal = 1.0; /* If less than Tgoalmin is spent, increase the number of repititions */ static double TgoalMin = 0.5; static int AutoReps = 0; /* This structure allows a collection of arbitray sizes to be specified */ #define MAX_SIZE_LIST 256 static int sizelist[MAX_SIZE_LIST]; static int nsizes = 0; int main( int argc, char *argv[]) { double (* f)(int,int,void*); void *MsgCtx = 0; /* This is the context of the message-passing operation */ void *outctx; int reps; int first,last,incr, svals[3]; char units[32]; /* Name of units of length */ MPI_Init( &argc, &argv ); MPI_Comm_size( MPI_COMM_WORLD, &__NUMNODES ); MPI_Comm_rank( MPI_COMM_WORLD, &__MYPROCID ); strcpy( units, "" ); if (SYArgHasName( &argc, argv, 1, "-help" )) { return PrintHelp( argv ); } if (__NUMNODES < 2) { fprintf( stderr, "Must run goptest with at least 2 nodes\n" ); return 1; } /* Get the output context */ outctx = SetupGraph( &argc, argv ); if (SYArgHasName( &argc, argv, 1, "-noinfo" )) doinfo = 0; if (SYArgHasName( &argc, argv, 1, "-nohead" )) doheader = 0; if (SYArgHasName( &argc, argv, 1, "-notail" )) dotail = 0; reps = DEFAULT_REPS; if (SYArgHasName( &argc, argv, 0, "-sync") ) { svals[0] = svals[1] = svals[2] = 0; } else { /* We use fewer values because we are generating them on the same line. */ svals[0] = 0; svals[1] = 1024; svals[2] = 256; } SYArgGetIntVec( &argc, argv, 1, "-size", 3, svals ); nsizes = SYArgGetIntList( &argc, argv, 1, "-sizelist", MAX_SIZE_LIST, sizelist ); /* We ALWAYS use sizelist */ if (nsizes == 0) { /* Generate the size list from the svals list */ sizelist[0] = svals[0]; for (nsizes=1; sizelist[nsizes-1] < svals[1] && nsizes svals[1]) nsizes--; } SYArgGetInt( &argc, argv, 1, "-reps", &reps ); if (SYArgHasName( &argc, argv, 1, "-autoreps" )) AutoReps = 1; if (SYArgGetDouble( &argc, argv, 1, "-tgoal", &Tgoal )) { AutoReps = 1; if (TgoalMin > 0.1 * Tgoal) TgoalMin = 0.1 * Tgoal; } SYArgGetDouble( &argc, argv, 1, "-rthresh", &repsThresh ); f = GetGOPFunction( &argc, argv, test_name, units ); MsgCtx = GOPInit( &argc, argv ); first = svals[0]; last = svals[1]; incr = svals[2]; if (incr == 0) incr = 1; /* Finally, we are ready to run the tests. We want to report times as the times for a single link, and rates as the aggregate rate. To do this, we need to know how to scale both the times and the rates. Times: scaled by the number of one-way trips measured by the base testing code. This is often 2 trips, or a scaling of 1/2. Rates: scaled by the number of simultaneous participants (as well as the scaling in times). Compute the rates based on the updated time, then multiply by the number of participants. Note that, for a single sender, time and rate are inversely proportional (that is, if TimeScale is 0.5, RateScale is 2.0). */ if (doinfo && doheader &&__MYPROCID == 0) { HeaderForGopGraph( outctx, test_name, (char *)0, units ); } time_gop_function(reps,first,last,incr,f,outctx,MsgCtx); /* Generate the "end of page". This allows multiple graphs on the same plot */ if (doinfo && dotail && __MYPROCID == 0) EndPageGraph( outctx ); MPI_Finalize(); return 0; } /* This is the basic routine for timing an operation. Input Parameters: . reps - Basic number of times to run basic test (see below) . first,last,incr - length of data is first, first+incr, ... last (if last != first + k * incr, then actual last value is the value of first + k * incr that is <= last and such that first + (k+1) * incr > last, just as you'd expect) . f - Routine to call to run a basic test. This routine returns the time that the test took in seconds. . outctx - Pointer to output context . msgctx - Context to pass through to operation routine */ void time_gop_function( int reps, int first, int last, int incr, double (*f)(int,int,void*), void *outctx, void *msgctx) { int len, myproc, np; double s, r; double T1, T2; int Len1, Len2; int i; myproc = __MYPROCID; np = __NUMNODES; /* Run test, using either the simple direct test or the automatic length test */ ntest = 0; T1 = 0; T2 = 0; if(myproc==0) { DatabeginForGop( outctx, np ); } for (i=0; i 0.0) rate = ((double)len)/mean_time; else rate = 0.0; if(myproc==0) { DataoutGraphForGop( outctx, len, t * TimeScale, mean_time * TimeScale, rate * RateScale, tmean, tmax ); } *T1 = *T2; *Len1 = *Len2; *T2 = mean_time; *Len2 = len; } /* This routine computes a good number of repititions to use based on previous computations */ int ComputeGoodReps( double t1, int len1, double t2, int len2, int len ) { double s, r; int reps; r = (t2 - t1) / (len2 - len1); s = t1 - r * len1; if (s <= 0.0) s = 0.0; reps = Tgoal / (s + r * len ); if (reps < 1) reps = 1; /* printf( "Reps = %d (%d,%d,%d)\n", reps, len1, len2, len ); fflush( stdout ); */ return reps; } /* This runs the tests for a single size. It adapts to the number of tests necessary to get a reliable value for the minimum time. It also keeps track of the average and maximum times (which are unused for now). We can estimate the variance of the trials by using the following formulas: variance = (1/N) sum (t(i) - (s+r n(i))**2 = (1/N) sum (t(i)**2 - 2 t(i)(s + r n(i)) + (s+r n(i))**2) = (1/N) (sum t(i)**2 - 2 s sum t(i) - 2 r sum t(i)n(i) + sum (s**2 + 2 r s n(i) + r**2 n(i)**2)) Since we compute the parameters s and r, we need only maintain sum t(i)**2 sum t(i)n(i) sum n(i)**2 We already keep all of these in computing the (s,r) parameters; this is simply a different computation. In the case n == constant (that is, inside a single test), we can use a similar test to estimate the variance of the individual measurements. In this case, variance = (1/N) sum (t(i) - s**2 = (1/N) sum (t(i)**2 - 2 t(i)s + s**2) = (1/N) (sum t(i)**2 - 2 s sum t(i) + sum s**2) Here, s = sum t(i)/N (For purists, the divison should be slightly different from (1/N) in the variance formula. I'll deal with that later.) */ double RunSingleGOPTest( double (*f)(int,int,void*), int reps, int len, void *msgctx ) { int flag, k, iwork, natmin; double t, tmin, mean_time, tmax, tsum; flag = 0; tmin = 1.0e+38; tmax = tsum = 0.0; natmin = 0; for (k=0; k tmax) tmax = t; if (t < tmin) { tmin = t; natmin = 0; } else if (minThreshTest < k && tmin * (1.0 + repsThresh) > t) { /* This time is close to the minimum; use this to decide that we've gotten close enough */ natmin++; if (natmin >= NatThresh) flag = 1; } } MPI_Allreduce(&flag, &iwork, 1, MPI_INT,MPI_SUM,MPI_COMM_WORLD ); memcpy(&flag,&iwork,(1)*sizeof(int));; if (flag > 0) break; } mean_time = tmin / reps; sumlen += len; sumtime += mean_time; sumlen2 += ((double)len)*((double)len); sumlentime += mean_time * len; sumtime2 += mean_time * mean_time; ntest ++; return tmin; } int PrintHelp( char *argv[] ) { if (__MYPROCID != 0) return 0; fprintf( stderr, "%s - test individual communication speeds\n", argv[0] ); fprintf( stderr, "Test a collective communication by various methods. The tests are \n\ combinations of\n" ); fprintf( stderr, " Message sizes:\n\ -size start end stride (default 0 1024 256)\n\ Messages of length (start + i*stride) for i=0,1,... until\n\ the length is greater than end.\n\ -sizelist n1,n2,...\n\ Messages of length n1, n2, etc are used. This overrides \n\ -size\n"); fprintf( stderr, "\n\ Number of tests\n\ -reps n Number of times message is sent (default %d)\n", DEFAULT_REPS ); fprintf( stderr, "\ -autoreps Compute the number of times a message is sent automatically\n\ -tgoal d Time that each test should take, in seconds. Use with \n\ -autoreps\n\ -rthresh d Fractional threshold used to determine when minimum time\n\ has been found. The default is 0.05.\n\ \n" ); fprintf( stderr, "\n\ Output options\n\ -nohead Do not print graphics header info\n\ -notail Do not print graphics tail info\n\ -noinfo Print neither head nor tail\n\ \n" ); fprintf( stderr, " -gop [ options ]:\n" ); PrintGOPHelp(); PrintGraphHelp(); return 0; } /* Re-initialize the variables used to estimate the time that it takes to send data */ void ClearTimes( void ) { sumtime = 0.0; sumlentime = 0.0; sumlen = 0.0; sumlen2 = 0.0; sumtime2 = 0.0; ntest = 0; } int GetRepititions( double T1, double T2, int Len1, int Len2, int len, int reps ) { if (__MYPROCID == 0) { if (T1 > 0 && T2 > 0) reps = ComputeGoodReps( T1, Len1, T2, Len2, len ); } MPI_Bcast(&reps, 1, MPI_INT, 0, MPI_COMM_WORLD ); return reps; } perftest-1.3a/buflimit.c0000664000115300004540000000545307135117300011015 /* test program to find out how much buffering a system supplies */ #include "mpi.h" #include "mpptestconf.h" #ifdef HAVE_STDLIB_H #include #endif #include int main( int argc, char *argv[]) { int myid, numprocs; int namelen; char processor_name[MPI_MAX_PROCESSOR_NAME]; char *buf; int bufsize, other, done, i; double t1, t2, tbase; MPI_Status status; MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD,&numprocs); MPI_Comm_rank(MPI_COMM_WORLD,&myid); if ((numprocs % 2) != 0) { fprintf( stderr, "buflimit requires an even number of processes\n" ); MPI_Abort(MPI_COMM_WORLD, 1); } /* Output processor names in rank order */ MPI_Get_processor_name(processor_name,&namelen); if (myid > 0) MPI_Recv( MPI_BOTTOM, 0, MPI_INT, myid - 1, 5, MPI_COMM_WORLD, &status ); fprintf(stderr,"Process %d on %s\n", myid, processor_name); fflush( stderr ); if (myid + 1 < numprocs) MPI_Send( MPI_BOTTOM, 0, MPI_INT, myid + 1, 5, MPI_COMM_WORLD ); bufsize = 1024; other = (myid + 1) % 2; done = 0; while (!done && bufsize < 1024*1024*16) { if ((buf = (char *) malloc (bufsize)) == NULL) { fprintf(stderr, "%d could not malloc %d bytes\n", myid, bufsize ); MPI_Abort( MPI_COMM_WORLD, 1 ); } /* fprintf(stderr,"%d sending %d to %d\n", myid, bufsize, other ); */ if ((myid % 2) == 0) { MPI_Send( MPI_BOTTOM, 0, MPI_INT, other, 1, MPI_COMM_WORLD ); MPI_Recv( MPI_BOTTOM, 0, MPI_INT, other, 2, MPI_COMM_WORLD, &status ); /* Compute a time to send when the receive is waiting */ t1 = MPI_Wtime(); MPI_Send( buf, bufsize, MPI_CHAR, other, 100, MPI_COMM_WORLD ); t2 = MPI_Wtime(); tbase = t2 - t1; MPI_Recv( MPI_BOTTOM, 0, MPI_INT, other, 2, MPI_COMM_WORLD, &status ); /* Compute a time when the receive is NOT waiting */ t1 = MPI_Wtime(); MPI_Send( buf, bufsize, MPI_CHAR, other, 100, MPI_COMM_WORLD ); t2 = MPI_Wtime(); if (t2 - t1 > 1.5 && t2 - t1 > 2.0 * tbase) { printf( "MPI_Send blocks with buffers of size %d\n", bufsize ); done = 1; } } else { MPI_Recv( MPI_BOTTOM, 0, MPI_INT, other, 1, MPI_COMM_WORLD, &status ); t1 = MPI_Wtime(); MPI_Send( MPI_BOTTOM, 0, MPI_INT, other, 2, MPI_COMM_WORLD ); MPI_Recv( buf, bufsize, MPI_CHAR, other, 100, MPI_COMM_WORLD, &status ); MPI_Send( MPI_BOTTOM, 0, MPI_INT, other, 2, MPI_COMM_WORLD ); while (MPI_Wtime() - t1 < 2.0) ; MPI_Recv( buf, bufsize, MPI_CHAR, other, 100, MPI_COMM_WORLD, &status ); } fprintf(stderr,"%d received %d fr %d\n", myid, bufsize, other ); free( buf ); i = done; MPI_Allreduce( &i, &done, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD ); bufsize *= 2; } MPI_Finalize(); return 0; } perftest-1.3a/mpptest.h0000664000115300004540000000775307314641664010726 #ifndef _MPPTEST #define _MPPTEST #include "mpptestconf.h" /* Definitions for pair-wise communication testing */ typedef double (*TimeFunction)( int, int, void * ); typedef struct _PairData *PairData; /* Structure for the collective communication testing */ typedef struct { MPI_Comm pset; /* Procset to test over */ int src; /* Source (for scatter) */ } GOPctx; #define NO_NBR -1 /* size of the job and my rank in MPI_COMM_WORLD */ extern int __NUMNODES, __MYPROCID; /* Function prototypes */ PairData PairInit( int, int ); PairData BisectInit( int ); void PrintPairInfo( PairData ); void PairChange( int, PairData ); void BisectChange( int, PairData ); int set_vector_stride( int ); void *GOPInit( int *, char ** ); void RunATest( int, int*, int*, double *, double *, int *, double (*)(int,int, void *), int, int, int, int, void *, void *); void CheckTimeLimit( void ); double (*GetPairFunction( int *, char *[], char * ))(int, int, void *); double (*GetGOPFunction( int*, char *[], char *, char *))(int, int, void *); double (*GetHaloFunction( int *, char *[], void *, char * ))(int, int, void *); int GetHaloPartners( void * ); void PrintHaloHelp( void ); /* copy.c : memcpy test */ double memcpy_rate( int, int, void *); double memcpy_rate_int( int, int, void *); double memcpy_rate_double( int, int, void *); double memcpy_rate_long_long( int, int, void *); double memcpy_rate_double_vector( int, int, void *); double memcpy_rate_long_long_vector( int, int, void *); /* Overlap testing */ typedef struct { int proc1, proc2; int MsgSize; /* Size of message in bytes */ int OverlapSize, /* */ OverlapLen, /* */ OverlapPos; /* Location in buffers */ double *Overlap1, *Overlap2; /* Buffers */ } OverlapData; double round_trip_nb_overlap( int, int, void *); double round_trip_b_overlap( int, int, void *); void *OverlapInit( int, int, int ); void OverlapSizes( int, int [3], void *); /* Graphics routines */ typedef struct _GraphData *GraphData; /* Routine to generate graphics context */ GraphData SetupGraph( int *, char *[] ); void PrintGraphHelp( void ); void HeaderGraph( GraphData ctx, char *protocol_name, char *title_string, char *units ); void DrawGraph( GraphData ctx, int first, int last, double s, double r ); void RateoutputGraph( GraphData ctx, double sumlen, double sumtime, double sumlentime, double sumlen2, double sumtime2, int ntest, double *S, double *R ); void EndPageGraph( GraphData ctx ); void EndGraph( GraphData ctx ); void DataoutGraph( GraphData ctx, int proc1, int proc2, int distance, int len, double t, double mean_time, double rate, double tmean, double tmax ); void DataScale( GraphData, int ); void DrawGraphGop( GraphData ctx, int first, int last, double s, double r, int nsizes, int *sizelist ); void HeaderForGopGraph( GraphData ctx, char *protocol_name, char *title_string, char *units ); void DataoutGraphForGop( GraphData ctx, int len, double t, double mean_time, double rate, double tmean, double tmax ); void DataendForGop( GraphData ctx ); void DatabeginForGop( GraphData ctx, int np ); /* Global operations */ void PrintGOPHelp( void ); /* Patterns */ void PrintPatternHelp( void ); int GetNeighbor( int, int, int ); void SetPattern( int *, char *[] ); int GetMaxIndex( void ); int GetDestination( int, int, int ); int GetSource( int, int, int ); /* Prototypes */ double RunSingleTest( double (*)(int,int,void *), int, int, void *, double *, double * ); void time_function( int, int, int, int, int, int, double (*)( int, int, void * ), void *, int, int, double, void *); void ClearTimes(void); /* Rate */ void PIComputeRate( double sumlen, double sumtime, double sumlentime, double sumlen2, int ntest, double *s, double *r ); /* MPE Seq */ void MPE_Seq_begin( MPI_Comm, int ); void MPE_Seq_end( MPI_Comm, int ); /* gopf.c (goptest) */ void *GOPInit( int *, char ** ); #endif perftest-1.3a/getopts.h0000664000115300004540000000123307040675655010705 #ifndef _GETOPTS_H #define _GETOPTS_H void SYArgSqueeze( int *Argc, char **argv ); int SYArgFindName( int argc, char **argv, char *name ); int SYArgGetInt( int *Argc, char **argv, int rflag, char *name, int *val ); int SYArgGetDouble( int *Argc, char **argv, int rflag, char *name, double *val ); int SYArgGetString( int *Argc, char **argv, int rflag, char *name, char *val, int vallen ); int SYArgHasName( int *Argc, char **argv, int rflag, char *name ); int SYArgGetIntVec( int *Argc, char **argv, int rflag, char *name, int n, int *val ); int SYArgGetIntList( int *Argc, char **argv, int rflag, char *name, int n, int *val ); #endif perftest-1.3a/config/0000775000115300004540000000000007666706563010404 5perftest-1.3a/config/install-sh0000755000115300004540000001273607101376405012315 #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 perftest-1.3a/config/mkinstalldirs0000775000115300004540000000132307102045077013106 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.1 2000/04/27 14:10:07 gropp Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here perftest-1.3a/config/missing0000755000115300004540000001421307101376727011707 #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 perftest-1.3a/config/confdb/0000775000115300004540000000000007666706563011637 5perftest-1.3a/config/confdb/.cvsignore0000664000115300004540000000021307660512601013531 www amdb tex pac.log pac.aux acconfig.h Makefile configure.in configure config.log config.status config.cache pac.ps pac.pdf config.system perftest-1.3a/config/confdb/Makefile.in0000664000115300004540000000267307660434704013621 # # Not yet a conforming Makefile... # SHELL = @SHELL@ SOURCES = aclocal.m4 aclocal_cache.m4 aclocal_cc.m4 aclocal_cross.m4 \ aclocal_f77.m4 aclocal_f90.m4 aclocal_make.m4 \ aclocal_mpi.m4 aclocal_perl.m4 \ aclocal_shl.m4 aclocal_cxx.m4 aclocal_bugfix.m4 \ aclocal_am.m4 aclocal_web.m4 aclocal_java.m4 config_SOURCES = acconfig.h.in acconfig_cc.h acconfig_f77.h DOCTEXT = ../src/doctext/doctext DOCTEXT_ARGS = -nolocation -heading Sowing -quotefmt -skipprefix dnl all: htmldoc texdoc .SUFFIXES: .tex .html .m4 htmldoc: ${SOURCES} ${DOCTEXT} ${DOCTEXT_ARGS} -html -mpath www ${SOURCES} rm -f www/index.htm @echo 'PAC Documentation' >www/index.htm @echo '' >>www/index.htm @echo '' >>www/index.htm @(cd www && ls -1 *.html | sed 's%^\(.*\)\.html%
  • \1%g' >>\ index.htm ) @echo '
  • ' >>www/index.htm texdoc: ${SOURCES} ${DOCTEXT} ${DOCTEXT_ARGS} -latex -mpath tex ${SOURCES} rm -f tex/ref.tex @(cd tex && ls -1 *.tex | sed 's%^\(.*\)\.tex%\\input \1.tex%g' > ../ref.tex) @mv ref.tex tex/ref.tex @(cd tex && @LATEX@ ../pac && dvips pac && dvipdfm pac) @mv tex/pac.pdf . @mv tex/pac.ps . acconfig.h: ${config_SOURCES} @-rm -f acconfig.h cat ${config_SOURCES} | sed '/#include/d' > acconfig.h clean: -rm -f *~ tex/*.log tex/*.aux tex/*.dvi dist-clean: clean rm -f config.cache config.log config.status Makefile maintainer-clean: dist-clean perftest-1.3a/config/confdb/README0000444000115300004540000000033407041123604012403 This directory contains autoconf version 2 (2.13) aclocal.m4 files They are organized by category, so that you can include subsets in your own aclocal.m4 files if you prefer (the aclocal.m4 file here includes them all). perftest-1.3a/config/confdb/acconfig.h.in0000444000115300004540000000050707073437056014072 /* This is a parallel file to aclocal.m4. It uses includes the same way that aclocal.m4 does. Unfortunately, autoheader doesn't process the acconfig.h files with cpp or with m4. Thus, we use acconfig.h.in to form acconfig.h with cpp */ #include "acconfig_f77.h" #include "acconfig_cc.h" #include "acconfig_mpi.h" perftest-1.3a/config/confdb/acconfig_cc.h0000444000115300004540000000153307251240416014120 /* acconfig_cc.h */ /* Define if union semun is defined in sys/sem.h */ #undef HAVE_UNION_SEMUN /* Define if semctl requires a union semun argument in the 4th position */ #undef SEMCTL_NEEDS_SEMUN /* Define as empty if C does not support volatile */ #undef volatile /* Define if #pragma weak supported */ #undef HAVE_PRAGMA_WEAK /* Define is #pragma _HP_SECONDARY_DEF supported */ #undef HAVE_PRAGMA_HP_SEC_DEF /* Define is #pragma _CRI duplicate x as y supported */ #undef HAVE_PRAGMA_CRI_DUP /* Define if crypt requires a prototype */ #undef NEED_CRYPT_PROTOTYPE /* Define as empty if C does not support any form of restrict or define as the appropriate extension */ #undef restrict /* Define if the XOPEN versions of routines and header files are needed */ #undef _XOPEN_SOURCE /* Define as empty if C does not support inline */ #undef inline perftest-1.3a/config/confdb/acconfig_f77.h0000444000115300004540000000132407073437056014146 /* acconfig_f77.h */ /* Define if Fortran uses lowercase name mangling */ #undef F77_NAME_LOWER /* Define if Fortran use lowercase followed by an underscore */ #undef F77_NAME_LOWER_USCORE /* Define if Fortran uses uppercase */ #undef F77_NAME_UPPER /* Define if Fortran uses two underscores for names with an underscore (and one for names without an underscore) */ #undef F77_NAME_LOWER_2USCORE /* Define if Fortran leaves case unchanged */ #undef F77_NAME_MIXED /* Define if Fortran leaves case unchanged, followed by an underscore */ #undef F77_NAME_MIXED_USCORE /* Sizeof standard Fortran types */ #undef SIZEOF_F77_DOUBLE_PRECISION #undef SIZEOF_F77_INTEGER #undef SIZEOF_F77_INTEGER_4 #undef SIZEOF_F77_REAL perftest-1.3a/config/confdb/acconfig_mpi.h0000444000115300004540000000011107073437056014321 /* Define if MPI_xxx_f2c and c2f routines defined */ #undef HAVE_MPI_F2C perftest-1.3a/config/confdb/aclocal.m40000664000115300004540000000423407641335127013405 dnl dnl This version of aclocal.m4 simply includes all of the individual dnl components builtin(include,aclocal_am.m4) builtin(include,aclocal_bugfix.m4) builtin(include,aclocal_cache.m4) builtin(include,aclocal_cc.m4) builtin(include,aclocal_cross.m4) builtin(include,aclocal_cxx.m4) builtin(include,aclocal_f77.m4) dnl If we're using 2.52, include new support for F90 ifelse(AC_ACVERSION,[2.52],[ builtin(include,aclangf90.m4) ],[ builtin(include,aclocal_f90.m4) ]) builtin(include,aclocal_make.m4) builtin(include,aclocal_mpi.m4) builtin(include,aclocal_web.m4) builtin(include,aclocal_shl.m4) dnl builtin(include,aclocal_tcl.m4) builtin(include,aclocal_java.m4) dnl PAC_CONFIG_SUBDIRS_IMMEDIATE(DIR ...) dnl Perform the configuration *now* dnl dnl There is a bug in AC_OUTPUT_SUBDIRS that is tickled by this dnl code. There is no step to create any of the intermediate dnl directories in the case that this is a vpath build. dnl AC_DEFUN(PAC_CONFIG_SUBDIRS_IMMEDIATE, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl SAVE_subdirs="$subdirs" subdirs="$1" # # Build any intermediate directories for dir in $1 ; do saveIFS="$IFS" IFS="/" curdir="" for subdir in $dir ; do curdir="${curdir}$subdir" if test ! -d "$curdir" ; then mkdir "$curdir" ; fi curdir="${curdir}/" done IFS="$saveIFS" done PAC_CACHE_CLEAN dnl autoconf 2.52 uses _ before *some* internal commands (!) dnl output_subdirs *ALSO* resets INSTALL. It *also* requires that dnl ac_given_INSTALL be set to INSTALL SAVE_INSTALL="$INSTALL" ac_given_INSTALL="$INSTALL" ifdef([AC_OUTPUT_SUBDIRS],[AC_OUTPUT_SUBDIRS($1)],[_AC_OUTPUT_SUBDIRS($1)]) subdirs="$SAVE_subdirs" INSTALL="$SAVE_INSTALL" ]) dnl dnl Find something to use for mkdir -p. Eventually, this will dnl have a script for backup AC_DEFUN(PAC_PROG_MKDIR_P,[ AC_CACHE_CHECK([whether mkdir -p works], pac_cv_mkdir_p,[ pac_cv_mkdir_p=no rm -rf .tmp if mkdir -p .tmp/.foo 1>/dev/null 2>&1 ; then if test -d .tmp/.foo ; then pac_cv_mkdir_p=yes fi fi ]) if test "$pac_cv_mkdir_p" = "yes" ; then MKDIR_P="mkdir -p" export MKDIR_P else AC_MSG_WARN([mkdir -p does not work; the install step may fail]) fi AC_SUBST(MKDIR_P) ]) perftest-1.3a/config/confdb/aclocal_am.m40000444000115300004540000000071407113030433014037 dnl dnl Automake updates dnl dnl dnl AM_IGNORE is an extension that tells (a patched) automake not to dnl include the specified AC_SUBST variable in the Makefile.in that dnl automake generates. We don't use AC_DEFUN, since aclocal will dnl then complain that AM_IGNORE is a duplicate (if you are using the dnl patched automake/aclocal). ifdef([AM_IGNORE],,[ define([AM_IGNORE],)]) AC_DEFUN(PAC_PROVIDE_IGNORE,[ ifdef([AM_IGNORE],,[ define([AM_IGNORE],)]) ]) perftest-1.3a/config/confdb/aclocal_bugfix.m40000664000115300004540000001052207661256341014750 dnl dnl Fixes to bugs in AC_xxx macros dnl dnl (AC_TRY_COMPILE is missing a newline after the end in the Fortran dnl branch; that has been fixed in-place) dnl dnl (AC_PROG_CC makes many dubious assumptions. One is that -O is safe dnl with -g, even with gcc. This isn't true; gcc will eliminate dead code dnl when -O is used, even if you added code explicitly for debugging dnl purposes. -O shouldn't do dead code elimination when -g is selected, dnl unless a specific option is selected. Unfortunately, there is no dnl documented option to turn off dead code elimination. dnl dnl dnl (AC_CHECK_HEADER and AC_CHECK_HEADERS both make the erroneous assumption dnl that the C-preprocessor and the C (or C++) compilers are the same program dnl and have the same search paths. In addition, CHECK_HEADER looks for dnl error messages to decide that the file is not available; unfortunately, dnl it also interprets messages such as "evaluation copy" and warning messages dnl from broken CPP programs (such as IBM's xlc -E, which often warns about dnl "lm not a valid option"). Instead, we try a compilation step with the dnl C compiler. dnl dnl AC_CONFIG_AUX_DIRS only checks for install-sh, but assumes other dnl values are present. Also doesn't provide a way to override the dnl sources of the various configure scripts. This replacement dnl version of AC_CONFIG_AUX_DIRS overcomes this. dnl Internal subroutine. dnl Search for the configuration auxiliary files in directory list $1. dnl We look only for install-sh, so users of AC_PROG_INSTALL dnl do not automatically need to distribute the other auxiliary files. dnl AC_CONFIG_AUX_DIRS(DIR ...) dnl Also note that since AC_CONFIG_AUX_DIR_DEFAULT calls this, there dnl isn't a easy way to fix it other than replacing it completely. dnl This fix applies to 2.13 dnl/*D dnl AC_CONFIG_AUX_DIRS - Find the directory containing auxillery scripts dnl for configure dnl dnl Synopsis: dnl AC_CONFIG_AUX_DIRS( [ directories to search ] ) dnl dnl Output Effect: dnl Sets 'ac_config_guess' to location of 'config.guess', 'ac_config_sub' dnl to location of 'config.sub', 'ac_install_sh' to the location of dnl 'install-sh' or 'install.sh', and 'ac_configure' to the location of a dnl Cygnus-style 'configure'. Only 'install-sh' is guaranteed to exist, dnl since the other scripts are needed only by some special macros. dnl dnl The environment variable 'CONFIG_AUX_DIR', if set, overrides the dnl directories listed. This is an extension to the 'autoconf' version of dnl this macro. dnl D*/ undefine([AC_CONFIG_AUX_DIRS]) AC_DEFUN(AC_CONFIG_AUX_DIRS, [if test -f $CONFIG_AUX_DIR/install-sh ; then ac_aux_dir=$CONFIG_AUX_DIR else ac_aux_dir= for ac_dir in $1; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done fi if test -z "$ac_aux_dir"; then AC_MSG_ERROR([can not find install-sh or install.sh in $1]) fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl ]) undefine([AC_CHECK_HEADER]) AC_DEFUN(AC_CHECK_HEADER, [dnl Do the transliteration at runtime so arg 1 can be a shell variable. ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(ac_cv_header_$ac_safe, [cat >conftest.c< int conftest() {return 0;} EOF ac_compile_for_cpp='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&AC_FD_CC' if AC_TRY_EVAL(ac_compile_for_cpp); then eval "ac_cv_header_$ac_safe=yes" else eval "ac_cv_header_$ac_safe=no" echo "configure: failed program was:" >&AC_FD_CC cat conftest.c >&AC_FD_CC fi rm -f conftest* ])dnl if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) ifelse([$3], , , [$3 ])dnl fi ]) dnl dnl This internal macro fails to work properly with OTHER internal macros. dnl Basically, if the prologue is [], then no message should be generated. dnl This macro is in autoconf 2.52 m4_define([AC_LANG_PROGRAM(Fortran 77)], [m4_if([$1],[[[]]],,[m4_ifval([$1], [m4_warn([syntax], [$0: ignoring PROLOGUE: $1])])])dnl program main $2 end]) perftest-1.3a/config/confdb/aclocal_cache.m40000664000115300004540000001676407660434704014545 dnl dnl/*D dnl AC_CACHE_LOAD - Replacement for autoconf cache load dnl dnl Notes: dnl Caching in autoconf is broken (through version 2.13). The problem is dnl that the cache is read dnl without any check for whether it makes any sense to read it. dnl A common problem is a build on a shared file system; connecting to dnl a different computer and then building within the same directory will dnl lead to at best error messages from configure and at worse a build that dnl is wrong but fails only at run time (e.g., wrong datatype sizes used). dnl Later versions of autoconf do include some checks for changes in the dnl environment that impact the choices, but still misses problems with dnl multiple different systems. dnl dnl This fixes that by requiring the user to explicitly enable caching dnl before the cache file will be loaded. dnl dnl To use this version of 'AC_CACHE_LOAD', you need to include dnl 'aclocal_cache.m4' in your 'aclocal.m4' file. The sowing 'aclocal.m4' dnl file includes this file. dnl dnl If no --enable-cache or --disable-cache option is selected, the dnl command causes configure to keep track of the system being configured dnl in a config.system file; if the current system matches the value stored dnl in that file (or there is neither a config.cache nor config.system file), dnl configure will enable caching. In order to ensure that the configure dnl tests make sense, the values of CC, F77, F90, and CXX are also included dnl in the config.system file. dnl dnl Bugs: dnl This does not work with the Cygnus configure because the enable arguments dnl are processed *after* AC_CACHE_LOAD (!). To address this, we avoid dnl changing the value of enable_cache, and use real_enable_cache, duplicating dnl the "notgiven" value. dnl dnl See Also: dnl PAC_ARG_CACHING dnl D*/ define([AC_CACHE_LOAD], [if test "X$cache_system" = "X" ; then # A default file name, just in case cache_system="config.system" if test "$cache_file" != "/dev/null" ; then # Get the directory for the cache file, if any changequote(,) cache_system=`echo $cache_file | sed -e 's%^\(.*/\)[^/]*%\1/config.system%'` changequote([,]) test "x$cache_system" = "x$cache_file" && cache_system="config.system" # else # We must *not* set enable_cache to no because we need to know if # enable_cache was not set. # enable_cache=no fi fi dnl dnl The "action-if-not-given" part of AC_ARG_ENABLE is not executed until dnl after the AC_CACHE_LOAD is executed (!). Thus, the value of dnl enable_cache if neither --enable-cache or --disable-cache is selected dnl is null. Just in case autoconf ever fixes this, we test both cases. if test -z "$real_enable_cache" ; then real_enable_cache=$enable_cache if test -z "$real_enable_cache" ; then real_enable_cache="notgiven" ; fi fi if test "X$real_enable_cache" = "Xnotgiven" ; then # check for valid cache file if test -z "$cache_system" ; then cache_system="config.system" ; fi if uname -srm >/dev/null 2>&1 ; then dnl cleanargs=`echo "$*" | tr '"' ' '` cleanargs=`echo "$CC $F77 $CXX $F90" | tr '"' ' '` testval="`uname -srm` $cleanargs" if test -f "$cache_system" -a -n "$testval" ; then if test "$testval" = "`cat $cache_system`" ; then real_enable_cache="yes" fi elif test ! -f "$cache_system" -a -n "$testval" ; then echo "$testval" > $cache_system # remove the cache file because it may not correspond to our # system rm -f $cache_file real_enable_cache="yes" fi fi fi if test "X$real_enable_cache" = "Xyes" -a "$cache_file" = "/dev/null" ; then real_enable_cache=no fi if test "X$real_enable_cache" = "Xyes" ; then if test -r "$cache_file" ; then echo "loading cache $cache_file" if test -w "$cache_file" ; then # Clean the cache file (ergh) PAC_CACHE_CLEAN fi . $cache_file else echo "creating cache $cache_file" > $cache_file rm -f $cache_system cleanargs=`echo "$CC $F77 $CXX" | tr '"' ' '` testval="`uname -srm` $cleanargs" echo "$testval" > $cache_system fi else cache_file="/dev/null" fi ]) dnl dnl/*D dnl PAC_ARG_CACHING - Enable caching of results from a configure execution dnl dnl Synopsis: dnl PAC_ARG_CACHING dnl dnl Output Effects: dnl Adds '--enable-cache' and '--disable-cache' to the command line arguments dnl accepted by 'configure'. dnl dnl See Also: dnl AC_CACHE_LOAD dnl D*/ dnl Add this call to the other ARG_ENABLE calls. Note that the values dnl set here are redundant; the LOAD_CACHE call relies on the way autoconf dnl initially processes ARG_ENABLE commands. AC_DEFUN(PAC_ARG_CACHING,[ AC_ARG_ENABLE(cache, [--enable-cache - Turn on configure caching], enable_cache="$enableval",enable_cache="notgiven") ]) dnl dnl Clean the cache of extraneous quotes that AC_CACHE_SAVE may add AC_DEFUN([PAC_CACHE_CLEAN],[ rm -f confcache sed -e "s/'\\\\''//g" -e "s/'\\\\/'/" -e "s/\\\\'/'/" \ -e "s/'\\\\''//g" $cache_file > confcache if cmp -s $cache_file confcache ; then : else if test -w $cache_file ; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache if test "$DEBUG_AUTOCONF_CACHE" = "yes" ; then echo "Results of cleaned cache file:" echo "--------------------------------------------------------" cat $cache_file echo "--------------------------------------------------------" fi ]) dnl/*D dnl PAC_SUBDIR_CACHE - Create a cache file before ac_output for subdirectory dnl configures. dnl dnl Synopsis: dnl PAC_SUBDIR_CACHE dnl dnl Output Effects: dnl dnl Create a cache file before ac_output so that subdir configures don't dnl make mistakes. dnl We can't use OUTPUT_COMMANDS to remove the cache file, because those dnl commands are executed *before* the subdir configures. dnl dnl D*/ AC_DEFUN(PAC_SUBDIR_CACHE,[ if test "$cache_file" = "/dev/null" -a "X$real_enable_cache" = "Xnotgiven" ; then cache_file=$$conf.cache touch $cache_file dnl dnl For Autoconf 2.52+, we should ensure that the environment is set dnl for the cache. ac_cv_env_CC_set=set ac_cv_env_CC_value=$CC ac_cv_env_CFLAGS_set=set ac_cv_env_CFLAGS_value=$CFLAGS ac_cv_env_CPP_set=set ac_cv_env_CPP_value=$CPP ac_cv_env_CPPFLAGS_set=set ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_LDFLAGS_set=set ac_cv_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LIBS_set=set ac_cv_env_LIBS_value=$LIBS ac_cv_env_FC_set=set ac_cv_env_FC_value=$FC ac_cv_env_F77_set=set ac_cv_env_F77_value=$F77 ac_cv_env_FFLAGS_set=set ac_cv_env_FFLAGS_value=$FFLAGS ac_cv_env_CXX_set=set ac_cv_env_CXX_value=$CXX dnl other parameters are dnl build_alias, host_alias, target_alias # It turns out that A C CACHE_SAVE can't be invoked more than once # with data that contains blanks. What happens is that the quotes # that it adds get quoted and then added again. To avoid this, # we strip off the outer quotes for all cached variables AC_CACHE_SAVE PAC_CACHE_CLEAN ac_configure_args="$ac_configure_args -enable-cache" fi dnl Unconditionally export these values. Subdir configures break otherwise export CC export CFLAGS export LDFLAGS export LIBS export CPPFLAGS export CPP export FC export F77 export CXX export FFLAGS export CCFLAGS ]) AC_DEFUN(PAC_SUBDIR_CACHE_CLEANUP,[ if test "$cache_file" != "/dev/null" -a "X$real_enable_cache" = "Xnotgiven" ; then rm -f $cache_file fi ]) perftest-1.3a/config/confdb/aclocal_cc.m40000664000115300004540000011746007660434705014063 dnl dnl This is a replacement for AC_PROG_CC that does not prefer gcc and dnl that does not mess with CFLAGS. See acspecific.m4 for the original defn. dnl dnl/*D dnl PAC_PROG_CC - Find a working C compiler dnl dnl Synopsis: dnl PAC_PROG_CC dnl dnl Output Effect: dnl Sets the variable CC if it is not already set dnl dnl Notes: dnl Unlike AC_PROG_CC, this does not prefer gcc and does not set CFLAGS. dnl It does check that the compiler can compile a simple C program. dnl It also sets the variable GCC to yes if the compiler is gcc. It does dnl not yet check for some special options needed in particular for dnl parallel computers, such as -Tcray-t3e, or special options to get dnl full ANSI/ISO C, such as -Aa for HP. dnl dnl D*/ dnl 2.52 doesn't have AC_PROG_CC_GNU ifdef([AC_PROG_CC_GNU],,[AC_DEFUN([AC_PROG_CC_GNU],)]) AC_DEFUN(PAC_PROG_CC,[ AC_PROVIDE([AC_PROG_CC]) AC_CHECK_PROGS(CC, cc xlC xlc pgcc icc gcc ) test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) PAC_PROG_CC_WORKS AC_PROG_CC_GNU if test "$ac_cv_prog_gcc" = yes; then GCC=yes else GCC= fi ]) dnl dnl/*D dnl PAC_C_CHECK_COMPILER_OPTION - Check that a compiler option is accepted dnl without warning messages dnl dnl Synopsis: dnl PAC_C_CHECK_COMPILER_OPTION(optionname,action-if-ok,action-if-fail) dnl dnl Output Effects: dnl dnl If no actions are specified, a working value is added to 'COPTIONS' dnl dnl Notes: dnl This is now careful to check that the output is different, since dnl some compilers are noisy. dnl dnl We are extra careful to prototype the functions in case compiler options dnl that complain about poor code are in effect. dnl dnl Because this is a long script, we have ensured that you can pass a dnl variable containing the option name as the first argument. dnl D*/ AC_DEFUN(PAC_C_CHECK_COMPILER_OPTION,[ AC_MSG_CHECKING([that C compiler accepts option $1]) save_CFLAGS="$CFLAGS" CFLAGS="$1 $CFLAGS" rm -f conftest.out echo 'int try(void);int try(void){return 0;}' > conftest2.c echo 'int main(void);int main(void){return 0;}' > conftest.c if ${CC-cc} $save_CFLAGS $CPPFLAGS -o conftest conftest.c $LDFLAGS >conftest.bas 2>&1 ; then if ${CC-cc} $CFLAGS $CPPFLAGS -o conftest conftest.c $LDFLAGS >conftest.out 2>&1 ; then if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then AC_MSG_RESULT(yes) AC_MSG_CHECKING([that routines compiled with $1 can be linked with ones compiled without $1]) /bin/rm -f conftest.out /bin/rm -f conftest.bas if ${CC-cc} -c $save_CFLAGS $CPPFLAGS conftest2.c >conftest2.out 2>&1 ; then if ${CC-cc} $CFLAGS $CPPFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.bas 2>&1 ; then if ${CC-cc} $CFLAGS $CPPFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.out 2>&1 ; then if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then AC_MSG_RESULT(yes) CFLAGS="$save_CFLAGS" ifelse($2,,COPTIONS="$COPTIONS $1",$2) elif test -s conftest.out ; then cat conftest.out >&AC_FD_CC AC_MSG_RESULT(no) CFLAGS="$save_CFLAGS" $3 else AC_MSG_RESULT(no) CFLAGS="$save_CFLAGS" $3 fi else if test -s conftest.out ; then cat conftest.out >&AC_FD_CC fi AC_MSG_RESULT(no) CFLAGS="$save_CFLAGS" $3 fi else # Could not link with the option! AC_MSG_RESULT(no) fi else if test -s conftest2.out ; then cat conftest.out >&AC_FD_CC fi AC_MSG_RESULT(no) CFLAGS="$save_CFLAGS" $3 fi else cat conftest.out >&AC_FD_CC AC_MSG_RESULT(no) $3 CFLAGS="$save_CFLAGS" fi else AC_MSG_RESULT(no) $3 if test -s conftest.out ; then cat conftest.out >&AC_FD_CC ; fi CFLAGS="$save_CFLAGS" fi else # Could not compile without the option! AC_MSG_RESULT(no) fi rm -f conftest* ]) dnl dnl/*D dnl PAC_C_OPTIMIZATION - Determine C options for producing optimized code dnl dnl Synopsis dnl PAC_C_OPTIMIZATION([action if found]) dnl dnl Output Effect: dnl Adds options to 'COPTIONS' if no other action is specified dnl dnl Notes: dnl This is a temporary standin for compiler optimization. dnl It should try to match known systems to known compilers (checking, of dnl course), and then falling back to some common defaults. dnl Note that many compilers will complain about -g and aggressive dnl optimization. dnl D*/ AC_DEFUN(PAC_C_OPTIMIZATION,[ for copt in "-O4 -Ofast" "-Ofast" "-fast" "-O3" "-xO3" "-O" ; do PAC_C_CHECK_COMPILER_OPTION($copt,found_opt=yes,found_opt=no) if test "$found_opt" = "yes" ; then ifelse($1,,COPTIONS="$COPTIONS $copt",$1) break fi done if test "$ac_cv_prog_gcc" = "yes" ; then for copt in "-fomit-frame-pointer" "-finline-functions" \ "-funroll-loops" ; do PAC_C_CHECK_COMPILER_OPTION($copt,found_opt=yes,found_opt=no) if test $found_opt = "yes" ; then ifelse($1,,COPTIONS="$COPTIONS $copt",$1) # no break because we're trying to add them all fi done # We could also look for architecture-specific gcc options fi ]) dnl dnl/*D dnl PAC_C_DEPENDS - Determine how to use the C compiler to generate dnl dependency information dnl dnl Synopsis: dnl PAC_C_DEPENDS dnl dnl Output Effects: dnl Sets the following shell variables and call AC_SUBST for them: dnl+ C_DEPEND_OPT - Compiler options needed to create dependencies dnl. C_DEPEND_OUT - Shell redirection for dependency file (may be empty) dnl. C_DEPEND_PREFIX - Empty (null) or true; this is used to handle dnl systems that do not provide dependency information dnl- C_DEPEND_MV - Command to move created dependency file dnl Also creates a Depends file in the top directory (!). dnl dnl In addition, the variable 'C_DEPEND_DIR' must be set to indicate the dnl directory in which the dependency files should live. dnl dnl Notes: dnl A typical Make rule that exploits this macro is dnl.vb dnl # dnl # Dependency processing dnl .SUFFIXES: .dep dnl DEP_SOURCES = ${SOURCES:%.c=.dep/%.dep} dnl C_DEPEND_DIR = .dep dnl Depends: ${DEP_SOURCES} dnl @-rm -f Depends dnl cat .dep/*.dep >Depends dnl .dep/%.dep:%.c dnl @if [ ! -d .dep ] ; then mkdir .dep ; fi dnl @@C_DEPEND_PREFIX@ ${C_COMPILE} @C_DEPEND_OPT@ $< @C_DEPEND_OUT@ dnl @@C_DEPEND_MV@ dnl dnl depends-clean: dnl @-rm -f *.dep ${srcdir}/*.dep Depends ${srcdir}/Depends dnl @-touch Depends dnl.ve dnl dnl For each file 'foo.c', this creates a file 'foo.dep' and creates a file dnl 'Depends' that contains all of the '*.dep' files. dnl dnl For your convenience, the autoconf variable 'C_DO_DEPENDS' names a file dnl that may contain this code (you must have `dependsrule` or dnl `dependsrule.in` in the same directory as the other auxillery configure dnl scripts (set with dnl 'AC_CONFIG_AUX_DIR'). If you use `dependsrule.in`, dnl you must have `dependsrule` in 'AC_OUTPUT' before this `Makefile`. dnl dnl D*/ dnl dnl Eventually, we can add an option to the C_DEPEND_MV to strip system dnl includes, such as /usr/xxxx and /opt/xxxx dnl AC_DEFUN(PAC_C_DEPENDS,[ AC_SUBST(C_DEPEND_OPT)AM_IGNORE(C_DEPEND_OPT) AC_SUBST(C_DEPEND_OUT)AM_IGNORE(C_DEPEND_OUT) AC_SUBST(C_DEPEND_MV)AM_IGNORE(C_DEPEND_MV) AC_SUBST(C_DEPEND_PREFIX)AM_IGNORE(C_DEPEND_PREFIX) AC_SUBST_FILE(C_DO_DEPENDS) dnl set the value of the variable to a dnl file that contains the dependency code, such as dnl ${top_srcdir}/maint/dependrule if test -n "$ac_cv_c_depend_opt" ; then AC_MSG_RESULT([Option $ac_cv_c_depend_opt creates dependencies (cached)]) C_DEPEND_OUT="$ac_cv_c_depend_out" C_DEPEND_MV="$ac_cv_c_depend_mv" C_DEPEND_OPT="$ac_cv_c_depend_opt" C_DEPEND_PREFIX="$ac_cv_c_depend_prefix" C_DO_DEPENDS="$ac_cv_c_do_depends" else # Determine the values rm -f conftest* dnl dnl Some systems (/usr/ucb/cc on Solaris) do not generate a dependency for dnl an include that doesn't begin in column 1 dnl cat >conftest.c <conftest.out 2>conftest.err && \ test ! -s conftest.err ; then dnl Check for dependency info in conftest.out if test -s conftest.u ; then C_DEPEND_OUT="" C_DEPEND_MV='mv $[*].u ${C_DEPEND_DIR}/$[*].dep' pac_dep_file=conftest.u elif test -s conftest.d ; then C_DEPEND_OUT="" C_DEPEND_MV='mv $[*].d ${C_DEPEND_DIR}/$[*].dep' pac_dep_file=conftest.d else dnl C_DEPEND_OUT='>${C_DEPEND_DIR}/$[*].dep' dnl This for is needed for VPATH. Perhaps the others should match. C_DEPEND_OUT='>$@' C_DEPEND_MV=: pac_dep_file=conftest.out fi if grep 'confdefs.h' $pac_dep_file >/dev/null 2>&1 ; then AC_MSG_RESULT(yes) C_DEPEND_OPT="$copt" AC_MSG_CHECKING([whether .o file created with dependency file]) if test -s conftest.o ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) echo "Output of $copt option was" >&AC_FD_CC cat $pac_dep_file >&AC_FD_CC fi break else AC_MSG_RESULT(no) fi else echo "Error in compiling program with flags $copt" >&AC_FD_CC cat conftest.out >&AC_FD_CC if test -s conftest.err ; then cat conftest.err >&AC_FD_CC ; fi AC_MSG_RESULT(no) fi copt="" done if test -f $CONFIG_AUX_DIR/dependsrule -o \ -f $CONFIG_AUX_DIR/dependsrule.in; then C_DO_DEPENDS="$CONFIG_AUX_DIR/dependsrule" else C_DO_DEPENDS="/dev/null" fi if test "X$copt" = "X" ; then C_DEPEND_PREFIX="true" else C_DEPEND_PREFIX="" fi ac_cv_c_depend_out="$C_DEPEND_OUT" ac_cv_c_depend_mv="$C_DEPEND_MV" ac_cv_c_depend_opt="$C_DEPEND_OPT" ac_cv_c_depend_prefix="$C_DEPEND_PREFIX" ac_cv_c_do_depends="$C_DO_DEPENDS" fi ]) dnl dnl/*D dnl PAC_C_PROTOTYPES - Check that the compiler accepts ANSI prototypes. dnl dnl Synopsis: dnl PAC_C_PROTOTYPES([action if true],[action if false]) dnl dnl D*/ AC_DEFUN(PAC_C_PROTOTYPES,[ AC_CACHE_CHECK([if $CC supports function prototypes], pac_cv_c_prototypes,[ AC_TRY_COMPILE([int f(double a){return 0;}],[return 0];, pac_cv_c_prototypes="yes",pac_cv_c_prototypes="no")]) if test "$pac_cv_c_prototypes" = "yes" ; then ifelse([$1],,:,[$1]) else ifelse([$2],,:,[$2]) fi ])dnl dnl dnl/*D dnl PAC_FUNC_SEMCTL - Check for semctl and its argument types dnl dnl Synopsis: dnl PAC_FUNC_SEMCTL dnl dnl Output Effects: dnl Sets 'HAVE_SEMCTL' if semctl is available. dnl Sets 'HAVE_UNION_SEMUN' if 'union semun' is available. dnl Sets 'SEMCTL_NEEDS_SEMUN' if a 'union semun' type must be passed as the dnl fourth argument to 'semctl'. dnl D*/ dnl Check for semctl and arguments AC_DEFUN(PAC_FUNC_SEMCTL,[ AC_CHECK_FUNC(semctl) if test "$ac_cv_func_semctl" = "yes" ; then AC_CACHE_CHECK([for union semun], pac_cv_type_union_semun,[ AC_TRY_COMPILE([#include #include #include ],[union semun arg;arg.val=0;], pac_cv_type_union_semun="yes",pac_cv_type_union_semun="no")]) if test "$pac_cv_type_union_semun" = "yes" ; then AC_DEFINE(HAVE_UNION_SEMUN,1,[Has union semun]) # # See if we can use an int in semctl or if we need the union AC_CACHE_CHECK([whether semctl needs union semun], pac_cv_func_semctl_needs_semun,[ AC_TRY_COMPILE([#include #include #include ],[ int arg = 0; semctl( 1, 1, SETVAL, arg );], pac_cv_func_semctl_needs_semun="yes", pac_cv_func_semctl_needs_semun="no") ]) if test "$pac_cv_func_semctl_needs_semun" = "yes" ; then AC_DEFINE(SEMCTL_NEEDS_SEMUN,1,[Needs an explicit definition of semun]) fi fi fi ]) dnl dnl/*D dnl PAC_C_VOLATILE - Check if C supports volatile dnl dnl Synopsis: dnl PAC_C_VOLATILE dnl dnl Output Effect: dnl Defines 'volatile' as empty if volatile is not available. dnl dnl D*/ AC_DEFUN(PAC_C_VOLATILE,[ AC_CACHE_CHECK([for volatile], pac_cv_c_volatile,[ AC_TRY_COMPILE(,[volatile int a;],pac_cv_c_volatile="yes", pac_cv_c_volatile="no")]) if test "$pac_cv_c_volatile" = "no" ; then AC_DEFINE(volatile,,[if C does not support volatile]) fi ])dnl dnl dnl/*D dnl PAC_C_INLINE - Check if C supports inline dnl dnl Synopsis: dnl PAC_C_INLINE dnl dnl Output Effect: dnl Defines 'inline' as empty if inline is not available. dnl dnl D*/ AC_DEFUN(PAC_C_INLINE,[ AC_CACHE_CHECK([for inline], pac_cv_c_inline,[ AC_TRY_COMPILE([inline int a( int b ){return b+1;}],[int a;], pac_cv_c_inline="yes",pac_cv_c_inline="no")]) if test "$pac_cv_c_inline" = "no" ; then AC_DEFINE(inline,,[if C does not support inline]) fi ])dnl dnl dnl/*D dnl PAC_C_CPP_CONCAT - Check whether the C compiler accepts ISO CPP string dnl concatenation dnl dnl Synopsis: dnl PAC_C_CPP_CONCAT([true-action],[false-action]) dnl dnl Output Effects: dnl Invokes the true or false action dnl dnl D*/ AC_DEFUN(PAC_C_CPP_CONCAT,[ pac_pound="#" AC_CACHE_CHECK([that the compiler $CC accepts $ac_pound$ac_pound for concatenation in cpp], pac_cv_c_cpp_concat,[ AC_TRY_COMPILE([ #define concat(a,b) a##b],[int concat(a,b);return ab;], pac_cv_cpp_concat="yes",pac_cv_cpp_concat="no")]) if test $pac_cv_c_cpp_concat = "yes" ; then ifelse([$1],,:,[$1]) else ifelse([$2],,:,[$2]) fi ])dnl dnl dnl/*D dnl PAC_FUNC_GETTIMEOFDAY - Check whether gettimeofday takes 1 or 2 arguments dnl dnl Synopsis dnl PAC_IS_GETTIMEOFDAY_OK(ok_action,failure_action) dnl dnl Notes: dnl One version of Solaris accepted only one argument. dnl dnl D*/ AC_DEFUN(PAC_FUNC_GETTIMEOFDAY,[ AC_CACHE_CHECK([whether gettimeofday takes 2 arguments], pac_cv_func_gettimeofday,[ AC_TRY_COMPILE([#include ],[struct timeval tp; gettimeofday(&tp,(void*)0);return 0;],pac_cv_func_gettimeofday="yes", pac_cv_func_gettimeofday="no") ]) if test "$pac_cv_func_gettimeofday" = "yes" ; then ifelse($1,,:,$1) else ifelse($2,,:,$2) fi ]) dnl dnl/*D dnl PAC_C_RESTRICT - Check if C supports restrict dnl dnl Synopsis: dnl PAC_C_RESTRICT dnl dnl Output Effect: dnl Defines 'restrict' if some version of restrict is supported; otherwise dnl defines 'restrict' as empty. This allows you to include 'restrict' in dnl declarations in the same way that 'AC_C_CONST' allows you to use 'const' dnl in declarations even when the C compiler does not support 'const' dnl dnl Note that some compilers accept restrict only with additional options. dnl DEC/Compaq/HP Alpha Unix (Tru64 etc.) -accept restrict_keyword dnl dnl D*/ AC_DEFUN(PAC_C_RESTRICT,[ AC_CACHE_CHECK([for restrict], pac_cv_c_restrict,[ AC_TRY_COMPILE(,[int * restrict a;],pac_cv_c_restrict="restrict", pac_cv_c_restrict="no") if test "$pac_cv_c_restrict" = "no" ; then AC_TRY_COMPILE(,[int * _Restrict a;],pac_cv_c_restrict="_Restrict", pac_cv_c_restrict="no") fi if test "$pac_cv_c_restrict" = "no" ; then AC_TRY_COMPILE(,[int * __restrict a;],pac_cv_c_restrict="__restrict", pac_cv_c_restrict="no") fi ]) if test "$pac_cv_c_restrict" = "no" ; then restrict_val="" elif test "$pac_cv_c_restrict" != "restrict" ; then restrict_val=$pac_cv_c_restrict fi if test "$restrict_val" != "restrict" ; then AC_DEFINE_UNQUOTED(restrict,$restrict_val,[if C does not support restrict]) fi ])dnl dnl dnl/*D dnl PAC_HEADER_STDARG - Check whether standard args are defined and whether dnl they are old style or new style dnl dnl Synopsis: dnl PAC_HEADER_STDARG(action if works, action if oldstyle, action if fails) dnl dnl Output Effects: dnl Defines HAVE_STDARG_H if the header exists. dnl defines dnl dnl Notes: dnl It isn't enough to check for stdarg. Even gcc doesn't get it right; dnl on some systems, the gcc version of stdio.h loads stdarg.h `with the wrong dnl options` (causing it to choose the `old style` 'va_start' etc). dnl dnl The original test tried the two-arg version first; the old-style dnl va_start took only a single arg. dnl This turns out to be VERY tricky, because some compilers (e.g., Solaris) dnl are quite happy to accept the *wrong* number of arguments to a macro! dnl Instead, we try to find a clean compile version, using our special dnl PAC_C_TRY_COMPILE_CLEAN command. dnl dnl D*/ AC_DEFUN(PAC_HEADER_STDARG,[ AC_CHECK_HEADER(stdarg.h) dnl Sets ac_cv_header_stdarg_h if test "$ac_cv_header_stdarg_h" = "yes" ; then dnl results are yes,oldstyle,no. AC_CACHE_CHECK([whether stdarg is oldstyle], pac_cv_header_stdarg_oldstyle,[ PAC_C_TRY_COMPILE_CLEAN([#include #include ], [int func( int a, ... ){ int b; va_list ap; va_start( ap ); b = va_arg(ap, int); printf( "%d-%d\n", a, b ); va_end(ap); fflush(stdout); return 0; } int main() { func( 1, 2 ); return 0;}],pac_check_compile) case $pac_check_compile in 0) pac_cv_header_stdarg_oldstyle="yes" ;; 1) pac_cv_header_stdarg_oldstyle="may be newstyle" ;; 2) pac_cv_header_stdarg_oldstyle="no" # compile failed ;; esac ]) if test "$pac_cv_header_stdarg_oldstyle" = "yes" ; then ifelse($2,,:,[$2]) else AC_CACHE_CHECK([whether stdarg works], pac_cv_header_stdarg_works,[ PAC_C_TRY_COMPILE_CLEAN([ #include #include ],[ int func( int a, ... ){ int b; va_list ap; va_start( ap, a ); b = va_arg(ap, int); printf( "%d-%d\n", a, b ); va_end(ap); fflush(stdout); return 0; } int main() { func( 1, 2 ); return 0;}],pac_check_compile) case $pac_check_compile in 0) pac_cv_header_stdarg_works="yes" ;; 1) pac_cv_header_stdarg_works="yes with warnings" ;; 2) pac_cv_header_stdarg_works="no" ;; esac ]) fi # test on oldstyle if test "$pac_cv_header_stdarg_works" = "no" ; then ifelse($3,,:,[$3]) else ifelse($1,,:,[$1]) fi else ifelse($3,,:,[$3]) fi # test on header ]) dnl/*D dnl PAC_C_TRY_COMPILE_CLEAN - Try to compile a program, separating success dnl with no warnings from success with warnings. dnl dnl Synopsis: dnl PAC_C_TRY_COMPILE_CLEAN(header,program,flagvar) dnl dnl Output Effect: dnl The 'flagvar' is set to 0 (clean), 1 (dirty but success ok), or 2 dnl (failed). dnl dnl D*/ AC_DEFUN(PAC_C_TRY_COMPILE_CLEAN,[ $3=2 dnl Get the compiler output to test against if test -z "$pac_TRY_COMPLILE_CLEAN" ; then rm -f conftest* echo 'int try(void);int try(void){return 0;}' > conftest.c if ${CC-cc} $CFLAGS -c conftest.c >conftest.bas 2>&1 ; then if test -s conftest.bas ; then pac_TRY_COMPILE_CLEAN_OUT=`cat conftest.bas` fi pac_TRY_COMPILE_CLEAN=1 else AC_MSG_WARN([Could not compile simple test program!]) if test -s conftest.bas ; then cat conftest.bas >> config.log ; fi fi fi dnl dnl Create the program that we need to test with rm -f conftest* cat >conftest.c <conftest.bas 2>&1 ; then dnl Success. Is the output the same? if test "$pac_TRY_COMPILE_CLEAN_OUT" = "`cat conftest.bas`" ; then $3=0 else cat conftest.c >>config.log if test -s conftest.bas ; then cat conftest.bas >> config.log ; fi $3=1 fi else dnl Failure. Set flag to 2 cat conftest.c >>config.log if test -s conftest.bas ; then cat conftest.bas >> config.log ; fi $3=2 fi rm -f conftest* ]) dnl dnl/*D dnl PAC_PROG_C_UNALIGNED_DOUBLES - Check that the C compiler allows unaligned dnl doubles dnl dnl Synopsis: dnl PAC_PROG_C_UNALIGNED_DOUBLES(action-if-true,action-if-false, dnl action-if-unknown) dnl dnl Notes: dnl 'action-if-unknown' is used in the case of cross-compilation. dnl D*/ AC_DEFUN(PAC_PROG_C_UNALIGNED_DOUBLES,[ AC_CACHE_CHECK([whether C compiler allows unaligned doubles], pac_cv_prog_c_unaligned_doubles,[ AC_TRY_RUN([ void fetch_double( v ) double *v; { *v = 1.0; } int main( argc, argv ) int argc; char **argv; { int p[4]; double *p_val; fetch_double( (double *)&(p[0]) ); p_val = (double *)&(p[0]); if (*p_val != 1.0) return 1; fetch_double( (double *)&(p[1]) ); p_val = (double *)&(p[1]); if (*p_val != 1.0) return 1; return 0; } ],pac_cv_prog_c_unaligned_doubles="yes",pac_cv_prog_c_unaligned_doubles="no", pac_cv_prog_c_unaligned_doubles="unknown")]) ifelse($1,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "yes" ; then $1 fi) ifelse($2,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "no" ; then $2 fi) ifelse($3,,,if test "X$pac_cv_prog_c_unaligned_doubles" = "unknown" ; then $3 fi) ]) dnl dnl/*D dnl PAC_PROG_C_WEAK_SYMBOLS - Test whether C supports weak symbols. dnl dnl Synopsis dnl PAC_PROG_C_WEAK_SYMBOLS(action-if-true,action-if-false) dnl dnl Output Effect: dnl Defines one of the following if a weak symbol pragma is found: dnl.vb dnl HAVE_PRAGMA_WEAK - #pragma weak dnl HAVE_PRAGMA_HP_SEC_DEF - #pragma _HP_SECONDARY_DEF dnl HAVE_PRAGMA_CRI_DUP - #pragma _CRI duplicate x as y dnl.ve dnl May also define dnl.vb dnl HAVE_WEAK_ATTRIBUTE dnl.ve dnl if functions can be declared as 'int foo(...) __attribute__ ((weak));' dnl sets the shell variable pac_cv_attr_weak to yes. dnl dnl D*/ AC_DEFUN(PAC_PROG_C_WEAK_SYMBOLS,[ pragma_extra_message="" AC_CACHE_CHECK([for type of weak symbol support], pac_cv_prog_c_weak_symbols,[ # Test for weak symbol support... # We can't put # in the message because it causes autoconf to generate # incorrect code AC_TRY_LINK([ extern int PFoo(int); #pragma weak PFoo = Foo int Foo(a) { return a; } ],[return PFoo(1);],has_pragma_weak=yes) # # Some systems (Linux ia64 and ecc, for example), support weak symbols # only within a single object file! This tests that case. # Note that there is an extern int PFoo declaration before the # pragma. Some compilers require this in order to make the weak symbol # extenally visible. if test "$has_pragma_weak" = yes ; then rm -f conftest* cat >>conftest1.c <>conftest2.c <>config.log echo "Failed program was" >>config.log cat conftest1.c >>config.log cat conftest2.c >>config.log if test -s conftest.out ; then cat conftest.out >> config.log ; fi has_pragma_weak=0 pragma_extra_message="pragma weak does not work outside of a file" fi rm -f conftest* fi dnl if test -z "$pac_cv_prog_c_weak_symbols" ; then AC_TRY_LINK([ extern int PFoo(int); #pragma _HP_SECONDARY_DEF Foo PFoo int Foo(a) { return a; } ],[return PFoo(1);],pac_cv_prog_c_weak_symbols="pragma _HP_SECONDARY_DEF") fi dnl if test -z "$pac_cv_prog_c_weak_symbols" ; then AC_TRY_LINK([ extern int PFoo(int); #pragma _CRI duplicate PFoo as Foo int Foo(a) { return a; } ],[return PFoo(1);],pac_cv_prog_c_weak_symbols="pragma _CRI duplicate x as y") fi dnl if test -z "$pac_cv_prog_c_weak_symbols" ; then pac_cv_prog_c_weak_symbols="no" fi dnl dnl If there is an extra explanatory message, echo it now so that it dnl doesn't interfere with the cache result value if test -n "$pragma_extra_message" ; then echo $pragma_extra_message fi dnl ]) if test "$pac_cv_prog_c_weak_symbols" = "no" ; then ifelse([$2],,:,[$2]) else case "$pac_cv_prog_c_weak_symbols" in "pragma weak") AC_DEFINE(HAVE_PRAGMA_WEAK,1,[Supports weak pragma]) ;; "pragma _HP") AC_DEFINE(HAVE_PRAGMA_HP_SEC_DEF,1,[HP style weak pragma]) ;; "pragma _CRI") AC_DEFINE(HAVE_PRAGMA_CRI_DUP,1,[Cray style weak pragma]) ;; esac ifelse([$1],,:,[$1]) fi AC_CACHE_CHECK([whether __attribute__ ((weak)) allowed], pac_cv_attr_weak,[ AC_TRY_COMPILE([int foo(int) __attribute__ ((weak));],[int a;], pac_cv_attr_weak=yes,pac_cv_attr_weak=no)]) ]) # # This is a replacement that checks that FAILURES are signaled as well # (later configure macros look for the .o file, not just success from the # compiler, but they should not HAVE to # dnl --- insert 2.52 compatibility here --- dnl 2.52 does not have AC_PROG_CC_WORKS ifdef([AC_PROG_CC_WORKS],,[AC_DEFUN([AC_PROG_CC_WORKS],)]) dnl AC_DEFUN(PAC_PROG_CC_WORKS, [AC_PROG_CC_WORKS AC_MSG_CHECKING([whether the C compiler sets its return status correctly]) AC_LANG_SAVE AC_LANG_C AC_TRY_COMPILE(,[int a = bzzzt;],notbroken=no,notbroken=yes) AC_MSG_RESULT($notbroken) if test "$notbroken" = "no" ; then AC_MSG_ERROR([installation or configuration problem: C compiler does not correctly set error code when a fatal error occurs]) fi ]) dnl dnl/*D dnl PAC_FUNC_CRYPT - Check that the function crypt is defined dnl dnl Synopsis: dnl PAC_FUNC_CRYPT dnl dnl Output Effects: dnl dnl In Solaris, the crypt function is not defined in unistd unless dnl _XOPEN_SOURCE is defines and _XOPEN_VERSION is 4 or greater. dnl We test by looking for a missing crypt by defining our own dnl incompatible one and trying to compile it. dnl Defines NEED_CRYPT_PROTOTYPE if no prototype is found. dnl D*/ AC_DEFUN(PAC_FUNC_CRYPT,[ AC_CACHE_CHECK([if crypt defined in unistd.h], pac_cv_func_crypt_defined,[ AC_TRY_COMPILE([ #include double crypt(double a){return a;}],[return 0];, pac_cv_func_crypt_defined="no",pac_cv_func_crypt_defined="yes")]) if test "$pac_cv_func_crypt_defined" = "no" ; then # check to see if defining _XOPEN_SOURCE helps AC_CACHE_CHECK([if crypt defined in unistd with _XOPEN_SOURCE], pac_cv_func_crypt_xopen,[ AC_TRY_COMPILE([ #define _XOPEN_SOURCE #include double crypt(double a){return a;}],[return 0];, pac_cv_func_crypt_xopen="no",pac_cv_func_crypt_xopen="yes")]) fi if test "$pac_cv_func_crypt_xopen" = "yes" ; then AC_DEFINE(_XOPEN_SOURCE,1,[if xopen needed for crypt]) elif test "$pac_cv_func_crypt_defined" = "no" ; then AC_DEFINE(NEED_CRYPT_PROTOTYPE,1,[if a prototype for crypt is needed]) fi ])dnl dnl/*D dnl PAC_ARG_STRICT - Add --enable-strict to configure. dnl dnl Synopsis: dnl PAC_ARG_STRICT dnl dnl Output effects: dnl Adds '--enable-strict' to the command line. If this is enabled, then dnl if no compiler has been set, set 'CC' to 'gcc'. dnl If the compiler is 'gcc', 'COPTIONS' is set to include dnl.vb dnl -O -Wall -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL dnl.ve dnl dnl If the value 'all' is given to '--enable-strict', additional warning dnl options are included. These are dnl.vb dnl -Wunused -Wshadow -Wmissing-declarations -Wno-long-long -Wpointer-arith dnl.ve dnl dnl This only works where 'gcc' is available. dnl In addition, it exports the variable 'enable_strict_done'. This dnl ensures that subsidiary 'configure's do not add the above flags to dnl 'COPTIONS' once the top level 'configure' sees '--enable-strict'. To ensure dnl this, 'COPTIONS' is also exported. dnl dnl Not yet available: options when using other compilers. However, dnl here are some possible choices dnl Solaris cc dnl -fd -v -Xc dnl IRIX dnl -ansi -DEBUG:trap_uninitialized=ON:varargs_interface_check=ON:verbose_runtime=ON dnl dnl D*/ AC_DEFUN(PAC_ARG_STRICT,[ AC_ARG_ENABLE(strict, [--enable-strict - Turn on strict compilation testing when using gcc]) export enable_strict_done export COPTIONS if test "$enable_strict_done" != "yes" ; then if test "$enable_strict" = "yes" ; then enable_strict_done="yes" if test -z "CC" ; then AC_CHECK_PROGS(CC,gcc) if test "$CC" = "gcc" ; then COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL" fi fi elif test "$enable_strict" = "all" ; then enable_strict_done="yes" if test -z "CC" ; then AC_CHECK_PROGS(CC,gcc) if test "$CC" = "gcc" ; then COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL -Wunused -Wshadow -Wmissing-declarations -Wno-long-long" fi fi fi fi ]) dnl/*D dnl PAC_ARG_CC_G - Add debugging flags for the C compiler dnl dnl Synopsis: dnl PAC_ARG_CC_G dnl dnl Output Effect: dnl Adds '-g' to 'COPTIONS' and exports 'COPTIONS'. Sets and exports the dnl variable 'enable_g_simple' so that subsidiary 'configure's will not dnl add another '-g'. dnl dnl Notes: dnl '--enable-g' should be used for all internal debugging modes if possible. dnl Use the 'enable_val' that 'enable_g' is set to to pass particular values, dnl and ignore any values that are not recognized (some other 'configure' dnl may have used them. Of course, if you need extra values, you must dnl add code to extract values from 'enable_g'. dnl dnl For example, to look for a particular keyword, you could use dnl.vb dnl SaveIFS="$IFS" dnl IFS="," dnl for key in $enable_g ; do dnl case $key in dnl mem) # add code for memory debugging dnl ;; dnl *) # ignore all other values dnl ;; dnl esac dnl done dnl IFS="$SaveIFS" dnl.ve dnl dnl D*/ AC_DEFUN(PAC_ARG_CC_G,[ AC_ARG_ENABLE(g, [--enable-g - Turn on debugging of the package (typically adds -g to COPTIONS)]) export COPTIONS export enable_g_simple if test -n "$enable_g" -a "$enable_g" != "no" -a \ "$enable_g_simple" != "done" ; then enable_g_simple="done" if test "$enable_g" = "g" -o "$enable_g" = "yes" ; then COPTIONS="$COPTIONS -g" fi fi ]) dnl dnl Simple version for both options dnl AC_DEFUN(PAC_ARG_CC_COMMON,[ PAC_ARG_CC_G PAC_ARG_STRICT ]) dnl dnl Eventually, this can be used instead of the funky Fortran stuff to dnl access the command line from a C routine. dnl # dnl # Under IRIX (some version) __Argc and __Argv gave the argc,argv values dnl #Under linux, __libc_argv and __libc_argc dnl AC_MSG_CHECKING([for alternative argc,argv names]) dnl AC_TRY_LINK([ dnl extern int __Argc; extern char **__Argv;],[return __Argc;], dnl alt_argv="__Argv") dnl if test -z "$alt_argv" ; then dnl AC_TRY_LINK([ dnl extern int __libc_argc; extern char **__libc_argv;],[return __lib_argc;], dnl alt_argv="__lib_argv") dnl fi dnl if test -z "$alt_argv" ; then dnl AC_MSG_RESULT(none found)) dnl else dnl AC_MSG_RESULT($alt_argv) dnl fi dnl dnl dnl Check whether we need -fno-common to correctly compile the source code. dnl This is necessary if global variables are defined without values in dnl gcc. Here is the test dnl conftest1.c: dnl extern int a; int a; dnl conftest2.c: dnl extern int a; int main(int argc; char *argv[] ){ return a; } dnl Make a library out of conftest1.c and try to link with it. dnl If that fails, recompile it with -fno-common and see if that works. dnl If so, add -fno-common to CFLAGS dnl An alternative is to use, on some systems, ranlib -c to force dnl the system to find common symbols. dnl dnl NOT TESTED AC_DEFUN(PAC_PROG_C_BROKEN_COMMON,[ AC_MSG_CHECKING([whether global variables handled properly]) AC_REQUIRE([AC_PROG_RANLIB]) ac_cv_prog_cc_globals_work=no echo 'extern int a; int a;' > conftest1.c echo 'extern int a; int main( ){ return a; }' > conftest2.c if ${CC-cc} $CFLAGS -c conftest1.c >conftest.out 2>&1 ; then if ${AR-ar} cr libconftest.a conftest1.o >/dev/null 2>&1 ; then if ${RANLIB-:} libconftest.a >/dev/null 2>&1 ; then if ${CC-cc} $CFLAGS -o conftest conftest2.c $LDFLAGS libconftest.a >>conftest.out 2>&1 ; then # Success! C works ac_cv_prog_cc_globals_work=yes else # Failure! Do we need -fno-common? ${CC-cc} $CFLAGS -fno-common -c conftest1.c >> conftest.out 2>&1 rm -f libconftest.a ${AR-ar} cr libconftest.a conftest1.o ${RANLIB-:} libconftest.a if ${CC-cc} $CFLAGS -o conftest conftest2.c $LDFLAGS libconftest.a >> conftest.out 2>&1 ; then ac_cv_prog_cc_globals_work="needs -fno-common" CFLAGS="$CFLAGS -fno-common" fi fi fi fi fi rm -f conftest* libconftest* AC_MSG_RESULT($ac_cv_prog_cc_globals_work) ]) dnl dnl dnl Return the structure alignment in pac_cv_c_struct_align dnl Possible values include dnl packed dnl largest dnl two dnl four dnl eight dnl dnl In addition, a "Could not determine alignment" and a dnl "Multiple cases:" return is possible. AC_DEFUN(PAC_C_STRUCT_ALIGNMENT,[ AC_CACHE_CHECK([for C struct alignment],pac_cv_c_struct_align,[ AC_TRY_RUN([ #include #define DBG(a,b,c) int main( int argc, char *argv[] ) { FILE *cf; int is_packed = 1; int is_two = 1; int is_four = 1; int is_eight = 1; int is_largest = 1; struct { char a; int b; } char_int; struct { char a; short b; } char_short; struct { char a; long b; } char_long; struct { char a; float b; } char_float; struct { char a; double b; } char_double; struct { char a; int b; char c; } char_int_char; struct { char a; short b; char c; } char_short_char; #ifdef HAVE_LONG_DOUBLE struct { char a; long double b; } char_long_double; #endif int size, extent; size = sizeof(char) + sizeof(int); extent = sizeof(char_int); if (size != extent) is_packed = 0; if ( (extent % sizeof(int)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if ( (extent % 4) != 0) is_four = 0; if (sizeof(int) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_int",size,extent); size = sizeof(char) + sizeof(short); extent = sizeof(char_short); if (size != extent) is_packed = 0; if ( (extent % sizeof(short)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if (sizeof(short) == 4 && (extent % 4) != 0) is_four = 0; if (sizeof(short) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_short",size,extent); size = sizeof(char) + sizeof(long); extent = sizeof(char_long); if (size != extent) is_packed = 0; if ( (extent % sizeof(long)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if ( (extent % 4) != 0) is_four = 0; if (sizeof(long) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_long",size,extent); size = sizeof(char) + sizeof(float); extent = sizeof(char_float); if (size != extent) is_packed = 0; if ( (extent % sizeof(float)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if ( (extent % 4) != 0) is_four = 0; if (sizeof(float) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_float",size,extent); size = sizeof(char) + sizeof(double); extent = sizeof(char_double); if (size != extent) is_packed = 0; if ( (extent % sizeof(double)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if ( (extent % 4) != 0) is_four = 0; if (sizeof(double) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_double",size,extent); #ifdef HAVE_LONG_DOUBLE size = sizeof(char) + sizeof(long double); extent = sizeof(char_long_double); if (size != extent) is_packed = 0; if ( (extent % sizeof(long double)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if ( (extent % 4) != 0) is_four = 0; if (sizeof(long double) >= 8 && (extent % 8) != 0) is_eight = 0; DBG("char_long-double",size,extent); #endif /* char int char helps separate largest from 4/8 aligned */ size = sizeof(char) + sizeof(int) + sizeof(char); extent = sizeof(char_int_char); if (size != extent) is_packed = 0; if ( (extent % sizeof(int)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if ( (extent % 4) != 0) is_four = 0; if (sizeof(int) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_int_char",size,extent); /* char short char helps separate largest from 4/8 aligned */ size = sizeof(char) + sizeof(short) + sizeof(char); extent = sizeof(char_short_char); if (size != extent) is_packed = 0; if ( (extent % sizeof(short)) != 0) is_largest = 0; if ( (extent % 2) != 0) is_two = 0; if (sizeof(short) == 4 && (extent % 4) != 0) is_four = 0; if (sizeof(short) == 8 && (extent % 8) != 0) is_eight = 0; DBG("char_short_char",size,extent); /* If aligned mod 8, it will be aligned mod 4 */ if (is_eight) { is_four = 0; is_two = 0; } if (is_four) is_two = 0; /* largest superceeds eight */ if (is_largest) is_eight = 0; /* Tabulate the results */ cf = fopen( "ctest.out", "w" ); if (is_packed + is_largest + is_two + is_four + is_eight == 0) { fprintf( cf, "Could not determine alignment\n" ); } else { if (is_packed + is_largest + is_two + is_four + is_eight != 1) { fprintf( cf, "Multiple cases:\n" ); } if (is_packed) fprintf( cf, "packed\n" ); if (is_largest) fprintf( cf, "largest\n" ); if (is_two) fprintf( cf, "two\n" ); if (is_four) fprintf( cf, "four\n" ); if (is_eight) fprintf( cf, "eight\n" ); } fclose( cf ); return 0; }], pac_cv_c_struct_align=`cat ctest.out` ,pac_cv_c_struct_align="unknown",pac_cv_c_struct_align="$CROSS_STRUCT_ALIGN") rm -f ctest.out ]) if test -z "$pac_cv_c_struct_align" ; then pac_cv_c_struct_align="unknown" fi ]) dnl dnl dnl/*D dnl PAC_FUNC_NEEDS_DECL - Set NEEDS__DECL if a declaration is needed dnl dnl Synopsis: dnl PAC_FUNC_NEEDS_DECL(headerfiles,funcname) dnl dnl Output Effect: dnl Sets 'NEEDS__DECL' if 'funcname' is not declared by the dnl headerfiles. dnl D*/ AC_DEFUN(PAC_FUNC_NEEDS_DECL,[ AC_CACHE_CHECK([whether $2 needs a declaration], pac_cv_func_decl_$2,[ AC_TRY_COMPILE([$1],[int a=$2(27,1.0,"foo");], pac_cv_func_decl_$2=yes,pac_cv_func_decl_$2=no)]) if test "$pac_cv_func_decl_$2" = "yes" ; then changequote(<<,>>)dnl define(<>, translit(NEEDS_$2_DECL, [a-z *], [A-Z__]))dnl changequote([, ])dnl AC_DEFINE_UNQUOTED(PAC_FUNC_NAME,1,[Define if $2 needs a declaration]) undefine([PAC_FUNC_NAME]) fi ])dnl dnl dnl /*D dnl PAC_CHECK_SIZEOF_DERIVED - Get the size of a user-defined type, dnl such as a struct dnl dnl PAC_CHECK_SIZEOF_DERIVED(shortname,definition,defaultsize) dnl Like AC_CHECK_SIZEOF, but handles arbitrary types. dnl Unlike AC_CHECK_SIZEOF, does not define SIZEOF_xxx (because dnl autoheader can''t handle this case) dnl D*/ AC_DEFUN(PAC_CHECK_SIZEOF_DERIVED,[ changequote(<<,>>)dnl define(<>,translit(sizeof_$1,[a-z *], [A-Z_P]))dnl define(<>,translit(pac_cv_sizeof_$1,[ *], [_p]))dnl changequote([,])dnl AC_MSG_CHECKING(size of $1) AC_CACHE_VAL(AC_CV_NAME, [AC_TRY_RUN([#include main() { $2 a; FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof(a)); exit(0); }],AC_CV_NAME=`cat conftestval`,AC_CV_NAME=0,ifelse([$3],,,AC_CV_NAME=$3))]) AC_MSG_RESULT($AC_CV_NAME) dnl AC_DEFINE_UNQUOTED(AC_TYPE_NAME,$AC_CV_NAME) undefine([AC_TYPE_NAME])undefine([AC_CV_NAME]) ]) dnl dnl PAC_C_GNU_ATTRIBUTE - See if the GCC __attribute__ specifier is allow. dnl Use the following dnl #ifndef HAVE_GCC_ATTRIBUTE dnl #define __attribute__(a) dnl #endif dnl If *not*, define __attribute__(a) as null dnl dnl We start by requiring Gcc. Some other compilers accept __attribute__ dnl but generate warning messages, or have different interpretations dnl (which seems to make __attribute__ just as bad as #pragma) dnl For example, the Intel icc compiler accepts __attribute__ and dnl __attribute__((pure)) but generates warnings for __attribute__((format...)) dnl AC_DEFUN([PAC_C_GNU_ATTRIBUTE],[ AC_REQUIRE([AC_PROG_CC_GNU]) if test "$ac_cv_prog_gcc" = "yes" ; then AC_CACHE_CHECK([whether __attribute__ allowed], pac_cv_gnu_attr_pure,[ AC_TRY_COMPILE([int foo(int) __attribute__ ((pure));],[int a;], pac_cv_gnu_attr_pure=yes,pac_cv_gnu_attr_pure=no)]) AC_CACHE_CHECK([whether __attribute__((format)) allowed], pac_cv_gnu_attr_format,[ AC_TRY_COMPILE([int foo(char *,...) __attribute__ ((format(printf,1,2)));],[int a;], pac_cv_gnu_attr_format=yes,pac_cv_gnu_attr_format=no)]) if test "$pac_cv_gnu_attr_pure" = "yes" -a "$pac_cv_gnu_attr_format" = "yes" ; then AC_DEFINE(HAVE_GCC_ATTRIBUTE,1,[Define if GNU __attribute__ is supported]) fi fi ]) perftest-1.3a/config/confdb/aclocal_cross.m40000664000115300004540000001524607660434705014626 dnl dnl/*D dnl PAC_LANG_PUSH_COMPILERS - Replace all compilers with test versions dnl dnl Synopsis: dnl PAC_LANG_PUSH_COMPILERS dnl dnl Output Effects: dnl The values of 'CC', 'CXX', 'F77', 'F90', and 'CPP' are replaced with dnl the values of 'TESTCC' etc. The old values are saved (see dnl 'PAC_LANG_POP_COMPILERS'). dnl dnl Calls to this macro may be nested, but only the outer-most calls have dnl any effect. dnl dnl See also: dnl PAC_LANG_POP_COMPILERS dnl D*/ dnl dnl These two name allow you to use TESTCC for CC, etc, in all of the dnl autoconf compilation tests. This is useful, for example, when the dnl compiler needed at the end cannot be used to build programs that can dnl be run, for example, as required by some parallel computing systems. dnl Instead, define TESTCC, TESTCXX, TESTF77, and TESTF90 as the "local" dnl compilers. Because autoconf insists on calling cpp for the header dnl checks, we use TESTCPP for the CPP test as well. And if no TESTCPP dnl is defined, we create one using TESTCC. dnl dnl 2.52 does not have try_compiler, which is like try_compile, but dnl it doesn't force a main program dnl Not quite correct, but adequate for here ifdef([AC_TRY_COMPILER],,[AC_DEFUN([AC_TRY_COMPILER], [cat > conftest.$ac_ext </dev/null; then [$3]=no else [$3]=yes fi else echo "configure: failed program was:" >&AC_FD_CC cat conftest.$ac_ext >&AC_FD_CC [$2]=no fi rm -fr conftest*]) ]) dnl dnl pac_cross_compiling overrides all tests if set to yes. This allows dnl us to test the cross-compilation branches of the code, and to use dnl compilers that can both cross-compile and build code for the current dnl platform dnl AC_DEFUN(PAC_LANG_PUSH_COMPILERS,[ if test "X$pac_save_level" = "X" ; then pac_save_CC="$CC" pac_save_CXX="$CXX" pac_save_F77="$F77" pac_save_F90="$F90" pac_save_prog_cc_cross="$ac_cv_prog_cc_cross" pac_save_prog_f77_cross="$ac_cv_prog_f77_cross" pac_save_prog_cxx_cross="$ac_cv_prog_cxx_cross" pac_save_prog_f90_cross="$pac_cv_prog_f90_cross" if test "X$CPP" = "X" ; then AC_PROG_CPP fi pac_save_CPP="$CPP" CC="${TESTCC:=$CC}" CXX="${TESTCXX:=$CXX}" F77="${TESTF77:=$F77}" F90="${TESTF90:=$F90}" if test -z "$TESTCPP" ; then PAC_PROG_TESTCPP fi CPP="${TESTCPP:=$CPP}" pac_save_level="0" # Recompute cross_compiling values and set for the current language # This is just: AC_LANG_SAVE AC_LANG_C if test "$pac_cross_compiling" = "yes" ; then ac_cv_prog_cc_cross=yes ac_cv_prog_cc_works=yes else AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross) fi AC_LANG_RESTORE # Ignore Fortran if we aren't using it. if test -n "$F77" ; then AC_LANG_SAVE AC_LANG_FORTRAN77 if test "$pac_cross_compiling" = "yes" ; then ac_cv_prog_f77_cross=yes ac_cv_prog_f77_works=yes else AC_TRY_COMPILER(dnl [ program conftest end ], ac_cv_prog_f77_works, ac_cv_prog_f77_cross) fi AC_LANG_RESTORE fi # Ignore C++ if we aren't using it. if test -n "$CXX" ; then AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILER([int main(){return(0);}], ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross) AC_LANG_RESTORE fi # Ignore Fortran 90 if we aren't using it. if test -n "$F90" ; then AC_LANG_SAVE PAC_LANG_FORTRAN90 dnl We can't use AC_TRY_COMPILER because it doesn't know about dnl Fortran 90 if test "$pac_cross_compiling" = "yes" ; then ac_cv_prog_f90_cross=yes ac_cv_prog_f90_works=yes else cat > conftest.$ac_ext << EOF program conftest end EOF if { (eval echo configure:2324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_f90_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_f90_cross=no else ac_cv_prog_f90_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_f90_works=no fi fi pac_cv_prog_f90_cross="$ac_cv_prog_f90_cross" pac_cv_prog_f90_works="$ac_cv_prog_f90_works" rm -fr conftest* AC_LANG_RESTORE fi fi pac_save_level=`expr $pac_save_level + 1` ]) dnl/*D dnl PAC_LANG_POP_COMPILERS - Restore compilers that were displaced by dnl PAC_LANG_PUSH_COMPILERS dnl dnl Synopsis: dnl PAC_LANG_POP_COMPILERS dnl dnl Output Effects: dnl The values of 'CC', 'CXX', 'F77', 'F90', and 'CPP' are replaced with dnl their original values from the outermost call to 'PAC_LANG_PUSH_COMPILERS'. dnl dnl Calls to this macro may be nested, but only the outer-most calls have dnl any effect. dnl dnl See also: dnl PAC_LANG_PUSH_COMPILERS dnl D*/ AC_DEFUN(PAC_LANG_POP_COMPILERS,[ pac_save_level=`expr $pac_save_level - 1` if test "X$pac_save_level" = "X0" ; then CC="$pac_save_CC" CXX="$pac_save_CXX" F77="$pac_save_F77" F90="$pac_save_F90" CPP="$pac_save_CPP" ac_cv_prog_cc_cross="$pac_save_prog_cc_cross" ac_cv_prog_f77_cross="$pac_save_prog_f77_cross" ac_cv_prog_cxx_cross="$pac_save_prog_cxx_cross" pac_cv_prog_f90_cross="$pac_save_prog_f90_cross" pac_save_level="" fi ]) AC_DEFUN(PAC_PROG_TESTCPP,[ if test -z "$TESTCPP"; then AC_CACHE_VAL(pac_cv_prog_TESTCPP,[ rm -f conftest.* cat > conftest.c < Syntax Error EOF # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. TESTCPP="${TESTCC-cc} -E" ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out" if AC_TRY_EVAL(ac_try) ; then pac_cv_prog_TESTCPP="$TESTCPP" fi if test "X$pac_cv_prog_TESTCPP" = "X" ; then TESTCPP="${TESTCC-cc} -E -traditional-cpp" ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out" if AC_TRY_EVAL(ac_try) ; then pac_cv_prog_TESTCPP="$TESTCPP" fi fi if test "X$pac_cv_prog_TESTCPP" = "X" ; then TESTCPP="${TESTCC-cc} -nologo -E" ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out" if AC_TRY_EVAL(ac_try) ; then pac_cv_prog_TESTCPP="$TESTCPP" fi fi if test "X$pac_cv_prog_TESTCPP" = "X" ; then AC_PATH_PROG(TESTCPP,cpp) fi rm -f conftest.* ]) else pac_cv_prog_TESTCPP="$TESTCPP" fi ]) perftest-1.3a/config/confdb/aclocal_cxx.m40000444000115300004540000001167007324611277014266 dnl dnl C++ macros dnl dnl Many compilers generate directories that hold information while compiling dnl and using templates. This definition attempts to find their names (so dnl that they can be cleaned later). dnl dnl This was inspired by similar code in the MPI-C++ distribution from dnl the University of Notre Dame. dnl PAC_PROG_CXX_TEMPLATE_DIR(dirname) dnl sets dirname to the name of the template directory, or to empty dnl if it can not be determined. AC_DEFUN(PAC_PROG_CXX_TEMPLATE_DIR,[ AC_CACHE_CHECK([for C++ template repository directory name], pac_cv_cxx_template_dir,[ mkdir conftest_dir cd conftest_dir AC_LANG_SAVE AC_LANG_CPLUSPLUS cat > conftest_1.h < class foo { public: foo( T in ) : data( in ) { in.member(1); }; void member( int i ); private: T data; }; class bar { public: bar( int i ) { data = i; }; void member( int i ) { data = data + i; }; private: int data; }; EOF cat > conftest_1.${ac_ext} < v1(6); foo< foo > v2(v1); } EOF cat > conftest.${ac_ext} < void foo::member(int i) { i++; } int main( int argc, char *argv[] ) { foo v1(6); foo< foo > v2(v1); my_function(); return 0; } EOF # ac_compile_special='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest_1.$ac_ext 1>&AC_FD_CC' if AC_TRY_EVAL(ac_compile_special) ; then if AC_TRY_EVAL(ac_compile) ; then # Look for a new directory for file in `ls` ; do if test -d "$file" -a "$file" != "." -a "$file" != ".." ; then pac_cv_cxx_template_dir="$pac_cv_cxx_template_dir $file" fi done pac_cv_cxx_template_dir_name="$pac_cv_cxx_template_dir" if test -z "$pac_cv_cxx_template_dir" ; then pac_cv_cxx_template_dir="could not determine" fi else echo "configure: failed program was:" >&AC_FD_CC cat conftest.$ac_ext >&AC_FD_CC pac_cv_cxx_template_dir="could not determine" fi else echo "configure: failed program was:" >&AC_FD_CC cat conftest_1.$ac_ext >&AC_FD_CC pac_cv_cxx_template_dir="templates not supported" fi cd .. #rm -rf conftest_dir AC_LANG_RESTORE ]) $1="$pac_cv_cxx_template_dir_name" ]) # # This is a replacement that checks that FAILURES are signaled as well # (later configure macros look for the .o file, not just success from the # compiler, but they should not HAVE to # AC_DEFUN(PAC_PROG_CXX_WORKS, [AC_PROG_CXX_WORKS AC_MSG_CHECKING([whether the C++ compiler sets its return status correctly]) AC_LANG_SAVE AC_LANG_CXX AC_TRY_COMPILE(,[int a = bzzzt;],notbroken=no,notbroken=yes) AC_MSG_RESULT($notbroken) if test "$notbroken" = "no" ; then AC_MSG_ERROR([installation or configuration problem: C++ compiler does not correctly set error code when a fatal error occurs]) fi ]) dnl dnl This is from crypt.to/autoconf-archive, slightly modified. dnl It defines bool as int if it is not availalbe dnl AC_DEFUN([AC_CXX_BOOL], [AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type, ac_cv_cxx_bool, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([ int f(int x){return 1;} int f(char x){return 1;} int f(bool x){return 1;} ],[bool b = true; return f(b);], ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_bool" != yes; then AC_DEFINE(bool,int,[define if bool is a built-in type]) fi ]) dnl dnl This is from crypt.to/autoconf-archive, slightly modified (name defined) dnl AC_DEFUN([AC_CXX_EXCEPTIONS], [AC_CACHE_CHECK(whether the compiler supports exceptions, ac_cv_cxx_exceptions, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE(,[try { throw 1; } catch (int i) { return i; }], ac_cv_cxx_exceptions=yes, ac_cv_cxx_exceptions=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_exceptions" = yes; then AC_DEFINE(HAVE_CXX_EXCEPTIONS,,[define if the compiler supports exceptions]) fi ]) dnl dnl This is from crypt.to/autoconf-archive, slightly modified (name defined) dnl AC_DEFUN([AC_CXX_HAVE_COMPLEX], [AC_CACHE_CHECK(whether the C++ compiler has complex, ac_cv_cxx_have_complex, [AC_REQUIRE([AC_CXX_NAMESPACES]) AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([#include #ifdef HAVE_NAMESPACES using namespace std; #endif],[complex a; complex b; return 0;], ac_cv_cxx_have_complex=yes, ac_cv_cxx_have_complex=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_have_complex" = yes; then AC_DEFINE(HAVE_CXX_COMPLEX,,[define if the C++ compiler has complex]) fi ]) dnl dnl This is from crypt.to/autoconf-archive dnl AC_DEFUN([AC_CXX_NAMESPACES], [AC_CACHE_CHECK(whether the compiler implements namespaces, ac_cv_cxx_namespaces, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], [using namespace Outer::Inner; return i;], ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_namespaces" = yes; then AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) fi ]) perftest-1.3a/config/confdb/aclocal_f77.m40000664000115300004540000010705107666673623014106 dnl dnl/*D dnl PAC_PROG_F77_NAME_MANGLE - Determine how the Fortran compiler mangles dnl names dnl dnl Synopsis: dnl PAC_PROG_F77_NAME_MANGLE([action]) dnl dnl Output Effect: dnl If no action is specified, one of the following names is defined: dnl.vb dnl If fortran names are mapped: dnl lower -> lower F77_NAME_LOWER dnl lower -> lower_ F77_NAME_LOWER_USCORE dnl lower -> UPPER F77_NAME_UPPER dnl lower_lower -> lower__ F77_NAME_LOWER_2USCORE dnl mixed -> mixed F77_NAME_MIXED dnl mixed -> mixed_ F77_NAME_MIXED_USCORE dnl.ve dnl If an action is specified, it is executed instead. dnl dnl Notes: dnl We assume that if lower -> lower (any underscore), upper -> upper with the dnl same underscore behavior. Previous versions did this by dnl compiling a Fortran program and running strings -a over it. Depending on dnl strings is a bad idea, so instead we try compiling and linking with a dnl C program, since that is why we are doing this anyway. A similar approach dnl is used by FFTW, though without some of the cases we check (specifically, dnl mixed name mangling) dnl dnl D*/ dnl AC_DEFUN(PAC_PROG_F77_NAME_MANGLE,[ AC_CACHE_CHECK([for Fortran 77 name mangling], pac_cv_prog_f77_name_mangle, [ # Check for strange behavior of Fortran. For example, some FreeBSD # systems use f2c to implement f77, and the version of f2c that they # use generates TWO (!!!) trailing underscores # Currently, WDEF is not used but could be... # # Eventually, we want to be able to override the choices here and # force a particular form. This is particularly useful in systems # where a Fortran compiler option is used to force a particular # external name format (rs6000 xlf, for example). rm -f conftest* cat > conftest.f <&AC_FD_CC cat conftest.f >&AC_FD_CC fi AC_LANG_SAVE AC_LANG_C save_LIBS="$LIBS" dnl FLIBS comes from AC_F77_LIBRARY_LDFLAGS LIBS="fconftestf.o $FLIBS $LIBS" AC_TRY_LINK(,my_name();,pac_cv_prog_f77_name_mangle="lower") if test "X$pac_cv_prog_f77_name_mangle" = "X" ; then AC_TRY_LINK(,my_name_();,pac_cv_prog_f77_name_mangle="lower underscore") fi if test "X$pac_cv_prog_f77_name_mangle" = "X" ; then AC_TRY_LINK(,MY_NAME();,pac_cv_prog_f77_name_mangle="upper") fi if test "X$pac_cv_prog_f77_name_mangle" = "X" ; then AC_TRY_LINK(,my_name__();, pac_cv_prog_f77_name_mangle="lower doubleunderscore") fi if test "X$pac_cv_prog_f77_name_mangle" = "X" ; then AC_TRY_LINK(,MY_name();,pac_cv_prog_f77_name_mangle="mixed") fi if test "X$pac_cv_prog_f77_name_mangle" = "X" ; then AC_TRY_LINK(,MY_name_();,pac_cv_prog_f77_name_mangle="mixed underscore") fi LIBS="$save_LIBS" AC_LANG_RESTORE rm -f fconftest* ]) # Make the actual definition pac_namecheck=`echo X$pac_cv_prog_f77_name_mangle | sed 's/ /-/g'` ifelse([$1],,[ case $pac_namecheck in X) AC_MSG_WARN([Cannot determine Fortran naming scheme]) ;; Xlower) AC_DEFINE(F77_NAME_LOWER,1,[Define if Fortran names are lowercase]) F77_NAME_MANGLE="F77_NAME_LOWER" ;; Xlower-underscore) AC_DEFINE(F77_NAME_LOWER_USCORE,1,[Define if Fortran names are lowercase with a trailing underscore]) F77_NAME_MANGLE="F77_NAME_LOWER_USCORE" ;; Xlower-doubleunderscore) AC_DEFINE(F77_NAME_LOWER_2USCORE,1,[Define if Fortran names containing an underscore have two trailing underscores]) F77_NAME_MANGLE="F77_NAME_LOWER_2USCORE" ;; Xupper) AC_DEFINE(F77_NAME_UPPER,1,[Define if Fortran names are uppercase]) F77_NAME_MANGLE="F77_NAME_UPPER" ;; Xmixed) AC_DEFINE(F77_NAME_MIXED,1,[Define if Fortran names preserve the original case]) F77_NAME_MANGLE="F77_NAME_MIXED" ;; Xmixed-underscore) AC_DEFINE(F77_NAME_MIXED_USCORE,1,[Define if Fortran names preserve the original case and add a trailing underscore]) F77_NAME_MANGLE="F77_NAME_MIXED_USCORE" ;; *) AC_MSG_WARN([Unknown Fortran naming scheme]) ;; esac AC_SUBST(F77_NAME_MANGLE) ],[$1]) ]) dnl dnl/*D dnl PAC_PROG_F77_CHECK_SIZEOF - Determine the size in bytes of a Fortran dnl type dnl dnl Synopsis: dnl PAC_PROG_F77_CHECK_SIZEOF(type,[cross-size]) dnl dnl Output Effect: dnl Sets SIZEOF_F77_uctype to the size if bytes of type. dnl If type is unknown, the size is set to 0. dnl If cross-compiling, the value cross-size is used (it may be a variable) dnl For example 'PAC_PROG_F77_CHECK_SIZEOF(real)' defines dnl 'SIZEOF_F77_REAL' to 4 on most systems. The variable dnl 'pac_cv_sizeof_f77_' (e.g., 'pac_cv_sizeof_f77_real') is also set to dnl the size of the type. dnl If the corresponding variable is already set, that value is used. dnl If the name has an '*' in it (e.g., 'integer*4'), the defined name dnl replaces that with an underscore (e.g., 'SIZEOF_F77_INTEGER_4'). dnl dnl Notes: dnl If the 'cross-size' argument is not given, 'autoconf' will issue an error dnl message. You can use '0' to specify undetermined. dnl dnl D*/ AC_DEFUN(PAC_PROG_F77_CHECK_SIZEOF,[ changequote(<<, >>)dnl dnl The name to #define. dnl If the arg value contains a variable, we need to update that define(<>, translit(sizeof_f77_$1, [a-z *], [A-Z__]))dnl dnl The cache variable name. define(<>, translit(pac_cv_f77_sizeof_$1, [ *], [__]))dnl changequote([, ])dnl AC_CACHE_CHECK([for size of Fortran type $1],PAC_CV_NAME,[ AC_REQUIRE([PAC_PROG_F77_NAME_MANGLE]) /bin/rm -f conftest* cat < conftest.f subroutine isize( ) $1 i(2) call cisize( i(1), i(2) ) end EOF if test "X$ac_fcompile" = "X" ; then ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&AC_FD_CC' fi if AC_TRY_EVAL(ac_fcompile) && test -s conftest.o ; then mv conftest.o conftestf.o AC_LANG_SAVE AC_LANG_C save_LIBS="$LIBS" dnl Add the Fortran linking libraries LIBS="conftestf.o $FLIBS $LIBS" AC_TRY_RUN([#include #ifdef F77_NAME_UPPER #define cisize_ CISIZE #define isize_ ISIZE #elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED) #define cisize_ cisize #define isize_ isize #endif static int isize_val; void cisize_(char *i1p, char *i2p) { isize_val = (int)(i2p - i1p); } main() { FILE *f = fopen("conftestval", "w"); if (!f) exit(1); isize_(); fprintf(f,"%d\n", isize_val ); exit(0); }], eval PAC_CV_NAME=`cat conftestval`,eval PAC_CV_NAME=0, ifelse([$2],,,eval PAC_CV_NAME=$2)) LIBS="$save_LIBS" AC_LANG_RESTORE else echo "configure: failed program was:" >&AC_FD_CC cat conftest.f >&AC_FD_CC ifelse([$2],,eval PAC_CV_NAME=0,eval PAC_CV_NAME=$2) fi ]) AC_DEFINE_UNQUOTED(PAC_TYPE_NAME,$PAC_CV_NAME,[Define size of PAC_TYPE_NAME]) undefine([PAC_TYPE_NAME]) undefine([PAC_CV_NAME]) ]) dnl dnl/*D dnl PAC_PROG_F77_EXCLAIM_COMMENTS dnl dnl Synopsis: dnl PAC_PROG_F77_EXCLAIM_COMMENTS([action-if-true],[action-if-false]) dnl dnl Notes: dnl Check whether '!' may be used to begin comments in Fortran. dnl dnl This macro requires a version of autoconf `after` 2.13; the 'acgeneral.m4' dnl file contains an error in the handling of Fortran programs in dnl 'AC_TRY_COMPILE' (fixed in our local version). dnl dnl D*/ AC_DEFUN(PAC_PROG_F77_EXCLAIM_COMMENTS,[ AC_CACHE_CHECK([whether Fortran accepts ! for comments], pac_cv_prog_f77_exclaim_comments,[ AC_LANG_SAVE AC_LANG_FORTRAN77 AC_TRY_COMPILE(,[ ! This is a comment ],pac_cv_prog_f77_exclaim_comments="yes", pac_cv_prog_f77_exclaim_comments="no") AC_LANG_RESTORE ]) if test "$pac_cv_prog_f77_exclaim_comments" = "yes" ; then ifelse([$1],,:,$1) else ifelse([$2],,:,$2) fi ])dnl dnl dnl/*D dnl PAC_F77_CHECK_COMPILER_OPTION - Check that a compiler option is accepted dnl without warning messages dnl dnl Synopsis: dnl PAC_F77_CHECK_COMPILER_OPTION(optionname,action-if-ok,action-if-fail) dnl dnl Output Effects: dnl dnl If no actions are specified, a working value is added to 'FOPTIONS' dnl dnl Notes: dnl This is now careful to check that the output is different, since dnl some compilers are noisy. dnl dnl We are extra careful to prototype the functions in case compiler options dnl that complain about poor code are in effect. dnl dnl Because this is a long script, we have ensured that you can pass a dnl variable containing the option name as the first argument. dnl D*/ AC_DEFUN(PAC_F77_CHECK_COMPILER_OPTION,[ AC_MSG_CHECKING([that Fortran 77 compiler accepts option $1]) ac_result="no" save_FFLAGS="$FFLAGS" FFLAGS="$1 $FFLAGS" rm -f conftest.out cat >conftest2.f <conftest.f </dev/null 2>&1 ; then AC_MSG_RESULT(yes) AC_MSG_CHECKING([that routines compiled with $1 can be linked with ones compiled without $1]) /bin/rm -f conftest2.out /bin/rm -f conftest.bas ac_fscompile3='${F77-f77} -c $save_FFLAGS conftest2.f >conftest2.out 2>&1' ac_fscompilelink4='${F77-f77} $FFLAGS -o conftest conftest2.o conftest.f $LDFLAGS >conftest.bas 2>&1' if AC_TRY_EVAL(ac_fscompile3) && test -s conftest2.o ; then if AC_TRY_EVAL(ac_fscompilelink4) && test -x conftest ; then if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then ac_result="yes" else echo "configure: Compiler output differed in two cases" >&AC_FD_CC diff -b conftest.out conftest.bas >&AC_FD_CC fi else echo "configure: failed program was:" >&AC_FD_CC cat conftest.f >&AC_FD_CC fi else echo "configure: failed program was:" >&AC_FD_CC cat conftest2.f >&AC_FD_CC fi else # diff echo "configure: Compiler output differed in two cases" >&AC_FD_CC diff -b conftest.out conftest.bas >&AC_FD_CC fi else # try_eval(fscompilelink2) echo "configure: failed program was:" >&AC_FD_CC cat conftest.f >&AC_FD_CC fi if test "$ac_result" != "yes" -a -s conftest.out ; then cat conftest.out >&AC_FD_CC fi else # Could not compile without the option! echo "configure: Could not compile program" >&AC_FD_CC cat conftest.f >&AC_FD_CC cat conftest.bas >&AC_FD_CC fi if test "$ac_result" = "yes" ; then AC_MSG_RESULT(yes) ifelse([$2],,FOPTIONS="$FOPTIONS $1",$2) else AC_MSG_RESULT(no) $3 fi FFLAGS="$save_FFLAGS" rm -f conftest* ]) dnl dnl/*D dnl PAC_PROG_F77_CMDARGS - Determine how to access the command line from dnl Fortran 77 dnl dnl Output Effects: dnl The following variables are set: dnl.vb dnl F77_GETARG - Statement to get an argument i into string s dnl F77_IARGC - Routine to return the number of arguments dnl FXX_MODULE - Module command when using Fortran 90 compiler dnl F77_GETARGDECL - Declaration of routine used for F77_GETARG dnl F77_GETARG_FFLAGS - Flags needed when compiling/linking dnl F77_GETARG_LDFLAGS - Flags needed when linking dnl.ve dnl If 'F77_GETARG' has a value, then that value and the values for these dnl other symbols will be used instead. If no approach is found, all of these dnl variables will have empty values. dnl If no other approach works and a file 'f77argdef' is in the directory, dnl that file will be sourced for the values of the above four variables. dnl dnl In most cases, you should add F77_GETARG_FFLAGS to the FFLAGS variable dnl and F77_GETARG_LDFLAGS to the LDFLAGS variable, to ensure that tests are dnl performed on the compiler version that will be used. dnl dnl 'AC_SUBST' is called for all six variables. dnl dnl One complication is that on systems with multiple Fortran compilers, dnl some libraries used by one Fortran compiler may have been (mis)placed dnl in a common location. We have had trouble with libg2c in particular. dnl To work around this, we test whether iargc etc. work first. This dnl will catch most systems and will speed up the tests. dnl dnl Next, the libraries are only added if they are needed to complete a dnl link; they aren''t added just because they exist. dnl dnl f77argdef dnl D*/ dnl dnl Random notes dnl You can export the command line arguments from C to the g77 compiler dnl using dnl extern char **__libc_argv; dnl extern int __libc_argc; dnl f_setarg( __libc_argc, __libc_argv ); dnl AC_DEFUN(PAC_PROG_F77_CMDARGS,[ found_cached="yes" AC_MSG_CHECKING([for routines to access the command line from Fortran 77]) AC_CACHE_VAL(pac_cv_prog_f77_cmdarg, [ AC_MSG_RESULT([searching...]) found_cached="no" # First, we perform a quick check. Does iargc and getarg work? fxx_module="${FXX_MODULE:-}" f77_getargdecl="${F77_GETARGDECL:-external getarg}" f77_getarg="${F77_GETARG:-call GETARG(i,s)}" f77_iargc="${F77_IARGC:-IARGC()}" # # Grumble. The Absoft Fortran compiler computes i - i as 0 and then # 1.0 / 0 at compile time, even though the code may never be executed. # What we need is a way to generate an error, so the second usage of i # was replaced with f77_iargc. cat > conftest.f </dev/null 2>&1 ; then found_answer="yes" FXX_MODULE="$fxx_module" F77_GETARGDECL="$f77_getargdecl" F77_GETARG="$f77_getarg" F77_IARGC="$f77_iargc" AC_MSG_RESULT(yes) fi fi fi if test $found_answer = "no" ; then AC_MSG_RESULT(no) # Grumph. Here are a bunch of different approaches # We have several axes the check: # Library to link with (none, -lU77 (HPUX), -lg2c (LINUX f77)) # PEPCF90 (Intel ifc) # The first line is a dummy # (we experimented with using a , but this caused other # problems because we need in the IFS) trial_LIBS="0 -lU77 -lPEPCF90" if test "$NOG2C" != "1" ; then trial_LIBS="$trial_LIBS -lg2c" fi # Discard libs that are not availble: save_IFS="$IFS" # Make sure that IFS includes a space, or the tests that run programs # may fail IFS=" " save_trial_LIBS="$trial_LIBS" trial_LIBS="" cat > conftest.f <, the space is important # To make the Absoft f77 and f90 work together, we need to prefer the # upper case versions of the arguments. They also require libU77. # -YCFRL=1 causes Absoft f90 to work with g77 and similar (f2c-based) # Fortran compilers # # Problem: The Intel efc compiler hangs when presented with -N109 . # The only real fix for this is to detect this compiler and exclude # the test. We may want to reorganize these tests so that if we # can compile code without special options, we never look for them. # using_intel_efc="no" pac_test_msg=`$F77 -V 2>&1 | grep 'Intel(R) Fortran Itanium'` if test "$pac_test_msg" != "" ; then using_intel_efc="yes" fi if test "$using_intel_efc" = "yes" ; then trial_FLAGS="000" else trial_FLAGS="000 -N109 -f -YEXT_NAMES=UCS -YEXT_NAMES=LCS -YCFRL=1 +U77" fi # Discard options that are not available: # (IFS already saved above) IFS=" " save_trial_FLAGS="$trial_FLAGS" trial_FLAGS="" for flag in $save_trial_FLAGS ; do if test "$flag" = " " -o "$flag" = "000" ; then opt_ok="yes" else PAC_F77_CHECK_COMPILER_OPTION($flag,opt_ok=yes,opt_ok=no) fi if test "$opt_ok" = "yes" ; then if test "$flag" = " " -o "$flag" = "000" ; then fflag="" else fflag="$flag" fi # discard options that don't allow mixed-case name matching cat > conftest.f < conftest.f </dev/null 2>&1 ; then found_answer="yes" fi else found_answer="yes" fi fi IFS=" " if test "$found_answer" = "yes" ; then AC_MSG_RESULT([yes]) pac_cv_prog_f77_cmdarg="$MSG" pac_cv_prog_f77_cmdarg_fflags="$flags" pac_cv_prog_f77_cmdarg_ldflags="$libs" break else AC_MSG_RESULT([no]) echo "configure: failed program was:" >&AC_FD_CC cat conftest.f >&AC_FD_CC fi done done IFS="$save_IFS" rm -f conftest.* trial=`expr $trial + 1` done fi pac_cv_F77_GETARGDECL="$F77_GETARGDECL" pac_cv_F77_IARGC="$F77_IARGC" pac_cv_F77_GETARG="$F77_GETARG" pac_cv_FXX_MODULE="$FXX_MODULE" ]) if test "$found_cached" = "yes" ; then AC_MSG_RESULT([$pac_cv_prog_f77_cmdarg]) elif test -z "$pac_cv_F77_IARGC" ; then AC_MSG_WARN([Could not find a way to access the command line from Fortran 77]) fi # Set the variable values based on pac_cv_prog_xxx F77_GETARGDECL="$pac_cv_F77_GETARGDECL" F77_IARGC="$pac_cv_F77_IARGC" F77_GETARG="$pac_cv_F77_GETARG" FXX_MODULE="$pac_cv_FXX_MODULE" F77_GETARG_FFLAGS="$pac_cv_prog_f77_cmdarg_fflags" F77_GETARG_LDFLAGS="$pac_cv_prog_f77_cmdarg_ldflags" AC_SUBST(F77_GETARGDECL) AC_SUBST(F77_IARGC) AC_SUBST(F77_GETARG) AC_SUBST(FXX_MODULE) AC_SUBST(F77_GETARG_FFLAGS) AC_SUBST(F77_GETARG_LDFLAGS) ]) dnl/*D dnl PAC_PROG_F77_LIBRARY_DIR_FLAG - Determine the flag used to indicate dnl the directories to find libraries in dnl dnl Notes: dnl Many compilers accept '-Ldir' just like most C compilers. dnl Unfortunately, some (such as some HPUX Fortran compilers) do not, dnl and require instead either '-Wl,-L,dir' or something else. This dnl command attempts to determine what is accepted. The flag is dnl placed into 'F77_LIBDIR_LEADER'. dnl dnl D*/ dnl dnl An earlier version of this only tried the arguments without using dnl a library. This failed when the HP compiler complained about the dnl arguments, but produced an executable anyway. AC_DEFUN(PAC_PROG_F77_LIBRARY_DIR_FLAG,[ if test "X$F77_LIBDIR_LEADER" = "X" ; then AC_CACHE_CHECK([for Fortran 77 flag for library directories], pac_cv_prog_f77_library_dir_flag, [ rm -f conftest.* conftest1.* cat > conftest.f < conftest1.f <&AC_FD_CC cat conftest1.f >&AC_FD_CC fi rm -f conftest* ]) AC_SUBST(F77_LIBDIR_LEADER) if test "X$pac_cv_prog_f77_library_dir_flag" != "X" ; then F77_LIBDIR_LEADER="$pac_cv_prog_f77_library_dir_flag" fi fi ]) dnl/*D dnl PAC_PROG_F77_HAS_INCDIR - Check whether Fortran accepts -Idir flag dnl dnl Syntax: dnl PAC_PROG_F77_HAS_INCDIR(directory,action-if-true,action-if-false) dnl dnl Output Effect: dnl Sets 'F77_INCDIR' to the flag used to choose the directory. dnl dnl Notes: dnl This refers to the handling of the common Fortran include extension, dnl not to the use of '#include' with the C preprocessor. dnl If directory does not exist, it will be created. In that case, the dnl directory should be a direct descendant of the current directory. dnl dnl D*/ AC_DEFUN(PAC_PROG_F77_HAS_INCDIR,[ checkdir=$1 AC_CACHE_CHECK([for include directory flag for Fortran], pac_cv_prog_f77_has_incdir,[ if test ! -d $checkdir ; then mkdir $checkdir ; fi cat >$checkdir/conftestf.h <conftest.f < conftest.$ac_ext <&AC_FD_CC cat conftest.$ac_ext >&AC_FD_CC rm -rf conftest* pac_cv_prog_f77_allows_unused_externals="no" $4 fi rm -f conftest* # AC_LANG_RESTORE ]) if test "X$pac_cv_prog_f77_allows_unused_externals" = "Xyes" ; then ifelse([$1],,:,[$1]) else ifelse([$2],,:,[$2]) fi ]) dnl /*D dnl PAC_PROG_F77_HAS_POINTER - Determine if Fortran allows pointer type dnl dnl Synopsis: dnl PAC_PROG_F77_HAS_POINTER(action-if-true,action-if-false) dnl D*/ AC_DEFUN(PAC_PROG_F77_HAS_POINTER,[ AC_CACHE_CHECK([whether Fortran has pointer declaration], pac_cv_prog_f77_has_pointer,[ AC_LANG_SAVE AC_LANG_FORTRAN77 AC_TRY_COMPILE(,[ integer M pointer (MPTR,M) data MPTR/0/ ],pac_cv_prog_f77_has_pointer="yes",pac_cv_prog_f77_has_pointer="no") AC_LANG_RESTORE ]) if test "$pac_cv_prog_f77_has_pointer" = "yes" ; then ifelse([$1],,:,[$1]) else ifelse([$2],,:,[$2]) fi ]) dnl dnl pac_prog_f77_run_proc_from_c( c main program, fortran routine, dnl action-if-works, action-if-fails, dnl cross-action ) dnl Fortran routine MUST be named ftest unless you include code dnl to select the appropriate Fortran name. dnl AC_DEFUN(PAC_PROG_F77_RUN_PROC_FROM_C,[ /bin/rm -f conftest* cat < conftest.f $2 EOF dnl if test "X$ac_fcompile" = "X" ; then ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&AC_FD_CC' fi if AC_TRY_EVAL(ac_fcompile) && test -s conftest.o ; then mv conftest.o conftestf.o AC_LANG_SAVE AC_LANG_C save_LIBS="$LIBS" LIBS="conftestf.o $FLIBS $LIBS" AC_TRY_RUN([#include #ifdef F77_NAME_UPPER #define ftest_ FTEST #elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED) #define ftest_ ftest #endif $1 ], [$3], [$4], [$5] ) LIBS="$save_LIBS" AC_LANG_RESTORE else echo "configure: failed program was:" >&AC_FD_CC cat conftest.f >&AC_FD_CC fi rm -f conftest* ]) dnl dnl PAC_PROG_F77_IN_C_LIBS dnl dnl Find the essential libraries that are needed to use the C linker to dnl create a program that includes a trival Fortran code. dnl dnl For example, all pgf90 compiled objects include a reference to the dnl symbol pgf90_compiled, found in libpgf90 . dnl AC_DEFUN(PAC_PROG_F77_IN_C_LIBS,[ AC_MSG_CHECKING([what Fortran libraries are needed to link C with Fortran]) F77_IN_C_LIBS="$FLIBS" /bin/rm -f conftest* cat < conftest.f subroutine ftest end EOF dnl if test "X$ac_fcompile" = "X" ; then ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&AC_FD_CC' fi if AC_TRY_EVAL(ac_fcompile) && test -s conftest.o ; then mv conftest.o mconftestf.o AC_LANG_SAVE AC_LANG_C save_LIBS="$LIBS" dnl First try with no libraries LIBS="mconftestf.o $save_LIBS" AC_TRY_LINK([#include ],[ #ifdef F77_NAME_UPPER #define ftest_ FTEST #elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED) #define ftest_ ftest #endif ftest_(); ], [link_worked=yes], [link_worked=no] ) if test "$link_worked" = "no" ; then flibdirs=`echo $FLIBS | tr ' ' '\012' | grep '\-L' | tr '\012' ' '` fliblibs=`echo $FLIBS | tr ' ' '\012' | grep -v '\-L' | tr '\012' ' '` for flibs in $fliblibs ; do LIBS="mconftestf.o $flibdirs $flibs $save_LIBS" AC_TRY_LINK([#include ],[ #ifdef F77_NAME_UPPER #define ftest_ FTEST #elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED) #define ftest_ ftest #endif ftest_(); ], [link_worked=yes], [link_worked=no] ) if test "$link_worked" = "yes" ; then F77_IN_C_LIBS="$flibdirs $flibs" break fi done if test "$link_worked" = "no" ; then # try to add libraries until it works... flibscat="" for flibs in $fliblibs ; do flibscat="$flibscat $flibs" LIBS="mconftestf.o $flibdirs $flibscat $save_LIBS" AC_TRY_LINK([#include ],[ #ifdef F77_NAME_UPPER #define ftest_ FTEST #elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED) #define ftest_ ftest #endif ftest_(); ], [link_worked=yes], [link_worked=no] ) if test "$link_worked" = "yes" ; then F77_IN_C_LIBS="$flibdirs $flibscat" break fi done fi else # No libraries needed F77_IN_C_LIBS="" fi LIBS="$save_LIBS" AC_LANG_RESTORE else echo "configure: failed program was:" >&AC_FD_CC cat conftest.f >&AC_FD_CC fi rm -f conftest* mconftest* if test -z "$F77_IN_C_LIBS" ; then AC_MSG_RESULT(none) else AC_MSG_RESULT($F77_IN_C_LIBS) fi ]) dnl dnl Test to see if we should use C or Fortran to link programs whose dnl main program is in Fortran. We may find that neither work because dnl we need special libraries in each case. dnl AC_DEFUN([PAC_PROG_F77_LINKER_WITH_C],[ AC_TRY_COMPILE(, long long a;,AC_DEFINE(HAVE_LONG_LONG,1,[Define if long long allowed])) AC_MSG_CHECKING([for linker for Fortran main programs]) dnl dnl Create a program that uses multiplication and division in case dnl that requires special libraries cat > conftest.c < conftest.f <&AC_FD_CC ; then AC_MSG_RESULT([Use Fortran to link programs]) elif ${CC} -o conftest conftest.o conftest1.o $LDFLAGS $FLIBS 2>&AC_FD_CC ; then AC_MSG_RESULT([Use C with FLIBS to link programs]) F77LINKER="$CC" F77_LDFLAGS="$F77_LDFLAGS $FLIBS" else AC_MSG_RESULT([Unable to determine how to link Fortran programs with C]) fi else AC_MSG_ERROR([Could not compile Fortran test program]) fi AC_LANG_RESTORE ]) dnl dnl dnl AC_DEFUN(PAC_PROG_F77_CHECK_FLIBS, [AC_MSG_CHECKING([whether C can link with $FLIBS]) # Try to link a C program with all of these libraries save_LIBS="$LIBS" LIBS="$LIBS $FLIBS" AC_TRY_LINK(,[int a;],runs=yes,runs=no) LIBS="$save_LIBS" AC_MSG_RESULT($runs) if test "$runs" = "no" ; then AC_MSG_CHECKING([which libraries can be used]) pac_ldirs="" pac_libs="" pac_other="" for name in $FLIBS ; do case $name in -l*) pac_libs="$pac_libs $name" ;; -L*) pac_ldirs="$pac_ldirs $name" ;; *) pac_other="$pac_other $name" ;; esac done save_LIBS="$LIBS" keep_libs="" for name in $pac_libs ; do LIBS="$save_LIBS $pac_ldirs $pac_other $name" AC_TRY_LINK(,[int a;],runs=yes,runs=no) if test $runs = "yes" ; then keep_libs="$keep_libs $name" ; fi done AC_MSG_RESULT($keep_libs) LIBS="$save_LIBS" FLIBS="$pac_ldirs $pac_other $keep_libs" fi ]) AC_DEFUN(PAC_PROG_F77_NEW_CHAR_DECL,[ AC_CACHE_CHECK([whether Fortran supports new-style character declarations], pac_cv_prog_f77_new_char_decl,[ AC_LANG_SAVE AC_LANG_FORTRAN77 AC_TRY_COMPILE(,[ character (len=10) s ],pac_cv_prog_f77_new_char_decl="yes", pac_cv_prog_f77_new_char_decl="no") AC_LANG_RESTORE ]) if test "$pac_cv_prog_f77_new_char_decl" = "yes" ; then ifelse([$1],,:,$1) else ifelse([$2],,:,$2) fi ])dnl AC_DEFUN([PAC_PROG_F77_CHAR_PARM],[ # # We need to check on how character variables are passed. If they # are *not* passed at the end of the list, we need to know that NOW! case $pac_cv_prog_f77_name_mangle in mixed|lower) sub1=sub sub2=conffoo ;; upper) sub1=SUB sub2=CONFFOO ;; *) sub1=sub_ sub2=conffoo_ ;; esac cat > conftest.c < int loc = -1; void $sub1( char *a, int b, int c ) { if (b == 10) { loc = 2; } if (c == 10) { loc = 3; } } int main( int argc, char **argv ) { int a, b, c; $sub2(); printf( "%d\n", loc ); } EOF cat > conftest1.f < conftest.$ac_ext <&AC_FD_CC cat conftest.$ac_ext >&AC_FD_CC ifelse([$4], , , [ rm -rf conftest* $4 ])dnl fi rm -f conftest* ifelse(NEED_POP,yes,[ undefine([NEED_POP]) AC_LANG_RESTORE]) ]) dnl dnl PAC_F90_MODULE_EXT(action if found,action if not found) dnl AC_DEFUN(PAC_F90_MODULE_EXT, [AC_CACHE_CHECK([for Fortran 90 module extension], pac_cv_f90_module_ext,[ pac_cv_f90_module_case="unknown" cat >conftest.$ac_f90ext <&1 | grep -v conftest.$ac_f90ext | grep -v conftest.o` pac_MOD=`echo $pac_MOD | sed -e 's/conftest\.//g'` pac_cv_f90_module_case="lower" if test "X$pac_MOD" = "X" ; then pac_MOD=`ls CONFTEST* 2>&1 | grep -v CONFTEST.f | grep -v CONFTEST.o` pac_MOD=`echo $pac_MOD | sed -e 's/CONFTEST\.//g'` if test -n "$pac_MOD" ; then testname="CONFTEST" pac_cv_f90_module_case="upper" fi fi if test -z "$pac_MOD" ; then pac_cv_f90_module_ext="unknown" else pac_cv_f90_module_ext=$pac_MOD fi else echo "configure: failed program was:" >&AC_FD_CC cat conftest.$ac_f90ext >&AC_FD_CC pac_cv_f90_module_ext="unknown" fi rm -f conftest* ]) AC_SUBST(F90MODEXT) if test "$pac_cv_f90_module_ext" = "unknown" ; then ifelse($2,,:,[$2]) else ifelse($1,,F90MODEXT=$pac_MOD,[$1]) fi ]) dnl dnl PAC_F90_MODULE_INCFLAG AC_DEFUN(PAC_F90_MODULE_INCFLAG,[ AC_CACHE_CHECK([for Fortran 90 module include flag], pac_cv_f90_module_incflag,[ AC_REQUIRE([PAC_F90_MODULE_EXT]) cat >conftest.$ac_f90ext <&AC_FD_CC cat conftest.$ac_f90ext >&AC_FD_CC fi rm -f conftest.$ac_f90ext cat >conftest.$ac_f90ext <&AC_FD_CC && \ test -s conftest.o ; then pac_cv_f90_module_incflag="-I" elif ${F90-f90} -c $F90FLAGS -Mconf conftest.$ac_f90ext 1>&AC_FD_CC && \ test-s conftest.o ; then pac_cv_f90_module_incflag="-M" elif ${F90-f90} -c $F90FLAGS -pconf conftest.$ac_f90ext 1>&AC_FD_CC && \ test -s conftest.o ; then pac_cv_f90_module_incflag="-p" else pac_cv_f90_module_incflag="unknown" fi if test "$pac_madedir" = "yes" ; then rm -rf conf ; fi rm -f conftest* ]) AC_SUBST(F90MODINCFLAG) F90MODINCFLAG=$pac_cv_f90_module_incflag ]) AC_DEFUN(PAC_F90_MODULE,[ PAC_F90_MODULE_EXT PAC_F90_MODULE_INCFLAG ]) AC_DEFUN(PAC_F90_EXT,[ AC_CACHE_CHECK([whether Fortran 90 accepts f90 suffix], pac_cv_f90_ext_f90,[ save_ac_f90ext=$ac_f90ext ac_f90ext="f90" PAC_TRY_F90_COMPILE(,,pac_cv_f90_ext_f90="yes",pac_cv_f90_ext_f90="no") ac_f90ext=$save_ac_f90ext ]) ]) dnl dnl/*D dnl PAC_PROG_F90_INT_KIND - Determine kind parameter for an integer with dnl the specified number of bytes. dnl dnl Synopsis: dnl PAC_PROG_F90_INT_KIND(variable-to-set,number-of-bytes,[cross-size]) dnl dnl D*/ AC_DEFUN(PAC_PROG_F90_INT_KIND,[ # Set the default $1=-1 if test "$pac_cv_prog_f90_cross" = "yes" ; then $1="$3" else if test -n "$ac_f90compile" ; then AC_MSG_CHECKING([for Fortran 90 integer kind for $2-byte integers]) # Convert bytes to digits case $2 in 1) sellen=2 ;; 2) sellen=4 ;; 4) sellen=8 ;; 8) sellen=16 ;; 16) sellen=30 ;; *) sellen=8 ;; esac # Check for cached value eval testval=\$"pac_cv_prog_f90_int_kind_$sellen" if test -n "$testval" ; then AC_MSG_RESULT([$testval (cached)]) $1=$testval else # must compute rm -f conftest* cat < conftest.$ac_f90ext program main integer i i = selected_int_kind($sellen) open(8, file="conftest1.out", form="formatted") write (8,*) i close(8) stop end EOF KINDVAL="unavailable" eval "pac_cv_prog_f90_int_kind_$sellen"=-1 if AC_TRY_EVAL(ac_f90link) && test -s conftest ; then ./conftest >>config.log 2>&1 if test -s conftest1.out ; then # Because of write, there may be a leading blank. KINDVAL=`cat conftest1.out | sed 's/ //g'` eval "pac_cv_prog_f90_int_kind_$sellen"=$KINDVAL $1=$KINDVAL fi fi rm -f conftest* AC_MSG_RESULT($KINDVAL) fi # not cached fi # Has Fortran 90 fi # is not cross compiling ])dnl dnl dnl dnl Note: This checks for f95 before f90, since F95 is the more recent dnl revision of Fortran 90. efc is the Intel Fortran 77/90/95 compiler AC_DEFUN(PAC_PROG_F90,[ if test -z "$F90" ; then AC_CHECK_PROGS(F90,f95 f90 xlf90 pgf90 efc) test -z "$F90" && AC_MSG_WARN([no acceptable Fortran 90 compiler found in \$PATH]) fi if test -n "$F90" ; then PAC_PROG_F90_WORKS fi dnl Cache these so we don't need to change in and out of f90 mode ac_f90ext=$pac_cv_f90_ext ac_f90compile='${F90-f90} -c $F90FLAGS conftest.$ac_f90ext 1>&AC_FD_CC' ac_f90link='${F90-f90} -o conftest${ac_exeext} $F90FLAGS $LDFLAGS conftest.$ac_f90ext $LIBS 1>&AC_FD_CC' # Check for problems with Intel efc compiler cat > conftest.$ac_f90ext <&1 | grep 'bfd assertion fail'` if test -n "$pac_msg" ; then pac_msg=`$F90 -o conftest $F90FLAGS $LDFLAGS conftest.$ac_f90ext -i_dynamic $LIBS 2>&1 | grep 'bfd assertion fail'` if test -z "$pac_msg" ; then LDFLAGS="-i_dynamic" ; fi # There should really be f90linker flags rather than generic ldflags. fi ]) dnl Internal routine for testing F90 dnl PAC_PROG_F90_WORKS() AC_DEFUN(PAC_PROG_F90_WORKS, [AC_MSG_CHECKING([for extension for Fortran 90 programs]) pac_cv_f90_ext="f90" cat > conftest.$pac_cv_f90_ext < conftest.$pac_cv_f90_ext <conftest.$ac_ext </dev/null ; then pac_cv_prog_f90_cross="no" else pac_cv_prog_f90_cross="yes" fi else echo "configure: failed program was:" >&AC_FD_CC cat conftest.$ac_ext >&AC_FD_CC pac_cv_prog_f90_works="no" fi rm -f conftest* AC_LANG_RESTORE AC_MSG_RESULT($pac_cv_prog_f90_works) if test $pac_cv_prog_f90_works = no; then AC_MSG_WARN([installation or configuration problem: Fortran 90 compiler cannot create executables.]) fi AC_MSG_CHECKING([whether the Fortran 90 compiler ($F90 $F90FLAGS $LDFLAGS) is a cross-compiler]) AC_MSG_RESULT($pac_cv_prog_f90_cross) cross_compiling=$pac_cv_prog_f90_cross ]) dnl dnl The following looks for F90 options to enable th specified f90 compiler dnl to work with the f77 compiler, particularly for accessing command-line dnl arguments perftest-1.3a/config/confdb/aclocal_java.m40000444000115300004540000000010607324611233014365 dnl dnl This is from crypt.to/autoconf-archive, slightly modified dnl perftest-1.3a/config/confdb/aclocal_make.m40000664000115300004540000002346707660434705014416 dnl dnl We need routines to check that make works. Possible problems with dnl make include dnl dnl It is really gnumake, and contrary to the documentation on gnumake, dnl it insists on screaming everytime a directory is changed. The fix dnl is to add the argument --no-print-directory to the make dnl dnl It is really BSD 4.4 make, and can't handle 'include'. For some dnl systems, this can be fatal; there is no fix (other than removing this dnl alleged make). dnl dnl It is the OSF V3 make, and can't handle a comment in a block of target dnl code. There is no acceptable fix. dnl dnl dnl dnl dnl Find a make program if none is defined. AC_DEFUN(PAC_PROG_MAKE_PROGRAM,[true if test "X$MAKE" = "X" ; then AC_CHECK_PROGS(MAKE,make gnumake nmake pmake smake) fi ])dnl dnl/*D dnl PAC_PROG_MAKE_ECHOS_DIR - Check whether make echos all directory changes dnl dnl Synopsis: dnl PAC_PROG_MAKE_ECHOS_DIR dnl dnl Output Effect: dnl If make echos directory changes, append '--no-print-directory' to the dnl symbol 'MAKE'. If 'MAKE' is not set, chooses 'make' for 'MAKE'. dnl dnl See also: dnl PAC_PROG_MAKE dnl D*/ dnl AC_DEFUN(PAC_PROG_MAKE_ECHOS_DIR,[ AC_CACHE_CHECK([whether make echos directory changes], pac_cv_prog_make_echos_dir, [ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) /bin/rm -f conftest cat > conftest <<. SHELL=/bin/sh ALL: @(dir="`pwd`" ; cd .. ; \$(MAKE) -f "\$\$dir/conftest" SUB) SUB: @echo "success" . str="`$MAKE -f conftest 2>&1`" if test "$str" != "success" ; then str="`$MAKE --no-print-directory -f conftest 2>&1`" if test "$str" = "success" ; then pac_cv_prog_make_echos_dir="yes using --no-print-directory" else pac_cv_prog_make_echos_dir="no" echo "Unexpected output from make with program" >>config.log cat conftest >>config.log echo "str" >> config.log fi else pac_cv_prog_make_echos_dir="no" fi /bin/rm -f conftest str="" ]) if test "$pac_cv_prog_make_echos_dir" = "yes using --no-print-directory" ; then MAKE="$MAKE --no-print-directory" fi ])dnl dnl dnl/*D dnl PAC_PROG_MAKE_INCLUDE - Check whether make supports include dnl dnl Synopsis: dnl PAC_PROG_MAKE_INCLUDE([action if true],[action if false]) dnl dnl Output Effect: dnl None dnl dnl Notes: dnl This checks for makes that do not support 'include filename'. Some dnl versions of BSD 4.4 make required '#include' instead; some versions of dnl 'pmake' have the same syntax. dnl dnl See Also: dnl PAC_PROG_MAKE dnl dnl D*/ dnl AC_DEFUN(PAC_PROG_MAKE_INCLUDE,[ AC_CACHE_CHECK([whether make supports include],pac_cv_prog_make_include,[ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) /bin/rm -f conftest cat > conftest <<. ALL: @echo "success" . cat > conftest1 <<. include conftest . pac_str=`$MAKE -f conftest1 2>&1` /bin/rm -f conftest conftest1 if test "$pac_str" != "success" ; then pac_cv_prog_make_include="no" else pac_cv_prog_make_include="yes" fi ]) if test "$pac_cv_prog_make_include" = "no" ; then ifelse([$2],,:,[$2]) else ifelse([$1],,:,[$1]) fi ])dnl dnl dnl/*D dnl PAC_PROG_MAKE_ALLOWS_COMMENTS - Check whether comments are allowed in dnl shell commands in a makefile dnl dnl Synopsis: dnl PAC_PROG_MAKE_ALLOWS_COMMENTS([false text]) dnl dnl Output Effect: dnl Issues a warning message if comments are not allowed in a makefile. dnl Executes the argument if one is given. dnl dnl Notes: dnl Some versions of OSF V3 make do not all comments in action commands. dnl dnl See Also: dnl PAC_PROG_MAKE dnl D*/ dnl AC_DEFUN(PAC_PROG_MAKE_ALLOWS_COMMENTS,[ AC_CACHE_CHECK([whether make allows comments in actions], pac_cv_prog_make_allows_comments,[ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) /bin/rm -f conftest cat > conftest <<. SHELL=/bin/sh ALL: @# This is a valid comment! @echo "success" . pac_str=`$MAKE -f conftest 2>&1` /bin/rm -f conftest if test "$pac_str" != "success" ; then pac_cv_prog_make_allows_comments="no" else pac_cv_prog_make_allows_comments="yes" fi ]) if test "$pac_cv_prog_make_allows_comments" = "no" ; then AC_MSG_WARN([Your make does not allow comments in target code. Using this make may cause problems when building programs. You should consider using gnumake instead.]) ifelse([$1],,[$1]) fi ])dnl dnl dnl/*D dnl PAC_PROG_MAKE_VPATH - Check whether make supports source-code paths. dnl dnl Synopsis: dnl PAC_PROG_MAKE_VPATH dnl dnl Output Effect: dnl Sets the variable 'VPATH' to either dnl.vb dnl VPATH = .:${srcdir} dnl.ve dnl or dnl.vb dnl .PATH: . ${srcdir} dnl.ve dnl dnl Notes: dnl The test checks that the path works with implicit targets (some makes dnl support only explicit targets with 'VPATH' or 'PATH'). dnl dnl NEED TO DO: Check that $< works on explicit targets. dnl dnl See Also: dnl PAC_PROG_MAKE dnl dnl D*/ dnl AC_DEFUN(PAC_PROG_MAKE_VPATH,[ AC_SUBST(VPATH)AM_IGNORE(VPATH) AC_CACHE_CHECK([for virtual path format], pac_cv_prog_make_vpath,[ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) rm -rf conftest* mkdir conftestdir cat >conftestdir/a.c < conftest <&1 | grep 'conftestdir/a.c'` if test -n "$ac_out" ; then pac_cv_prog_make_vpath="VPATH" else rm -f conftest cat > conftest <&1 | grep 'conftestdir/a.c'` if test -n "$ac_out" ; then pac_cv_prog_make_vpath=".PATH" else pac_cv_prog_make_vpath="neither VPATH nor .PATH works" fi fi rm -rf conftest* ]) if test "$pac_cv_prog_make_vpath" = "VPATH" ; then VPATH='VPATH=.:${srcdir}' elif test "$pac_cv_prog_make_vpath" = ".PATH" ; then VPATH='.PATH: . ${srcdir}' fi ])dnl dnl dnl/*D dnl PAC_PROG_MAKE_SET_CFLAGS - Check whether make sets CFLAGS dnl dnl Synopsis: dnl PAC_PROG_MAKE_SET_CFLAGS([action if true],[action if false]) dnl dnl Output Effects: dnl Executes the first argument if 'CFLAGS' is set by 'make'; executes dnl the second argument if 'CFLAGS' is not set by 'make'. dnl dnl Notes: dnl If 'CFLAGS' is set by make, you may wish to override that choice in your dnl makefile. dnl dnl See Also: dnl PAC_PROG_MAKE dnl D*/ AC_DEFUN(PAC_PROG_MAKE_SET_CFLAGS,[ AC_CACHE_CHECK([whether make sets CFLAGS], pac_cv_prog_make_set_cflags,[ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) /bin/rm -f conftest cat > conftest <&1` /bin/rm -f conftest if test "$pac_str" = "XX" ; then pac_cv_prog_make_set_cflags="no" else pac_cv_prog_make_set_cflags="yes" fi ]) if test "$pac_cv_prog_make_set_cflags" = "no" ; then ifelse([$2],,:,[$2]) else ifelse([$1],,:,[$1]) fi ])dnl dnl/*D dnl PAC_PROG_MAKE_CLOCK_SKEW - Check whether there is a problem with dnl clock skew in suing make. dnl dnl Effect: dnl Sets the cache variable 'pac_cv_prog_make_found_clock_skew' to yes or no dnl D*/ AC_DEFUN(PAC_PROG_MAKE_CLOCK_SKEW,[ AC_CACHE_CHECK([whether clock skew breaks make], pac_cv_prog_make_found_clock_skew,[ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) rm -f conftest* cat > conftest < conftest.out 2>&1 if grep -i skew conftest >/dev/null 2>&1 ; then pac_cv_prog_make_found_clock_skew=yes else pac_cv_prog_make_found_clock_skew=no fi rm -f conftest* ]) dnl We should really do something if we detect clock skew. The question is, dnl what? if test "$pac_cv_prog_make_found_clock_skew" = "yes" ; then AC_MSG_WARN([Clock skew found by make. The configure and build may fail. Consider building in a local instead of NFS filesystem.]) fi ]) dnl dnl/*D dnl PAC_PROG_MAKE_HAS_PATTERN_RULES - Determine if the make program supports dnl pattern rules dnl dnl Synopsis: dnl PAC_PROG_MAKE_HAS_PATTERN_RULES([action if true],[action if false]) dnl dnl Output Effect: dnl Executes the first argument if patterns of the form dnl.vb dnl prefix%suffix: prefix%suffix dnl.ve dnl are supported by make (gnumake and Solaris make are known to support dnl this form of target). If patterns are not supported, executes the dnl second argument. dnl dnl See Also: dnl PAC_PROG_MAKE dnl dnl D*/ AC_DEFUN(PAC_PROG_MAKE_HAS_PATTERN_RULES,[ AC_CACHE_CHECK([whether make has pattern rules], pac_cv_prog_make_has_patterns,[ AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) rm -f conftest* cat > conftestmm <\[$]@ EOF date > conftest.c if ${MAKE} -f conftestmm conftestconftest.dep 1>&AC_FD_CC 2>&1 ' was given. dnl dnl Sets 'CC', 'F77', 'TESTCC', 'TESTF77', and 'MPILIBNAME'. Does `not` dnl perform an AC_SUBST for these values. dnl Also sets 'MPIBOOT' and 'MPIUNBOOT'. These are used to specify dnl programs that may need to be run before and after running MPI programs. dnl For example, 'MPIBOOT' may start demons necessary to run MPI programs and dnl 'MPIUNBOOT' will stop those demons. dnl dnl See also: dnl PAC_LANG_PUSH_COMPILERS, PAC_LIB_MPI dnl D*/ AC_DEFUN(PAC_ARG_MPI_TYPES,[ AC_PROVIDE([AC_PROG_CC]) AC_SUBST(CC) AC_SUBST(CXX) AC_SUBST(F77) AC_SUBST(F90) AC_ARG_WITH(mpich, [--with-mpich=path - Assume that we are building with MPICH], ac_mpi_type=mpich) AC_ARG_WITH(lammpi, [--with-lammpi=path - Assume that we are building with LAM/MPI], ac_mpi_type=lammpi) AC_ARG_WITH(ibmmpi, [--with-ibmmpi - Use the IBM SP implementation of MPI], ac_mpi_type=ibmmpi) AC_ARG_WITH(sgimpi, [--with-sgimpi - Use the SGI implementation of MPI], ac_mpi_type=sgimpi) if test "X$ac_mpi_type" = "X" ; then if test "X$1" != "X" ; then ac_mpi_type=$1 else ac_mpi_type=unknown fi fi if test "$ac_mpi_type" = "unknown" -a "$pac_lib_mpi_is_building" = "yes" ; then ac_mpi_type="mpich" fi case $ac_mpi_type in mpich) dnl dnl This isn't correct. It should try to get the underlying compiler dnl from the mpicc and mpif77 scripts or mpireconfig if test "X$pac_lib_mpi_is_building" != "Xyes" ; then save_PATH="$PATH" if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then # Look for commands; if not found, try adding bin to the # path if test ! -x $with_mpich/mpicc -a -x $with_mpich/bin/mpicc ; then with_mpich="$with_mpich/bin" fi PATH=$with_mpich:${PATH} fi AC_PATH_PROG(MPICC,mpicc) TESTCC=${CC-cc} CC="$MPICC" AC_PATH_PROG(MPIF77,mpif77) TESTF77=${F77-f77} F77="$MPIF77" AC_PATH_PROG(MPIF90,mpif90) TESTF90=${F90-f90} F90="$MPIF90" AC_PATH_PROG(MPICXX,mpiCC) TESTCXX=${CXX-CC} CXX="$MPICXX" # We may want to restrict this to the path containing mpirun AC_PATH_PROG(MPIRUN,mpirun) AC_PATH_PROG(MPIBOOT,mpichboot) AC_PATH_PROG(MPIUNBOOT,mpichstop) PATH="$save_PATH" MPILIBNAME="mpich" else # All of the above should have been passed in the environment! : fi ;; lammpi) dnl dnl This isn't correct. It should try to get the underlying compiler dnl from the mpicc and mpif77 scripts or mpireconfig save_PATH="$PATH" if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then # Look for commands; if not found, try adding bin to the path if test ! -x $with_lammpi/mpicc -a -x $with_lammpi/bin/mpicc ; then with_lammpi="$with_lammpi/bin" fi PATH=$with_lammpi:${PATH} fi AC_PATH_PROG(MPICC,mpicc) TESTCC=${CC-cc} CC="$MPICC" AC_PATH_PROG(MPIF77,mpif77) TESTF77=${F77-f77} F77="$MPIF77" AC_PATH_PROG(MPIF90,mpif90) TESTF90=${F90-f90} F90="$MPIF90" AC_PATH_PROG(MPICXX,mpiCC) TESTCXX=${CXX-CC} CXX="$MPICXX" PATH="$save_PATH" MPILIBNAME="lammpi" MPIBOOT="lamboot" MPIUNBOOT="wipe" MPIRUN="mpirun" ;; ibmmpi) TESTCC=${CC-xlC}; TESTF77=${F77-xlf}; CC=mpcc; F77=mpxlf # There is no mpxlf90, but the options langlvl and free can # select the F90 version of xlf TESTF90=${F90-xlf90}; F90="mpxlf -qlanglvl=90ext -qfree=f90" MPILIBNAME="" ;; sgimpi) TESTCC=${CC:=cc}; TESTF77=${F77:=f77}; TESTCXX=${CXX:=CC}; TESTF90=${F90:=f90} AC_CHECK_LIB(mpi,MPI_Init) if test "$ac_cv_lib_mpi_MPI_Init" = "yes" ; then MPILIBNAME="mpi" fi MPIRUN=mpirun MPIBOOT="" MPIUNBOOT="" ;; *) # Find the compilers PAC_PROG_CC # We only look for the other compilers if there is no # disable for them if test "$enable_f77" != no -a "$enable_fortran" != no ; then AC_PROG_F77 fi if test "$enable_cxx" != no ; then AC_PROG_CXX fi if test "$enable_f90" != no ; then PAC_PROG_F90 fi # Set defaults for the TEST versions if not already set if test -z "$TESTCC" ; then TESTCC=${CC:=cc} fi if test -z "$TESTF77" ; then TESTF77=${F77:=f77} fi if test -z "$TESTCXX" ; then TESTCXX=${CXX:=CC} fi if test -z "$TESTF90" ; then TESTF90=${F90:=f90} fi ;; esac ]) dnl dnl/*D dnl PAC_MPI_F2C - Determine if MPI has the MPI-2 functions MPI_xxx_f2c and dnl MPI_xxx_c2f dnl dnl Output Effect: dnl Define 'HAVE_MPI_F2C' if the routines are found. dnl dnl Notes: dnl Looks only for 'MPI_Request_c2f'. dnl D*/ AC_DEFUN(PAC_MPI_F2C,[ AC_CACHE_CHECK([for MPI F2C and C2F routines], pac_cv_mpi_f2c, [ AC_TRY_LINK([#include "mpi.h"], [MPI_Request request;MPI_Fint a;a = MPI_Request_c2f(request);], pac_cv_mpi_f2c="yes",pac_cv_mpi_f2c="no") ]) if test "$pac_cv_mpi_f2c" = "yes" ; then AC_DEFINE(HAVE_MPI_F2C) fi ]) dnl dnl/*D dnl PAC_HAVE_ROMIO - make mpi.h include mpio.h if romio enabled dnl dnl Output Effect: dnl expands @HAVE_ROMIO@ in mpi.h into #include "mpio.h" dnl D*/ AC_DEFUN(PAC_HAVE_ROMIO,[ if test "$enable_romio" = "yes" ; then HAVE_ROMIO='#include "mpio.h"'; fi AC_SUBST(HAVE_ROMIO) ]) perftest-1.3a/config/confdb/aclocal_perl.m40000444000115300004540000000101707042340443014407 dnl dnl dnl Find perl5 AC_DEFUN(PAC_PROG_PERL5,[ AC_CACHE_VAL(pac_cv_prog_perl, [ AC_PATH_PROGS(PERL,perl5 perl) if test -n "$PERL" ; then changequote(,) pac_perlversion=`$PERL -v | grep 'This is perl' | \ sed -e 's/^.*version *\([0-9]\).*$/\1/'` changequote([,]) # Should do a test first for ch_p4 etc. if test "$pac_perlversion" != 5 ; then AC_MSG_WARN([Perl version 5 was not found]) AC_MSG_WARN([$PERL is version $pac_perlversion]) fi AC_SUBST(PERL) fi pac_cv_prog_perl=$PERL ])dnl ]) perftest-1.3a/config/confdb/aclocal_web.m40000664000115300004540000000077707660434706014256 dnl dnl Add support for web/HTML needs dnl/*D dnl PAC_ARG_WWW - Add support for wwwdir to the configure command line dnl dnl Output Effects: dnl Sets the variable 'wwwdir' to the specified directory; if no directory dnl is given, it uses '${prefix}/www'. dnl dnl D*/ dnl AC_DEFUN(PAC_ARG_WWWDIR,[ AC_ARG_WITH([wwwdir],[ --with-wwwdir=directory - Specify the root directory for HTML documentation], wwwdir=$withval,wwwdir='${prefix}/www') AC_SUBST(wwwdir)]) dnl dnl This will eventually include other tools dnl perftest-1.3a/config/confdb/config.guess0000775000115300004540000012104707666673623014104 #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-05-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:3*) echo i586-pc-interix3 exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: perftest-1.3a/config/confdb/config.sub0000775000115300004540000007247407666673623013560 #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-05-09' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic4x | c4x*) basic_machine=tic4x-unknown os=-coff ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: perftest-1.3a/config/confdb/install-sh0000555000115300004540000001267107340737523013553 #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then : else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else : fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else : fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else : fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 perftest-1.3a/config/confdb/pac.tex0000444000115300004540000000045307043124265013020 \documentclass{article} \usepackage{../../share/refman} \setlength{\textwidth}{6.5in} \setlength\oddsidemargin{0in} \setlength\evensidemargin{0in} \setlength\marginparwidth{0.7in} % % Run this from within the confdb/tex directory with % latex ../pac % \begin{document} \input ref.tex \end{document} perftest-1.3a/config/confdb/aclocal_shl.m40000664000115300004540000000570207627143215014253 dnl dnl Definitions for creating shared libraries dnl dnl The purpose of these definitions is to provide common support for dnl shared libraries, with *or without* the use of the GNU Libtool package. dnl For many of our important platforms, the Libtool approach is overkill, dnl and can be particularly painful for developers. dnl dnl/*D dnl PAC_ARG_SHAREDLIBS - Add --enable-sharedlibs=kind to configure. dnl dnl Synopsis: dnl PAC_ARG_SHAREDLIBS dnl dnl Output effects: dnl Adds '--enable-sharedlibs=kind' to the command line. If this is enabled, dnl then based on the value of 'kind', programs are selected for the dnl names 'CC_SHL' and 'CC_LINK_SHL' that configure will substitute for in dnl 'Makefile.in's. These symbols are generated by 'simplemake' when dnl shared library support is selected. dnl dnl Supported values of 'kind' include \: dnl+ gcc - Use gcc to create both shared objects and libraries dnl- none - The same as '--disable-sharedlibs' dnl dnl Others will be added as experience dictates. Likely names are dnl + libtool - For general GNU libtool dnl . linux-pgcc - For Portland group under Linux dnl - solaris-cc - For Solaris C compiler dnl dnl Notes: dnl Shared libraries are only partially implemented. Additional symbols dnl will probably be defined, including symbols to specify how shared library dnl search paths are specified and how shared library names are set. dnl D*/ AC_DEFUN(PAC_ARG_SHAREDLIBS,[ AC_ARG_ENABLE(sharedlibs, [--enable-sharedlibs=kind - Enable shared libraries. kind may be gcc - Standard gcc and GNU ld options for creating shared libraries libtool - GNU libtool none - same as --disable-sharedlibs Only gcc is currently supported], ,enable_sharedlibs=none) dnl CC_SHL=true C_LINK_SHL=true case "$enable_sharedlibs" in no|none) ;; gcc) AC_MSG_RESULT([Creating shared libraries using GNU]) # Not quite right yet. See mpich/util/makesharedlib # Use syntax that works in both Make and the shell #C_LINK_SHL='${CC} -shared -Wl,-r' C_LINK_SHL='${CC} -shared' # For example, include the libname as ${LIBNAME_SHL} #C_LINK_SHL='${CC} -shared -Wl,-h,' CC_SHL='${CC} -shared -fpic' ;; libtool) AC_MSG_RESULT([Creating shared libraries using libtool (not yet supported)]) AC_CHECK_PROGS(LIBTOOL,libtool,false) if test "$LIBTOOL" = "false" ; then AC_MSG_WARN([Could not find libtool]) else # Likely to be # either CC or CC_SHL is libtool $cc CC_SHL='libtool ${CC}' # CC_LINK_SHL includes the final installation path # For many systems, the link may need to include *all* libraries # (since many systems don't allow any unsatisfied dependencies) C_LINK_SHL='libtool ${CC} -rpath ${libdir}' fi ;; dnl dnl Other, such as solaris-cc *) AC_MSG_WARN([Unknown value $enable_sharedlibs for enable-sharedlibs]) enable_sharedlibs=no ;; esac AC_SUBST(CC_SHL) AC_SUBST(C_LINK_SHL) ]) perftest-1.3a/config/confdb/aclangf90.m40000664000115300004540000007356707660434704013574 # This file is part of Autoconf. -*- Autoconf -*- # Programming languages support. # Copyright 2000, 2001 # Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, the Free Software Foundation gives unlimited # permission to copy, distribute and modify the configure scripts that # are the output of Autoconf. You need not follow the terms of the GNU # General Public License when using or distributing such scripts, even # though portions of the text of Autoconf appear in them. The GNU # General Public License (GPL) does govern all other use of the material # that constitutes the Autoconf program. # # Certain portions of the Autoconf source text are designed to be copied # (in certain cases, depending on the input) into the output of # Autoconf. We call these the "data" portions. The rest of the Autoconf # source text consists of comments plus executable code that decides which # of the data portions to output in any given case. We call these # comments and executable code the "non-data" portions. Autoconf never # copies any of the non-data portions into its output. # # This special exception to the GPL applies to versions of Autoconf # released by the Free Software Foundation. When you make and # distribute a modified version of Autoconf, you may extend this special # exception to the GPL to apply to your modified version as well, *unless* # your modified version has the potential to copy into its output some # of the text that was the non-data portion of the version that you started # with. (In other words, unless your change moves or copies text from # the non-data portions to the data portions.) If your modification has # such potential, you must delete any notice of this special exception # to the GPL from your modified version. # # Written by David MacKenzie, with help from # Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, # Roland McGrath, Noah Friedman, david d zuhn, and many others. # # # This file was created from aclang.m4, from the autoconf 2.52 distribution # It contains modifications that are specific to Fortran 90 support, # needed to support systems that wish to use separate Fortran compilers # for Fortran 77 and Fortran 90 programs. # Fortran 90 part written by William Gropp. # ## ----------------------- ## ## 1. Language selection. ## ## ----------------------- ## # ----------------------------- # # 1e. The Fortran 90 language. # # ----------------------------- # # AC_LANG(Fortran 90) # ------------------- m4_define([AC_LANG(Fortran 90)], [ac_ext=${ac_f90ext-f} ac_compile='$F90 -c $F90FLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD' ac_link='$F90 -o conftest$ac_exeext $F90FLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD' ac_compiler_gnu=$ac_cv_f90_compiler_gnu ]) # AC_LANG_FORTRAN90 # ----------------- AU_DEFUN([AC_LANG_FORTRAN90], [AC_LANG(Fortran 90)]) # _AC_LANG_ABBREV(Fortran 90) # --------------------------- m4_define([_AC_LANG_ABBREV(Fortran 90)], [f90]) ## ---------------------- ## ## 2.Producing programs. ## ## ---------------------- ## # ------------------------ # # 2e. Fortran 90 sources. # # ------------------------ # # AC_LANG_SOURCE(Fortran 90)(BODY) # -------------------------------- # FIXME: Apparently, according to former AC_TRY_COMPILER, the CPP # directives must not be included. But AC_TRY_RUN_NATIVE was not # avoiding them, so? m4_define([AC_LANG_SOURCE(Fortran 90)], [$1]) # AC_LANG_PROGRAM(Fortran 90)([PROLOGUE], [BODY]) # ----------------------------------------------- # Yes, we discard the PROLOGUE. m4_define([AC_LANG_PROGRAM(Fortran 90)], [m4_ifval([$1], [m4_warn([syntax], [$0: ignoring PROLOGUE: $1])])dnl program main $2 end]) # AC_LANG_CALL(Fortran 90)(PROLOGUE, FUNCTION) # -------------------------------------------- # FIXME: This is a guess, help! m4_define([AC_LANG_CALL(Fortran 90)], [AC_LANG_PROGRAM([$1], [ call $2])]) ## -------------------------------------------- ## ## 3. Looking for Compilers and Preprocessors. ## ## -------------------------------------------- ## # ----------------------------- # # 3e. The Fortran 90 compiler. # # ----------------------------- # # AC_LANG_PREPROC(Fortran 90) # --------------------------- # Find the Fortran 90 preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able. AC_DEFUN([AC_LANG_PREPROC(Fortran 90)], [m4_warn([syntax], [$0: No preprocessor defined for ]_AC_LANG)]) # AC_LANG_COMPILER(Fortran 90) # ---------------------------- # Find the Fortran 90 compiler. Must be AC_DEFUN'd to be # AC_REQUIRE'able. AC_DEFUN([AC_LANG_COMPILER(Fortran 90)], [AC_REQUIRE([AC_PROG_F90])]) # ac_cv_prog_g90 # -------------- # We used to name the cache variable this way. AU_DEFUN([ac_cv_prog_g90], [ac_cv_f90_compiler_gnu]) # AC_PROG_F90([COMPILERS...]) # --------------------------- # COMPILERS is a space separated list of Fortran 90 compilers to search # for. # # Compilers are ordered by # 1. F95, F90 # 2. Good/tested native compilers, bad/untested native compilers # # frt is the Fujitsu Fortran compiler. # pgf90 is the Portland Group F90 compilers. # xlf90/xlf95 are IBM (AIX) F90/F95 compilers. # lf95 is the Lahey-Fujitsu compiler. # fl32 is the Microsoft Fortran "PowerStation" compiler. # epcf90 is the "Edinburgh Portable Compiler" F90. # fort is the Compaq Fortran 90 (now 95) compiler for Tru64 and Linux/Alpha. AC_DEFUN([AC_PROG_F90], [AC_LANG_PUSH(Fortran 90)dnl AC_ARG_VAR([F90], [Fortran 90 compiler command])dnl AC_ARG_VAR([F90FLAGS], [Fortran 90 compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOLS(F90, [m4_default([$1], [f95 f90 pgf90 epcf90 fort xlf95 xlf90 xlf lf95 g95 fc])]) # Provide some information about the compiler. echo "$as_me:__oline__:" \ "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD ac_compiler=`set X $ac_compile; echo $[2]` _AC_EVAL([$ac_compiler --version &AS_MESSAGE_LOG_FD]) _AC_EVAL([$ac_compiler -v &AS_MESSAGE_LOG_FD]) _AC_EVAL([$ac_compiler -V &AS_MESSAGE_LOG_FD]) m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl # If we don't use `.F' as extension, the preprocessor is not run on the # input file. ac_save_ext=$ac_ext ac_ext=F _AC_LANG_COMPILER_GNU ac_ext=$ac_save_ext G90=`test $ac_compiler_gnu = yes && echo yes` _AC_PROG_F90_G AC_LANG_POP(Fortran 90)dnl ])# AC_PROG_F90 # _AC_PROG_F90_G # -------------- # Check whether -g works, even if F90FLAGS is set, in case the package # plays around with F90FLAGS (such as to build both debugging and normal # versions of a library), tasteless as that idea is. m4_define([_AC_PROG_F90_G], [ac_test_F90FLAGS=${F90FLAGS+set} ac_save_F90FLAGS=$F90FLAGS F90FLAGS= AC_CACHE_CHECK(whether $F90 accepts -g, ac_cv_prog_f90_g, [F90FLAGS=-g _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ac_cv_prog_f90_g=yes], [ac_cv_prog_f90_g=no]) ]) if test "$ac_test_F90FLAGS" = set; then F90FLAGS=$ac_save_F90FLAGS elif test $ac_cv_prog_f90_g = yes; then if test "$G95" = yes; then F90FLAGS="-g -O2" else F90FLAGS="-g" fi else if test "$G95" = yes; then F90FLAGS="-O2" else F90FLAGS= fi fi[]dnl ])# _AC_PROG_F90_G # AC_PROG_F90_C_O # --------------- # Test if the Fortran 90 compiler accepts the options `-c' and `-o' # simultaneously, and define `F90_NO_MINUS_C_MINUS_O' if it does not. # # The usefulness of this macro is questionable, as I can't really see # why anyone would use it. The only reason I include it is for # completeness, since a similar test exists for the C compiler. AC_DEFUN([AC_PROG_F90_C_O], [AC_REQUIRE([AC_PROG_F90])dnl AC_CACHE_CHECK([whether $F90 understand -c and -o together], [ac_cv_prog_f90_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # We test twice because some compilers refuse to overwrite an existing # `.o' file with `-o', although they will create one. ac_try='$F90 $F90FLAGS -c conftest.$ac_ext -o conftest.$ac_objext >&AS_MESSAGE_LOG_FD' if AC_TRY_EVAL(ac_try) && test -f conftest.$ac_objext && AC_TRY_EVAL(ac_try); then ac_cv_prog_f90_c_o=yes else ac_cv_prog_f90_c_o=no fi rm -f conftest*]) if test $ac_cv_prog_f90_c_o = no; then AC_DEFINE(F90_NO_MINUS_C_MINUS_O, 1, [Define if your Fortran 90 compiler doesn't accept -c and -o together.]) fi ])# AC_PROG_F90_C_O ## ------------------------------- ## ## 4. Compilers' characteristics. ## ## ------------------------------- ## # ---------------------------------------- # # 4d. Fortan 90 compiler characteristics. # # ---------------------------------------- # # _AC_PROG_F90_V_OUTPUT([FLAG = $ac_cv_prog_f90_v]) # ------------------------------------------------- # Link a trivial Fortran program, compiling with a verbose output FLAG # (which default value, $ac_cv_prog_f90_v, is computed by # _AC_PROG_F90_V), and return the output in $ac_f90_v_output. This # output is processed in the way expected by AC_F90_LIBRARY_LDFLAGS, # so that any link flags that are echoed by the compiler appear as # space-separated items. AC_DEFUN([_AC_PROG_F90_V_OUTPUT], [AC_REQUIRE([AC_PROG_F90])dnl AC_LANG_PUSH(Fortran 90)dnl AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Compile and link our simple test program by passing a flag (argument # 1 to this macro) to the Fortran 90 compiler in order to get # "verbose" output that we can then parse for the Fortran 90 linker # flags. ac_save_F90FLAGS=$F90FLAGS F90FLAGS="$F90FLAGS m4_default([$1], [$ac_cv_prog_f90_v])" (eval echo $as_me:__oline__: \"$ac_link\") >&AS_MESSAGE_LOG_FD ac_f90_v_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1 | grep -v 'Driving:'` echo "$ac_f90_v_output" >&AS_MESSAGE_LOG_FD F90FLAGS=$ac_save_F90FLAGS rm -f conftest* AC_LANG_POP(Fortran 90)dnl # If we are using xlf then replace all the commas with spaces. if echo $ac_f90_v_output | grep xlfentry >/dev/null 2>&1; then ac_f90_v_output=`echo $ac_f90_v_output | sed 's/,/ /g'` fi # If we are using Cray Fortran then delete quotes. # Use "\"" instead of '"' for font-lock-mode. # FIXME: a more general fix for quoted arguments with spaces? if echo $ac_f90_v_output | grep cft90 >/dev/null 2>&1; then ac_f90_v_output=`echo $ac_f90_v_output | sed "s/\"//g"` fi[]dnl ])# _AC_PROG_F90_V_OUTPUT # _AC_PROG_F90_V # -------------- # # Determine the flag that causes the Fortran 90 compiler to print # information of library and object files (normally -v) # Needed for AC_F90_LIBRARY_FLAGS # Some compilers don't accept -v (Lahey: -verbose, xlf: -V, Fujitsu: -###) AC_DEFUN([_AC_PROG_F90_V], [AC_CACHE_CHECK([how to get verbose linking output from $F90], [ac_cv_prog_f90_v], [AC_LANG_ASSERT(Fortran 90) AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ac_cv_prog_f90_v= # Try some options frequently used verbose output for ac_verb in -v -verbose --verbose -V -\#\#\#; do _AC_PROG_F90_V_OUTPUT($ac_verb) # look for -l* and *.a constructs in the output for ac_arg in $ac_f90_v_output; do case $ac_arg in [[\\/]]*.a | ?:[[\\/]]*.a | -[[lLRu]]*) ac_cv_prog_f90_v=$ac_verb break 2 ;; esac done done if test -z "$ac_cv_prog_f90_v"; then AC_MSG_WARN([cannot determine how to obtain linking information from $F90]) fi], [AC_MSG_WARN([compilation failed])]) ])])# _AC_PROG_F90_V # AC_F90_LIBRARY_LDFLAGS # ---------------------- # # Determine the linker flags (e.g. "-L" and "-l") for the Fortran 90 # intrinsic and run-time libraries that are required to successfully # link a Fortran 90 program or shared library. The output variable # F90LIBS is set to these flags. # # This macro is intended to be used in those situations when it is # necessary to mix, e.g. C++ and Fortran 90, source code into a single # program or shared library. # # For example, if object files from a C++ and Fortran 90 compiler must # be linked together, then the C++ compiler/linker must be used for # linking (since special C++-ish things need to happen at link time # like calling global constructors, instantiating templates, enabling # exception support, etc.). # # However, the Fortran 90 intrinsic and run-time libraries must be # linked in as well, but the C++ compiler/linker doesn't know how to # add these Fortran 90 libraries. Hence, the macro # "AC_F90_LIBRARY_LDFLAGS" was created to determine these Fortran 90 # libraries. # # This macro was packaged in its current form by Matthew D. Langston. # However, nearly all of this macro came from the "OCTAVE_FLIBS" macro # in "octave-2.0.13/aclocal.m4", and full credit should go to John # W. Eaton for writing this extremely useful macro. Thank you John. AC_DEFUN([AC_F90_LIBRARY_LDFLAGS], [AC_LANG_PUSH(Fortran 90)dnl _AC_PROG_F90_V AC_CACHE_CHECK([for Fortran 90 libraries], ac_cv_f90libs, [if test "x$F90LIBS" != "x"; then ac_cv_f90libs="$F90LIBS" # Let the user override the test. else _AC_PROG_F90_V_OUTPUT ac_cv_f90libs= # Save positional arguments (if any) ac_save_positional="$[@]" set X $ac_f90_v_output while test $[@%:@] != 1; do shift ac_arg=$[1] case $ac_arg in [[\\/]]*.a | ?:[[\\/]]*.a) AC_LIST_MEMBER_OF($ac_arg, $ac_cv_f90libs, , ac_cv_f90libs="$ac_cv_f90libs $ac_arg") ;; -bI:*) AC_LIST_MEMBER_OF($ac_arg, $ac_cv_f90libs, , [AC_LINKER_OPTION([$ac_arg], ac_cv_f90libs)]) ;; # Ignore these flags. -lang* | -lcrt0.o | -lc | -lgcc | -LANG:=*) ;; -lkernel32) test x"$CYGWIN" != xyes && ac_cv_f90libs="$ac_cv_f90libs $ac_arg" ;; -[[LRuY]]) # These flags, when seen by themselves, take an argument. # We remove the space between option and argument and re-iterate # unless we find an empty arg or a new option (starting with -) case $[2] in "" | -*);; *) ac_arg="$ac_arg$[2]" shift; shift set X $ac_arg "$[@]" ;; esac ;; -YP,*) for ac_j in `echo $ac_arg | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do AC_LIST_MEMBER_OF($ac_j, $ac_cv_f90libs, , [ac_arg="$ac_arg $ac_j" ac_cv_f90libs="$ac_cv_f90libs $ac_j"]) done ;; -[[lLR]]*) AC_LIST_MEMBER_OF($ac_arg, $ac_cv_f90libs, , ac_cv_f90libs="$ac_cv_f90libs $ac_arg") ;; # Ignore everything else. esac done # restore positional arguments set X $ac_save_positional; shift # We only consider "LD_RUN_PATH" on Solaris systems. If this is seen, # then we insist that the "run path" must be an absolute path (i.e. it # must begin with a "/"). case `(uname -sr) 2>/dev/null` in "SunOS 5"*) ac_ld_run_path=`echo $ac_f90_v_output | sed -n 's,^.*LD_RUN_PATH *= *\(/[[^ ]]*\).*$,-R\1,p'` test "x$ac_ld_run_path" != x && AC_LINKER_OPTION([$ac_ld_run_path], ac_cv_f90libs) ;; esac fi # test "x$F90LIBS" = "x" ]) F90LIBS="$ac_cv_f90libs" AC_SUBST(F90LIBS) AC_LANG_POP(Fortran 90)dnl ])# AC_F90_LIBRARY_LDFLAGS # AC_F90_DUMMY_MAIN([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # ----------------------------------------------------------- # # Detect name of dummy main routine required by the Fortran libraries, # (if any) and define F90_DUMMY_MAIN to this name (which should be # used for a dummy declaration, if it is defined). On some systems, # linking a C program to the Fortran library does not work unless you # supply a dummy function called something like MAIN__. # # Execute ACTION-IF-NOT-FOUND if no way of successfully linking a C # program with the F90 libs is found; default to exiting with an error # message. Execute ACTION-IF-FOUND if a dummy routine name is needed # and found or if it is not needed (default to defining F90_DUMMY_MAIN # when needed). # # What is technically happening is that the Fortran libraries provide # their own main() function, which usually initializes Fortran I/O and # similar stuff, and then calls MAIN__, which is the entry point of # your program. Usually, a C program will override this with its own # main() routine, but the linker sometimes complain if you don't # provide a dummy (never-called) MAIN__ routine anyway. # # Of course, programs that want to allow Fortran subroutines to do # I/O, etcetera, should call their main routine MAIN__() (or whatever) # instead of main(). A separate autoconf test (AC_F90_MAIN) checks # for the routine to use in this case (since the semantics of the test # are slightly different). To link to e.g. purely numerical # libraries, this is normally not necessary, however, and most C/C++ # programs are reluctant to turn over so much control to Fortran. =) # # The name variants we check for are (in order): # MAIN__ (g90, MAIN__ required on some systems; IRIX, MAIN__ optional) # MAIN_, __main (SunOS) # MAIN _MAIN __MAIN main_ main__ _main (we follow DDD and try these too) AC_DEFUN([AC_F90_DUMMY_MAIN], [AC_REQUIRE([AC_F90_LIBRARY_LDFLAGS])dnl m4_define([_AC_LANG_PROGRAM_C_F90_HOOKS], [#ifdef F90_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F90_DUMMY_MAIN() { return 1; } #endif ]) AC_CACHE_CHECK([for dummy main to link with Fortran 90 libraries], ac_cv_f90_dummy_main, [AC_LANG_PUSH(C)dnl ac_f90_dm_save_LIBS=$LIBS LIBS="$LIBS $F90LIBS" # First, try linking without a dummy main: AC_TRY_LINK([], [], ac_cv_f90_dummy_main=none, ac_cv_f90_dummy_main=unknown) if test $ac_cv_f90_dummy_main = unknown; then for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do AC_TRY_LINK([@%:@define F90_DUMMY_MAIN $ac_func], [], [ac_cv_f90_dummy_main=$ac_func; break]) done fi rm -f conftest* LIBS=$ac_f90_dm_save_LIBS AC_LANG_POP(C)dnl ]) F90_DUMMY_MAIN=$ac_cv_f90_dummy_main AS_IF([test "$F90_DUMMY_MAIN" != unknown], [m4_default([$1], [if test $F90_DUMMY_MAIN != none; then AC_DEFINE_UNQUOTED([F90_DUMMY_MAIN], $F90_DUMMY_MAIN, [Define to dummy `main' function (if any) required to link to the Fortran 90 libraries.]) fi])], [m4_default([$2], [AC_MSG_ERROR([Linking to Fortran libraries from C fails.])])]) ])# AC_F90_DUMMY_MAIN # AC_F90_MAIN # ----------- # Define F90_MAIN to name of alternate main() function for use with # the Fortran libraries. (Typically, the libraries may define their # own main() to initialize I/O, etcetera, that then call your own # routine called MAIN__ or whatever.) See AC_F90_DUMMY_MAIN, above. # If no such alternate name is found, just define F90_MAIN to main. # AC_DEFUN([AC_F90_MAIN], [AC_REQUIRE([AC_F90_LIBRARY_LDFLAGS])dnl AC_CACHE_CHECK([for alternate main to link with Fortran 90 libraries], ac_cv_f90_main, [AC_LANG_PUSH(C)dnl ac_f90_m_save_LIBS=$LIBS LIBS="$LIBS $F90LIBS" ac_cv_f90_main="main" # default entry point name for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do AC_TRY_LINK([#undef F90_DUMMY_MAIN @%:@define main $ac_func], [], [ac_cv_f90_main=$ac_func; break]) done rm -f conftest* LIBS=$ac_f90_m_save_LIBS AC_LANG_POP(C)dnl ]) AC_DEFINE_UNQUOTED([F90_MAIN], $ac_cv_f90_main, [Define to alternate name for `main' routine that is called from a `main' in the Fortran libraries.]) ])# AC_F90_MAIN # _AC_F90_NAME_MANGLING # --------------------- # Test for the name mangling scheme used by the Fortran 90 compiler. # # Sets ac_cv_f90_mangling. The value contains three fields, separated # by commas: # # lower case / upper case: # case translation of the Fortan 90 symbols # underscore / no underscore: # whether the compiler appends "_" to symbol names # extra underscore / no extra underscore: # whether the compiler appends an extra "_" to symbol names already # containing at least one underscore # AC_DEFUN([_AC_F90_NAME_MANGLING], [AC_REQUIRE([AC_F90_LIBRARY_LDFLAGS])dnl AC_REQUIRE([AC_F90_DUMMY_MAIN])dnl AC_CACHE_CHECK([for Fortran 90 name-mangling scheme], ac_cv_f90_mangling, [AC_LANG_PUSH(Fortran 90)dnl AC_COMPILE_IFELSE( [ subroutine foobar() return end subroutine foo_bar() return end], [mv conftest.$ac_objext cf90_test.$ac_objext AC_LANG_PUSH(C)dnl ac_save_LIBS=$LIBS LIBS="cf90_test.$ac_objext $LIBS $F90LIBS" ac_success=no for ac_foobar in foobar FOOBAR; do for ac_underscore in "" "_"; do ac_func="$ac_foobar$ac_underscore" AC_TRY_LINK_FUNC($ac_func, [ac_success=yes; break 2]) done done if test "$ac_success" = "yes"; then case $ac_foobar in foobar) ac_case=lower ac_foo_bar=foo_bar ;; FOOBAR) ac_case=upper ac_foo_bar=FOO_BAR ;; esac ac_success_extra=no for ac_extra in "" "_"; do ac_func="$ac_foo_bar$ac_underscore$ac_extra" AC_TRY_LINK_FUNC($ac_func, [ac_success_extra=yes; break]) done if test "$ac_success_extra" = "yes"; then ac_cv_f90_mangling="$ac_case case" if test -z "$ac_underscore"; then ac_cv_f90_mangling="$ac_cv_f90_mangling, no underscore" else ac_cv_f90_mangling="$ac_cv_f90_mangling, underscore" fi if test -z "$ac_extra"; then ac_cv_f90_mangling="$ac_cv_f90_mangling, no extra underscore" else ac_cv_f90_mangling="$ac_cv_f90_mangling, extra underscore" fi else ac_cv_f90_mangling="unknown" fi else ac_cv_f90_mangling="unknown" fi LIBS=$ac_save_LIBS AC_LANG_POP(C)dnl rm -f cf90_test* conftest*]) AC_LANG_POP(Fortran 90)dnl ]) ])# _AC_F90_NAME_MANGLING # The replacement is empty. AU_DEFUN([AC_F90_NAME_MANGLING], []) # AC_F90_WRAPPERS # --------------- # Defines C macros F90_FUNC(name,NAME) and F90_FUNC_(name,NAME) to # properly mangle the names of C identifiers, and C identifiers with # underscores, respectively, so that they match the name mangling # scheme used by the Fortran 90 compiler. AC_DEFUN([AC_F90_WRAPPERS], [AC_REQUIRE([_AC_F90_NAME_MANGLING])dnl AH_TEMPLATE([F90_FUNC], [Define to a macro mangling the given C identifier (in lower and upper case), which must not contain underscores, for linking with Fortran.])dnl AH_TEMPLATE([F90_FUNC_], [As F90_FUNC, but for C identifiers containing underscores.])dnl case $ac_cv_f90_mangling in "lower case, no underscore, no extra underscore") AC_DEFINE([F90_FUNC(name,NAME)], [name]) AC_DEFINE([F90_FUNC_(name,NAME)], [name]) ;; "lower case, no underscore, extra underscore") AC_DEFINE([F90_FUNC(name,NAME)], [name]) AC_DEFINE([F90_FUNC_(name,NAME)], [name ## _]) ;; "lower case, underscore, no extra underscore") AC_DEFINE([F90_FUNC(name,NAME)], [name ## _]) AC_DEFINE([F90_FUNC_(name,NAME)], [name ## _]) ;; "lower case, underscore, extra underscore") AC_DEFINE([F90_FUNC(name,NAME)], [name ## _]) AC_DEFINE([F90_FUNC_(name,NAME)], [name ## __]) ;; "upper case, no underscore, no extra underscore") AC_DEFINE([F90_FUNC(name,NAME)], [NAME]) AC_DEFINE([F90_FUNC_(name,NAME)], [NAME]) ;; "upper case, no underscore, extra underscore") AC_DEFINE([F90_FUNC(name,NAME)], [NAME]) AC_DEFINE([F90_FUNC_(name,NAME)], [NAME ## _]) ;; "upper case, underscore, no extra underscore") AC_DEFINE([F90_FUNC(name,NAME)], [NAME ## _]) AC_DEFINE([F90_FUNC_(name,NAME)], [NAME ## _]) ;; "upper case, underscore, extra underscore") AC_DEFINE([F90_FUNC(name,NAME)], [NAME ## _]) AC_DEFINE([F90_FUNC_(name,NAME)], [NAME ## __]) ;; *) AC_MSG_WARN([unknown Fortran 90 name-mangling scheme]) ;; esac ])# AC_F90_WRAPPERS # AC_F90_FUNC(NAME, [SHELLVAR = NAME]) # ------------------------------------ # For a Fortran subroutine of given NAME, define a shell variable # $SHELLVAR to the Fortran-90 mangled name. If the SHELLVAR # argument is not supplied, it defaults to NAME. AC_DEFUN([AC_F90_FUNC], [AC_REQUIRE([_AC_F90_NAME_MANGLING])dnl case $ac_cv_f90_mangling in upper*) ac_val="m4_toupper([$1])" ;; lower*) ac_val="m4_tolower([$1])" ;; *) ac_val="unknown" ;; esac case $ac_cv_f90_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac m4_if(m4_index([$1],[_]),-1,[], [case $ac_cv_f90_mangling in *," extra underscore"*) ac_val="$ac_val"_ ;; esac ]) m4_default([$2],[$1])="$ac_val" ])# AC_F90_FUNC # # ------------------------------------------------------------------------ # Special characteristics that have no autoconf counterpart but that # we need as part of the Fortran 90 support. To distinquish these, they # have a [PAC] prefix. # dnl dnl PAC_F90_MODULE_EXT(action if found,action if not found) dnl AC_DEFUN([PAC_F90_MODULE_EXT], [AC_CACHE_CHECK([for Fortran 90 module extension], pac_cv_f90_module_ext,[ pac_cv_f90_module_case="unknown" AC_LANG_PUSH(Fortran 90) cat >conftest.$ac_ext <&1 2>&1 | grep -v conftest.$ac_ext | grep -v conftest.o` pac_MOD=`echo $pac_MOD | sed -e 's/conftest\.//g'` pac_cv_f90_module_case="lower" if test "X$pac_MOD" = "X" ; then for file in CONFTEST* ; do if test "x$file" = "xCONFTEST.$ac_ext" ; then continue ; fi if test "x$file" = "xCONFTEST.o" ; then continue ; fi if test -s "$file" ; then pac_MOD=$file break fi done pac_MOD=`echo $pac_MOD | sed -e 's/CONFTEST\.//g'` if test -n "$pac_MOD" ; then testname="CONFTEST" pac_cv_f90_module_case="upper" fi fi if test -z "$pac_MOD" ; then pac_cv_f90_module_ext="unknown" else pac_cv_f90_module_ext=$pac_MOD fi else echo "configure: failed program was:" >&AC_FD_CC cat conftest.$ac_ext >&AC_FD_CC pac_cv_f90_module_ext="unknown" fi AC_LANG_POP rm -f conftest* ]) AC_SUBST(F90MODEXT) if test "$pac_cv_f90_module_ext" = "unknown" ; then ifelse($2,,:,[$2]) else ifelse($1,,F90MODEXT=$pac_MOD,[$1]) fi ]) dnl dnl PAC_F90_MODULE_INCFLAG AC_DEFUN([PAC_F90_MODULE_INCFLAG],[ AC_CACHE_CHECK([for Fortran 90 module include flag], pac_cv_f90_module_incflag,[ AC_REQUIRE([PAC_F90_MODULE_EXT]) AC_LANG_PUSH(Fortran 90) cat >conftest.$ac_ext <&AC_FD_CC cat conftest.$ac_ext >&AC_FD_CC fi rm -f conftest.$ac_ext cat >conftest.$ac_ext <&AC_FD_CC && \ test -s conftest.o ; then pac_cv_f90_module_incflag="-I" elif ${F90-f90} -c $F90FLAGS -Mconf conftest.$ac_ext 1>&AC_FD_CC && \ test-s conftest.o ; then pac_cv_f90_module_incflag="-M" elif ${F90-f90} -c $F90FLAGS -pconf conftest.$ac_ext 1>&AC_FD_CC && \ test -s conftest.o ; then pac_cv_f90_module_incflag="-p" else pac_cv_f90_module_incflag="unknown" fi if test "$pac_madedir" = "yes" ; then rm -rf conf ; fi rm -f conftest* AC_LANG_POP ]) AC_SUBST(F90MODINCFLAG) F90MODINCFLAG=$pac_cv_f90_module_incflag ]) AC_DEFUN([PAC_F90_MODULE],[ PAC_F90_MODULE_EXT PAC_F90_MODULE_INCFLAG ]) AC_DEFUN([PAC_F90_EXT],[ AC_CACHE_CHECK([whether Fortran 90 accepts f90 suffix], pac_cv_f90_ext_f90,[ save_ac_f90ext=$ac_f90ext ac_f90ext="f90" AC_LANG_PUSH(Fortran 90) AC_TRY_COMPILE(,,pac_cv_f90_ext_f90="yes",pac_cv_f90_ext_f90="no") AC_LANG_POP ]) if test "$pac_cv_f90_ext_f90" = "yes" ; then ac_f90ext=f90 else ac_f90ext=f fi ]) dnl dnl/*D dnl PAC_PROG_F90_INT_KIND - Determine kind parameter for an integer with dnl the specified number of bytes. dnl dnl Synopsis: dnl PAC_PROG_F90_INT_KIND(variable-to-set,number-of-bytes,[cross-size]) dnl dnl D*/ AC_DEFUN(PAC_PROG_F90_INT_KIND,[ # Set the default $1=-1 if test "$pac_cv_prog_f90_cross" = "yes" ; then $1="$3" else AC_LANG_PUSH(Fortran 90) if test -n "$ac_compile" ; then AC_MSG_CHECKING([for Fortran 90 integer kind for $2-byte integers]) # Convert bytes to digits case $2 in 1) sellen=2 ;; 2) sellen=4 ;; 4) sellen=8 ;; 8) sellen=16 ;; 16) sellen=30 ;; *) sellen=8 ;; esac # Check for cached value eval testval=\$"pac_cv_prog_f90_int_kind_$sellen" if test -n "$testval" ; then AC_MSG_RESULT([$testval (cached)]) $1=$testval else # must compute rm -f conftest* cat < conftest.$ac_ext program main integer i i = selected_int_kind($sellen) open(8, file="conftest1.out", form="formatted") write (8,*) i close(8) stop end EOF KINDVAL="unavailable" eval "pac_cv_prog_f90_int_kind_$sellen"=-1 if AC_TRY_EVAL(ac_link) && test -s conftest ; then ./conftest >>config.log 2>&1 if test -s conftest1.out ; then # Because of write, there may be a leading blank. KINDVAL=`cat conftest1.out | sed 's/ //g'` eval "pac_cv_prog_f90_int_kind_$sellen"=$KINDVAL $1=$KINDVAL fi fi rm -f conftest* AC_MSG_RESULT($KINDVAL) fi # not cached fi # Has Fortran 90 AC_LANG_POP fi # is not cross compiling ])dnl dnl dnl Backwards compatibility features dnl AC_DEFUN([PAC_PROG_F90],[AC_PROG_F90]) AC_DEFUN([PAC_LANG_FORTRAN90],[AC_LANG_PUSH(Fortran 90)]) perftest-1.3a/rungoptest0000775000115300004540000000644706410037635011211 #! /bin/csh # # Run goptest to get communication performance and scalability # # Set defaults set MAXNP = 8 set SIZE = "-tgoal 0.1" set fname = "-fname gop.out" set system = "MPI" set NATIVE = "" set BCAST = 1 set DSUM = 1 set SYNC = 1 set MULT = 2 set ADD = 0 set PLOT = "Cit" set MPIRUNOPT = "" set MPIRUN = "mpirun" if ($#argv > 0) then if ("$1" == "-help") then echo "Run goptest for collective operations" echo "Output goes to stdout" echo " " echo "rungoptest [ -help ] [ -short ] [ -long ] [ -vlong ] " echo " [ -maxnp n ] [ -fname file ]" echo " [ -gnuplot ] [ -sync ] [ -dsum ] [ -bcast ]" echo " [ -add ] [ -mpirun options ]" echo " [ -mpirunpgm program ]" echo " An fname of -stdout will write all output to stdout" echo " -add choses nodes of the form 2*k instead of 2**k" echo " -mpirunpgm chooses a different version of mpirun" exit endif while ( $#argv > 0 ) switch ($1) case -short: shift set SIZE = "-size 0 1024 256 -tgoal 0.1" breaksw case -long: shift set SIZE = "-size 1024 16384 2048 -tgoal 0.1" breaksw case -vlong: shift set SIZE = "-size 16384 65536 16384 -reps 100 -tgoal 0.5" breaksw case -maxnp: shift set MAXNP = $1 shift breaksw case -fname: shift if ( "$1" == "-stdout" ) then set fname = "" else set fname = "-fname $1" endif if ( "$PLOT" == "gnuplot" ) then set fname = "-gnuplot $fname" endif shift breaksw case -gnuplot: shift set fname = "-gnuplot $fname" set PLOT = "gnuplot" breaksw case -sync: shift set DSUM = 0 set BCAST = 0 breaksw case -bcast: shift set SYNC = 0 set DSUM = 0 breaksw case -dsum: shift set SYNC = 0 set BCAST = 0 breaksw case -add: shift set ADD = 2 set MULT = 1 breaksw case -mpirun: shift set MPIRUNOPT = "$1" shift breaksw case -mpirunpgm: shift set MPIRUN = "$1" shift breaksw default: echo "Unknown option $1" shift endsw end endif # # SP1 systems require this and it does not hurt other systems setenv PWD `pwd | sed 's%/tmp_mnt/%/%g'` set GRAPH = "$fname" set GRAPHHEAD = "" set GRAPHTAIL = "-notail" # # Choose the system to run with ... set NP = 2 while ($NP <= $MAXNP) setenv MP_PROCS $NP set GOPTEST = "$MPIRUN $MPIRUNOPT -np $NP goptest" set MPP = "" # # Begin the tests # # Round-trip times, blocking (from 0 to 1 MBytes) if ( $SYNC == 1 ) then if ($NP == 2) echo "# Synchronization time" $GOPTEST $GRAPH -tgoal 0.1 $GRAPHHEAD $GRAPHTAIL -sync endif # if ( $BCAST == 1 ) then # # Broadcast tsets if ($NP == 2) echo "# Broadcast tests" $GOPTEST $GRAPH -bcast $SIZE $GRAPHHEAD $GRAPHTAIL endif # # Collective operation tests # if ( $DSUM == 1 ) then if ($NP == 2) echo "# Reduction tests" # # We set sizes on these since they are with respect to either ints or # doubles, not bytes $GOPTEST $GRAPH -dsum $SIZE $GRAPHHEAD $GRAPHTAIL endif # # End of the while on NP @ NP = $NP * $MULT + $ADD set GRAPHHEAD = "-nohead" # If we are the second to last iteration, remove the -notail option. if ($NP * $MULT + $ADD > $MAXNP) set GRAPHTAIL = "" end perftest-1.3a/runmpptest0000775000115300004540000001436406410037636011216 #! /bin/csh # # Run mpptest to get communication performance. # # Set defaults set NP = 2 set SHORT = 0 set LONG = 0 set fname = "-fname mpp.out" set fbname = "mpp.out" set system = "MPI" set NATIVE = "" set PAIR = 1 set OVERLAP = 1 set GOP = 1 set BISECT = 1 set PLOT = "Cit" set GIVEDY = "" set MPIRUNOPT = "" set BLOCKING = 1 set NONBLOCKING = 1 set mpirun = "mpirun" if ($#argv > 0) then if ("$1" == "-help") then echo "Run mpptest for round-trip messages from 0 to 1 MByte." echo "Output goes to stdout" echo " " echo "runmpptest [ -help ] [ -short ] [ -long ] [ -fname file ] [-gnuplot]" echo " [ -pair ] [ -gop ] [ -overlap ] [ -bisect ]" echo " [ -blocking ] [ -nonblocking ]" echo " [ -givedy ] " echo " [ -mpirun options ] [ -np n ]" exit endif while ( $#argv > 0 ) switch ($1) case -short: shift set SHORT = 1 breaksw case -long: shift set LONG = 1 set SHORT = 0 breaksw case -blocking: shift set NONBLOCKING = 0 breaksw case -givedy: shift set GIVEDY = "-givedy" breaksw case -nonblocking: shift set BLOCKING = 0 breaksw case -np: shift set NP=$1 shift breaksw case -fname: shift if ( "$1" == "-stdout" ) then set fname = "" set fbname = "" else set fname = "-fname $1" set fbname = "$1" endif if ( "$PLOT" == "gnuplot" ) then set fname = "-gnuplot $fname" endif shift breaksw case -gnuplot: shift set fname = "-gnuplot $fname" set PLOT = "gnuplot" breaksw case -pair: shift set BISECT = 0 set GOP = 0 set OVERLAP = 0 breaksw case -bisect: shift set PAIR = 0 set GOP = 0 set OVERLAP = 0 breaksw case -gop: shift set PAIR = 0 set BISECT = 0 set OVERLAP = 0 breaksw case -overlap: shift set PAIR = 0 set BISECT = 0 set GOP = 0 breaksw case -mpirun: shift set MPIRUNOPT = "$1" shift breaksw case -mpirunpgm: shift set mpirun = "$1" shift breaksw default: echo "Unknown option $1" shift endsw end endif # # SP1 systems require this and it does not hurt other systems setenv PWD `pwd | sed 's%/tmp_mnt/%/%g'` setenv MP_PROCS $NP set GRAPH = "$fname" if ( $SHORT == 0 && $PLOT == "Cit") then set GRAPH11 = "-wx 1 2 -wy 2 2 $fname" set GRAPH12 = "-wx 2 2 -wy 2 2 $fname" set GRAPH21 = "-wx 1 2 -wy 1 2 $fname" set GRAPH22 = "-wx 2 2 -wy 1 2 $fname -lastwindow" else set GRAPH11 = "$fname" set GRAPH12 = "$fname" set GRAPH21 = "$fname" set GRAPH22 = "$fname" endif # # Choose the system to run with ... set MPPTEST = "$mpirun $MPIRUNOPT -np $NP mpptest" # # # Begin the tests # # Round-trip times, blocking (from 0 to 1 MBytes) if ( $PAIR == 1 ) then if ( $BLOCKING == 1 ) then echo "Round trip tests-blocking" if ( $LONG == 0 ) then $MPPTEST $GRAPH11 $GIVEDY -np 2 -tgoal 0.1 -auto endif if ( $SHORT == 0 ) then if ( $LONG == 0 ) then $MPPTEST $GRAPH12 $GIVEDY -np 2 -tgoal 0.1 -auto \ -size 1024 16384 256 -autodx 128 endif $MPPTEST $GRAPH21 $GIVEDY -np 2 -tgoal 0.5 -auto \ -size 16384 65536 1024 -autodx 512 -reps 100 if ( $LONG == 0 ) then $MPPTEST $GRAPH22 $GIVEDY -np 2 -tgoal 1.0 -auto \ -size 65536 1048576 8192 -autodx 8192 -reps 25 endif endif endif # # # Nonblocking times if ( $NONBLOCKING == 1 ) then echo "Round trip tests-nonblocking" if ( $LONG == 0 ) then $MPPTEST $GRAPH11 $GIVEDY -async -np 2 -tgoal 0.1 -auto endif if ( $SHORT == 0 ) then if ( $LONG == 0 ) then $MPPTEST $GRAPH12 $GIVEDY -async -np 2 -tgoal 0.1 -auto \ -size 1024 16384 256 -autodx 128 endif $MPPTEST $GRAPH21 $GIVEDY -async -np 2 -tgoal 0.5 -auto \ -size 16384 65536 1024 -autodx 512 -reps 100 if ( $LONG == 0 ) then $MPPTEST $GRAPH22 $GIVEDY -async -np 2 -tgoal 1.0 -auto \ -size 65536 1048576 8192 -autodx 8192 -reps 25 endif endif endif endif # if ( $BISECT == 1 ) then # # Bisection and contention tests # Round-trip times, blocking (from 0 to 1 MBytes) set BISECT = "-bisect -distance -nbrdbl" if ( "$PLOT" == "gnuplot" ) then # Gnuplot doesn't have a nice way to handle multipage output in a single # file, so we turn off the variable distance feature set BISECT = "-bisect" endif if ( $BLOCKING == 1 ) then echo "Bisection tests-blocking" if ( $LONG == 0 ) then $MPPTEST $GRAPH11 $BISECT -np $NP -tgoal 0.1 -auto endif if ( $SHORT == 0 ) then if ( $LONG == 0 ) then $MPPTEST $GRAPH12 $BISECT -np $NP -tgoal 0.1 -auto \ -size 1024 16384 256 -autodx 128 endif $MPPTEST $GRAPH21 $BISECT -np $NP -tgoal 0.5 -auto \ -size 16384 65536 1024 -autodx 512 -reps 100 #if ( $LONG == 0 ) then #$MPPTEST $GRAPH22 $BISECT -np $NP -tgoal 1.0 -auto \ # -size 65536 1048576 8192 -autodx 8192 -reps 25 #endif endif endif # # Nonblocking times-bisection if ( $NONBLOCKING == 1 ) then echo "Bisection tests-nonblocking" $MPPTEST $GRAPH11 $BISECT -async -np $NP -tgoal 0.1 -auto if ( $SHORT == 0 ) then $MPPTEST $GRAPH12 $BISECT -async -np $NP -tgoal 0.1 -auto \ -size 1024 16384 256 -autodx 128 $MPPTEST $GRAPH21 $BISECT -async -np $NP -tgoal 0.5 -auto \ -size 16384 65536 1024 -autodx 512 -reps 100 #$MPPTEST $GRAPH22 $BISECT -async -np $NP -tgoal 1.0 -auto \ # -size 65536 1048576 8192 -autodx 8192 -reps 25 endif endif endif # # Collective operation tests # if ( $GOP == 1 ) then echo "Collective operation tests" set COLL = "-gop $NATIVE" $MPPTEST $COLL $fname -sync -np $NP -size 0 0 0 # # We set sizes on these since they are with respect to either ints or # doubles, not bytes foreach gop ( dsum col scatter ) $MPPTEST $GRAPH11 $COLL -$gop -np $NP -tgoal 0.1 -auto \ -size 0 256 8 if ( $SHORT == 0 ) then $MPPTEST $GRAPH12 $COLL -$gop -np $NP -tgoal 0.1 -auto \ -size 256 4096 64 -autodx 128 endif end endif # # Floating point overlap tests # if ( $OVERLAP == 1 ) then echo "Round trip-floating-point overlaps tests-blocking" set SIZE = "-overlapauto -autodx 64" foreach msgsize ( -1 0 128 1024 2048 ) $MPPTEST $GRAPH -sync -overlap -overlapmsgsize $msgsize -np 2 \ -tgoal 0.1 -auto $SIZE end echo "Round trip-floating-point overlaps tests-nonblocking" foreach msgsize ( 0 128 1024 2048 ) $MPPTEST $GRAPH -async -overlap -overlapmsgsize $msgsize -np 2 \ -tgoal 0.1 -auto $SIZE end endif perftest-1.3a/runsample0000775000115300004540000000253006705162702010773 #! /bin/sh # # Run some sample mpptest etc programs (for the paper "Characterizing # the parallel performance of message-passing environments") # MPIRUN=mpirun NPARG=-np FNAME=mpp SIZEARG="-size 0 2048 16" # The escaped blanks are needed for many mpirun programs. # # Stair step example $MPIRUN $NPARG 2 mpptest -auto $SIZEARG -title 'Blocking\ Send' \ >${FNAME}-stair.cit # # Overlap example $MPIRUN $NPARG 2 mpptest -auto $SIZEARG -overlap -overlapsize 2048 \ -title 'Send\ with\ 2048\ overlap' >${FNAME}-overlap.cit # # Cache effects $MPIRUN $NPARG 2 mpptest -auto $SIZEARG -cachesize 10000000 \ -title 'Send\ not\ in\ cache' >${FNAME}-cache.cit # # Scaling of performance $MPIRUN $NPARG 4 mpptest -auto $SIZEARG -bisect \ -title 'Send\ with\ 4\ processes' >${FNAME}-scaling4.cit $MPIRUN $NPARG 8 mpptest -auto $SIZEARG -bisect \ -title 'Send\ with\ 8\ processes' >${FNAME}-scaling8.cit #$MPIRUN $NPARG 16 mpptest -auto $SIZEARG -bisect \ # -title 'Send\ with\ 16\ processes' >${FNAME}-scaling16.cit #$MPIRUN $NPARG 32 mpptest -auto $SIZEARG -bisect \ # -title 'Send\ with\ 32\ processes' >${FNAME}-scaling32.cit # # Variation of performance $MPIRUN $NPARG 2 mpptest -auto $SIZEARG -givedy \ -title 'Blocking\ send' >${FNAME}-variation.cit # # Nonblocking tests $MPIRUN $NPARG 2 mpptest -auto $SIZEARG -async \ -title 'Nonblocking\ send' >${FNAME}-isend.cit