Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Coon, Ethan
ELM_Kernels
Commits
c91f79fb
Commit
c91f79fb
authored
May 21, 2019
by
Ethan Coon
Browse files
working on improving makefiles and getting all to co-exist
parent
b79819fb
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/config/Makefile.config
View file @
c91f79fb
#
# Users should change these
# ------------------------------------------------------------------
# Available from: git clone https://code.ornl.gov/isp/acme_inputdata
ELM_DATA_LOCATION
?= /
home
/
7
hp
/
Downloads
/
acme_inputdata
#ELM_DATA_LOCATION ?= /home/7hp/Downloads/acme_inputdata
ELM_DATA_LOCATION
?= /
Users
/
uec
/
codes
/
elm
/
kernels
/
repos
/
acme_inputdata
# assumes you have a working NETCDF. This can easily be the version built by
# ATS as a part of an ATS installation.
NETCDF_ROOT
?= ${
AMANZI_TPLS_DIR
}
# assumes you have a working fortran
and c++ compilers with libraries
# assumes you have a working
g
fortran
FC
=
gfortran
FC_FLAGS
= -
fimplicit
-
none
-
free
-
g3
-
fbounds
-
check
-
fbacktrace
FC_LIB_ROOT
= /
usr
/
l
ib
/
gcc
/
x86_64
-
linux
-
gnu
/
8
FC_FLAGS
+
= -
fimplicit
-
none
-
free
-
g3
-
fbounds
-
check
-
fbacktrace
FC_LIB_ROOT
= /
usr
/
l
ocal
/
Cellar
/
gcc
/
8
.
2
.
0
/
lib
/
gcc
/
8
CC
=
g
++
CPP_FLAGS
= -
g
-
Wall
-
Wshadow
-
std
=
c
++
11
# assumes you have a working c++ compiler
CC
=
clang
++
CPP_FLAGS
+= -
g
-
Wall
-
Wshadow
-
std
=
c
++
11
STD_LIB_ROOT
= /
usr
# assumes you have a working CUDA
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
# note, the linker should almost always be your fortran compiler, NOT your c compiler
#LINKER = gfortran
CC_LD_FLAGS
= -
L
$(
SRCDIR
) -
lelm
-
L
$(
NETCDF_ROOT
)/
lib
-
lnetcdf
-
L
$(
STD_LIB_ROOT
)/
lib
-
lstdc
++
#-L$(FC_LIB_ROOT) -lgfortran
FC_LD_FLAGS
= -
L
$(
SRCDIR
) -
lelm
-
L
$(
NETCDF_ROOT
)/
lib
-
lnetcdff
CUDA_LD_FLAGS
= -
L
$(
SRCDIR
) -
lelm
-
L
$(
NETCDF_ROOT
)/
lib
-
lnetcdf
-
L
$(
CUDA_LIBDIRS
) -
lstdc
++ -
lopenblas
-
lpthread
-
lcudart
-
lcublas
#
------------------------------------------------
#
Hopefully below shouldn't have to be changed.
# ------------------------------------------------
#
END of User specified things
#
----------------------------------------
.
PHONY
:
all
# linking flags
CC_LD_FLAGS
+= -
L
$(
SRCDIR
) -
lelm
-
L
$(
NETCDF_ROOT
)/
lib
-
lnetcdf
-
L
$(
STD_LIB_ROOT
)/
lib
-
lstdc
++ -
L
$(
FC_LIB_ROOT
) -
lgfortran
FC_LD_FLAGS
+= -
L
$(
SRCDIR
) -
lelm
-
L
$(
NETCDF_ROOT
)/
lib
-
lnetcdff
CUDA_LD_FLAGS
+= -
L
$(
SRCDIR
) -
lelm
-
L
$(
NETCDF_ROOT
)/
lib
-
lnetcdf
-
L
$(
CUDA_LIBDIRS
) -
lstdc
++ -
lopenblas
-
lpthread
-
lcudart
-
lcublas
#
# rules
#
.
PHONY
:
all
.
PRECIOUS
: %.
cc
.
o
%.
F90
.
o
%.
cpp
.
o
%.
cu
.
o
.
SUFFIXES
: .
cc
.
o
.
F90
.
o
.
cpp
.
o
.
cu
.
o
.
cc
.
F90
.
cpp
.
cu
%.
F90
.
o
: %.
F90
$(
FC
) $(
FC_FLAGS
) -
c
$< -
o
$@
%.
cc
.
o
: %.
cc
$(
C
XX
) $(
CC_FLAGS
) $(
CPP_FLAGS
) $(
INC_FLAGS
) -
c
$< -
o
$@
$(
C
C
) $(
CC_FLAGS
) $(
CPP_FLAGS
) $(
INC_FLAGS
) -
c
$< -
o
$@
%.
cpp
.
o
: %.
cpp
$(
C
XX
) $(
CC_FLAGS
) $(
CPP_FLAGS
) $(
INC_FLAGS
) -
c
$< -
o
$@
$(
C
C
) $(
CC_FLAGS
) $(
CPP_FLAGS
) $(
INC_FLAGS
) -
c
$< -
o
$@
%.
cu
.
o
: %.
cu
$(
NVCC
) $(
CUDA_FLAGS
) $(
INC_FLAGS
) -
c
$< -
o
$@
SHELL
= /
bin
/
sh
ELM_LIB
=
libelm
.
a
ELM_LIBS
= -
lelm
ELM_DIR
=
elm
ELM_UTILS_DIR
=
cime_utils
LIB_SUFFIX
=.
a
...
...
tests/links/Makefile
View file @
c91f79fb
...
...
@@ -93,3 +93,7 @@ surfacedataBRW.nc:
surfacedataWBW.nc
:
ln
-s
$(ELM_DATA_LOCATION)
/lnd/clm2/surfdata_map/surfdata_1x1pt_wbw_simyr1850.nc surfacedataWBW.nc
clean
:
rm
-f
./
*
.nc
tests/tests_c_f/CanopyHydrology_kern1_multiple.cc
View file @
c91f79fb
...
...
@@ -29,7 +29,10 @@ static const int n_max_times = 31 * 24 * 2; // max days per month times hours pe
// day * half hour timestep
static
const
int
n_grid_cells
=
24
;
// NOTE: This is C -- row major, or n_pfts is fastest varying dimension
using
MatrixState
=
MatrixStatic
<
n_grid_cells
,
n_pfts
>
;
// NOTE: This is C -- row major, or n_grid_cells is fastest varying
using
MatrixForc
=
MatrixStatic
<
n_max_times
,
n_grid_cells
>
;
...
...
@@ -89,12 +92,14 @@ int main(int argc, char ** argv)
// output state by the pft
auto
h2o_can
=
ELM
::
Utils
::
MatrixState
();
h2o_can
=
0.
;
std
::
cout
<<
"Time
\t
Total Canopy Water
\t
Min Water
\t
Max Water"
<<
std
::
endl
;
auto
min_max
=
std
::
minmax_element
(
h2o_can
.
begin
(),
h2o_can
.
end
());
std
::
cout
<<
std
::
setprecision
(
16
)
<<
0
<<
"
\t
"
<<
std
::
accumulate
(
h2o_can
.
begin
(),
h2o_can
.
end
(),
0.
)
<<
"
\t
"
<<
*
min_max
.
first
<<
"
\t
"
<<
*
min_max
.
second
<<
std
::
endl
;
{
std
::
cout
<<
"Time
\t
Total Canopy Water
\t
Min Water
\t
Max Water"
<<
std
::
endl
;
auto
min_max
=
std
::
minmax_element
(
h2o_can
.
begin
(),
h2o_can
.
end
());
std
::
cout
<<
std
::
setprecision
(
16
)
<<
0
<<
"
\t
"
<<
std
::
accumulate
(
h2o_can
.
begin
(),
h2o_can
.
end
(),
0.
)
<<
"
\t
"
<<
*
min_max
.
first
<<
"
\t
"
<<
*
min_max
.
second
<<
std
::
endl
;
}
// main loop
// -- the timestep loop cannot/should not be parallelized
...
...
tests/tests_c_f/Makefile
View file @
c91f79fb
...
...
@@ -4,6 +4,7 @@ OBJECT = ../../src/
include
$(OBJECT)config/Makefile.config
CPP_FLAGS
+=
-DKERNEL_LANG_FORT
INC_FLAGS
=
-I
$(AMANZI_TPLS_DIR)
/include
-I
../../src/cpp
-I
../tests_c
...
...
@@ -16,6 +17,7 @@ EXEC_TESTS = CanopyHydrology_kern1_single \
CanopyHydrology_module
.PHONY
:
links library test
default
:
all
...
...
@@ -25,7 +27,6 @@ all: library $(TESTS)
test
:
$(EXEC_TESTS)
python ../compare_to_gold.py
$(TESTS)
CanopyHydrology_kern1_single
:
test_CanopyHydrology_kern1_single
./test_CanopyHydrology_kern1_single &> test_CanopyHydrology_kern1_single.stdout
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment