From 5b3e6eaabfbb692c0ab3447be42cc1ebea826b39 Mon Sep 17 00:00:00 2001 From: Juan Fiol Date: Mon, 6 Dec 2021 21:25:54 -0300 Subject: [PATCH 1/2] Fix compilation errors with makefiles due to variable assignments --- Makefile.manual | 6 ++++-- README.md | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile.manual b/Makefile.manual index c6b437295..559426850 100644 --- a/Makefile.manual +++ b/Makefile.manual @@ -2,14 +2,16 @@ FC ?= gfortran FFLAGS ?= -Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all -FYPPFLAGS ?= +ADD_FYPPFLAGS ?= VERSION := $(subst ., ,$(file < VERSION)) -FYPPFLAGS += \ +VERSION_FYPPFLAGS += \ -DPROJECT_VERSION_MAJOR=$(word 1,$(VERSION)) \ -DPROJECT_VERSION_MINOR=$(word 2,$(VERSION)) \ -DPROJECT_VERSION_PATCH=$(word 3,$(VERSION)) +FYPPFLAGS := $(ADD_FYPPFLAGS) $(VERSION_FYPPFLAGS) + export FC export FFLAGS export FYPPFLAGS diff --git a/README.md b/README.md index f7f70aaba..837aff087 100644 --- a/README.md +++ b/README.md @@ -176,15 +176,15 @@ Alternatively, you can build using provided Makefiles: make -f Makefile.manual ``` -You can limit the maximum rank by setting ``-DMAXRANK=`` in the ``FYPPFLAGS`` environment variable (which can reduce the compilation time): +You can limit the maximum rank by setting ``-DMAXRANK=`` in the ``ADD_FYPPFLAGS`` environment variable (which can reduce the compilation time): ```sh -make -f Makefile.manual FYPPFLAGS=-DMAXRANK=4 +make -f Makefile.manual ADD_FYPPFLAGS=-DMAXRANK=4 ``` You can also specify the compiler and compiler-flags by setting the ``FC`` and ``FFLAGS`` environmental variables. Among other things, this facilitates use of compiler optimizations that are not specified in the Makefile.manual defaults. ```sh -make -f Makefile.manual FYPPFLAGS=-DMAXRANK=4 FC=gfortran FFLAGS="-O3 -flto" +make -f Makefile.manual ADD_FYPPFLAGS=-DMAXRANK=4 FC=gfortran FFLAGS="-O3 -flto" ``` ### Build with [fortran-lang/fpm](https://github.com/fortran-lang/fpm) From 8fcebc877d55a8c4245eee67aab35310e7fc9e71 Mon Sep 17 00:00:00 2001 From: Juan Fiol Date: Tue, 7 Dec 2021 19:18:31 -0300 Subject: [PATCH 2/2] Modified CI to reflect new variable name in Makefile.manual --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 124c3fcd5..14639f49f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -98,7 +98,7 @@ jobs: make -f Makefile.manual test make -f Makefile.manual clean env: - FYPPFLAGS: "-DMAXRANK=4" + ADD_FYPPFLAGS: "-DMAXRANK=4" intel-build: runs-on: ${{ matrix.os }}