Skip to content
Snippets Groups Projects
Commit 6d3b3bfd authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Faster compilation

parent 08e4da34
No related branches found
No related tags found
1 merge request!155Faster compilation
...@@ -11,7 +11,7 @@ config.sub ...@@ -11,7 +11,7 @@ config.sub
ltmain.sh ltmain.sh
libtool libtool
src/version.h src/version_string.h
swift*.tar.gz swift*.tar.gz
doc/doxyfile.stamp doc/doxyfile.stamp
doc/html/ doc/html/
......
...@@ -36,7 +36,7 @@ endif ...@@ -36,7 +36,7 @@ endif
include_HEADERS = space.h runner.h queue.h task.h lock.h cell.h part.h const.h \ include_HEADERS = space.h runner.h queue.h task.h lock.h cell.h part.h const.h \
engine.h swift.h serial_io.h timers.h debug.h scheduler.h proxy.h parallel_io.h \ engine.h swift.h serial_io.h timers.h debug.h scheduler.h proxy.h parallel_io.h \
common_io.h single_io.h multipole.h map.h tools.h partition.h clocks.h parser.h \ common_io.h single_io.h multipole.h map.h tools.h partition.h clocks.h parser.h \
physical_constants.h physical_constants_cgs.h potentials.h physical_constants.h physical_constants_cgs.h potentials.h version.h
# Common source files # Common source files
AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c \ AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c \
...@@ -72,27 +72,27 @@ libswiftsim_mpi_la_CFLAGS = $(AM_CFLAGS) -DWITH_MPI $(METIS_INCS) ...@@ -72,27 +72,27 @@ libswiftsim_mpi_la_CFLAGS = $(AM_CFLAGS) -DWITH_MPI $(METIS_INCS)
libswiftsim_mpi_la_SHORTNAME = mpi libswiftsim_mpi_la_SHORTNAME = mpi
# Versioning. If any sources change then update the version.h file with # Versioning. If any sources change then update the version_string.h file with
# the current git revision and package version. # the current git revision and package version.
# May have a checkout without a version.h file and no git command (tar/zip # May have a checkout without a version_string.h file and no git command (tar/zip
# download), allow that, but make sure we know it. # download), allow that, but make sure we know it.
version.h: version.h.in $(AM_SOURCES) $(include_HEADERS) $(noinst_HEADERS) version_string.h: version_string.h.in $(AM_SOURCES) $(include_HEADERS) $(noinst_HEADERS)
if test "X$(GIT_CMD)" != "X"; then \ if test "X$(GIT_CMD)" != "X"; then \
GIT_REVISION=`$(GIT_CMD) describe --abbrev=8 --always --tags --dirty`; \ GIT_REVISION=`$(GIT_CMD) describe --abbrev=8 --always --tags --dirty`; \
GIT_BRANCH=`$(GIT_CMD) branch | sed -n 's/^\* \(.*\)/\1/p'`; \ GIT_BRANCH=`$(GIT_CMD) branch | sed -n 's/^\* \(.*\)/\1/p'`; \
sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \ sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
-e "s,@GIT_REVISION\@,$${GIT_REVISION}," \ -e "s,@GIT_REVISION\@,$${GIT_REVISION}," \
-e "s|@GIT_BRANCH\@|$${GIT_BRANCH}|" version.h.in > version.h; \ -e "s|@GIT_BRANCH\@|$${GIT_BRANCH}|" version_string.h.in > version_string.h; \
else \ else \
if test ! -f version.h; then \ if test ! -f version_string.h; then \
sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \ sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
-e "s,@GIT_REVISION\@,unknown," \ -e "s,@GIT_REVISION\@,unknown," \
-e "s,@GIT_BRANCH\@,unknown," version.h.in > version.h; \ -e "s,@GIT_BRANCH\@,unknown," version_string.h.in > version_string.h; \
fi; \ fi; \
fi fi
# Make sure version.h is built first. # Make sure version_string.h is built first.
BUILT_SOURCES = version.h BUILT_SOURCES = version_string.h
# And distribute the built files. # And distribute the built files.
EXTRA_DIST = version.h version.h.in EXTRA_DIST = version_string.h version_string.h.in
...@@ -40,6 +40,9 @@ ...@@ -40,6 +40,9 @@
/* This object's header. */ /* This object's header. */
#include "version.h" #include "version.h"
/* Local headers. */
#include "version_string.h"
/** /**
* @brief Return the source code git revision * @brief Return the source code git revision
* *
......
...@@ -2,33 +2,24 @@ ...@@ -2,33 +2,24 @@
* This file is part of SWIFT. * This file is part of SWIFT.
* Copyright (c) 2012 Matthieu Schaller (matthieu.schaller@durham.ac.uk). * Copyright (c) 2012 Matthieu Schaller (matthieu.schaller@durham.ac.uk).
* Copyright (c) 2015 Peter W. Draper (p.w.draper@durham.ac.uk). * Copyright (c) 2015 Peter W. Draper (p.w.draper@durham.ac.uk).
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published * it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or * by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
******************************************************************************/ ******************************************************************************/
#ifndef SWIFT_VERSION_H #ifndef SWIFT_VERSION_H
#define SWIFT_VERSION_H #define SWIFT_VERSION_H
/**
* @file version.h
* @brief Package version, git revision sha and compiler info.
*/
#define PACKAGE_VERSION "@PACKAGE_VERSION@"
#define GIT_REVISION "@GIT_REVISION@"
#define GIT_BRANCH "@GIT_BRANCH@"
const char* package_description(void); const char* package_description(void);
const char* package_version(void); const char* package_version(void);
const char* git_revision(void); const char* git_revision(void);
...@@ -36,8 +27,8 @@ const char* git_branch(void); ...@@ -36,8 +27,8 @@ const char* git_branch(void);
const char* compiler_name(void); const char* compiler_name(void);
const char* compiler_version(void); const char* compiler_version(void);
const char* mpi_version(void); const char* mpi_version(void);
const char *hdf5_version(void); const char* hdf5_version(void);
const char *metis_version(void); const char* metis_version(void);
void greetings(void); void greetings(void);
#endif /* SWIFT_VERSION_H */ #endif /* SWIFT_VERSION_H */
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2012 Matthieu Schaller (matthieu.schaller@durham.ac.uk).
* Copyright (c) 2015 Peter W. Draper (p.w.draper@durham.ac.uk).
*
* This program 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, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_VERSION_STRING_H
#define SWIFT_VERSION_STRING_H
/**
* @file version_string.h
* @brief Package version, git revision sha and compiler info.
*/
#define PACKAGE_VERSION "@PACKAGE_VERSION@"
#define GIT_REVISION "@GIT_REVISION@"
#define GIT_BRANCH "@GIT_BRANCH@"
#endif /* SWIFT_VERSION_STRING_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment