changeset 6640:f62a89647da6 octave-forge

uses mpicc -showme:link and mpicc -showme:compile to read in the information needed. Uses whatever mpicc is in the path (should be mpicc for Open MPI). This should now be generically applicable independently of where Open MPI is installed.
author mcreel
date Wed, 03 Feb 2010 10:29:27 +0000
parents 41940d598abf
children 44d1aa7b6444
files extra/openmpi_ext/src/Makefile
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/extra/openmpi_ext/src/Makefile	Tue Feb 02 14:53:19 2010 +0000
+++ b/extra/openmpi_ext/src/Makefile	Wed Feb 03 10:29:27 2010 +0000
@@ -1,11 +1,9 @@
-# <<<<<<< .mine
-MYHOME = /home/corradin/
-MPIINC = -I$(MYHOME)openmpi-1.3.3/include
-MPILIBS = -lpthread -L$(MYHOME)openmpi-1.3.3/lib -lmpi_cxx -lmpi -lopen-rte -lopen-pal -ldl -lnsl -lutil -lm -ldl
-# =======
-# MPIINC = -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi
-# MPILIBS = -lpthread -L/usr/lib/openmpi/lib -lmpi_cxx -lmpi -lopen-rte -lopen-pal -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl
-# >>>>>>> .r6543
+MPICC = mpicc
+JUNK := $(shell $(MPICC) -showme:compile)
+MPIINC := $(shell echo $(JUNK) | sed -e "s/-pthread/-lpthread/g")
+JUNK := $(shell $(MPICC) -showme:link)
+MPILIBS := $(shell echo $(JUNK) | sed -e "s/-pthread/ /g")
+
 
 all: MPI_Init.oct \
      MPI_Initialized.oct \
@@ -23,6 +21,6 @@
 
 
 %.oct: %.cc
-	mkoctfile -s $(MPIINC)  $(MPILIBS)   $<
+	mkoctfile -s $(MPIINC) $(MPILIBS) $<
 clean:
 	-rm *.o  *.oct *~