-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 build support future #732
Comments
We would like to drop make in favor or cmake completely.
There are still a few issues, but this is the future of the build part of
or-tools.
Thanks
Laurent Perron | Operations Research | [email protected] | (33) 1 42 68 53
00
Le lun. 25 juin 2018 à 07:30, Navid Rahimi <[email protected]> a
écrit :
… I am trying to add or-tools to vcpkg [1]. But before that, I need to know
what is future of cmake support in or-tools? I see it is experimental.
Experimental means there is a good chance of removing it in future? Or
experimental in this context means it is going to get more stable and
eventually fully supported in or-tools? (In this case, I can rely on CMake
support of or-tools team and add it to vcpkg).
1. microsoft/vcpkg#692 <microsoft/vcpkg#692>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#732>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKj17UrEs5fysT7GcZl1JYWbt7hGf9lLks5uAHWMgaJpZM4U1iI2>
.
|
Hi, Yes it is intended to use CMake as default build (at least for C++) and to replace our current Makefile based system. i.e. currently in CMakelists.txt I build zlib, gflags, glog, protobuf, mizux/CBC and merge everything. ZLIB: I want to use my CMake PR madler/zlib#337
Then we will provide an OR-Tools vcpkg after. CMake is currently experimental since:
|
It is good news to hear we are going to rely on CMake. And only C++ would suffice I think (for now). I am fighting right now with https://github.com/google/or-tools/blob/master/CMakeLists.txt#L12 It seems you are redefining find_package. I think it is better to have something like ortools_find_library than redefining find_package. (LLVM does this with add_llvm_library). redefining find_package does not play well when I want to integrate vcpkg and use dependencies of or-tools from vcpkg. For example : find_package(gflags QUIET)
if(NOT TARGET gflags::gflags AND NOT gflags_FOUND)
This makes much more sense than trying to download-compile the dependencies all the time. With this I am able to do |
Yup that the problem with CMake if you depends on or maybe I should rewrite option(ORTOOLS_STANDALONE ON)
...
if (ORTOOLS_STANDALONE)
add_subdirectory(dependencies/bar)
add_subdirectory(dependencies/foo)
endif()
...
if(NOT TARGET Foo::Foo)
find_package(Foo required) But if BTW thanks for your feedback I think I will try to change this sooner...
I know vcpkg is mainly for C++ developers but OR-Tools also provide swig wrapper in Python, Java and .Net and CMake is not really built for this... |
Are you guys open to looking into a PR? I can restructure the project a little bit. I use clone vcpkg itself in our code repository. It makes management of dependencies way more easier. You should basically have a git submodule of vcpkg and then you can customize vcpkg to your need. So basically the flow for compiling or-tools will be like this :
That's about it. In all supported platform that is going to work. I am doing this in our private code repository. And you can have a private patch of vcpkg for your dependencies. As you wanted a customized version of zlib or anything else. |
While I'm agree with your flow, I don't think we need to have some vcpkg file here. I mean vcpkg is a tools by Microsoft to fix their own package management issue (yes it's multi platform but we don't wait them to build some tools)...
So, while I'm open to have some change to CMake to be more usable, I think vcpkg stuff should live directly in https://github.com/Microsoft/vcpkg/tree/master/ports not in this repo. i.e. here we should have an agnostic CMake that you can use/embed with your prefered tools (e.g. vcpkg, adment, conan, yocto recipe, android toolchain etc...). note: Homebrew Makefile test https://github.com/Mizux/homebrew-or-tools/blob/master/or-tools.rb basically I want the same workflow for CMake, i.e. you can have installed all dependencies in the host system, then having a way to CMake/Make OR-Tools using them instead of compiling them. |
Just as small fix, I think you have to reinvestigate vcpkg. The developers of vcpkg designed it to be integrated into every kind of project (not as a system-wide package manager, but as a customized dependency manager integrated into your codebase rather than being universal). It is basically dependency management tool. So having a one united dependency management tool for a C++ project is a huge sum. While the cost is very low and we have to only maintain a private branch of vcpkg (if we don't need anything special to the main branch, even that is not requirement). The problem with using Linux distro package managers or homebrew (as I use right now) is mostly inconsistent version between libraries. Some are older, some are newer. vcpkg would give us one united and robust dependency management. Something like Rust's cargo. And as far as I know, some enterprises do use the approach I am explaining to you in their private repos. But I agree with your other point. The integration of vcpkg would mean a headache for Android, embedded stuff, or custom targets. (Since it only supports Windows/Linux/OSX, right now. But I have heard from its developers they are going to add a way to have custom triplet). Anyways, I hope we will see more cmake improvement to or-tools. |
Just to bump this up, we definitely have this capability[1]! Additionally, we accept CMake toolchain files[2], and have several users who've successfully build libraries for Android and iOS via that mechanism :) [1] https://github.com/Microsoft/vcpkg/blob/master/docs/users/triplets.md |
Currently no plan, sorry. |
I am trying to add or-tools to vcpkg [1]. But before that, I need to know what is future of cmake support in or-tools? I see it is experimental. Experimental means there is a good chance of removing it in future? Or experimental in this context means it is going to get more stable and eventually fully supported in or-tools? (In this case, I can rely on CMake support of or-tools team and add it to vcpkg).
The text was updated successfully, but these errors were encountered: