From 58dc95b9cc7cf05e4b41dc4cb14a766e695ca5e4 Mon Sep 17 00:00:00 2001 From: Maho Nakata Date: Sat, 18 Nov 2006 23:42:24 +0000 Subject: Add OpenMPI support PR: 105474 Submitted by: trasz --- math/blacs/Makefile | 15 ++++-- math/blacs/files/Bmake.inc-mpich.diff | 64 +++++++++++++++++++++++++ math/blacs/files/Bmake.inc-openmpi.diff | 84 +++++++++++++++++++++++++++++++++ math/blacs/files/patch-Bmake.inc | 64 ------------------------- math/blacs/files/pkg-message.in | 7 +++ 5 files changed, 166 insertions(+), 68 deletions(-) create mode 100644 math/blacs/files/Bmake.inc-mpich.diff create mode 100644 math/blacs/files/Bmake.inc-openmpi.diff delete mode 100644 math/blacs/files/patch-Bmake.inc (limited to 'math') diff --git a/math/blacs/Makefile b/math/blacs/Makefile index 75bbb8496463..59df40ba5ca4 100644 --- a/math/blacs/Makefile +++ b/math/blacs/Makefile @@ -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,14 +22,21 @@ EXTRACT_ONLY= mpiblacs.tgz blacstester.tgz mpiblacs-patch03.tgz MAINTAINER= maho@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 +.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," @${ECHO} "plase set NO_GNUF77=yes" diff --git a/math/blacs/files/Bmake.inc-mpich.diff b/math/blacs/files/Bmake.inc-mpich.diff new file mode 100644 index 000000000000..1b6f547a9a87 --- /dev/null +++ b/math/blacs/files/Bmake.inc-mpich.diff @@ -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 --git a/math/blacs/files/Bmake.inc-openmpi.diff b/math/blacs/files/Bmake.inc-openmpi.diff new file mode 100644 index 000000000000..40a12bfd93d0 --- /dev/null +++ b/math/blacs/files/Bmake.inc-openmpi.diff @@ -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 = -DUseMpi2 + # ----------------------------------------------------------------------- + # 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 = @LOCALBASE@/mpi/openmpi/bin/mpif77 ++ F77NO_OPTFLAGS = @F77EXTRAFLAGS@ ++ F77FLAGS = @FFLAGS@ ++ F77LOADER = @LOCALBASE@/mpi/openmpi/bin/mpif77 + F77LOADFLAGS = +- CC = gcc +- CCFLAGS = -O4 +- CCLOADER = $(CC) ++ CC = @LOCALBASE@/mpi/openmpi/bin/mpicc ++ CCFLAGS = @CFLAGS@ ++ CCLOADER = @LOCALBASE@/mpi/openmpi/bin/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 --git a/math/blacs/files/patch-Bmake.inc b/math/blacs/files/patch-Bmake.inc deleted file mode 100644 index 1b6f547a9a87..000000000000 --- a/math/blacs/files/patch-Bmake.inc +++ /dev/null @@ -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 --git a/math/blacs/files/pkg-message.in b/math/blacs/files/pkg-message.in index fff4dfef90dc..1c08c8429a88 100644 --- a/math/blacs/files/pkg-message.in +++ b/math/blacs/files/pkg-message.in @@ -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. ********************************************************************* -- cgit v1.2.3