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

Replace distutils throughout building system #351

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
397 changes: 206 additions & 191 deletions .github/workflows/ubuntu.yml

Large diffs are not rendered by default.

49 changes: 22 additions & 27 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (C) 2006 Imperial College London and others.
#
#
# Please see the AUTHORS file in the main source directory for a full list
# of copyright holders.
#
Expand All @@ -9,7 +9,7 @@
# Imperial College London
#
# [email protected]
#
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation,
Expand Down Expand Up @@ -151,7 +151,7 @@ lib/libvtkfortran.a:
ifeq (@SPUD_ONLY@,yes)
echo ' MAKE libspud'; $(MAKE) -C libspud && $(MAKE) -C libspud install-libspud
else
echo ' MAKE libspud'; $(MAKE) -C libspud && $(MAKE) -C libspud install-libspud && cd libspud/python && python3 setup.py build && cd ../.. && cp libspud/python/build/lib*/libspud*.so python/
echo ' MAKE libspud'; $(MAKE) -C libspud && $(MAKE) -C libspud install-libspud && cd libspud/python && @PYTHON@ setup.py build && cd ../.. && cp libspud/python/build/lib*/libspud*.so python/
endif

libfemtools: sub_system
Expand Down Expand Up @@ -190,19 +190,18 @@ static: fluidity_library

shared: lib/shared/$(SLIB_FLUIDITY).1

