xref: /libCEED/examples/Makefile (revision bd882c8a454763a096666645dc9a6229d5263694)
1# Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3# reserved. See files LICENSE and NOTICE for details.
4#
5# This file is part of CEED, a collection of benchmarks, miniapps, software
6# libraries and APIs for efficient high-order finite element and spectral
7# element discretizations for exascale applications. For more information and
8# source code availability see http://github.com/ceed
9#
10# The CEED research is supported by the Exascale Computing Project (17-SC-20-SC)
11# a collaborative effort of two U.S. Department of Energy organizations (Office
12# of Science and the National Nuclear Security Administration) responsible for
13# the planning and preparation of a capable exascale ecosystem, including
14# software, applications, hardware, advanced system engineering and early
15# testbed platforms, in support of the nation's exascale computing imperative.
16
17CEED_DIR ?= $(abspath ..)
18CEED_FLAGS ?= -I$(CEED_DIR)/include
19CEED_LIBS ?= -Wl,-rpath,$(CEED_DIR)/lib -L$(CEED_DIR)/lib -lceed
20
21# Use an MFEM build directory or an MFEM install directory
22MFEM_DIR ?= $(abspath ../../mfem)
23CONFIG_MK ?= $(or $(wildcard $(MFEM_DIR)/config/config.mk),$(wildcard\
24  $(MFEM_DIR)/share/mfem/config.mk),invalid_mfem_dir)
25
26NEK5K_DIR ?= $(abspath ../../Nek5000)
27MPI ?= 1
28
29PETSC_DIR ?=
30PETSC_ARCH ?=
31
32.PHONY: all ceed mfem nek petsc fluids solids clean
33
34all: ceed mfem nek petsc fluids solids
35
36ceed:
37	make CEED_DIR=$(CEED_DIR) -C ceed all
38
39mfem:
40	make CEED_DIR=$(CEED_DIR) MFEM_DIR=$(MFEM_DIR) -C mfem all
41
42# Note: Multiple Nek files cannot be built in parallel. The '+' here enables
43#       this single Nek bps file to be built in parallel with other examples,
44#       such as when calling `make prove-all -j2` for the top level Makefile.
45nek:
46	+make CEED_DIR=$(CEED_DIR) NEK5K_DIR=$(NEK5K_DIR) MPI=$(MPI) -C nek bps
47
48petsc:
49	make CEED_DIR=$(CEED_DIR) PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=$(PETSC_ARCH) -C petsc all
50
51fluids:
52	make CEED_DIR=$(CEED_DIR) PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=$(PETSC_ARCH) -C fluids all
53
54solids:
55	make CEED_DIR=$(CEED_DIR) PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=$(PETSC_ARCH) -C solids all
56clean:
57	+make -C ceed clean
58	+make -C mfem clean
59	+make -C nek clean
60	+make -C petsc clean
61	+make -C fluids clean
62	+make -C solids clean
63