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 script regex match patterns has unnecessary kleenes #1040

Closed
zao opened this issue Jan 6, 2014 · 2 comments
Closed

CMake script regex match patterns has unnecessary kleenes #1040

zao opened this issue Jan 6, 2014 · 2 comments
Assignees
Labels
category: CMake difficulty: easy Good issues for starting out with HPX development type: enhancement
Milestone

Comments

@zao
Copy link
Contributor

zao commented Jan 6, 2014

Several of the string(REGEX MATCH patterns in the CMake scripts surround the pattern with .* on one or both sides. This is unnecessary as this kind of pattern only needs to match the part that it tries to match.

On my FreeBSD machine with Clang 3.3, the pattern in cmake/HPX_Compile.cmake:91 [1] tries to match across 120 kilobytes of linker errors and doesn't terminate in acceptable timescales (still hung after ten minutes of saturation).

Removing the .* parts results in an acceptable sub-second match attempt.

There seems to be more occurrences of unnecessary wildcards in the codebase as well, but none that trigger performance cliffs on my system.

[1] ".*(argument unused during compilation|unknown warning option).*"

@hkaiser
Copy link
Member

hkaiser commented Jan 6, 2014

Would you care to provide a patch?

zao added a commit to zao/hpx that referenced this issue Jan 6, 2014
Some of the string(REGEX MATCH) operations surround the pattern
with ".*", causing the CMake process to effectively wedge when
trying to match on larger (100KiB) bodies of input.

This commit removes those parts without any change in semantics
as MATCH patterns only need to match the actual match.

This should fix bug STEllAR-GROUP#1040.
zao added a commit to zao/hpx that referenced this issue Jan 6, 2014
Some of the string(REGEX MATCH) operations surround the pattern
with ".*", causing the CMake process to effectively wedge when
trying to match on larger (100KiB) bodies of input.

This commit removes those parts without any change in semantics
as MATCH patterns only need to match the actual match.

This should fix bug STEllAR-GROUP#1040.
@K-ballo
Copy link
Member

K-ballo commented Jan 6, 2014

Thank you!

@K-ballo K-ballo closed this as completed Jan 6, 2014
@ghost ghost assigned zao Jan 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: CMake difficulty: easy Good issues for starting out with HPX development type: enhancement
Projects
None yet
Development

No branches or pull requests

3 participants