lib/shared/$(SLIB_FLUIDITY).1: fluidity_library
lib/shared/$(SLIB_FLUIDITY).1: fluidity_library
@echo "BUILD shared libfluidity"
@rm -rf tmp
@mkdir -p tmp lib/shared
@cp $(LIB_FLUIDITY) tmp
@cd tmp; ar x lib$(FLUIDITY).a; rm lib$(FLUIDITY).a; cd ..
@echo " LD lib$(FLUIDITY).so"
@$(EVAL) $(LINKER) -shared -Wl,-soname,$(SLIB_FLUIDITY).1 -o lib/shared/$(SLIB_FLUIDITY).1 tmp/* -L./lib -lvtkfortran
@$(EVAL) $(LINKER) -shared -Wl,-soname,$(SLIB_FLUIDITY).1 -o lib/shared/$(SLIB_FLUIDITY).1 tmp/* -L./lib -lvtkfortran
@rm -rf tmp
@cd lib/shared; ln -sf $(SLIB_FLUIDITY).1 $(SLIB_FLUIDITY); cd ../..

fltools: fluidity_library
@$(MAKE) fldecomp
fltools: fldecomp
@echo "BUILD fluidity tools"
@cd tools; $(MAKE)
@echo " MAKE climatology"
Expand All @@ -216,14 +215,14 @@ manual:
python_build:
ifeq (@HAVE_PYTHON@,yes)
@echo " MAKE python"
@cd python; python3 setup.py build > build.log 2>&1
@cd python/fluidity; find ../build/lib* -name '*.so' -exec ln -sf {} . \;
@cd python; @PYTHON@ -m build
@PYTHON@ -m pip install --upgrade python/dist/fluidity*.whl
endif

python_clean:
@echo " CLEAN python"
@cd python; rm -rf build
@cd python/fluidity; find . -type l -name '*.so' -exec rm -f {} \;
@cd python; rm -rf dist fluidity.egg-info
PYTHONPATH=@PYTHON_SITE_PKG@ @PYTHON@ -m pip uninstall --yes fluidity

.PHONY: scripts

Expand Down Expand Up @@ -297,9 +296,7 @@ ifeq (@HYPERLIGHT@,yes)
@$(AR) $(ARFLAGS) lib/libfluidity.a hyperlight/*.o
endif



fldecomp: fluidity_library
fldecomp: fluidity_library
@echo "BUILD fldecomp"
@echo " MKDIR bin"
@mkdir -p bin
Expand Down Expand Up @@ -381,9 +378,9 @@ endif

clean-debian:
@echo " CLEAN debian"
@cd debian; rm -rf files tmp fluidity python-fluidity *.substvars *.debhelper*
@cd debian; rm -rf files tmp fluidity python-fluidity *.substvars *.debhelper*

clean-test:
clean-test:
@echo " CLEAN tests"
@cd tests; PYTHONPATH=../python ../tools/testharness.py --clean >/dev/null
@cd tests/data; $(MAKE) clean
Expand All @@ -404,7 +401,7 @@ clean-unittest:
@echo " CLEAN ocean_forcing/tests"
@cd ocean_forcing/tests; $(MAKE) clean

clean-all-tests: clean-test
clean-all-tests: clean-test
@echo " CLEAN parallel/special/long tests"
@PYTHONPATH=python tools/testharness.py --parallelism=parallel --clean >/dev/null
@PYTHONPATH=python tools/testharness.py --length=special --clean >/dev/null
Expand Down Expand Up @@ -445,27 +442,26 @@ distclean: clean
include/spud_enums.h include/tinystr.h include/tinyxml.h \
include/version.h include/vtk.h \
preprocessor/check_options.F90 \
preprocessor/register_diagnostics.F90 python/setup.py > \
/dev/null
preprocessor/register_diagnostics.F90 > /dev/null
@for i in `find ./*/ -name Makefile.in`; do rm -f `echo $$i | sed 's/.in$$//'`; done > /dev/null
@find ./ \( -name make.log \) -exec rm -f {} \; > /dev/null
@rm -f Makefile > /dev/null

test: serialtest

serialtest: fltools bin/$(FLUIDITY)
@cd tests; ../bin/testharness -x test_results.xml -l short $(EXCLUDE_TAGS) -n $(THREADS)
@cd tests; ../bin/testharness -x short-tests.xml -l short $(EXCLUDE_TAGS) -n $(THREADS)

mediumtest: fltools bin/$(FLUIDITY) manual spudtools
@cd tests; ../bin/testharness -x test_results_medium.xml -l medium $(EXCLUDE_TAGS) -n $(THREADS)
@cd tests; ../bin/testharness -x medium-tests.xml -l medium $(EXCLUDE_TAGS) -n $(THREADS)

.PHONY: spudtools

spudtools:
@cd libspud ; $(MAKE) install-spudtools
@echo " INSTALL spudtools"

setuputs:
setuputs:
@echo "SETUP tests"
@echo " RMDIR bin/tests"
@rm -rf bin/tests
Expand Down Expand Up @@ -494,7 +490,7 @@ endif

unittest: build_unittest
@echo "RUN bin/tests"
@bin/unittestharness -d bin/tests -x tests/test_results_unittests.xml
@bin/unittestharness -d bin/tests -x tests/unit-tests.xml

bin/spud-preprocess:
@echo "Installing spudtools"
Expand Down Expand Up @@ -543,14 +539,14 @@ endif
@cd diagnostics; ../bin/create_makefile --exclude \
"Diagnostic_Fields_Interfaces.F90 Diagnostic_Fields_New.F90" $(TESTOPTS)
@cd diagnostics; $(MAKE) Diagnostic_Fields_Interfaces.o \
Diagnostic_Fields_New.o
Diagnostic_Fields_New.o
@echo " Generating main dependencies"
@cd main; ../bin/create_makefile --exclude test_coupler.F90 $(TESTOPTS)
@echo " Cleaning up the mess"
$(MAKE) clean-light
@echo " Congratulations, make makefiles succeeded!"

install: default fltools
install:
@mkdir -p $(DESTDIR)$(bindir) $(DESTDIR)$(docdir)/fluidity
find bin/ -maxdepth 1 -type f -exec cp '{}' $(DESTDIR)$(bindir) \;
rm -f $(DESTDIR)$(bindir)/spud-* $(DESTDIR)$(bindir)/diamond $(DESTDIR)$(bindir)/silenteval
Expand All @@ -559,14 +555,13 @@ install: default fltools
cp -R schemas $(DESTDIR)$(datadir)/fluidity/
mkdir -p $(DESTDIR)$(datadir)/diamond/schemata
$(SED) 's/$${datadir}/$(subst /,\/,$(datadir))/g' schemas/flml.in > $(DESTDIR)$(datadir)/diamond/schemata/flml
cd python ; python3 setup.py install --root=$(shell echo ${DESTDIR} | sed 's/^$$/\//') --prefix="$(prefix)" $$FLUIDITY_PYTHON_INSTALL_ARGS
cp -R examples $(DESTDIR)$(docdir)/fluidity
find $(DESTDIR)$(docdir)/fluidity/examples -type f -exec $(SED) -i "s/\.\.\/\.\.\/\.\.\/bin\///" '{}' \;
find $(DESTDIR)$(docdir)/fluidity/examples -type f -exec $(SED) -i "s/\.\.\/\.\.\/bin\///" '{}' \;
cd $(DESTDIR)$(docdir)/fluidity ; tar -czvf $(DESTDIR)$(docdir)/fluidity/examples.tar.gz examples/
rm -rf $(DESTDIR)$(docdir)/fluidity/examples/

install-diamond:
install-diamond:
cd libspud; ./configure --prefix=@prefix@; cd ../..
cd libspud; $(MAKE) clean; cd ../..
cd libspud; $(MAKE) install-diamond; cd ../..
Expand Down
Loading