ports/105474: [PATCH] math/blacs: add OpenMPI support

trasz trasz at pin.if.uz.zgora.pl
Mon Nov 13 13:40:10 UTC 2006


>Number:         105474
>Category:       ports
>Synopsis:       [PATCH] math/blacs: add OpenMPI support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 13 13:40:02 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     trasz
>Release:        FreeBSD 6.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD pin.if.uz.zgora.pl 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sat Jun  3 01:12:10 CEST
>Description:
Add OpenMPI support.

Added file(s):
- files/Bmake.inc-mpich.diff
- files/Bmake.inc-openmpi.diff

Removed file(s):
- files/patch-Bmake.inc

Port maintainer (maho at FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- blacs-1.7_3.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/math/blacs/Makefile /home/trasz/blacs/Makefile
--- /usr/ports/math/blacs/Makefile	Tue Aug 22 05:47:49 2006
+++ /home/trasz/blacs/Makefile	Mon Nov 13 14:36:49 2006
@@ -7,7 +7,7 @@
 
 PORTNAME=	blacs
 PORTVERSION=	1.7
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	math
 MASTER_SITES=	ftp://ftp.netlib.org/blacs/
 DISTNAME=	BLACS
@@ -22,13 +22,24 @@
 MAINTAINER=	maho at FreeBSD.org
 COMMENT=	The BLACS (Basic Linear Algebra Communication Subprograms)
 
-BUILD_DEPENDS=	${LOCALBASE}/mpich2/lib/libmpich.a:${PORTSDIR}/net/mpich2
-RUN_DEPENDS=	${LOCALBASE}/mpich2/bin/mpirun:${PORTSDIR}/net/mpich2
-
 PKGMESSAGE=	${WRKDIR}/pkg-message
 SUB_FILES=	pkg-message
 
 .include <bsd.port.pre.mk>
+
+.if exists(${LOCALBASE}/mpi/openmpi/bin/mpirun)
+WITH_OPENMPI=	yes
+.endif
+
+.if defined(WITH_OPENMPI)
+BUILD_DEPENDS=	${LOCALBASE}/mpi/openmpi/lib/libmpi.so:${PORTSDIR}/net/openmpi
+RUN_DEPENDS=	${LOCALBASE}/mpi/openmpi/bin/mpirun:${PORTSDIR}/net/openmpi
+EXTRA_PATCHES+=	${FILESDIR}/Bmake.inc-openmpi.diff
+.else
+BUILD_DEPENDS=	${LOCALBASE}/mpich2/lib/libmpich.a:${PORTSDIR}/net/mpich2
+RUN_DEPENDS=	${LOCALBASE}/mpich2/bin/mpirun:${PORTSDIR}/net/mpich2
+EXTRA_PATCHES+=	${FILESDIR}/Bmake.inc-mpich.diff
+.endif
 
 pre-fetch:
 	@${ECHO} "If you want to use compiler other than f77,"
diff -ruN --exclude=CVS /usr/ports/math/blacs/files/Bmake.inc-mpich.diff /home/trasz/blacs/files/Bmake.inc-mpich.diff
--- /usr/ports/math/blacs/files/Bmake.inc-mpich.diff	Thu Jan  1 01:00:00 1970
+++ /home/trasz/blacs/files/Bmake.inc-mpich.diff	Mon Nov 13 14:36:48 2006
@@ -0,0 +1,64 @@
+--- Bmake.inc.orig	Mon May  5 10:53:00 2003
++++ Bmake.inc	Mon May  5 10:58:38 2003
+@@ -13,7 +13,7 @@
+ #  -----------------------------
+ #  The top level BLACS directory
+ #  -----------------------------
+-   BTOPdir = $(HOME)/BLACS
++   BTOPdir = @WRKSRC@
+ 
+ #  ---------------------------------------------------------------------------
+ #  The communication library your BLACS have been written for.
+@@ -32,14 +32,14 @@
+ #  -------------------------------------------------------------
+ #  The platform identifier to suffix to the end of library names
+ #  -------------------------------------------------------------
+-   PLAT = LINUX
++   PLAT = FreeBSD
+ 
+ #  ----------------------------------------------------------
+ #  Name and location of the BLACS library.  See section 2 for 
+ #  details on BLACS debug level (BLACSDBGLVL).
+ #  ----------------------------------------------------------
+    BLACSdir    = $(BTOPdir)/LIB
+-   BLACSDBGLVL = 0
++   BLACSDBGLVL = @DEBUG_LEVEL@
+    BLACSFINIT  = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
+    BLACSCINIT  = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
+    BLACSLIB    = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
+@@ -47,10 +47,10 @@
+ #  -------------------------------------
+ #  Name and location of the MPI library.
+ #  -------------------------------------
+-   MPIdir = /usr/local/mpich
++   MPIdir = @LOCALBASE@/mpich2
+    MPILIBdir = $(MPIdir)/lib/
+    MPIINCdir = $(MPIdir)/include
+-   MPILIB = $(MPILIBdir)/libmpich.a
++   MPILIB = $(MPILIBdir)/libmpich.a
+ 
+ #  -------------------------------------
+ #  All libraries required by the tester.
+@@ -195,16 +195,15 @@
+ #  optimization.  This is the F77NO_OPTFLAG.  The usage of the remaining
+ #  macros should be obvious from the names.
+ #=============================================================================
+-   F77            = g77
+-   F77NO_OPTFLAGS = 
+-   F77FLAGS       = $(F77NO_OPTFLAGS) -O
+-   F77LOADER      = $(F77)
++   F77            = @F77@
++   F77NO_OPTFLAGS = @F77EXTRAFLAGS@
++   F77FLAGS       = @FFLAGS@
++   F77LOADER      = @F77@
+    F77LOADFLAGS   = 
+-   CC             = gcc
+-   CCFLAGS        = -O4
++   CC             = @CC@
++   CCFLAGS        = @CFLAGS@
+    CCLOADER       = $(CC)
+    CCLOADFLAGS    = 
+-
+ #  --------------------------------------------------------------------------
+ #  The archiver and the flag(s) to use when building an archive (library).
+ #  Also the ranlib routine.  If your system has no ranlib, set RANLIB = echo.
diff -ruN --exclude=CVS /usr/ports/math/blacs/files/Bmake.inc-openmpi.diff /home/trasz/blacs/files/Bmake.inc-openmpi.diff
--- /usr/ports/math/blacs/files/Bmake.inc-openmpi.diff	Thu Jan  1 01:00:00 1970
+++ /home/trasz/blacs/files/Bmake.inc-openmpi.diff	Mon Nov 13 14:36:48 2006
@@ -0,0 +1,84 @@
+--- Bmake.inc.orig	Mon Nov 13 14:17:35 2006
++++ Bmake.inc	Mon Nov 13 14:19:18 2006
+@@ -13,7 +13,7 @@
+ #  -----------------------------
+ #  The top level BLACS directory
+ #  -----------------------------
+-   BTOPdir = $(HOME)/BLACS
++   BTOPdir = @WRKSRC@
+ 
+ #  ---------------------------------------------------------------------------
+ #  The communication library your BLACS have been written for.
+@@ -32,14 +32,14 @@
+ #  -------------------------------------------------------------
+ #  The platform identifier to suffix to the end of library names
+ #  -------------------------------------------------------------
+-   PLAT = LINUX
++   PLAT = FreeBSD
+ 
+ #  ----------------------------------------------------------
+ #  Name and location of the BLACS library.  See section 2 for 
+ #  details on BLACS debug level (BLACSDBGLVL).
+ #  ----------------------------------------------------------
+    BLACSdir    = $(BTOPdir)/LIB
+-   BLACSDBGLVL = 0
++   BLACSDBGLVL = @DEBUG_LEVEL@
+    BLACSFINIT  = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
+    BLACSCINIT  = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
+    BLACSLIB    = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
+@@ -47,10 +47,10 @@
+ #  -------------------------------------
+ #  Name and location of the MPI library.
+ #  -------------------------------------
+-   MPIdir = /usr/local/mpich
+-   MPILIBdir = $(MPIdir)/lib/
++   MPIdir = @LOCALBASE@/mpi/openmpi
++   MPILIBdir = 
+    MPIINCdir = $(MPIdir)/include
+-   MPILIB = $(MPILIBdir)/libmpich.a
++   MPILIB = 
+ 
+ #  -------------------------------------
+ #  All libraries required by the tester.
+@@ -86,7 +86,7 @@
+ #  The directory to find the required communication library include files, 
+ #  if they are required by your system.
+ #  -----------------------------------------------------------------------
+-   SYSINC = -I$(MPIINCdir)
++   SYSINC = 
+ 
+ #  ---------------------------------------------------------------------------
+ #  The Fortran 77 to C interface to be used.  If you are unsure of the correct
+@@ -140,7 +140,7 @@
+ #  If you know that your MPI uses the same handles for fortran and C
+ #  communicators, you can replace the empty macro definition below with
+ #  the macro definition on the following line.
+-  TRANSCOMM = -DCSameF77
++  TRANSCOMM = 
+ #  -----------------------------------------------------------------------
+ #  TRANSCOMM =
+ 
+@@ -195,16 +195,15 @@
+ #  optimization.  This is the F77NO_OPTFLAG.  The usage of the remaining
+ #  macros should be obvious from the names.
+ #=============================================================================
+-   F77            = g77
+-   F77NO_OPTFLAGS = 
+-   F77FLAGS       = $(F77NO_OPTFLAGS) -O
+-   F77LOADER      = $(F77)
++   F77            = mpif77
++   F77NO_OPTFLAGS = @F77EXTRAFLAGS@
++   F77FLAGS       = @FFLAGS@
++   F77LOADER      = mpif77
+    F77LOADFLAGS   = 
+-   CC             = gcc
+-   CCFLAGS        = -O4
+-   CCLOADER       = $(CC)
++   CC             = mpicc
++   CCFLAGS        = @CFLAGS@
++   CCLOADER       = mpicc
+    CCLOADFLAGS    = 
+-
+ #  --------------------------------------------------------------------------
+ #  The archiver and the flag(s) to use when building an archive (library).
+ #  Also the ranlib routine.  If your system has no ranlib, set RANLIB = echo.
diff -ruN --exclude=CVS /usr/ports/math/blacs/files/patch-Bmake.inc /home/trasz/blacs/files/patch-Bmake.inc
--- /usr/ports/math/blacs/files/patch-Bmake.inc	Mon Jul 24 03:42:21 2006
+++ /home/trasz/blacs/files/patch-Bmake.inc	Thu Jan  1 01:00:00 1970
@@ -1,64 +0,0 @@
---- Bmake.inc.orig	Mon May  5 10:53:00 2003
-+++ Bmake.inc	Mon May  5 10:58:38 2003
-@@ -13,7 +13,7 @@
- #  -----------------------------
- #  The top level BLACS directory
- #  -----------------------------
--   BTOPdir = $(HOME)/BLACS
-+   BTOPdir = @WRKSRC@
- 
- #  ---------------------------------------------------------------------------
- #  The communication library your BLACS have been written for.
-@@ -32,14 +32,14 @@
- #  -------------------------------------------------------------
- #  The platform identifier to suffix to the end of library names
- #  -------------------------------------------------------------
--   PLAT = LINUX
-+   PLAT = FreeBSD
- 
- #  ----------------------------------------------------------
- #  Name and location of the BLACS library.  See section 2 for 
- #  details on BLACS debug level (BLACSDBGLVL).
- #  ----------------------------------------------------------
-    BLACSdir    = $(BTOPdir)/LIB
--   BLACSDBGLVL = 0
-+   BLACSDBGLVL = @DEBUG_LEVEL@
-    BLACSFINIT  = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
-    BLACSCINIT  = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
-    BLACSLIB    = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
-@@ -47,10 +47,10 @@
- #  -------------------------------------
- #  Name and location of the MPI library.
- #  -------------------------------------
--   MPIdir = /usr/local/mpich
-+   MPIdir = @LOCALBASE@/mpich2
-    MPILIBdir = $(MPIdir)/lib/
-    MPIINCdir = $(MPIdir)/include
--   MPILIB = $(MPILIBdir)/libmpich.a
-+   MPILIB = $(MPILIBdir)/libmpich.a
- 
- #  -------------------------------------
- #  All libraries required by the tester.
-@@ -195,16 +195,15 @@
- #  optimization.  This is the F77NO_OPTFLAG.  The usage of the remaining
- #  macros should be obvious from the names.
- #=============================================================================
--   F77            = g77
--   F77NO_OPTFLAGS = 
--   F77FLAGS       = $(F77NO_OPTFLAGS) -O
--   F77LOADER      = $(F77)
-+   F77            = @F77@
-+   F77NO_OPTFLAGS = @F77EXTRAFLAGS@
-+   F77FLAGS       = @FFLAGS@
-+   F77LOADER      = @F77@
-    F77LOADFLAGS   = 
--   CC             = gcc
--   CCFLAGS        = -O4
-+   CC             = @CC@
-+   CCFLAGS        = @CFLAGS@
-    CCLOADER       = $(CC)
-    CCLOADFLAGS    = 
--
- #  --------------------------------------------------------------------------
- #  The archiver and the flag(s) to use when building an archive (library).
- #  Also the ranlib routine.  If your system has no ranlib, set RANLIB = echo.
diff -ruN --exclude=CVS /usr/ports/math/blacs/files/pkg-message.in /home/trasz/blacs/files/pkg-message.in
--- /usr/ports/math/blacs/files/pkg-message.in	Mon Jul 24 03:42:21 2006
+++ /home/trasz/blacs/files/pkg-message.in	Mon Nov 13 14:36:48 2006
@@ -9,6 +9,13 @@
   % %%LOCALBASE%%/mpich2/bin/mpirun -np 4 ./xFbtest_MPI-FreeBSD
   % %%LOCALBASE%%/mpich2/bin/mpdallexit
 
+ Or, if you're using OpenMPI:
+  % cd %%PREFIX%%/share/BLACS/TESTING
+  % LD_LIBRARY_PATH=%%LOCALBASE%%/mpi/openmpi/lib/ export LD_LIBRARY_PATH
+  % PATH=$PATH:%%LOCALBASE%%/mpi/openmpi/bin/ export PATH
+  % mpirun -np 4 ./xCbtest_MPI-FreeBSD
+  % mpirun -np 4 ./xFbtest_MPI-FreeBSD
+
 You can change -np 4 to any number to meet your local environment.
 See files at %%DOCSDIR%% for detail.
 *********************************************************************
--- blacs-1.7_3.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list