-
Notifications
You must be signed in to change notification settings - Fork 39
fix: Add AXIOM_MONO_LIBRARY #375
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
base: main
Are you sure you want to change the base?
Conversation
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.
copied from velox, replaced (case sensetive) velox with axiom
| BUILD_TYPE=Release | ||
|
|
||
| CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) | ||
| CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DAXIOM_BUILD_TESTING=ON -DVELOX_MONO_LIBRARY=ON -DAXIOM_MONO_LIBRARY=ON |
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.
I can remove it after PR will pass tests, if you think it's better without it
| CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DAXIOM_BUILD_TESTING=ON -DVELOX_MONO_LIBRARY=ON -DAXIOM_MONO_LIBRARY=ON | |
| CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DAXIOM_BUILD_TESTING=ON -DVELOX_MONO_LIBRARY=ON |
or
| CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DAXIOM_BUILD_TESTING=ON -DVELOX_MONO_LIBRARY=ON -DAXIOM_MONO_LIBRARY=ON | |
| CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DAXIOM_BUILD_TESTING=ON |
|
@assignUser @kgpai Jacob, Krishna, would you help review this change? @MBkkt Would you update PR description to explain what is the effect of this change and why is it beneficial? Thanks. |
|
@mbasmanova is it ok now? |
Why would it be helpful to use VELOX_MONO_LIBRARY? What does that do?
Would you provide an example? Would you like to introduce a naming convention for CMake targets? That would be nice, but let's document it in https://github.com/facebookexperimental/verax/blob/main/CONTRIBUTING.md
Would you share an example? What do you mean "by default" and "is fixed"? It sounds there are 3 separate changes in this PR. Would you split these into 3 separate PRs? |
It's already exist in velox, it's used to produce single
I'm not sure what to write contributing, and honestly don't think it's really necessary.
The naming is deeply related to But I think I can try to separate |
|
@mbasmanova I made separate PR with |
1bfce8b to
91a6679
Compare
assignUser
left a comment
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.
I really appreciate your efforts here but just vendoring the Velox CMake is not the right way to do this.
The wrapper functions in Velox are a workaround because the codebase was already massive and had 100+ targets. Reducing/combining those targets is a longterm goal but wasn't feasible in the short-term, hence the workaround with the mono library.
This is not the case for verax/axiom (btw what is the right name here for what? 😁), we can just create fewer more logical targets from the start and keep think organized. I am not familiar with the code base so I don't really know what that amount is, it depends on intended usage etc. (e.g. could be libverax-optimizer, libverax-runner, or something like that or just a single library if the use case would always require everything)
|
The short-term way to get verax to work with VELOX_MONO_LIBRARY is to remove the use of |
The name is correct, as far as I know (see #211). I don't see why do we need multiple targets for this. Maybe someone need, in such case they can build with AXIOM_MONO=OFF. Also without this PR using verax is kind of painful, because VELOX_MONO just doesn't work. Can we just have solution that
Later we can refactor this. |
It's worse solution, it produces a lot of unnecessary targets |
|
With static build from source we don't need at all separate targets. At the same time, build + link time with single target (as dependency) is reduced compared to multiple dependent targets |
|
Also with separate targets build directory in CI takes a lot of more space. |
That's why I said short-term solution. The real solution is, as I explained above, to reduce the number of targets that are created. This codebase is small enough to just make that change instead of making use of a workaround from another codebase.
I don't know why you are trying to convince me that less targets are better. I know, I was the one to write |
|
@assignUser I created this discussion for velox facebookincubator/velox#14807 |
Why? What is bad about it, except it doesn't work for PUBLIC/PRIVATE/INTERFACE (can be fixed later, same in velox) |
So why don't you want to allow us (in serenedb) to build with single axiom target? |
It doesn't solve my problem, it doesn't produce single axiom target |
|
Well in theory we can make add_library( OBJECT) for separated targets, and when reference them in separated STATIC/SHARED libraries + in single(common) library. But it's complicated plus cmake doesn't work for OBJECT with cyclic dependecies |
Ok? The solution for that is to create a config for axiom like we just started adding in velox which will give you one
I don't. I just want to do it in an idiomatic CMake way instead of vendoring tech-debt from another project. (even if I created said tech-debt ;))
I agree OBJECT libraries are absolutely not the solution. I understand your need for a single target you can link against in your downstream project and I agree, that is much better DX than having to check which of the n targets is needed (well maybe outside from high-level components like libvelox-core, libvelox-gpu, ... but that's not relevant here). But let's solve the actual problem in the right way. |
Unfortunately it's not the good solution for serenedb.
I think this is reason why it's difficult to us to agree. From my point of view there's no such thing as idiomatic cmake. cmake is just configure system to get expected binaries and files in my opinion. And solution that you proposed unfortunately doesn't solve our problem (I can be wrong about this, so please correct me in such case). |
|
I don't have the time to look at the verax codebase in depth to propose a concert solution but rest assured that it is possible.
Yeah, and there is an idiomatic way to do things, so called 'modern cmake', you'll just have to believe the build engineer who does nothing but stare at CMake all day 🫠 😁
I will but won't have time for a bit to do it. I also would like some input from @mbasmanova et al |
|
Maybe I can try to explain it in a different way. If someone want and can refactor it in idiomatic cmake, ofc it will be good. Idiomatic cmake unfortunately doesn't get anything to our project. And I think it makes current state better than in main branch from any perspective (even from cmake). If it's not possible to merge this, ok, well I probably can't do anything else about it, and will maintain it as a patch |
With interface target we will link against N small libraries, and we will build N small libraries. Interface is just convenient way to link against these N libraries. It's not the same as single library |
This the whole point, no one, at least for now, have time for this. I just want to solve build issues and make it is a way better than in current main. |
No, you want to solve a problem that you have, without taking the overall code quality/tech debt into consideration. Not sure why you are constrained by disk space but the majority of size when building Axiom should come from Velox (yes we can still optimize with less targets etc.), so if you just remove the use of |
This isn't true, my branch cmake code quality is better than current main branch.
It's true for now, but why do we need to choose solution that will introduce issues in future and will be worse now?
Yes, but it will be worse than this branch solution.
It's not the only issue that I mentioned.
This is really not collaborative approach from you. You're really fight for writing At the same time I have real build issues (I need to produce single binary) and I have solution for it, on which I spend time. |
1402027 to
cff924e
Compare
|
Hi @MBkkt ,
Apologies can you educate me on why VELOX_MONO_LIBRARY (assuming you have also set VELOX_BUILD_SHARED) prevents building/using axiom ? Also looking at axiom, it seems that just linking against axiom_optimizer should help you produce your single binary. |
@kgpai Hi, ofc. There's issue related to right now for targets with
See our patch serenedb/velox@d3d3a04 to fix this and my issue #210 |
cff924e to
660a1f9
Compare
|
Hi @MBkkt ,
I also confess I dont fully understand the multiple target problem and why that is an issue, but I am keen to understand the build issues you are seeing so we can fix it and other projects can use standard cmake and make things work out of the box. |
|
Hi @kgpai
I know the reason, I can fix it in a different ways. The different ways have different tradeoffs. Fix that just replaces everything with add_library/etc, is bad IMO.
Sounds reasonable to me, its not difficult to implement.
This is different from PR approach that I discussed above with assignUser.
IMO in ideal world any C++ library can be produced with single target and library. VeloxUtils approach allows this for velox and I think we need to do same for AxiomUtils. |
|
Hi @MBkkt , Firstly thank you for patience and understanding. There are still many gaps in my understanding here - Would it be possible for you to reach out to me on slack to help me out ? My slack id is ([email protected]) . |
660a1f9 to
bfaa9f8
Compare
bfaa9f8 to
cdd7917
Compare
Adding AxiomUtils to make possible to configure
This PR also contains fixes from #460