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

Issue with rapidjson when building #147

Closed
jmpfar opened this issue Apr 15, 2024 · 4 comments
Closed

Issue with rapidjson when building #147

jmpfar opened this issue Apr 15, 2024 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@jmpfar
Copy link

jmpfar commented Apr 15, 2024

Hi, really nice library! ☄️

When building the project I got the following error from cmake:

fatal: could not create work tree dir '/rapidjson': Read-only file system
/usr/bin/cd: line 4: cd: /rapidjson: No such file or directory
CMake Error at /usr/local/lib/cmake/vrslib/cmake/FindRapidjsonLib.cmake:33 (message):
  Could not setup rapidjson external dependency at /rapidjson
Call Stack (most recent call first):
  /usr/local/lib/cmake/vrslib/cmake/LibrariesSetup.cmake:29 (find_package)
  /usr/local/lib/cmake/vrslib/vrslibConfig.cmake:45 (include)
  /Users/x/.../CMakeLists.txt:20 (find_package)

After reading a bit of the cmake code and the python library I realized what was missing is the following line:

set(EXTERNAL_DEPENDENCIES_DIR "${CMAKE_BINARY_DIR}/external")

It looks like it is either something specific to my environment (MacOS) or something missing from the docs. Also currently the make files triggers a git clone on clean build, it'd be nice if that could be changed as it slows down builds and adds a networking dependency 🙏

@jmpfar jmpfar added the documentation Improvements or additions to documentation label Apr 15, 2024
@georges-berenger
Copy link
Contributor

EXTERNAL_DEPENDENCIES_DIR should always end up being set by this code , which is at the top of the cmake code. I'm not sure how it's not set for you, but you need to make sure to include that top cmake file, that's a requirement. The other cmake lists should not be accessed directly.

@jmpfar
Copy link
Author

jmpfar commented Apr 15, 2024

Hey, thanks for the reply!
So my flow was as mentioned here:

I compiled and installed the library locally, I then added find_package(vrslib REQUIRED) to my cmake file. That line failed with the above mentioned error. So reading your response, do you think I should have imported that CMakeLists.txt file manually because for some reason it wasn't included on its own?

@georges-berenger
Copy link
Contributor

The code I pointed to sets EXTERNAL_DEPENDENCIES_DIR if it's not set externally, which is an optional customization option given to the users of the library. You need to debug why it's not happening for you, because you should not get to the FindRapidjsonLib.cmake file without going through that code first.
I'm not sure I understand your question. The only CMakeLists.txt in the vrs project you should use directly is the top one, in the main folder.

@jmpfar
Copy link
Author

jmpfar commented Apr 15, 2024

Alright, I wasn't aware that cmake is supposed to import a library's CMakeLists.txt in find_package but I only recently started working with it so that makes perfect sense. If that's the case then this sounds like this is an issue in my specific environment

Feel free to close, in any case it might be helpful to anyone seeing the same error

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

No branches or pull requests

2 participants