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

add support for the CMAKE_PARAMS environment variable #510

Merged
merged 2 commits into from
Sep 6, 2024

Conversation

jschauma
Copy link
Contributor

@jschauma jschauma commented Sep 5, 2024

I was unable to convince fullbuild.sh to use the right OpenSSL library from /opt/lib64 by setting OPENSSL_ROOT_DIR=/opt nor by setting OPENSSL_INSTALL=/opt or other variations I tried. It seemed I needed to invoke cmake with -DOPENSSL_CRYPTO_LIBRARY="/opt/lib64/libcrypto.so", but there was no obvious way to get this flag passed into the script.

Adding a generic CMAKE_FLAGS environment variable allows me to pass this flag and would allow others to set additional flags they might need, and falls in line with common Unix practice of supporting e.g., CFLAGS, LDFLAGS etc.

Perhaps this is useful to somebody else.

@jschauma jschauma requested a review from baentsch as a code owner September 5, 2024 01:30
Copy link
Member

@baentsch baentsch 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 the contribution, @jschauma . Basically LGTM. Just one nit: What's the advantage of naming this variable "CMAKE_FLAGS"? The name "CMAKE_PARAMS" would be more in line with its "sibling" parameters... If you'd agree, please just update the PR, I'd squash-merge afterwards.

@baentsch
Copy link
Member

baentsch commented Sep 5, 2024

Ah, and please "sign" your commit (option -s) to confirm you're OK with the project's license terms (making the bean-counters at LinuxFoundation happy), i.e., so the "DCO" test passes. The other CI failures are due to a recent upstream merge that should be resolved by merging #461.

@jschauma jschauma changed the title add support for the CMAKE_FLAGS environment variable add support for the CMAKE_PARAMS environment variable Sep 5, 2024
@jschauma
Copy link
Contributor Author

jschauma commented Sep 5, 2024

Ok, just 'git commit -s'd the s/FLAGS/PARAMS/ change.

@beldmit
Copy link
Contributor

beldmit commented Sep 5, 2024

@jschauma does it mean that it becomes possible to build all the chain (openssl => liboqs => oqs-provider) without installing the previous components?

@jschauma
Copy link
Contributor Author

jschauma commented Sep 5, 2024

I had installed OpenSSL manually into /opt, then ran

env OPENSSL_ROOT=/opt CMAKE_PARAMS="-DOPENSSL_CRYPTO_LIBRARY=/opt/lib64/libcrypto.so" bash scripts/fullbuild.sh

and that built liboqs and oqs-provider successfully. I didn't test having fullbuild.sh build OpenSSL (mainly because I didn't want bleeding edge from git, but a stable release).

@baentsch
Copy link
Member

baentsch commented Sep 5, 2024

it becomes possible to build all the chain (openssl => liboqs => oqs-provider) without installing the previous components?

This precisely is the purpose of the script from the start (and it is used in this way in CI to build-test the chain). The most important env var to set IMO, though, is OPENSSL_BRANCH: If not set, any openssl (>=3.0) available will be used and no from-scratch build is done.

@baentsch baentsch merged commit 2cdbc17 into open-quantum-safe:main Sep 6, 2024
23 of 26 checks passed
@jschauma
Copy link
Contributor Author

jschauma commented Sep 6, 2024

Thanks for merging!

@baentsch
Copy link
Member

baentsch commented Sep 6, 2024

Thanks for merging!

Thanks for improving the system!

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.

3 participants