Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ScalFMM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
solverstack
ScalFMM
Commits
d78145bf
Commit
d78145bf
authored
10 years ago
by
BRAMAS Berenger
Browse files
Options
Downloads
Patches
Plain Diff
Add a show compile to all exec (but we need to update the cmake)
parent
9e880dbf
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Src/ScalFmmConfig.h.cmake
+7
-0
7 additions, 0 deletions
Src/ScalFmmConfig.h.cmake
Src/Utils/FParameterNames.hpp
+20
-0
20 additions, 0 deletions
Src/Utils/FParameterNames.hpp
with
27 additions
and
0 deletions
Src/ScalFmmConfig.h.cmake
+
7
−
0
View file @
d78145bf
...
@@ -102,4 +102,11 @@
...
@@ -102,4 +102,11 @@
#include <string>
#include <string>
const std::string
SCALFMMDataPath
(
"@CMAKE_SOURCE_DIR@/Data/"
)
;
const std::string
SCALFMMDataPath
(
"@CMAKE_SOURCE_DIR@/Data/"
)
;
///////////////////////////////////////////////////////
// Flags and libs used to compile
///////////////////////////////////////////////////////
const std::string
SCALFMMCompileFlags
(
"@CMAKE_COMPILE_FLAGS@"
)
;
const std::string
SCALFMMCompileLibs
(
"@CMAKE_COMPILE_LIBS@"
)
;
#endif // CONFIG_H
#endif // CONFIG_H
This diff is collapsed.
Click to expand it.
Src/Utils/FParameterNames.hpp
+
20
−
0
View file @
d78145bf
...
@@ -45,6 +45,11 @@ static const FParameterNames Help = {
...
@@ -45,6 +45,11 @@ static const FParameterNames Help = {
"To have print the options used by the application."
"To have print the options used by the application."
};
};
static
const
FParameterNames
Compile
=
{
{
"-show-compile"
,
"--show-compile"
,
"--flags"
}
,
"To have the list of flags and lib linked to scalfmm."
};
static
const
FParameterNames
NbParticles
=
{
static
const
FParameterNames
NbParticles
=
{
{
"-nb"
,
"--number-of-particles"
,
"-N"
}
,
{
"-nb"
,
"--number-of-particles"
,
"-N"
}
,
"The number of particles if they are generated by the executable."
"The number of particles if they are generated by the executable."
...
@@ -178,12 +183,23 @@ inline void PrintUsedOptions(const std::vector<FParameterNames>& options){
...
@@ -178,12 +183,23 @@ inline void PrintUsedOptions(const std::vector<FParameterNames>& options){
}
}
}
}
inline
void
PrintFlags
(){
std
::
cout
<<
"This executable has been compiled with:
\n
"
;
std
::
cout
<<
"Flags = "
<<
SCALFMMCompileFlags
<<
"
\n
"
;
std
::
cout
<<
"Libs = "
<<
SCALFMMCompileLibs
<<
"
\n
"
;
std
::
cout
.
flush
();
}
}
// End of namespace
}
// End of namespace
/** This should be include at the beginin of all main file
/** This should be include at the beginin of all main file
* @code FHelpAndExit(argc, argv, FParameterDefinitions::NbParticles, FParameterNames OctreeSubHeight );
* @code FHelpAndExit(argc, argv, FParameterDefinitions::NbParticles, FParameterNames OctreeSubHeight );
*/
*/
#define FHelpAndExit(argc, argv, ...) \
#define FHelpAndExit(argc, argv, ...) \
if(FParameters::existParameter(argc, argv, FParameterDefinitions::Compile.options)) {\
FParameterDefinitions::PrintFlags();\
return 0;\
} \
if(FParameters::existParameter(argc, argv, FParameterDefinitions::Help.options)) {\
if(FParameters::existParameter(argc, argv, FParameterDefinitions::Help.options)) {\
const std::vector<FParameterNames> optionsvec = {__VA_ARGS__};\
const std::vector<FParameterNames> optionsvec = {__VA_ARGS__};\
FParameterDefinitions::PrintUsedOptions(optionsvec);\
FParameterDefinitions::PrintUsedOptions(optionsvec);\
...
@@ -196,6 +212,10 @@ inline void PrintUsedOptions(const std::vector<FParameterNames>& options){
...
@@ -196,6 +212,10 @@ inline void PrintUsedOptions(const std::vector<FParameterNames>& options){
* @code FParameterDefinitions::NbParticles, FParameterNames OctreeSubHeight );
* @code FParameterDefinitions::NbParticles, FParameterNames OctreeSubHeight );
*/
*/
#define FHelpDescribeAndExit(argc, argv, description, ...) \
#define FHelpDescribeAndExit(argc, argv, description, ...) \
if(FParameters::existParameter(argc, argv, FParameterDefinitions::Compile.options)) {\
FParameterDefinitions::PrintFlags();\
return 0;\
} \
if(FParameters::existParameter(argc, argv, FParameterDefinitions::Help.options)) {\
if(FParameters::existParameter(argc, argv, FParameterDefinitions::Help.options)) {\
std::cout << argv[0] << " : " << description << "\n"; \
std::cout << argv[0] << " : " << description << "\n"; \
const std::vector<FParameterNames> optionsvec = {__VA_ARGS__};\
const std::vector<FParameterNames> optionsvec = {__VA_ARGS__};\
...
...
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