-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add badges and improve make output #879
Add badges and improve make output #879
Conversation
MohammadAlTurany
commented
Mar 9, 2019
- Add license badge
- Use the FairMQ style implemented by Dennis in FairRoot
EndMacro (SetBasicVariables) | ||
################################################################################ | ||
macro(find_package2 qualifier pkgname) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use this improved version of the find_package2
macro: https://github.com/FairRootGroup/FairMQ/blob/master/cmake/FairMQLib.cmake#L296-L341
It allows to write this (in top level CMakeLists.txt
)
set(FairRoot_Boost_COMPONENTS thread system timer program_options random filesystem chrono exception regex serialization log log_setup atomic date_time signals)
list(APPEND FairRoot_Boost_COMPONENTS ${FairMQ_Boost_COMPONENTS})
list(REMOVE_DUPLICATES FairRoot_Boost_COMPONENTS)
find_package2(PUBLIC Boost VERSION 1.67 COMPONENTS ${FairRoot_Boost_COMPONENTS})
as just
find_package2(PUBLIC Boost
VERSION 1.67 ${FairMQ_Boost_VERSION}
COMPONENTS thread system timer program_options random filesystem chrono exception regex serialization log log_setup atomic date_time signals ${FairMQ_Boost_COMPONENTS}
)
It will pick highest listed version and automatically make the components list unique. I was also thinking about a syntax like this:
find_package2(PUBLIC Boost
VERSION 1.67
COMPONENTS thread system timer program_options random filesystem chrono exception regex serialization log log_setup atomic date_time signals
ADD_REQUIREMENTS_OF FairMQ
)
or similar. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reminds me, we should also add find_package2
to FairLogger, which now has an optional dependency to Boost as well. With generate_package_dependencies() one can generate a cmake string, that can be exported in the cmake package, which defines ${FairLogger_Boost_VERSION}
and ${FairLogger_Boost_COMPONENTS}
- basically for any find_package2
call, if PUBLIC
and VERSION
/COMPONENTS
are specified. Made an issue FairRootGroup/FairLogger#14.
Then it would read
find_package2(PUBLIC Boost
VERSION 1.67 ${FairMQ_Boost_VERSION} ${FairLogger_Boost_VERSION}
COMPONENTS thread system timer program_options random filesystem chrono exception regex serialization log log_setup atomic date_time signals ${FairMQ_Boost_COMPONENTS} ${FairLogger_Boost_COMPONENTS}
)
or
find_package2(PUBLIC Boost
VERSION 1.67
COMPONENTS thread system timer program_options random filesystem chrono exception regex serialization log log_setup atomic date_time signals
ADD_REQUIREMENTS_OF FairMQ FairLogger
)
Actually, I like second one even better, will add it at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This topic has another aspect: The reason for exporting the public package dependency versions/components, is obviously, that we do not have to hardcode any requirements of the dependent package. But what about the list of dependencies itself? Currently, we hardcode it. For Boost, it is somewhat hidden, because we depend on it directly in FairRoot, FairMQ, and FairLogger. E.g. FairMQ also exports a variable ${FairMQ_PACKAGE_DEPENDENCIES}
that could be used to loop over all public FairMQ dependencies and "find_package
" them, even if FairRoot does not directly depend on them.
So far, so good, but this is not enough. Imagine multiple dependencies exporting such a list of their dependencies and they overlap partly. Then one would first have to "fuse" those lists together preserving their topological properties (doable, if the order is the original call order !currently not the case! those lines would be a bug) and figure out a call order together with the direct dependencies FairRoot "finds" explicitely. All doable, but it is not yet done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding here is to clean and simplify the CMake output so that the users see in one shot what he has. The real issue of dependancies between packages is solved in AliBuild or FairSoft, OR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those tools will build, install and decide on the package versions. But the public package dependencies must be discovered by each project for the whole subtree.
E.g. if a dependency uses a symbol of yet another library in its header, that is included in a FairRoot source file. Then, we only know about the target name, that we need to link against. But that target is not defined unless we find_package
the righr dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a way, it is a standard way of doing, what the config.sh
does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the package components, you may want to have a look at generate_package_components. It picks up the list of components in the variable ${PROJECT_PACKAGE_COMPONENTS}
and generates component checking code that can be exported in a cmake package (code similar to this and that). This will enable that the user can find a FairRoot with specific components enabled (even without find_package2
), e.g.
find_package(FairRoot COMPONENTS base eve)
In FairMQ, I chose to keep the component names in sync with the table output when running cmake. E.g.
find_package(FairMQ 1.3.8 COMPONENTS nanomsg_transport)
will explicitely require a FairMQ installation with enabled nanomsg transport.
@dennisklein Thanks, I will adapt to your suggestions. |
Find out which package version was installed
-Find report only on errors, the out put of find is summarized at the end -Improve the Compiler check
27fb66a
to
fe43822
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I only add some comments at specific places. What I only saw in the end is that we use exec_program() at several places. Since this function is deprecated we should use execute_process() instead.
@@ -1,8 +1,8 @@ | |||
################################################################################ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this Find module? We use the CLHEP which comes with Geant4.
@@ -9,7 +9,7 @@ if (GENERATORS_LIBRARY_DIR) | |||
SET (GENERATORS_LIBRARY_DIR GENERATORS_LIBRARY_DIR-NOTFOUND) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this Find module?
CMakeLists.txt
Outdated
# Set project version | ||
SET(FAIRROOT_MAJOR_VERSION 18) | ||
SET(FAIRROOT_MINOR_VERSION 0) | ||
SET(FAIRROOT_PATCH_VERSION 1) | ||
SET(FAIRROOT_PATCH_VERSION 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are already at patch version 6 for the v18.0 branch. So for the development branch we should choose a higher number or decide on a different numbering scheme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will change it to 7 now.
The problem I see is that we create a new patch we will have again a conflict. Somehow we have to distinguish patches from the development.
… Am 13.03.2019 um 13:20 schrieb Mohammad Al-Turany ***@***.***>:
@MohammadAlTurany commented on this pull request.
In CMakeLists.txt:
> # Set project version
SET(FAIRROOT_MAJOR_VERSION 18)
SET(FAIRROOT_MINOR_VERSION 0)
-SET(FAIRROOT_PATCH_VERSION 1)
+SET(FAIRROOT_PATCH_VERSION 3)
Ok, I will change it to 7 now.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub, or mute the thread.
|