Move the logger in a submodule
A lot of changes here, but it is mostly a big git rm -rf logger
. The submodule is now hosted here https://gitlab.cosma.dur.ac.uk/lhausammann/csds-reader
The interesting changes are:
- Adding a submodule called CSDS
-
autogen.sh
is now updating the submodules (it is required due to the wayAC_CONFIG_FILES
is working) - When running
./configure --enable-csds
, I am also updating the submodule to be safe - I am adding an old script from Peter to update the submodules
Due to the changes in the structure, some scripts for the logger might be broken now. As I am planning to rename everything, I will test and fix everything once the renaming is done.
Merge request reports
Activity
changed milestone to %Continuous Simulation Data Stream
added code health label
If you really want to pull the submodule later then you need to have configure in logger as well and use the
AC_CONFIG_SUBDIRS()
macro to call it or not, see:https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Subdirectories.html
It seems that with
AC_CONFIG_SUBDIRS
, I need to redefine everything that is done in SWIFT.My current
csds/configure.ac
:AC_INIT([CSDS], [1.0]) AC_CONFIG_AUX_DIR([.]) AM_INIT_AUTOMAKE([subdir-objects]) AC_PROG_CC AM_PROG_AR AC_PROG_RANLIB AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile]) AC_OUTPUT
The output when I run
./autogen.sh
:Makefile.am: error: required file './NEWS' not found Makefile.am: error: required file './README' not found Makefile.am: error: required file './AUTHORS' not found Makefile.am: error: required file './ChangeLog' not found src/Makefile.am:48: error: HAVE_STARS_BASIC does not appear in AM_CONDITIONAL src/Makefile.am:51: error: HAVE_STARS_GEAR does not appear in AM_CONDITIONAL src/Makefile.am:56: error: HAVE_SPHENIX does not appear in AM_CONDITIONAL src/Makefile.am:59: error: HAVE_GADGET2 does not appear in AM_CONDITIONAL src/Makefile.am:64: error: HAVE_CHEMISTRY_NONE does not appear in AM_CONDITIONAL src/Makefile.am:67: error: HAVE_CHEMISTRY_GEAR does not appear in AM_CONDITIONAL src/Makefile.am:72: error: HAVE_STAR_FORMATION_DEFAULT does not appear in AM_CONDITIONAL src/Makefile.am:75: error: HAVE_STAR_FORMATION_GEAR does not appear in AM_CONDITIONAL src/Makefile.am:89: error: HAVEPYTHON does not appear in AM_CONDITIONAL src/Makefile.am:93: error: HAVEPYTHON does not appear in AM_CONDITIONAL src/Makefile.am:40: error: Libtool library used but 'LIBTOOL' is undefined src/Makefile.am:40: The usual way to define 'LIBTOOL' is to add 'LT_INIT' src/Makefile.am:40: to 'configure.ac' and run 'aclocal' and 'autoconf' again. src/Makefile.am:40: If 'LT_INIT' is in 'configure.ac', make sure src/Makefile.am:40: its definition is in aclocal's search path. autoreconf: automake failed with exit status: 1
Do you have a way to avoid the copy?
No, you will need to make logger a thirdparty code to work like this. Most submodules are that, code from other projects that you want to include by default, so also have an independent life.
How about: https://www.gnu.org/software/automake/manual/html_node/Usage-of-Conditionals.html as an approach instead?
And that is probably autoconf not automake, so unlikely to have a workaround. git is very fussy about having content in the submodule directories, so I suspect that will never work, as well as being unpleasant.
So you're stuck with adding all the missing configure stuff, or always having the submodule pulled and present.
With the following trick, it seems to work and I keep a clean submodule directory.
autogen.sh
:#! /bin/sh # Update generated configuration files, i.e. do work so that a # developer checkout can be configured. if [ -f csds/Makefile.am ]; then fake_sub=0 else echo Creating fake files fake_sub=1 mkdir csds/src csds/tests touch csds/Makefile.am csds/src/Makefile.am csds/tests/Makefile.am fi autoreconf --install --symlink if [ $fake_sub -eq 1 ]; then echo Removing fake files rm -rf csds/src csds/tests rm csds/Makefile.am csds/Makefile.in fi exit
added 1 commit
- 6b912b8a - Ensure that everything is alright with the submodule
To ensure that everything is alright, I am now checking if
csds/Makefile.in
exists and if it is not the case, I am abortingconfigure
and print a message saying thatautogen.sh
should be run again.if test "$with_csds" = "yes"; then AC_DEFINE([WITH_LOGGER], 1, [csds enabled]) # Ensure that the submodule is initialized ${srcdir}/tools/update-modules csds # The csds requires that long long is a 64bit type, let's # check that. AC_CHECK_SIZEOF([long long int]) if test "$ac_cv_sizeof_long_long_int" != "8"; then AC_MSG_ERROR([The CSDS requires that 'long long int' has size 8 bytes]) fi # Ensure that everything is alright for the CSDS if test ! -f csds/Makefile.in; then AC_MSG_ERROR([It seems that the submodule "CSDS" was not initialized, please rerun autogen.sh and reconfigure.]) fi fi AM_CONDITIONAL([HAVELOGGER],[test $with_csds = "yes"]) AM_COND_IF([HAVELOGGER], [AC_CONFIG_FILES([csds/Makefile csds/src/Makefile csds/tests/Makefile])])
What do you think?