Skip to content
Snippets Groups Projects
Commit c83c1562 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Generate the version.h file when git is not available and it is still required

This can happen if a zip/tar of the source code is download directly from gitlab


Former-commit-id: 87b39ab3cf4d53a625511937b8bdda5c9b3a9cf1
parent 8447037c
No related branches found
No related tags found
No related merge requests found
...@@ -573,7 +573,8 @@ int main ( int argc , char *argv[] ) { ...@@ -573,7 +573,8 @@ int main ( int argc , char *argv[] ) {
#endif #endif
/* Greeting message */ /* Greeting message */
message( "This is %s\n", package_description() ); if ( myrank == 0 )
message( "This is %s\n", package_description() );
/* Init the space. */ /* Init the space. */
bzero( &s , sizeof(struct space) ); bzero( &s , sizeof(struct space) );
......
...@@ -63,6 +63,9 @@ int main ( int argc , char *argv[] ) { ...@@ -63,6 +63,9 @@ int main ( int argc , char *argv[] ) {
struct part p1, p2; struct part p1, p2;
float x, w, dwdx, r2, dx[3] = { 0.0f , 0.0f , 0.0f }, gradw[3]; 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. */ /* Init the particles. */
for ( k = 0 ; k < 3 ; k++ ) { for ( k = 0 ; k < 3 ; k++ ) {
p1.a[k] = 0.0f; p1.v[k] = 0.0f; p1.x[k] = 0.0; p1.a[k] = 0.0f; p1.v[k] = 0.0f; p1.x[k] = 0.0;
......
...@@ -58,11 +58,18 @@ libswiftsim_mpi_la_SHORTNAME = mpi ...@@ -58,11 +58,18 @@ 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.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
# download), allow that, but make sure we know it.
version.h: version.h.in $(AM_SOURCES) $(include_HEADERS) $(noinst_HEADERS) version.h: version.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 describe --abbrev=8 --always --tags --dirty`; \ GIT_REVISION=`git describe --abbrev=8 --always --tags --dirty`; \
sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \ sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
-e "s,@GIT_REVISION\@,$${GIT_REVISION}," version.h.in > version.h; \ -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 fi
# Make sure version.h is built first. # Make sure version.h is built first.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment