Commit 2cd5cb5e authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Merge branch 'configure_options_in_code' into 'master'

Added the configuration command line and CFLAGS/CXXFLAGS to the snapshots and greeting message.

Does what it says on the tin. Just wanted to run it pass you in case you have a better way of doing this. 

Thanks ! Branch can be removed.

See merge request !285
parents 3aac6968 a0e45903
......@@ -20,7 +20,15 @@
#ifndef SWIFT_RIEMANN_HLLC_H
#define SWIFT_RIEMANN_HLLC_H
/* Some standard headers. */
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
/* Local headers. */
#include "adiabatic_index.h"
#include "error.h"
#include "minmax.h"
#include "riemann_vacuum.h"
......
......@@ -16,11 +16,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_RIEMANN_TRRS_H
#define SWIFT_RIEMANN_TRRS_H
/* Some standard headers. */
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
/* Local headers. */
#include "adiabatic_index.h"
#include "error.h"
#include "minmax.h"
#include "riemann_vacuum.h"
#ifndef EOS_IDEAL_GAS
......
......@@ -40,7 +40,6 @@
/* Local headers. */
#include "atomic.h"
#include "const.h"
#include "cycle.h"
#include "engine.h"
#include "error.h"
......
......@@ -38,7 +38,6 @@
/* Includes. */
#include "adiabatic_index.h"
#include "const.h"
#include "error.h"
/**
......
......@@ -39,10 +39,12 @@
/* Some standard headers. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
/* This object's header. */
#include "error.h"
#include "version.h"
/* Local headers. */
......@@ -109,6 +111,44 @@ const char *git_branch(void) {
return buf;
}
/**
* @brief Return the options passed to the 'configure' script
*
* @result List of configuration options within simple quotes (').
*/
const char *configuration_options(void) {
static char buf[1024];
static int initialised = 0;
static const char *config = SWIFT_CONFIG_FLAGS;
if (!initialised) {
if (strlen(config) < 1024 - 2)
sprintf(buf, "'%s'", config);
else
error("SWIFT_CONFIG_FLAGS string longer than buffer");
initialised = 1;
}
return buf;
}
/**
* @brief Return the CFLAGS the code was compiled with
*
* @result List of CFLAGS within simple quotes (').
*/
const char *compilation_cflags(void) {
static char buf[1024];
static int initialised = 0;
static const char *cflags = SWIFT_CFLAGS;
if (!initialised) {
if (strlen(cflags) < 1024 - 2)
sprintf(buf, "'%s'", cflags);
else
error("SWIFT_CFLAGS string longer than buffer");
initialised = 1;
}
return buf;
}
/**
* @brief The version of SWIFT
*
......@@ -293,8 +333,11 @@ void greetings(void) {
printf(" Version : %s\n", package_version());
printf(" Revision: %s, Branch: %s\n", git_revision(), git_branch());
printf(" Webpage : www.swiftsim.com\n\n");
printf(" Webpage : %s\n\n", PACKAGE_URL);
printf(" Config. options: %s\n\n", configuration_options());
printf(" Compiler: %s, Version: %s\n", compiler_name(), compiler_version());
printf(" CFLAGS : %s\n", compilation_cflags());
printf("\n");
#ifdef HAVE_HDF5
printf(" HDF5 library version: %s\n", hdf5_version());
#endif
......
......@@ -25,6 +25,8 @@ const char* package_version(void);
const char* hostname(void);
const char* git_revision(void);
const char* git_branch(void);
const char* configuration_options(void);
const char* compilation_cflags(void);
const char* compiler_name(void);
const char* compiler_version(void);
const char* mpi_version(void);
......
......@@ -28,5 +28,6 @@
#define PACKAGE_VERSION "@PACKAGE_VERSION@"
#define GIT_REVISION "@GIT_REVISION@"
#define GIT_BRANCH "@GIT_BRANCH@"
#define SWIFT_CFLAGS "@SWIFT_CFLAGS@"
#endif /* SWIFT_VERSION_STRING_H */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment