Makefile.config 2.26 KB
Newer Older
1
2
3
4
#
# Users should change these
# ------------------------------------------------------------------

5
# Available from: git clone https://code.ornl.gov/isp/acme_inputdata
6
7
ELM_DATA_LOCATION ?= /home/7hp/Downloads/acme_inputdata
#ELM_DATA_LOCATION ?= /Users/uec/codes/elm/kernels/repos/acme_inputdata
8
9
10

# assumes you have a working NETCDF.  This can easily be the version built by
# ATS as a part of an ATS installation.
11
NETCDF_ROOT ?= /usr/local
12

13
# assumes you have a working gfortran
14
FC            = gfortran
15
FC_FLAGS      += -fimplicit-none -free -g3 -fbounds-check -fbacktrace
16
FC_LIB_ROOT = /usr/lib/gcc/x86_64-linux-gnu/8 #/usr/local/Cellar/gcc/8.2.0/lib/gcc/8
17

18
# assumes you have a working c++ compiler
19
CC	      = g++
20
CPP_FLAGS     += -g -Wall -Wshadow -std=c++11
21
22
STD_LIB_ROOT  = /usr

23
# assumes you have a working CUDA
24
25
26
27
28
29
NVCC=nvcc
CUDA_FLAGS= -std=c++11 -c -arch=sm_60
CUDA_LIBS= -lopenblas -lpthread -lcudart -lcublas
CUDA_LIBDIRS=-L/usr/local/cuda-10.0/lib64
CUDA_INCDIRS=-I/usr/local/cuda-10.0/include

30

31
32
33
# END of User specified things
#----------------------------------------

34

Ethan Coon's avatar
Ethan Coon committed
35

36
# linking flags
37
38
39
CC_LD_FLAGS += -L$(SRCDIR) -lelm -L$(NETCDF_ROOT) -lnetcdf -L$(STD_LIB_ROOT)/lib -lstdc++ -L$(FC_LIB_ROOT) -lgfortran
FC_LD_FLAGS += -L$(SRCDIR) -lelm -L$(NETCDF_ROOT) -lnetcdff
CUDA_LD_FLAGS += -L$(SRCDIR) -lelm -L$(NETCDF_ROOT) -lnetcdf -L$(CUDA_LIBDIRS) -lstdc++ -lopenblas -lpthread -lcudart -lcublas
40
41
42
43
44

#
# rules
#
.PHONY: all
45
46
.PRECIOUS: %.cc.o %.F90.o %.cpp.o %.cu.o
.SUFFIXES: .cc.o .F90.o .cpp.o .cu.o .cc .F90 .cpp .cu
47

48
49
50
%.F90.o: %.F90
	$(FC) $(FC_FLAGS) -c $< -o $@ 
%.cc.o: %.cc
51
	$(CC) $(CC_FLAGS) $(CPP_FLAGS) $(INC_FLAGS) -c $< -o $@
52
%.cpp.o: %.cpp
53
	$(CC) $(CC_FLAGS) $(CPP_FLAGS) $(INC_FLAGS) -c $< -o $@
54
55
%.cu.o: %.cu
	$(NVCC) $(CUDA_FLAGS) $(INC_FLAGS) -c $< -o $@
56

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
SHELL         = /bin/sh

ELM_LIB				= libelm.a
ELM_LIBS                        = -lelm
ELM_DIR                         = elm
ELM_UTILS_DIR = cime_utils

LIB_SUFFIX=.a

M4	      =	
RM            = rm -fr
CP            = cp
XARGS	      = 
AR	      = ar

######################################################################
# Rules used in all directories.
######################################################################

76
ELM_CLEAN=$(RM) -f *.o *.ii *.int.c *.log *.log.* stamp-* core core.* stats -r ti_files ii_files *.mod *.a
77

Ethan Coon's avatar
Ethan Coon committed
78

79