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

Allow AOMP env var to end in lib/llvm. #1253

Open
wants to merge 1 commit into
base: aomp-dev
Choose a base branch
from

Conversation

gregrodgers
Copy link
Contributor

Historically the AOMP environment variable was intended to indicate where to install the AOMP compiler, AND for test scripts to identify where the compiler to test is found. For example clang++ is in $AOMP/bin/clang++. But we made a change to build and install AOMP using the ROCm installation directory structure, where compiler components go in the directory lib/llvm. Build scripts were changed to install compiler components in $AOMP_INSTALL_DIR/lib/llvm and non-compiler components such as debugger, hipcc, etc get installed in $AOMP_INSTALL_DIR . For the most part, we did NOT change testing scripts. That is, they expect to find clang++ at $AOMP/bin/clang++ etc. So for testing, AOMP should be set to AOMP_INSTALL_DIR/lib/llvm.

But what about build? What should AOMP be set to? We need to assume that AOMP is always pointing to the lowerer level directory (./lib/llvm) where the compiler is installed. This allows us to test ROCm, and trunk-built compilers. So if you dont want the script default to AOMP, set it to $HOME/rocm/aomp/lib/llvm. This set of changes will set AOMP_INSTALL_DIR to the higher level directory by setting AOMP_INSTALL_DIR to AOMP stripped of "lib/llvm" and adding on the version number. It also enforces that the stripped directory (without the version number) does not exist or is a symbolic link. The build_project.sh script will continue to link the versioned directory (e.g. aomp__21.0-0) to the stripped directory (aomp) upon successful compiler installation to AOMP_INSTALL_DIR/lib/llvm.

There are clarifying comments added to aomp_common_var.

# 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.
Copy link
Contributor Author

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.


# 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}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also make this work for AOMP=/usr/lib/aomp/llvm?

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.

3 participants