Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
e659ed1c
Commit
e659ed1c
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added compiler name and version to the greeting message and HDF5 output.
Former-commit-id: a6b730e23ea9189d8c1da1278426abe1453b3811
parent
07fc51c5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common_io.c
+2
-0
2 additions, 0 deletions
src/common_io.c
src/version.c
+41
-4
41 additions, 4 deletions
src/version.c
src/version.h.in
+3
-1
3 additions, 1 deletion
src/version.h.in
with
46 additions
and
5 deletions
src/common_io.c
+
2
−
0
View file @
e659ed1c
...
...
@@ -356,6 +356,8 @@ void writeCodeDescription(hid_t h_file) {
if
(
h_grpcode
<
0
)
error
(
"Error while creating code group"
);
writeAttribute_s
(
h_grpcode
,
"Code Version"
,
package_version
());
writeAttribute_s
(
h_grpcode
,
"Compiler Name"
,
compiler_name
());
writeAttribute_s
(
h_grpcode
,
"Compiler Version"
,
compiler_version
());
writeAttribute_s
(
h_grpcode
,
"Git Branch"
,
git_branch
());
writeAttribute_s
(
h_grpcode
,
"Git Revision"
,
git_revision
());
...
...
This diff is collapsed.
Click to expand it.
src/version.c
+
41
−
4
View file @
e659ed1c
...
...
@@ -45,7 +45,6 @@ const char *git_branch(void) {
return
branch
;
}
/**
* @brief The version of SWIFT
*/
...
...
@@ -61,13 +60,50 @@ const char *package_description(void) {
static
char
buf
[
256
];
static
int
initialised
=
0
;
if
(
!
initialised
)
{
sprintf
(
buf
,
"SWIFT version: %s, at revision: %s, branch: %s"
,
sprintf
(
buf
,
"SWIFT version: %s, at revision: %s, branch: %s"
,
PACKAGE_VERSION
,
GIT_REVISION
,
GIT_BRANCH
);
initialised
=
1
;
}
return
buf
;
}
const
char
*
compiler_name
(
void
)
{
#if defined(__INTEL_COMPILER)
static
const
char
*
compiler
=
"ICC"
;
#elif defined(__clang__)
static
const
char
*
compiler
=
"LLVM/Clang"
;
#elif defined(__xlc__)
static
const
char
*
compiler
=
"IBM XL"
;
#elif defined(__GNUC__)
static
const
char
*
compiler
=
"GCC"
;
#else
static
const
char
*
compiler
=
"Unknown Compiler"
;
#endif
return
compiler
;
}
const
char
*
compiler_version
(
void
)
{
static
char
version
[
256
];
#if defined(__INTEL_COMPILER)
const
int
major
=
__INTEL_COMPILER
/
100
;
const
int
minor
=
__INTEL_COMPILER
-
major
*
100
;
sprintf
(
version
,
"%i.%i.%i"
,
major
,
minor
,
__INTEL_COMPILER_BUILD_DATE
);
#elif defined(__clang__)
sprintf
(
version
,
"%i.%i.%i"
,
__clang_major__
,
__clang_minor__
,
__clang_patchlevel__
);
#elif defined(__xlc__)
const
int
major
=
__IBMC__
/
100
;
const
int
minor
=
(
__IBMC__
-
major
*
100
)
/
10
;
const
int
patch
=
(
__IBMC__
-
major
*
100
-
minor
*
10
);
sprintf
(
version
,
"%i.%i.%i"
,
major
,
minor
,
patch
);
#elif defined(__GNUC__)
sprintf
(
version
,
"%i.%i.%i"
,
__GNUC__
,
__GNUC_MINOR__
,
__GNUC_PATCHLEVEL__
);
#else
sprintf
(
version
,
"---"
);
#endif
return
version
;
}
/**
* @brief Prints a greeting message to the standard output containing code
* version and revision number
...
...
@@ -83,6 +119,7 @@ void greetings(void) {
printf
(
" SPH With Inter-dependent Fine-grained Tasking
\n\n
"
);
printf
(
" Version : %s
\n
"
,
package_version
());
printf
(
" Revision: %s, branch: %s
\n
"
,
git_revision
(),
git_branch
());
printf
(
" Webpage : www.swiftsim.com
\n\n
"
);
printf
(
" Revision: %s, Branch: %s
\n
"
,
git_revision
(),
git_branch
());
printf
(
" Webpage : www.swiftsim.com
\n
"
);
printf
(
" Compiler: %s, Version: %s
\n\n
"
,
compiler_name
(),
compiler_version
());
}
This diff is collapsed.
Click to expand it.
src/version.h.in
+
3
−
1
View file @
e659ed1c
...
...
@@ -22,7 +22,7 @@
/**
* @file version.h
* @brief Package version
and
git revision sha.
* @brief Package version
,
git revision sha
and compiler info
.
*/
#define PACKAGE_VERSION "@PACKAGE_VERSION@"
...
...
@@ -33,6 +33,8 @@ const char* package_description(void);
const char* package_version(void);
const char* git_revision(void);
const char* git_branch(void);
const char* compiler_name(void);
const char* compiler_version(void);
void greetings(void);
#endif /* SWIFT_VERSION_H */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment