From 970026c9a605a29f842cf92b37eea3a226f38b78 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 1 Nov 2021 09:55:51 +0100 Subject: [PATCH 1/3] Removed QMCKL_DEVEL=1 in configure --- README.md | 4 ++-- configure.ac | 7 ++++++- tools/build_makefile.py | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b2d3bef..7ba1e08 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ in org-mode files and produce the source code and the documentation from these f ``` ./autogen.sh -QMCKL_DEVEL=1 ./configure --prefix=$PWD/_install --enable-silent-rules --enable-maintainer-mode +./configure --prefix=$PWD/_install --enable-silent-rules --enable-maintainer-mode make make check @@ -54,7 +54,7 @@ by the preprocessor otherwise). To enable vfc_ci support, the library should be configured with the following command : ``` -QMCKL_DEVEL=1 ./configure --prefix=$PWD/_install \ --enable-silent-rules --enable-maintainer-mode --enable-vfc_ci --host=x86_64 \ CC="verificarlo-f" FC="verificarlo-f" +./configure --prefix=$PWD/_install \ --enable-silent-rules --enable-maintainer-mode --enable-vfc_ci --host=x86_64 \ CC="verificarlo-f" FC="verificarlo-f" ``` where CC and FC are set to verificarlo-f, and support is explicitely enabled diff --git a/configure.ac b/configure.ac index 5fef528..550f858 100644 --- a/configure.ac +++ b/configure.ac @@ -189,11 +189,16 @@ AC_TYPE_UINT64_T AC_CHECK_FUNCS([memset strerror]) # Development mode +if test "x$enable_maintainer_mode" == "xyes" ; then + QMCKL_DEVEL=" -- Developer mode" +else + QMCKL_DEVEL="" +fi + AM_CONDITIONAL([QMCKL_DEVEL],[test "x$QMCKL_DEVEL" != x]) if test "x${QMCKL_DEVEL}" != "x"; then - QMCKL_DEVEL=" -- Developer mode" AC_PROG_AWK AM_PATH_PYTHON ${PYTHON} ${srcdir}/tools/build_makefile.py diff --git a/tools/build_makefile.py b/tools/build_makefile.py index 42880f2..e3851c2 100755 --- a/tools/build_makefile.py +++ b/tools/build_makefile.py @@ -206,7 +206,7 @@ def main(): "if QMCKL_DEVEL" ] for f in DEPS_ORG.keys(): output += [ DEPS_ORG[f] + ": "+f, - "\t$(tangle_verbose)top_builddir=$(top_builddir) srcdir=$(srcdir) $(srcdir)/tools/tangle.sh "+f, + "\t$(tangle_verbose)top_builddir=$(top_builddir) srcdir=$(srcdir) $(srcdir)/tools/missing bash $(srcdir)/tools/tangle.sh "+f, "" ] output += [ "endif", "" ] @@ -257,7 +257,7 @@ def main(): for f in sorted(DEPS_DOC.keys()): output += [ DEPS_DOC[f] + ": " + f + " $(htmlize_el)", - "\t$(export_verbose)top_builddir=$(top_builddir) srcdir=$(srcdir) $(srcdir)/tools/build_doc.sh "+f, + "\t$(export_verbose)top_builddir=$(top_builddir) srcdir=$(srcdir) $(srcdir)/tools/missing bash $(srcdir)/tools/build_doc.sh "+f, "" ] output += ["endif"] From 4a63473eabe6605fe89a33405a68573ce5faeabe Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 1 Nov 2021 10:43:08 +0100 Subject: [PATCH 2/3] Automatic maintainer mode --- .github/workflows/test-build.yml | 4 ++-- README.md | 4 ++-- autogen.sh | 3 --- configure.ac | 8 ++++++++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 9dc27d6..f957ade 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -31,7 +31,7 @@ jobs: - name: Build run: | ./autogen.sh - QMCKL_DEVEL=1 ./configure --enable-silent-rules --enable-maintainer-mode --enable-debug + ./configure --enable-silent-rules --enable-debug make -j 8 - name: Run test @@ -80,7 +80,7 @@ jobs: # - name: Run test # run: | # ./autogen.sh -# QMCKL_DEVEL=1 ./configure --enable-silent-rules --enable-maintainer-mode --enable-debug +# ./configure --enable-silent-rules --enable-debug # make -j 8 # make -j check # make distcheck diff --git a/README.md b/README.md index 7ba1e08..fb1281b 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ in org-mode files and produce the source code and the documentation from these f ``` ./autogen.sh -./configure --prefix=$PWD/_install --enable-silent-rules --enable-maintainer-mode +./configure --prefix=$PWD/_install make make check @@ -54,7 +54,7 @@ by the preprocessor otherwise). To enable vfc_ci support, the library should be configured with the following command : ``` -./configure --prefix=$PWD/_install \ --enable-silent-rules --enable-maintainer-mode --enable-vfc_ci --host=x86_64 \ CC="verificarlo-f" FC="verificarlo-f" +./configure --prefix=$PWD/_install \ --enable-vfc_ci --host=x86_64 \ CC="verificarlo-f" FC="verificarlo-f" ``` where CC and FC are set to verificarlo-f, and support is explicitely enabled diff --git a/autogen.sh b/autogen.sh index 97ce9ec..c993445 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,6 +2,3 @@ python ./tools/build_makefile.py autoreconf -i -echo "To configure in maintainer mode, use: -$ QMCKL_DEVEL=1 ./configure --enable-silent-rules --enable-maintainer-mode -" diff --git a/configure.ac b/configure.ac index 550f858..ca54f83 100644 --- a/configure.ac +++ b/configure.ac @@ -40,6 +40,14 @@ AC_INIT([qmckl],[0.1.1], [https://trex-coe.github.io/qmckl/index.html]) AC_CONFIG_AUX_DIR(tools) AM_INIT_AUTOMAKE([subdir-objects color-tests parallel-tests silent-rules 1.11]) + +# Activate developer mode when the source is the git repository. +# Otherwise, it is the source distribution and the developer mode should not be activated. +TEST_IFEXISTS=".git" +AC_CHECK_FILE([$TEST_IFEXISTS], + [enable_maintainer_mode="yes"], +) + AM_MAINTAINER_MODE() LT_INIT AC_CONFIG_SRCDIR([configure.ac]) From 65495eb896617282570e769d45fa06ddac9c63fc Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 9 Nov 2021 18:59:46 +0100 Subject: [PATCH 3/3] Improve configure --- Makefile.am | 2 +- autogen.sh | 2 +- configure.ac | 27 +++++++++++++-------------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Makefile.am b/Makefile.am index 406fee7..7f42436 100644 --- a/Makefile.am +++ b/Makefile.am @@ -90,7 +90,7 @@ share/doc/qmckl/html/index.html: share/doc/qmckl/html/README.html $(LN_S) README.html index.html -html: $(dist_html_DATA) +html-local: $(dist_html_DATA) text: $(dist_text_DATA) doc: html text diff --git a/autogen.sh b/autogen.sh index c993445..122cf87 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,4 +1,4 @@ #!/bin/bash python ./tools/build_makefile.py -autoreconf -i +autoreconf -i -Wall --no-recursive diff --git a/configure.ac b/configure.ac index ca54f83..d4f4621 100644 --- a/configure.ac +++ b/configure.ac @@ -35,19 +35,18 @@ AC_PREREQ([2.69]) -AC_INIT([qmckl],[0.1.1], - [https://github.com/TREX-CoE/qmckl/issues], [], - [https://trex-coe.github.io/qmckl/index.html]) -AC_CONFIG_AUX_DIR(tools) +AC_INIT([qmckl],[0.1.1],[https://github.com/TREX-CoE/qmckl/issues],[],[https://trex-coe.github.io/qmckl/index.html]) +AC_CONFIG_AUX_DIR([tools]) AM_INIT_AUTOMAKE([subdir-objects color-tests parallel-tests silent-rules 1.11]) # Activate developer mode when the source is the git repository. # Otherwise, it is the source distribution and the developer mode should not be activated. -TEST_IFEXISTS=".git" -AC_CHECK_FILE([$TEST_IFEXISTS], +AS_IF([test -d .git], [enable_maintainer_mode="yes"], + [enable_maintainer_mode="no"] ) +AM_PROG_AR AM_MAINTAINER_MODE() LT_INIT AC_CONFIG_SRCDIR([configure.ac]) @@ -66,7 +65,7 @@ AC_SUBST([VERSION_PATCH]) #AM_SILENT_RULES(yes) #AC_SUBST(SHARED_VERSION_INFO) -#AM_ENABLE_SHARED(no) dnl shared libs cause too many headaches to be default +#AC_ENABLE_SHARED([no]) dnl shared libs cause too many headaches to be default AC_LANG(C) @@ -80,7 +79,7 @@ AC_PROG_FC AC_PROG_FC_C_O AC_FC_SRCEXT([f90]) AC_FC_FREEFORM -AC_PROG_LIBTOOL +LT_INIT AC_PROG_INSTALL AC_PROG_LN_S PKG_PROG_PKG_CONFIG([]) @@ -98,7 +97,7 @@ AC_CHECK_HEADERS([assert.h errno.h math.h pthread.h stdbool.h stdint.h stdio.h s AC_CHECK_LIB([pthread], [pthread_create]) # OpenMP -#AC_ARG_WITH(openmp, [AC_HELP_STRING([--with-openmp],[enable OpenMP])], with_omp=$withval, with_omp=no) +#AC_ARG_WITH(openmp, [AS_HELP_STRING([--with-openmp],[enable OpenMP])], with_omp=$withval, with_omp=no) #if test "x$with_omp" = xyes; then # AC_DEFINE([HAVE_OPENMP], [1], [Define to use OpenMP threading.]) # AX_OPENMP([], @@ -108,7 +107,7 @@ AC_CHECK_LIB([pthread], [pthread_create]) # TREXIO -AC_ARG_WITH(trexio, [AC_HELP_STRING([--without-trexio],[disable support for TREXIO])], +AC_ARG_WITH(trexio, [AS_HELP_STRING([--without-trexio],[disable support for TREXIO])], with_trexio=$withval, with_trexio=yes) AS_IF([test "x$with_trexio" != xno], [ @@ -132,7 +131,7 @@ PKG_LIBS="$PKG_LIBS $TREXIO_LIBS" # Options. -AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug],[compile for debugging])], ok=$enableval, ok=no) +AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[compile for debugging])], ok=$enableval, ok=no) if test "$ok" = "yes"; then if test "$GCC" = "yes"; then CFLAGS="$CFLAGS \ @@ -154,20 +153,20 @@ if test "$ok" = "yes"; then ARGS="${ARGS} debug" fi -AC_ARG_ENABLE(malloc-trace, [AC_HELP_STRING([--enable-malloc-trace],[use debug malloc/free])], ok=$enableval, ok=no) +AC_ARG_ENABLE(malloc-trace, [AS_HELP_STRING([--enable-malloc-trace],[use debug malloc/free])], ok=$enableval, ok=no) if test "$ok" = "yes"; then AC_DEFINE(MALLOC_TRACE,"malloc_trace.dat",[Define to use debugging malloc/free]) ARGS="${ARGS} malloc-trace" fi -AC_ARG_ENABLE(prof, [AC_HELP_STRING([--enable-prof],[compile for profiling])], ok=$enableval, ok=no) +AC_ARG_ENABLE(prof, [AS_HELP_STRING([--enable-prof],[compile for profiling])], ok=$enableval, ok=no) if test "$ok" = "yes"; then CFLAGS="${CFLAGS} -pg" AC_DEFINE(ENABLE_PROF,1,[Define when using the profiler tool]) ARGS="${ARGS} prof" fi -AC_ARG_WITH(efence, [AC_HELP_STRING([--with-efence],[use ElectricFence library])], ok=$withval, ok=no) +AC_ARG_WITH(efence, [AS_HELP_STRING([--with-efence],[use ElectricFence library])], ok=$withval, ok=no) if test "$ok" = "yes"; then AC_CHECK_LIB(efence, malloc) ARGS="${ARGS} efence"