-
Notifications
You must be signed in to change notification settings - Fork 52
Allow AOMP env var to end in lib/llvm. #1253
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
Open
gregrodgers
wants to merge
1
commit into
aomp-dev
Choose a base branch
from
allow_AOMP_to_end_in_lib_llvm
base: aomp-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,14 +31,25 @@ AOMP_VERSION_STRING=${AOMP_VERSION_STRING:-"$AOMP_VERSION-$AOMP_VERSION_MOD"} | |
ROCM_EXPECTED_MODVERSION=${ROCM_EXPECTED_MODVERSION:-6.2.4} | ||
export AOMP_VERSION_STRING AOMP_VERSION AOMP_VERSION_MOD ROCM_VERSION ROCM_EXPECTED_MODVERSION | ||
|
||
# Set install directory and the link directory. | ||
# AOMP will be a symbolic link AOMP_INSTALL_DIR is the versioned dir name | ||
AOMP=${AOMP:-$HOME/rocm/aomp} | ||
AOMP_INSTALL_DIR=${AOMP}_${AOMP_VERSION_STRING} | ||
|
||
# For example, if AOMP_REPOS=$HOME/git/aomp11, then the primary aomp repo | ||
# is stored in $HOME/git/aomp11/aomp and the mono repo is stored in | ||
# $HOME/aomp/llvm-project. | ||
# Determine AOMP_INSTALL_DIR based on AOMP and if AOMP ends in lib/llvm | ||
# strip off the lib/llvm. BUILD scripts should only use AOMP_INSTALL_DIR, not AOMP. | ||
|
||
# NOTE regarding test scripts and test makefiles: | ||
# TEST scripts or Makefiles should use AOMP env variable to find the compiler | ||
# and runtimes. AOMP has a historic default to $HOME/rocm/aomp. But with the | ||
# new convention, that follows the ROCm directory structure, AOMP should really | ||
# be set to $HOME/rocm/aomp/lib/llvm. Some test scripts detect this historic | ||
# default and add the lib/llvm to find the compiler. Since AOMP uses the same | ||
# directory structure as /opt/rocm, setting AOMP=/opt/rocm/lib/llvm will use the | ||
# ROCm compiler. | ||
|
||
AOMP=${AOMP:-$HOME/rocm/aomp} # Assume test scripts will correct this. | ||
|
||
# In case AOMP ws preset and ends in lib/llvm (like most testers correctly do), | ||
# strip off the lib/llvm to determine AOMP_INSTALL_DIR. | ||
_aomp_libllvm_stripped=${AOMP%*\/lib\/llvm} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we also make this work for |
||
AOMP_INSTALL_DIR=${AOMP_INSTALL_DIR:-${_aomp_libllvm_stripped}_${AOMP_VERSION_STRING}} | ||
|
||
AOMP_MAJOR_VERSION=${AOMP_VERSION%.*} | ||
export AOMP_MAJOR_VERSION | ||
AOMP_REPOS=${AOMP_REPOS:-${HOME}/git/aomp${AOMP_VERSION}} | ||
|
@@ -170,6 +181,10 @@ AOMP_CXX_COMPILER=${AOMP_CXX_COMPILER:-$GCCXX} | |
# Non standalone builds are done with ROCm builds. | ||
AOMP_STANDALONE_BUILD=${AOMP_STANDALONE_BUILD:-1} | ||
|
||
# BUILD scripts use the higher level AOMP_INSTALL_DIR for NON-compiler COMPONENTS | ||
# such as HIP, debugger, and profiler. Compiler COMPONENTS are installed into | ||
# the lower level LLVM_INSTALL_LOC . If LLVM_INSTALL_LOC is not set, it defaults | ||
# to AOMP_INSTALL_DIR/lib/llvm. We strongly recommend NOT overriding LLVM_INSTALL_LOC. | ||
if [ "$AOMP_STANDALONE_BUILD" == 1 ] ; then | ||
LLVM_INSTALL_LOC=$AOMP_INSTALL_DIR/lib/llvm | ||
else | ||
|
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most team members were presetting AOMP to end in lib/llvm. This strips that off to set AOMP_INSTALL_DIR. If you were using the default listed here, then nothing is stripped and build progresses correctly. However, since test scripts assume the compiler (e.g. clang++) is located at $AOMP (e.g. $AOMP/bin/clang++) , those test scripts will fail with this default value of AOMP. So a lot of people were presetting AOMP=/work/$USER/rocm/aomp/lib/llvm. Which causes build_aomp.sh to fail. This PR strips off lib/llvm for setting AOMP_INSTALL_DIR and does not modify AOMP. So now one can build if AOMP is set to something/lib/llvm.