59 |
|
|
60 |
|
using namespace OpenMD; |
61 |
|
|
62 |
– |
char* __get_svn_version(); |
63 |
– |
|
62 |
|
int main(int argc,char* argv[]){ |
63 |
|
|
64 |
|
// first things first, all of the initializations |
69 |
|
|
70 |
|
initSimError(); // the error handler |
71 |
|
srand48( 1337 ); // the random number generator. |
72 |
< |
|
72 |
> |
|
73 |
> |
std::string revision; |
74 |
> |
//convert a macro from compiler to a string in c++ |
75 |
> |
STR_DEFINE(revision, SVN_REV ); |
76 |
> |
if (revision.empty()) revision.assign("release"); |
77 |
> |
|
78 |
> |
revision.resize(8,' '); |
79 |
> |
|
80 |
|
#ifdef IS_MPI |
81 |
|
if( worldRank == 0 ){ |
82 |
|
#endif |
89 |
|
" | \\____/ .___/\\___/_/ /_//_/ /_//_____/ Copyright 2004-2010 by the |\n"<< |
90 |
|
" | /_/ University of Notre Dame. |\n"<< |
91 |
|
" | |\n"<< |
92 |
< |
" | version " << |
93 |
< |
OPENMD_VERSION_MAJOR << "." << OPENMD_VERSION_MINOR << " Revision:" << __get_svn_version() << |
92 |
> |
" | version " << |
93 |
> |
OPENMD_VERSION_MAJOR << "." << OPENMD_VERSION_MINOR << " Revision:" << revision << |
94 |
|
" http://www.openmd.net |\n"<< |
95 |
|
" | |\n"<< |
96 |
|
" | OpenMD is an OpenScience project. All source code is available for |\n"<< |
199 |
|
|
200 |
|
return 0 ; |
201 |
|
} |
197 |
– |
|
198 |
– |
char svnVersionString[1024]; |
199 |
– |
char* __get_svn_version(){ |
200 |
– |
int howMuchToCopy=0; |
201 |
– |
const char *theVersion="$Revision$"; |
202 |
– |
howMuchToCopy=strlen(theVersion+11) - 2; |
203 |
– |
assert(howMuchToCopy>0); |
204 |
– |
memcpy(svnVersionString, theVersion+11, howMuchToCopy); |
205 |
– |
svnVersionString[howMuchToCopy] = '\0'; |
206 |
– |
return svnVersionString; |
207 |
– |
} |