diff --git a/examples/test.c b/examples/test.c index 427b761680bde8c96d23f576cbde792fb13519b2..2ffeda6e340a76f4d641f757497a25549cb7c3c9 100644 --- a/examples/test.c +++ b/examples/test.c @@ -573,7 +573,8 @@ int main ( int argc , char *argv[] ) { #endif /* Greeting message */ - message( "This is %s\n", package_description() ); + if ( myrank == 0 ) + message( "This is %s\n", package_description() ); /* Init the space. */ bzero( &s , sizeof(struct space) ); diff --git a/examples/test_single.c b/examples/test_single.c index 9387f826acf4e43ed8aebc6e9242a9ac8afbee15..76d475a2158d2f37d86fa0353711350b3fb21064 100644 --- a/examples/test_single.c +++ b/examples/test_single.c @@ -63,6 +63,9 @@ int main ( int argc , char *argv[] ) { struct part p1, p2; float x, w, dwdx, r2, dx[3] = { 0.0f , 0.0f , 0.0f }, gradw[3]; + /* Greeting message */ + printf( "This is %s\n", package_description() ); + /* Init the particles. */ for ( k = 0 ; k < 3 ; k++ ) { p1.a[k] = 0.0f; p1.v[k] = 0.0f; p1.x[k] = 0.0; diff --git a/src/Makefile.am b/src/Makefile.am index f9aa25995a20d4aacebf74aa24cd7a9dfc4d2418..49ef5e70554a8921a15906cfe70768557468c40f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -58,11 +58,18 @@ libswiftsim_mpi_la_SHORTNAME = mpi # Versioning. If any sources change then update the version.h file with # the current git revision and package version. +# May have a checkout without a version.h file and no git command (tar/zip +# download), allow that, but make sure we know it. version.h: version.h.in $(AM_SOURCES) $(include_HEADERS) $(noinst_HEADERS) if test "X$(GIT_CMD)" != "X"; then \ GIT_REVISION=`git describe --abbrev=8 --always --tags --dirty`; \ sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \ -e "s,@GIT_REVISION\@,$${GIT_REVISION}," version.h.in > version.h; \ + else \ + if test ! -f version.h; then \ + sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \ + -e "s,@GIT_REVISION\@,unknown," version.h.in > version.h; \ + fi; \ fi # Make sure version.h is built first.