[NFC] Makefile.defs: Improve omptest search path building#2233
Merged
mhalk merged 2 commits intoMay 29, 2026
Merged
Conversation
Use `clang -print-resource-dir` instead of manual path building - supported since at least version 18 of clang
Kewen12
reviewed
May 27, 2026
| # ompTest: Set header include path + linker flag for corresponding OMPT tests | ||
| CLANG_VERSION := $(lastword $(sort $(notdir $(patsubst %/,%,$(dir $(wildcard $(AOMP)/lib/clang/*/)))))) | ||
| OMPTEST = -I$(AOMP)/lib/clang/$(CLANG_VERSION)/include/omptest -lomptest | ||
| CLANG_RESOURCE_DIR := $(shell $(AOMP)/bin/clang -print-resource-dir) |
Contributor
There was a problem hiding this comment.
do we need to check if clang exists here?
Contributor
Author
There was a problem hiding this comment.
Good point!
AFAICT that check is done here: Makefile.defs#L44-L69
And we e.g. rely on the presence of clang here: Makefile.defs#L71
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use
clang -print-resource-dirinstead of manual path buildingMotivation
Direct improvement.
Found out about the
-print-resource-dirflag and current path building is somewhat error prone.Technical Details
This change should behave roughly as before with the difference of being maintained by upstream.
Test Plan
Few manual runs with omptest-based smoke tests.
Test Result
Headers were discovered as before.
Submission Checklist