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 configuration error #120

Closed
victimsnino opened this issue Sep 1, 2023 · 5 comments · Fixed by #121
Closed

Cmake configuration error #120

victimsnino opened this issue Sep 1, 2023 · 5 comments · Fixed by #121
Labels
bug:confirmed Something isn't working (confirmed)
Milestone

Comments

@victimsnino
Copy link

Hi. With last version of snitch i'm getting following error during configuration:

[cmake] CMake Error (dev) at build/_deps/snitch-src/CMakeLists.txt:52 (set):
[cmake]   uninitialized variable 'BUILD_SHARED_LIBS'
@tocic
Copy link
Member

tocic commented Sep 2, 2023

Looks like you use cmake -B "build/" -S . --warn-uninitialized -Werror=dev or an equivalent configure preset. We can get rid of this error by providing an explicit option(BUILD_SHARED_LIBS ...).
At the moment, you can get rid of this error by either changing your warnings options (remove --warn-uninitialized or -Werror=dev or add -Wno-error=dev) or explicitly defining the variable (-D BUILD_SHARED_LIBS:BOOL="ON" or -DBUILD_SHARED_LIBS=OFF). Using SNITCH_HEADER_ONLY also helps, see https://github.com/cschreib/snitch/blob/main/CMakeLists.txt.

@victimsnino
Copy link
Author

I'm getting it during configuring my own project where snitch fetched during configuration. So, suppression of all cmake warnings is not an option - I want to see my own :)
Fixed by defining BUILD_SHARED_LIBS but ideally, I expect, snitch should fix it by its own

@cschreib
Copy link
Member

cschreib commented Sep 2, 2023

Thanks both for reporting and pinpointing the issue. I've never used CMake warning levels, so I had assumed that CMake was always defining BUILD_SHARED_LIBS (to YES or NO). Should have know better than to assume something about CMake :)

Indeed there is something we can do to fix the warning on our end, I'll prepare a PR. I might turn on these warnings in CI as well, so it doesn't happen again.

@cschreib cschreib added the bug:confirmed Something isn't working (confirmed) label Sep 2, 2023
@cschreib cschreib added this to the v1.2.1 milestone Sep 2, 2023
@cschreib
Copy link
Member

cschreib commented Sep 2, 2023

This is now fixed in the main branch. I'll probably issue another release (1.2.1) when more fixes have accumulated.

@cschreib
Copy link
Member

cschreib commented Sep 3, 2023

v1.2.1 is now released with the fix. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:confirmed Something isn't working (confirmed)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants