Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with dependencies #296

Merged
merged 8 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ endif
# initialize empty variables
AM_CPPFLAGS =
AM_FFLAGS =
AM_LDFLAGS =
CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST =
Expand Down
33 changes: 33 additions & 0 deletions docs/fclaw-build-wdeps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /bin/bash

# Build and install the latest ForestClaw develop branch including p4est,
# libsc, zlib and jansson. We first download and install a recent zlib to
# a local directory, then do the same for the jansson library. Then we
# clone and install the current develop branches of p4est and libsc using
# that zlib and jansson installation and finally clone and install the
# current develop branch of ForestClaw, linking against all of the above.

# This results in five installation directories that any higher
# level software package may be compiled and linked against.
# The options are similar to those used in this script.
# In particular, the -rpath option may turn out useful.

# let the p4est installation script set the stage
BLP4="p4est-build-wdeps.sh"
wget -N "https://github.com/cburstedde/p4est/raw/develop/doc/$BLP4" && \
source "$BLP4" && \
rm "$BLP4" || exit 1

# clone, build and install ForestClaw
git clone --depth 1 https://github.com/forestclaw/forestclaw.git -b develop && \
cd forestclaw && \
./bootstrap "$PREFIX/libsc/share/aclocal" "$PREFIX/p4est/share/aclocal" && \
mkdir build && \
cd build && \
../configure $CONFIG --with-sc="$PREFIX/libsc" --with-p4est="$PREFIX/p4est" \
--prefix="$PREFIX/fclaw" && \
(make -j V=0 || make -j V=0 || make -j V=0) && \
make -j install V=0 && \
cd ../../ && \
rm -rf forestclaw.git && \
rm -r forestclaw || bdie "ForestClaw"
43 changes: 26 additions & 17 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -150,36 +150,46 @@ libforestclaw_compiled_sources = \
src/fortran_source2d/fdisc.f \
src/fortran_source2d/philim.f

# this variable is used for headers that are not publicly installed
FCLAW_CPPFLAGS = \
-I@top_srcdir@/src \
-I@top_srcdir@/src/fortran_source2d
## Extra flags that are not provided by general AM_CPPFLAGS
FCLAW_CPPFLAGS =

FCLAW_FFLAGS = $(FCLAW_CPPFLAGS) # (orignally used for metric.i; not needed now)
## In case we like to build only the library and no programs
justlibs-local: src/libforestclaw.la

## Using libtool to build the ForestClaw library
lib_LTLIBRARIES += src/libforestclaw.la
src_libforestclaw_la_SOURCES = \
$(libforestclaw_internal_headers) \
$(libforestclaw_compiled_sources)

src_libforestclaw_la_CPPFLAGS = $(AM_CPPFLAGS) $(FCLAW_CPPFLAGS)

FCLAW_LDADD = @top_builddir@/src/libforestclaw.la \
@FCLAW_P4EST_LDADD@ \
@FCLAW_SC_LDADD@
## This is the official API versioning scheme of libtool. Please see:
## Read https://www.gnu.org/software/libtool/manual/libtool.html#Versioning
src_libforestclaw_la_LDFLAGS = -version-info 2:0:0
src_libforestclaw_la_LIBADD = @FCLAW_P4EST_LIBADD@ @FCLAW_SC_LIBADD@

## Explicitly depend on other libraries
EXTRA_src_libforestclaw_la_DEPENDENCIES = @FCLAW_P4EST_EDEPS@ @FCLAW_SC_EDEPS@

LDADD += @top_builddir@/src/libforestclaw.la \
@FCLAW_P4EST_LDADD@ \
@FCLAW_SC_LDADD@
## Code p4est and libsc installation path into ForestClaw executables
AM_LDFLAGS += @FCLAW_P4EST_RPATH@ @FCLAW_SC_RPATH@

EXTRA_src_libforestclaw_la_DEPENDENCIES = @FCLAW_P4EST_LDADD@ @FCLAW_SC_LDADD@
## Flags to support linking against ForestClaw and support libraries
LDADD += src/libforestclaw.la \
@FCLAW_P4EST_LDADD@ \
@FCLAW_SC_LDADD@
FCLAW_LDADD = src/libforestclaw.la \
@FCLAW_P4EST_LDADD@ \
@FCLAW_SC_LDADD@

nodist_include_HEADERS += $(libforestclaw_generated_headers)
include_HEADERS += $(libforestclaw_installed_headers)

AM_CPPFLAGS += $(FCLAW_CPPFLAGS) @FCLAW_SC_CPPFLAGS@ @FCLAW_P4EST_CPPFLAGS@
AM_FFLAGS += $(FCLAW_FFLAGS)
## These flags are passed to populate the include path
AM_CPPFLAGS += \
-I@top_srcdir@/src \
-I@top_srcdir@/src/fortran_source2d \
@FCLAW_SC_CPPFLAGS@ @FCLAW_P4EST_CPPFLAGS@

## UNIT TESTS
check_PROGRAMS += src/forestclaw.TEST
Expand All @@ -202,5 +212,4 @@ src_forestclaw_TEST_CPPFLAGS = \
src_forestclaw_TEST_LDADD = \
test/libtestutils.la \
$(test_libtestutils_la_LDADD) \
$(LDADD) \
$(FCLAW_LDADD)
$(LDADD)
Loading