Skip to content
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 support #33

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

CMake support #33

wants to merge 4 commits into from

Conversation

eifrah-aws
Copy link

@eifrah-aws eifrah-aws commented Feb 4, 2025

With this PR, valkey-search can be built with CMake.

Build instructions where added to the BUILD_cmake.md.

Point to take into consideration while reviewing this PR:

OpenSSL

OpenSSL used, is the system SSL (this is similar to how valkey works)

Submodules

Submodules are being pulled and built during the cmake stage. The first time you run cmake it might took a while (due to git clone + build), consecutive calls for cmake are much faster.

The rationale behind this, is that submodules are rarely changed so there is no need to rebuild them after each make call (even if CMake will just report Built target)

How to build & run

To build:

mkdir build-release
cd $_
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)

To run:

valkey-server --loadmodule lib/valkeysearch.so

Copy link
Collaborator

@yairgott yairgott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for driving this! I left a couple of comments inside, PTAL.

Copy link
Collaborator

@yairgott yairgott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the tests are missing

@eifrah-aws eifrah-aws requested a review from yairgott February 12, 2025 15:14
@yairgott
Copy link
Collaborator

The changes look good to me! I noticed there are still two unresolved comments: porting the tests and build.sh. I’ll do a more thorough review once those are addressed.

Signed-off-by: Eran Ifrah <[email protected]>
- Added LTO to the various targets
- Match compile flags as defined in `.bazelrc` to CMake
- Fixed typo
- Suppressed warnings
- Creaet symbolik link for compile_commands.json

Signed-off-by: Eran Ifrah <[email protected]>
- Build tests
- Added build script (run: build.sh --help)

Signed-off-by: Eran Ifrah <[email protected]>
@eifrah-aws eifrah-aws force-pushed the cmake branch 3 times, most recently from fb309bc to 9a31afc Compare February 17, 2025 06:40
@eifrah-aws eifrah-aws requested a review from yairgott February 17, 2025 07:21
@eifrah-aws eifrah-aws force-pushed the cmake branch 2 times, most recently from 88cfc96 to 3efea19 Compare February 18, 2025 09:57
- Changed clone URL to https version
- Updated BUILD_cmake.md
- Fixed LTO build error for UT
- build.sh script: added --run-test option
- Added missing build flags: -DBAZEL_BUILD, -Wno-unknown-pragmas
- Ensured that all UT are passing
- Do not rebuild on consecutive calls for cmake when nothing was changed
- Added missing tests: vmsdk/testing
- Reduced CMake requirement to 3.16
- Fixed memory allocation test on GCC 13
- Added script timer
- Support build on arm

Signed-off-by: Eran Ifrah <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants