Gentoo Archives: gentoo-commits

From: "Sebastien Fabbro (bicatali)" <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-libs/parmetis/files: parmetis-3.1-autotools.patch
Date: Thu, 27 Mar 2008 19:02:14
Message-Id: E1JexMC-00050m-CZ@stork.gentoo.org
1 bicatali 08/03/27 19:01:48
2
3 Added: parmetis-3.1-autotools.patch
4 Log:
5 Initial import. Thankss Oliver Borm for his work and everyone else in bug #49953.
6 (Portage version: 2.1.4.4)
7
8 Revision Changes Path
9 1.1 sci-libs/parmetis/files/parmetis-3.1-autotools.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/parmetis/files/parmetis-3.1-autotools.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/parmetis/files/parmetis-3.1-autotools.patch?rev=1.1&content-type=text/plain
13
14 Index: parmetis-3.1-autotools.patch
15 ===================================================================
16 --- acx_mpi.m4 1970-01-01 01:00:00.000000000 +0100
17 +++ acx_mpi.m4 2008-02-01 16:24:54.723228974 +0000
18 @@ -0,0 +1,183 @@
19 +##### http://autoconf-archive.cryp.to/acx_mpi.html
20 +#
21 +# SYNOPSIS
22 +#
23 +# ACX_MPI([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
24 +#
25 +# DESCRIPTION
26 +#
27 +# This macro tries to find out how to compile programs that use MPI
28 +# (Message Passing Interface), a standard API for parallel process
29 +# communication (see http://www-unix.mcs.anl.gov/mpi/)
30 +#
31 +# On success, it sets the MPICC, MPICXX, MPIF77, or MPIFC output
32 +# variable to the name of the MPI compiler, depending upon the
33 +# current language. (This may just be $CC/$CXX/$F77/$FC, but is more
34 +# often something like mpicc/mpiCC/mpif77/mpif90.) It also sets
35 +# MPILIBS to any libraries that are needed for linking MPI (e.g.
36 +# -lmpi or -lfmpi, if a special MPICC/MPICXX/MPIF77/MPIFC was not
37 +# found).
38 +#
39 +# If you want to compile everything with MPI, you should set:
40 +#
41 +# CC="MPICC" #OR# CXX="MPICXX" #OR# F77="MPIF77" #OR# FC="MPIFC"
42 +# LIBS="$MPILIBS $LIBS"
43 +#
44 +# NOTE: The above assumes that you will use $CC (or whatever) for
45 +# linking as well as for compiling. (This is the default for automake
46 +# and most Makefiles.)
47 +#
48 +# The user can force a particular library/compiler by setting the
49 +# MPICC/MPICXX/MPIF77/MPIFC and/or MPILIBS environment variables.
50 +#
51 +# ACTION-IF-FOUND is a list of shell commands to run if an MPI
52 +# library is found, and ACTION-IF-NOT-FOUND is a list of commands to
53 +# run if it is not found. If ACTION-IF-FOUND is not specified, the
54 +# default action will define HAVE_MPI.
55 +#
56 +# LAST MODIFICATION
57 +#
58 +# 2007-07-29
59 +#
60 +# COPYLEFT
61 +#
62 +# Copyright (c) 2007 Steven G. Johnson <stevenj@××××××××.edu>
63 +# Copyright (c) 2007 Julian C. Cummings <cummings@××××××××××××.edu>
64 +#
65 +# This program is free software: you can redistribute it and/or
66 +# modify it under the terms of the GNU General Public License as
67 +# published by the Free Software Foundation, either version 3 of the
68 +# License, or (at your option) any later version.
69 +#
70 +# This program is distributed in the hope that it will be useful, but
71 +# WITHOUT ANY WARRANTY; without even the implied warranty of
72 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
73 +# General Public License for more details.
74 +#
75 +# You should have received a copy of the GNU General Public License
76 +# along with this program. If not, see
77 +# <http://www.gnu.org/licenses/>.
78 +#
79 +# As a special exception, the respective Autoconf Macro's copyright
80 +# owner gives unlimited permission to copy, distribute and modify the
81 +# configure scripts that are the output of Autoconf when processing
82 +# the Macro. You need not follow the terms of the GNU General Public
83 +# License when using or distributing such scripts, even though
84 +# portions of the text of the Macro appear in them. The GNU General
85 +# Public License (GPL) does govern all other use of the material that
86 +# constitutes the Autoconf Macro.
87 +#
88 +# This special exception to the GPL applies to versions of the
89 +# Autoconf Macro released by the Autoconf Macro Archive. When you
90 +# make and distribute a modified version of the Autoconf Macro, you
91 +# may extend this special exception to the GPL to apply to your
92 +# modified version as well.
93 +
94 +AC_DEFUN([ACX_MPI], [
95 +AC_PREREQ(2.50) dnl for AC_LANG_CASE
96 +
97 +AC_LANG_CASE([C], [
98 + AC_REQUIRE([AC_PROG_CC])
99 + AC_ARG_VAR(MPICC,[MPI C compiler command])
100 + AC_CHECK_PROGS(MPICC, mpicc hcc mpxlc_r mpxlc mpcc cmpicc, $CC)
101 + acx_mpi_save_CC="$CC"
102 + CC="$MPICC"
103 + AC_SUBST(MPICC)
104 +],
105 +[C++], [
106 + AC_REQUIRE([AC_PROG_CXX])
107 + AC_ARG_VAR(MPICXX,[MPI C++ compiler command])
108 + AC_CHECK_PROGS(MPICXX, mpic++ mpicxx mpiCC hcp mpxlC_r mpxlC mpCC cmpic++, $CXX)
109 + acx_mpi_save_CXX="$CXX"
110 + CXX="$MPICXX"
111 + AC_SUBST(MPICXX)
112 +],
113 +[Fortran 77], [
114 + AC_REQUIRE([AC_PROG_F77])
115 + AC_ARG_VAR(MPIF77,[MPI Fortran 77 compiler command])
116 + AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf_r mpxlf mpf77 cmpifc, $F77)
117 + acx_mpi_save_F77="$F77"
118 + F77="$MPIF77"
119 + AC_SUBST(MPIF77)
120 +],
121 +[Fortran], [
122 + AC_REQUIRE([AC_PROG_FC])
123 + AC_ARG_VAR(MPIFC,[MPI Fortran compiler command])
124 + AC_CHECK_PROGS(MPIFC, mpif90 mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c, $FC)
125 + acx_mpi_save_FC="$FC"
126 + FC="$MPIFC"
127 + AC_SUBST(MPIFC)
128 +])
129 +
130 +if test x = x"$MPILIBS"; then
131 + AC_LANG_CASE([C], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])],
132 + [C++], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])],
133 + [Fortran 77], [AC_MSG_CHECKING([for MPI_Init])
134 + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ call MPI_Init])],[MPILIBS=" "
135 + AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])],
136 + [Fortran], [AC_MSG_CHECKING([for MPI_Init])
137 + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ call MPI_Init])],[MPILIBS=" "
138 + AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])])
139 +fi
140 +AC_LANG_CASE([Fortran 77], [
141 + if test x = x"$MPILIBS"; then
142 + AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"])
143 + fi
144 + if test x = x"$MPILIBS"; then
145 + AC_CHECK_LIB(fmpich, MPI_Init, [MPILIBS="-lfmpich"])
146 + fi
147 +],
148 +[Fortran], [
149 + if test x = x"$MPILIBS"; then
150 + AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"])
151 + fi
152 + if test x = x"$MPILIBS"; then
153 + AC_CHECK_LIB(mpichf90, MPI_Init, [MPILIBS="-lmpichf90"])
154 + fi
155 +])
156 +if test x = x"$MPILIBS"; then
157 + AC_CHECK_LIB(mpi, MPI_Init, [MPILIBS="-lmpi"])
158 +fi
159 +if test x = x"$MPILIBS"; then
160 + AC_CHECK_LIB(mpich, MPI_Init, [MPILIBS="-lmpich"])
161 +fi
162 +
163 +dnl We have to use AC_TRY_COMPILE and not AC_CHECK_HEADER because the
164 +dnl latter uses $CPP, not $CC (which may be mpicc).
165 +AC_LANG_CASE([C], [if test x != x"$MPILIBS"; then
166 + AC_MSG_CHECKING([for mpi.h])
167 + AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS=""
168 + AC_MSG_RESULT(no)])
169 +fi],
170 +[C++], [if test x != x"$MPILIBS"; then
171 + AC_MSG_CHECKING([for mpi.h])
172 + AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS=""
173 + AC_MSG_RESULT(no)])
174 +fi],
175 +[Fortran 77], [if test x != x"$MPILIBS"; then
176 + AC_MSG_CHECKING([for mpif.h])
177 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[ include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS=""
178 + AC_MSG_RESULT(no)])
179 +fi],
180 +[Fortran], [if test x != x"$MPILIBS"; then
181 + AC_MSG_CHECKING([for mpif.h])
182 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[ include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS=""
183 + AC_MSG_RESULT(no)])
184 +fi])
185 +
186 +AC_LANG_CASE([C], [CC="$acx_mpi_save_CC"],
187 + [C++], [CXX="$acx_mpi_save_CXX"],
188 + [Fortran 77], [F77="$acx_mpi_save_F77"],
189 + [Fortran], [FC="$acx_mpi_save_FC"])
190 +
191 +AC_SUBST(MPILIBS)
192 +
193 +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
194 +if test x = x"$MPILIBS"; then
195 + $2
196 + :
197 +else
198 + ifelse([$1],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$1])
199 + :
200 +fi
201 +])dnl ACX_MPI
202 --- configure.ac 1970-01-01 01:00:00.000000000 +0100
203 +++ configure.ac 2008-03-25 11:18:28.135641410 +0000
204 @@ -0,0 +1,17 @@
205 +# -*- Autoconf -*-
206 +AC_PREREQ(2.59)
207 +AC_INIT(parmetis, 3.1, karypis@××××××.edu)
208 +AM_INIT_AUTOMAKE([foreign])
209 +AC_CONFIG_HEADER([config.h])
210 +AC_PROG_INSTALL
211 +AC_PROG_LIBTOOL
212 +AC_CHECK_LIB(m, sqrt)
213 +sinclude(acx_mpi.m4)
214 +AC_LANG_PUSH([C])
215 +ACX_MPI([], AC_MSG_ERROR([could not compile an mpi test program]))
216 +AC_CONFIG_FILES([Makefile
217 + parmetis.pc
218 + ParMETISLib/Makefile
219 + METISLib/Makefile
220 + Programs/Makefile])
221 +AC_OUTPUT
222 --- parmetis.pc.in 1970-01-01 01:00:00.000000000 +0100
223 +++ parmetis.pc.in 2008-03-25 11:04:08.281809709 +0000
224 @@ -0,0 +1,10 @@
225 +prefix=@prefix@
226 +exec_prefix=@exec_prefix@
227 +libdir=@libdir@
228 +includedir=@includedir@
229 +
230 +Name: ParMetis
231 +Description: Software for parallel (mpi) unstructured graph partitioning
232 +Version: @VERSION@
233 +Libs: -L${libdir} -lmetis -lparmetis
234 +Cflags: -I${includedir}
235 --- ./METISLib/Makefile.am 1970-01-01 01:00:00.000000000 +0100
236 +++ ./METISLib/Makefile.am 2008-03-25 09:45:51.421429040 +0000
237 @@ -0,0 +1,18 @@
238 +include_HEADERS = defs.h macros.h metis.h proto.h rename.h \
239 + stdheaders.h struct.h
240 +pkgincludedir = $(includedir)/metis
241 +
242 +lib_LTLIBRARIES = libmetis.la
243 +libmetis_la_SOURCES = \
244 + coarsen.c fm.c initpart.c match.c ccgraph.c \
245 + pmetis.c pqueue.c refine.c util.c timing.c debug.c \
246 + bucketsort.c graph.c stat.c kmetis.c kwayrefine.c \
247 + kwayfm.c balance.c ometis.c srefine.c sfm.c separator.c \
248 + mincover.c mmd.c mesh.c meshpart.c frename.c fortran.c \
249 + myqsort.c compress.c parmetis.c estmem.c \
250 + mpmetis.c mcoarsen.c mmatch.c minitpart.c mbalance.c \
251 + mutil.c mkmetis.c mkwayrefine.c mkwayfmh.c \
252 + mrefine2.c minitpart2.c mbalance2.c mfm2.c \
253 + kvmetis.c kwayvolrefine.c kwayvolfm.c subdomains.c \
254 + mfm.c memory.c mrefine.c checkgraph.c
255 +libmetis_la_LDFLAGS = -no-undefined -version-info 4:1:0
256 --- ./ParMETISLib/Makefile.am 1970-01-01 01:00:00.000000000 +0100
257 +++ ./ParMETISLib/Makefile.am 2008-03-25 11:16:59.090567020 +0000
258 @@ -0,0 +1,21 @@
259 +include_HEADERS = defs.h macros.h parmetislib.h proto.h \
260 + rename.h stdheaders.h struct.h
261 +pkgincludedir = $(includedir)/parmetis
262 +
263 +lib_LTLIBRARIES = libparmetis.la
264 +libparmetis_la_SOURCES = \
265 + comm.c util.c debug.c setup.c grsetup.c timer.c \
266 + node_refine.c initmsection.c order.c \
267 + xyzpart.c pspases.c frename.c \
268 + iintsort.c iidxsort.c ikeysort.c ikeyvalsort.c \
269 + kmetis.c gkmetis.c ometis.c \
270 + initpart.c match.c coarsen.c \
271 + kwayfm.c kwayrefine.c kwaybalance.c \
272 + remap.c stat.c fpqueue.c \
273 + ametis.c rmetis.c lmatch.c initbalance.c \
274 + mdiffusion.c diffutil.c wave.c \
275 + csrmatch.c redomylink.c balancemylink.c \
276 + selectq.c akwayfm.c serial.c move.c \
277 + mmetis.c mesh.c memory.c weird.c backcompat.c
278 +libparmetis_la_LDFLAGS = -no-undefined -version-info 3:1:0
279 +libparmetis_la_LIBADD = @MPILIBS@
280 --- ./Programs/Makefile.am 1970-01-01 01:00:00.000000000 +0100
281 +++ ./Programs/Makefile.am 2008-03-25 11:16:01.063260233 +0000
282 @@ -0,0 +1,13 @@
283 +AM_CPPFLAGS = -I$(top_srcdir)/ParMETISLib
284 +LDADD = $(top_builddir)/METISLib/libmetis.la \
285 + $(top_builddir)/ParMETISLib/libparmetis.la
286 +
287 +check_PROGRAMS = ptest mtest
288 +ptest_SOURCES = ptest.c io.c adaptgraph.c
289 +mtest_SOURCES = mtest.c io.c
290 +
291 +MPIRUN = mpirun -np 4
292 +
293 +check-local: $(check_PROGRAMS)
294 + $(MPIRUN) ptest ../Graphs/rotor.graph
295 + $(MPIRUN) mtest ../Graphs/bricks.hex3d 2
296 --- ./Makefile.am 1970-01-01 01:00:00.000000000 +0100
297 +++ ./Makefile.am 2008-03-26 00:34:09.072802498 +0000
298 @@ -0,0 +1,3 @@
299 +SUBDIRS = METISLib ParMETISLib Programs
300 +EXTRA_DIST = CHANGES VERSION parmetis.pc.in
301 +include_HEADERS = parmetis.h
302
303
304
305 --
306 gentoo-commits@l.g.o mailing list