ifeq ($(MACHINE), OSF1)
  #MPI_HOME:=/usr/local/mpi
  MPI_HOME:=/usr/opt/mpi
  #BL_MPI_LIBS += -lmpich
  BL_MPI_LIBS += -lmpi -lpmpi
  LIBRARY_LOCATIONS += $(MPI_HOME)/lib
  INCLUDE_LOCATIONS += $(MPI_HOME)/include
endif
#ifeq ($(MACHINE), OSF1)
#  MPI_HOME:=/usr/local/mpi
#  BL_MPI_LIBS += -lmpich
#  LIBRARY_LOCATIONS += $(MPI_HOME)/lib
#  INCLUDE_LOCATIONS += $(MPI_HOME)/include
#endif

ifeq ($(MACHINE), AIX)
  MPI_HOME:=/usr/lpp/ppe.poe
  BL_MPI_LIBS += -lmpi
  LIBRARY_LOCATIONS += $(MPI_HOME)/lib
  INCLUDE_LOCATIONS += $(MPI_HOME)/include
endif

ifeq ($(MACHINE), IRIX64)
  BL_MPI_LIBS += -lmpi
endif

ifeq ($(MACHINE), Linux)
  ifdef aaWHICHLINUX
    ifeq ($(WHICHLINUX), PCCLUSTER)
      MPI_HOME=/usr/local/pkg/mpich
      LIBRARY_LOCATIONS += $(MPI_HOME)/lib/LINUX/ch_p4
      INCLUDE_LOCATIONS += $(MPI_HOME)/lib/LINUX/ch_p4
    endif
    ifeq ($(WHICHLINUX), ALPHACLUSTER)
      MPI_HOME=/usr/local/pkg/mpich
      LIBRARY_LOCATIONS += $(MPI_HOME)/build/LINUX/ch_p4/lib
      INCLUDE_LOCATIONS += $(MPI_HOME)/build/LINUX/ch_p4/include
    endif
    ifndef MPI_HOME
      MPI_HOME=/usr/local/mpich
    endif
    BL_MPI_LIBS += -lmpich
    ifeq ($(WHICHLINUX), GENERICLINUX)
      LIBRARY_LOCATIONS += $(MPI_HOME)/build/LINUX/ch_p4/lib
    endif
  else
    ifdef LAMHOME
      BL_MPI_LIBS += -lmpi -ltstdio -ltrillium -largs -lt
      LIBRARY_LOCATIONS += $(LAMHOME)/lib
      INCLUDE_LOCATIONS += $(LAMHOME)/include
    endif
    ifdef MPI_HOME
      BL_MPI_LIBS += -lmpich
      LIBRARY_LOCATIONS += $(MPI_HOME)/build/LINUX/ch_p4/lib
      INCLUDE_LOCATIONS += $(MPI_HOME)/include
    endif
    ifdef MPICHHOME
      mpicharch := $(shell $(MPICHHOME)/bin/tarch)
      mpichdevice := $(shell $(MPICHHOME)/bin/tdevice)
      BL_MPI_LIBS += -lmpich
      # 1.2.0 locations
      INCLUDE_LOCATIONS += $(MPICHHOME)/include
      LIBRARY_LOCATIONS += $(MPICHHOME)/lib
      # not needed in 1.2.0
      # INCLUDE_LOCATIONS += $(MPICHHOME)/build/$(mpicharch)/$(mpichdevice)/include
      # LIBRARY_LOCATIONS += $(MPICHHOME)/build/$(mpicharch)/$(mpichdevice)/lib
    endif
  endif
endif
