From 4502d3276be418283be236dc897cbe41830042d5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 18 Oct 2016 14:45:06 -0400 Subject: [PATCH] updated Makefile.lammps for NetCDF support based on suggestions from lars pastewka --- lib/netcdf/Makefile.lammps | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/netcdf/Makefile.lammps b/lib/netcdf/Makefile.lammps index 3da0bebea4..feeea61a0f 100644 --- a/lib/netcdf/Makefile.lammps +++ b/lib/netcdf/Makefile.lammps @@ -2,18 +2,17 @@ # netCDF library is installed. This tries to automate configuration # via the nc-config tool, which is part of the netCDF installation. -ifeq ($(shell nc-config --has-pnetcdf),no) - -netcdf_SYSINC = $(shell nc-config --cflags) -netcdf_SYSLIB = $(shell nc-config --libs) +netcdf_SYSINC = +netcdf_SYSLIB = netcdf_SYSPATH = +ifneq ($(shell which nc-config),) +netcdf_SYSINC += -DLMP_HAS_NETCDF $(shell nc-config --cflags) +netcdf_SYSLIB += $(shell nc-config --libs) endif -ifeq ($(shell nc-config --has-pnetcdf),yes) - -netcdf_SYSINC = -DLMP_HAS_PNETCDF $(nc-config --cflags) -netcdf_SYSLIB = $(shell nc-config --libs) -netcdf_SYSPATH = - +ifneq ($(shell which ncmpidump),) +PNETCDF_PATH = ($shell which ncmpidump | sed -e 's,bin/ncmpidump,,') +netcdf_SYSINC = -DLMP_HAS_PNETCDF -I$(PNETCDF_PATH)/include +netcdf_SYSLIB = -L$(PNETCDF_PATH)/lib -lpnetcdf endif