Description: use CXX and LD-flags, proposed by build environment instead
 of hardcoded. Fix linkage problem with fftw3.
Author: Anton Gladky <gladk@debian.org>
Last-Update: 2015-03-15

Index: lammps-0~20161109.git9806da6/src/MAKE/Makefile.mpi
===================================================================
--- lammps-0~20161109.git9806da6.orig/src/MAKE/Makefile.mpi
+++ lammps-0~20161109.git9806da6/src/MAKE/Makefile.mpi
@@ -7,13 +7,13 @@ SHELL = /bin/sh
 # specify flags and libraries needed for your compiler
 
 CC =		mpicxx
-CCFLAGS =	-g -O3 
+CCFLAGS =	-Wall $(shell dpkg-buildflags --get CXXFLAGS) -fopenmp -std=c++0x -I/usr/include/eigen3
 SHFLAGS =	-fPIC
 DEPFLAGS =	-M
 
 LINK =		mpicxx
-LINKFLAGS =	-g -O
-LIB = 
+LINKFLAGS =	-O  $(shell dpkg-buildflags --get LDFLAGS)
+LIB = -lstdc++ -fopenmp
 SIZE =		size
 
 ARCHIVE =	ar
@@ -28,7 +28,7 @@ SHLIBFLAGS =	-shared
 # LAMMPS ifdef settings
 # see possible settings in Section 2.2 (step 4) of manual
 
-LMP_INC =	-DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64
+LMP_INC =	-DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLAMMPS_JPEG
 
 # MPI library
 # see discussion in Section 2.2 (step 5) of manual
@@ -50,9 +50,9 @@ MPI_LIB =
 # PATH = path for FFT library
 # LIB = name of FFT library
 
-FFT_INC =    	
+FFT_INC =    	-DFFT_FFTW3 
 FFT_PATH = 
-FFT_LIB =	
+FFT_LIB =	-lfftw3
 
 # JPEG and/or PNG library
 # see discussion in Section 2.2 (step 7) of manual
@@ -63,7 +63,7 @@ FFT_LIB =
 
 JPG_INC =       
 JPG_PATH = 	
-JPG_LIB =	
+JPG_LIB =	-ljpeg
 
 # ---------------------------------------------------------------------
 # build rules and dependencies
