Commit bc533c7a authored by Carsten Lemmen's avatar Carsten Lemmen
Browse files

Renamed PDAF_BUILD_DIR => PDAF_LIB_DIR for clarity and fixed Makefiles for pdaf build

parent 2e912b8f
......@@ -23,19 +23,19 @@ include src/include/Rules.mk
DESTDIR?=./lib
ifdef PDAF_BUILD_DIR
ifdef PDAF_LIB_DIR
CPPFLAGS+= -DUSE_PDAF
USE_PDAF=ON
endif
# @todo parmetis should have been included in lschism_esmf, but
# that does not seem to work cross-platform ...
LIBS+= -lschism_esmf -lparmetis -lmetis
LIBS+= -lschism_esmf -lparmetis -lmetis -lesmf
F90FLAGS+= -I$(SCHISM_BUILD_DIR)/include -I src/schism #-r8 ###-I src/model -I src/schism
##PDAF requires MKL (BLAS, LAPACK), this should already be provided by ESMF_FLAGS ...
ifdef USE_PDAF
LDFLAGS+= -L$(PDAF_BUILD_DIR)/lib -lpdaf-d
LDFLAGS+= -L$(PDAF_LIB_DIR) -lpdaf-d -mkl -lpthread -lm -ldl
endif
ifeq ($(ESMF_COMPILER), intel)
LDFLAGS+= -L$(SCHISM_BUILD_DIR)/lib -L. -Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a $(MKLROOT)/lib/intel64/libmkl_intel_thread.a $(MKLROOT)/lib/intel64/libmkl_core.a -Wl,--end-group -qopenmp -lpthread -lm
......@@ -57,7 +57,8 @@ ifneq ($(wildcard $(SCHISM_BUILD_DIR)/lib/libfabm.a),)
F90FLAGS += -DUSE_FABM
endif
.PHONY: all lib test schism_nuopc_lib schism_esmf_lib schism_pdaf install install-esmf install-nuopc
.SUFFIXES:
.PHONY: all lib test schism_nuopc_lib schism_esmf_lib install install-esmf install-nuopc pdaf
default: all
# User-callable make targets
......@@ -111,8 +112,8 @@ PDAF_OBJS=$(addprefix src/PDAF_bindings/,parser_mpi.o mod_parallel_pdaf.o mod_as
# $(F90) $(CPPFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)
ifdef USE_PDAF
schism_pdaf: dep-pdaf $(PDAF_OBJS) $(SCHISM_OBJS) $(SCHISM_ESMF_OBJS) schism_pdaf.o
$(F90) $(CPPFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)
schism_pdaf: install-esmf dep-pdaf $(PDAF_OBJS) $(SCHISM_OBJS) $(SCHISM_ESMF_OBJS) schism_pdaf.o
$(F90) $(CPPFLAGS) $(PDAF_OBJS) $(SCHISM_OBJS) $(SCHISM_ESMF_OBJS) schism_pdaf.o -o $@ $(LDFLAGS) -L./lib $(LIBS)
endif
schism_esmf_lib: dep-esmf dep-schism $(SCHISM_OBJS) $(SCHISM_ESMF_OBJS) $(EXPAND_TARGETS)
......
......@@ -46,10 +46,10 @@ Earth System Modeling Framework (ESMF) and National Unified Operational Predicti
3. Optionally, you need PDAF:
on WW:
setenv PDAF_BUILD_DIR /sciclone/home10/yinglong/PDAF-D_V1.14/lib/Whirlwind
setenv PDAF_LIB_DIR /sciclone/home10/yinglong/PDAF-D_V1.14/lib/Whirlwind
on Cyclops:
setenv PDAF_BUILD_DIR /sciclone/home10/yinglong/PDAF-D_V1.14/lib/Cyclops
setenv PDAF_LIB_DIR /sciclone/home10/yinglong/PDAF-D_V1.14/lib/Cyclops
## Compilation (in schism-esmf)
......
......@@ -26,7 +26,7 @@ endif
# @todo parmetis should have been included in lschism_esmf, but
# that does not seem to work cross-platform ...
LIBS+= -lhydro -lcore -lparmetis -lmetis
F90FLAGS+= -I$(SCHISM_BUILD_DIR)/include #-I $(PDAF_BUILD_DIR)/src
F90FLAGS+= -I$(SCHISM_BUILD_DIR)/include #-I $(PDAF_LIB_DIR)/../src
# Add compiler-specific flags to CFLAGS and F90FLAGS
......@@ -54,7 +54,7 @@ endif # intel
endif # gfortran
endif # g95
LDFLAGS+= -L$(SCHISM_BUILD_DIR)/lib -L$(PDAF_BUILD_DIR) -lpdaf-d
LDFLAGS+= -L$(SCHISM_BUILD_DIR)/lib -L$(PDAF_LIB_DIR) -lpdaf-d
.SUFFIXES: .F90
......
......@@ -63,10 +63,10 @@ ifeq ($(wildcard $(SCHISM_BUILD_DIR)/lib/libhydro.a),)
endif
dep-pdaf:
ifndef PDAF_BUILD_DIR
$(error PDAF_BUILD_DIR has to be set)
ifndef PDAF_LIB_DIR
$(error PDAF_LIB_DIR has to be set)
endif
ifeq ($(wildcard $(PDAF_BUILD_DIR)/libpdaf-d.a),)
ifeq ($(wildcard $(PDAF_LIB_DIR)/libpdaf-d.a),)
$(error PDAF has to be compiled before ESMF-SCHISM.)
endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment