Skip to content

Conversation

mosullivan93
Copy link
Contributor

@mosullivan93 mosullivan93 commented May 23, 2023

Basically I got annoyed that my Ubuntu 20.04 machine couldn't compile the benchmarks so I looked into it. I also updated the Makefile to have some available compiler smarts like Meson. Closes #44.


On systems with glibc < 2.34, the -lpthread option needs to be included when linking with Google's benchmark and test frameworks. However, the pkg-config command for benchmark needs to be explicitly given the --static flag for this to be included. The static inclusion has also been added to the Meson configuration.

I've also included some rudimentary logic to allow the Makefile to shrink the scope of its compilation targets when an older compiler is being used. I changed the benchmarks to run using benchmark_main in the same way that the tests use gtest_main. Finally, I turned off compilation of the package-internal tests for Google Benchmarks when running in GitHub actions.

On systems with glibc < 2.34, the `-lpthread` option needs to be
included when linking with Google's benchmark and test frameworks.
However, the `pkg-config` command for `benchmark` needs to be explicitly
given the `--static` flag for this to be included. The static inclusion
has also been added to the Meson configuration.

I've also included some rudimentary logic to allow the Makefile to
shrink the scope of its compilation targets when an older compiler is
being used. I changed the benchmarks to run using `benchmark_main` in
the same way that the tests use `gtest_main`. Finally, I turned off
compilation of the package-internal tests for Google Benchmarks when
running in GitHub actions.
Copy link
Member

@r-devulap r-devulap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank for you fixing it :)

@r-devulap r-devulap merged commit 1473250 into numpy:main May 25, 2023
@mosullivan93 mosullivan93 deleted the build-updates branch May 26, 2023 02:47
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.

Benchmarks can't be compiled on older platforms

2 participants