Skip to content

Convert project build process to cmake#249

Open
ngie-eign wants to merge 1 commit into
usnistgov:masterfrom
ngie-eign:cmake
Open

Convert project build process to cmake#249
ngie-eign wants to merge 1 commit into
usnistgov:masterfrom
ngie-eign:cmake

Conversation

@ngie-eign

Copy link
Copy Markdown

In order to build this project on many operating systems (including FreeBSD, macOS with Homebrew, etc), one generally needs to reinvent the wheel in order to build the project on their target OS of choice due to issues with compilers, package pathing, etc.

This change incorporates a lot of the already invented wheels from the cmake project around OpenMP and pkg-config so the information previously hardcoded is now obtained via maintainer provided pkg-config files.

This change also makes it possible to redistribute binaries for the project and generate SBOMs for the contents in the project more easily.

Some effort is required to get this project to build with FreeBSD (see this Phabricator review for more details: https://reviews.freebsd.org/D56885).

Update .gitignore per the changes.

Tested on: FreeBSD 14.4, macOS 26.3.1
Signed-off-by: Enji Cooper yaneurabeya@gmail.com

Comment thread CMakeLists.txt Outdated
@ngie-eign ngie-eign force-pushed the cmake branch 2 times, most recently from b3cc421 to 69b0e46 Compare May 16, 2026 00:48
@celic

celic commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the contribution. Cross-platform compilation has always been tough for this project. I'm not as familiar with cmake. However we do have internal dependencies that rely on this makefile. Is it possible for both cmake and make to exist here?

@ngie-eign

ngie-eign commented May 18, 2026

Copy link
Copy Markdown
Author

Thanks for the contribution.

Of course — thank you too.

Cross-platform compilation has always been tough for this project. I'm not as familiar with cmake. However we do have internal dependencies that rely on this makefile. Is it possible for both cmake and make to exist here?

Hm. Could you please better describe the “internal dependencies”? The overarching goal of cmake is to produce portable makefiles. All that you should need to do is call cmake once, then call make as you would before (albeit with different arguments). Most of the prior calls have parallels after this change, but if you need more details, please let me know!

@celic

celic commented May 18, 2026

Copy link
Copy Markdown
Collaborator

We have a very simple build chain internally for ESVTS to run the C++ within a Docker container. Our containers use the makefile to build. This would need to be updated and tested in tandem.

As well I know of downstream users such as https://github.com/smuellerDD/jitterentropy-library/tree/master/tests/raw-entropy/validation-runtime. Getting verification from the author that removing the makefile does not disrupt their build processes would be helpful.

We have had it on the todo list for too long to enable this library on more platforms, so I am very interested in merging this in once I can test it locally. I've got an Ubuntu VM and native MacOS to try this out on. Do you have any experience running this on something like Windows Subsystem for Linux (WSL)?

In order to build this project on many operating systems (including
FreeBSD, macOS with Homebrew, etc), one generally needs to reinvent
the wheel in order to build the project on their target OS of choice
due to issues with compilers, package pathing, etc.

This change incorporates a lot of the already invented wheels from the
cmake project around OpenMP and pkg-config so the information previously
hardcoded is now obtained via maintainer provided pkg-config files.

This change also makes it possible to redistribute binaries for the
project and generate SBOMs for the contents in the project more easily.

Some effort is required to get this project to build with FreeBSD (see
this Phabricator review for more details: https://reviews.freebsd.org/D56885).

Update `.gitignore` per the changes.

Tested on:	FreeBSD 14.4, macOS 26.3.1
Signed-off-by:	Enji Cooper <yaneurabeya@gmail.com>
@ngie-eign

ngie-eign commented May 21, 2026

Copy link
Copy Markdown
Author

We have a very simple build chain internally for ESVTS to run the C++ within a Docker container. Our containers use the makefile to build. This would need to be updated and tested in tandem.

As well I know of downstream users such as https://github.com/smuellerDD/jitterentropy-library/tree/master/tests/raw-entropy/validation-runtime. Getting verification from the author that removing the makefile does not disrupt their build processes would be helpful.

Ironically, if integration is done at the cmake level, this change would make it easier to vendor the project in downstream projects (FetchContent, etc) (CC: @smuellerDD).

We have had it on the todo list for too long to enable this library on more platforms, so I am very interested in merging this in once I can test it locally. I've got an Ubuntu VM and native MacOS to try this out on. Do you have any experience running this on something like Windows Subsystem for Linux (WSL)?

I just ran the build in an Ubuntu 25.04 (Plucky) WSL2 container. I haven't verified that the content works beyond just doing a basic smoke test (getting the usage message for various utilities) on 25.04, but it definitely builds using the instructions in README.md .

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