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

CMakeLists.txt Missing from LZ4 v1.9.4 Tag on Both macOS and Windows Systems #1366

Open
WoodrowLove opened this issue Feb 18, 2024 · 2 comments

Comments

@WoodrowLove
Copy link

Description:
I am encountering a repeatable issue where the CMakeLists.txt file appears to be missing when checking out the LZ4 v1.9.4 tag during Docker builds on two separate systems: a Mac Mini with Apple M2 chip running MacOS Sonoma and a PC with Windows 11 using a Linux subsystem (Ubuntu). The Dockerfile aims to clone and build the LZ4 source as part of setting up an XRPL node. The process is successful up to the point of executing cmake for LZ4, at which it fails, indicating the absence of CMakeLists.txt in the expected directory.

Expected Behavior:
The CMakeLists.txt should be present in the root of the LZ4 repository when the v1.9.4 tag is checked out, allowing for the successful execution of cmake and subsequent build steps.

Steps to Reproduce:

  1. Create a Dockerfile to set up an XRPL node with LZ4 as a dependency.
  2. Use the command git clone --branch v1.9.4 https://github.com/lz4/lz4.git to clone the LZ4 repository.
  3. Run git checkout v1.9.4 and then attempt to build with cmake.

System:

  • Mac Mini (Apple M2, MacOS Sonoma)
  • PC (Windows 11, 12th Gen Intel Core i7-12700H, x64-based processor, Linux subsystem with Ubuntu)
  • Docker version: 4.27.2 (137060)
  • Compiler: Apple clang version 15.0.0 (clang-1500.1.0.2.5)
    Target: arm64-apple-darwin23.3.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Additional Context:
This issue persists across different operating systems and hardware, suggesting a potential discrepancy in the v1.9.4 tag of the LZ4 repository. Similar issues were not present in earlier versions/tags tried, and the problem is consistent with two different setups, indicating it is not isolated to a single environment.

Title: Difficulties Encountering and Resolving lz4Config.cmake File Issues When Building LZ4

Description:
In addition to the previously mentioned CMakeLists.txt absence, I'm also facing challenges concerning the lz4Config.cmake file when attempting to build LZ4 from source during Docker builds. The expected behavior is for the lz4Config.cmake or lz4-config.cmake file to be generated upon a successful installation of LZ4, which CMake can then use to find and link against LZ4. Despite following standard build procedures, this configuration file is not being created or is not located by CMake, leading to build failures and necessitating workarounds.

This issue arises even after ensuring correct repository cloning and following LZ4's build instructions, pointing towards potential gaps in the build/install scripts or CMake configuration for the LZ4 project.

I've encountered this problem on both macOS and Windows (with WSL), which suggests a broader inconsistency with the LZ4 build process as it relates to CMake integration.

@WoodrowLove
Copy link
Author

Any suggestions on this issue? Anyone?

@laszlo-dobcsanyi
Copy link
Contributor

Hey 👋

CMakeLists.txt is usually in the root directory of projects where it is the primary build system, however this is not the case for many projects like LZ4 which only provide support for it.

The CMake setup is located in build/cmake subdirectory, which you can specify when generating CMake via the -S option. So after cloning the repository step 3 could be cmake -S lz4/build/cmake -B _build to generate a out-of-source build and step 4 could be cmake --build _build to actually build all targets.

Your other issue seams to be missing config files. Those files are only generated and copied to the appropriate directory in case you install LZ4 - maybe you are just building it? For instance to install to the default directory, step 5 could be cmake --install _build.

Hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants