-
Notifications
You must be signed in to change notification settings - Fork 239
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
[CMake] Remove external projects #1907
Conversation
c1b632c
to
78959e6
Compare
scripts/cmake/CompilerSetup.cmake
Outdated
@@ -148,3 +160,4 @@ endif() | |||
# preceding cxx flags definition in order to override earlier flags, e.g. for | |||
# optimization. | |||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OGS_CXX_FLAGS}") | |||
add_compile_options(${OGS_CXX_FLAGS}) |
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.
Just curious, why is this add_compile_options
needed beside the setting of the CMAKE_CXX_FLAGS
?
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.
Mostly comments about old compiler flags. One comment about ssh security.
Where do we put the Conan migration guide after this PR is merged?
endif() | ||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
message(STATUS "Set GCC release flags") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG") | ||
else() | ||
# Enable assertions in STL in debug mode. | ||
if (NOT STL_NO_DEBUG) | ||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_ASSERT -D_GLIBCXX_DEBUG_PEDASSERT -D_GLIBCXX_DEBUG_VERIFY") | ||
if(NOT STL_NO_DEBUG) |
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 need to set this up manually?
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 is an extra option introduced in #807.
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.
Ah, I see. Thanks for telling me. But actually we could ask ourselves if that option shouldn't be better removed from our cmake config, because (i) it's rather special, i.e., it is not an OGS feature in any way (ii) every pro-user can set it in their custom cmake config.
But I agree, STL_NO_DEBUG
is a useful option. If we wanted to remove it, we should put it into some "How to debug" document.
endif() | ||
endif() | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPU_FLAGS} -Wno-deprecated -Wall -Wextra -fext-numeric-literals") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPU_FLAGS} -Wno-deprecated -Wall \ | ||
-Wextra -fext-numeric-literals") |
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.
Is "-fext-numeric-literals" necessary?
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.
Somehow this was necessary but I don't remember the details..
if(CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
# Enable assertions in STL in debug mode. | ||
if (NOT STL_NO_DEBUG) | ||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_ASSERT -D_GLIBCXX_DEBUG_PEDASSERT -D_GLIBCXX_DEBUG_VERIFY") | ||
if(NOT STL_NO_DEBUG) |
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.
Was introduced here: 6a0dcaa
endif() | ||
set(PROFILE_FLAGS "-pg -fno-omit-frame-pointer -O2 -DNDEBUG") | ||
# clang compiler does not know the following flags | ||
if(NOT COMPILER_IS_CLANG) | ||
set(PROFILE_FLAGS "${PROFILE_FLAGS} -fno-inline-functions-called-once -fno-optimize-sibling-calls") | ||
set(PROFILE_FLAGS "${PROFILE_FLAGS} -fno-inline-functions-called-once \ | ||
-fno-optimize-sibling-calls") |
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.
Is profiling used anywhere?
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 had a Jenkinks job in the past with this enabled...
scripts/jenkins/gcc.groovy
Outdated
|
||
if (helper.isOriginMaster(this)) { | ||
sshagent(credentials: ['www-data_jenkins']) { | ||
sh 'rsync -a --delete --stats -e "ssh -o StrictHostKeyChecking=no"' + |
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.
Is it wise to put StrictHostKeyChecking=no
here? In this case it might not be a problem, because we just copy some public data there, probably using public key authentication. But in general host keys should be checked. If editing the usual known_hosts file is not an option, there also the possibility to specify a -oUserKnownHostsFile
on the command line.
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.
No. Initially this comes from the times as we had no ssh access to the Jenkins server ... Will remove it.
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.
Thanks.
In the ctests the |
I am going to take a look at the ctest. |
@bilke @endJunction
Since the directory of /data/ogs/jenkins/workspace/7-ELU3QZ43AJ/build/ is gone, I cannot find any clue to the failure. Could you please restart tests on the jenkins? |
Started new jenkins build. |
Again everything is green except:
Maybe the Eigen version from Conan differs from the one installed with ExternalProject (although both are 3.2.9)? Will check that.. |
@chleh Conan migration guide is hosted here. |
Still conan problems: conan remote list
ogs: https://api.bintray.com/conan/ogs/conan [Verify SSL: True]
conan-center: https://conan.bintray.com [Verify SSL: True]
conan-transit: https://conan-transit.bintray.com [Verify SSL: True] then building with
Is it possible to use system's VTK and zlib and bzip? ✅
|
@endJunction zlib and bzip2 should not be necassary, see https://github.com/lasote/conan-boost/issues/52. ✅ |
53d4f53
to
decf9f7
Compare
24f8ca1
to
13a5c09
Compare
@endJunction This is now ready to merge. The issues on envinf1 with gcc 6.2 could not be resolved so far, people on the internet even mention a bug in |
This makes sure that CMAKE_BUILD_TYPE variable is set which is required by Conan.
The latter was reported N. Grunwald and should be fixed with the added fPIC option in the VTK Conan package.
My Boost fix was integrated in 1.64.0 only. Added Conan remote conan-community where the package is hosted.
1feb1ea
to
9b8f128
Compare
If using system libraries is still possible ⏩ from me. |
@bilke thank you for the clarification. |
Possible values: missing (default), all, never, list of lib names Examples: cmake . -DOGS_CONAN_BUILD="Eigen3;Boost" -> Builds Eigen and Boost locally cmake . -DOGS_CONAN_BUILD=all -> Builds all libs locally This basically reimplements all functionality we had with ExternalProject.
@endJunction @chleh @wenqing Thanks for your feedback! I have added another last commit (finally) which gives complete control over what is used directly from Conan binary packages and what is build locally. So for example if Conan VTK on envinf1 does not work with gcc 6.2 one can still use Conan but just build VTK locally: cmake ../ogs -DOGS_USE_CONAN=ON -DOGS_CONAN_BUILD=VTK |
I checked out the branch and created a new build folder. Then in the build folder I did: What is wrong here? It seems the problem is that my compiler is gcc 7.1. |
@TomFischer Thanks for testing! Your Conan is way too old! Please upgrade it (via gcc 7.1 should be ok with the upgraded Conan but please be aware that for the moment there are no prebuilt packages for gcc 7.x so it will build them locally.
|
|
|
Btw: Did anybody test this PR under Windows? |
@chleh I have to update the docs. The migration should not be necessary anymore. Jenkins tested this PR on Windows 😜.. @TomFischer I have built gcc 7.1 packages for VTK. A gcc 7.2 build environment (a Docker container) for creating the packages is not yet available from Conan. Although 7.1 packages should be compatible with the 7.2 compiler I guess Conan will complain about this version mismatch so maybe you have to built them locally anyway... |
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.
No test failed on jenkins now. Jenkins shows only one failure
Log parsing has failed
I'm so glad, Jenkins always cares for us 😄 (and @bilke always cares for Jenkins!). |
@bilke What was the necessary conan remote for the VTK and other OGS specialities? I don't see it neither here nor in the docs page any longer... ;( Another error using intel compilers
|
@endJunction You can find the remote here: https://github.com/ufz/ogs/blob/master/scripts/cmake/ConanSetup.cmake#L67. I have to check what we can do if we use a compiler which is not yet known by Conan... |
OpenGeoSys development has been moved to GitLab. |
This PR removes the possibility to automatically build required third-party packages as this is already integrated by Conan.
Now you have two choices to handle third-party libs:
OGS_USE_CONAN=ON
) which is fully integrated into CMake, see docsConan installs prebuilt binaries. As not all compiler / os combinations are available the default behavior is to build missing binaries locally.
Points to discuss
1. Should header-only libs (i.e. Eigen) be integrated withAfter discussion: No for the moment.git submodule
? This allows for easily changing libraries version (with e.g.cd ThirdParty/Eigen; git checkout 3.3
) and we have less Conan packages to manage.Conan migration guide
DELETED, not required anymore
TODOs