Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

CMake: SHELL: Escape Combined Flags Missing on Cray CC? #12

@ax3l

Description

@ax3l

Migrated from originally:

Flags like these -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false:
https://github.com/ROCm-Developer-Tools/hipamd/blob/d2d2cacfe210307ec10c77400e1dafdeafefbc0f/hip-config.cmake.in#L225

Need to be escaped with SHELL:, otherwise CMake will de-duplicate the -llvm part and then they are not passed as intented in the compile line (e.g., they become -mllvm -amdgpu-early-inline-all=true -amdgpu-function-calls=false and the 2nd flag is ignored).
Update: oh, maybe they are (see comment).

It looks like these flags are not present when compiling through HPE/Cray Compiler wrappers (CC) on OLCF Crusher (ROCm 4.5.2).

[ 17%] Building CXX object _deps/localamrex-build/Src/CMakeFiles/amrex.dir/LinearSolvers/MLMG/AMReX_MLTensorOp.cpp.o
/sw/crusher/spack-envs/base/opt/linux-sles15-x86_64/gcc-7.5.0/ccache-4.4.2-p3gb734ehpc3nfdqv3sxf7itxq5uvpmq/bin/ccache /opt/cray/pe/craype/2.7.13/bin/CC -D__HIP_PLATFORM_AMD__=1 -D__HIP_PLATFORM_HCC__=1 -I/ccs/home/huebl/src/amrex/Src/Base -I/ccs/home/huebl/src/amrex/Src/Base/Parser -I/ccs/home/huebl/src/amrex/Src/Boundary -I/ccs/home/huebl/src/amrex/Src/AmrCore -I/ccs/home/huebl/src/amrex/Src/LinearSolvers/MLMG -I/ccs/home/huebl/src/amrex/Src/Particle -I/ccs/home/huebl/src/warpx/build_crusher/_deps/localamrex-build -isystem /opt/rocm-4.5.2/llvm/lib/clang/13.0.0/include/.. -isystem /opt/rocm-4.5.2/hip/include -isystem /opt/rocm-4.5.2/hiprand/include -isystem /opt/rocm-4.5.2/rocrand/include -isystem /opt/rocm-4.5.2/rocprim/include -I/opt/rocm-4.5.2/include -O3 -DNDEBUG -m64 -munsafe-fp-atomics -x hip --offload-arch=gfx90a -std=c++17 -MD -MT _deps/localamrex-build/Src/CMakeFiles/amrex.dir/LinearSolvers/MLMG/AMReX_MLTensorOp.cpp.o -MF CMakeFiles/amrex.dir/LinearSolvers/MLMG/AMReX_MLTensorOp.cpp.o.d -o CMakeFiles/amrex.dir/LinearSolvers/MLMG/AMReX_MLTensorOp.cpp.o -c /ccs/home/huebl/src/amrex/Src/LinearSolvers/MLMG/AMReX_MLTensorOp.cpp

fatal error: error in backend: Error while trying to spill SGPR4_SGPR5 from class SReg_64: Cannot scavenge register without an emergency spill slot!
clang-13: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Cray clang version 13.0.0  (24b043d62639ddb4320c86db0b131600fdbc6ec6)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/cray/pe/cce/13.0.0/cce-clang/x86_64/share/../bin
clang-13: note: diagnostic msg: Error generating preprocessed source(s).
gmake[2]: *** [_deps/localamrex-build/Src/CMakeFiles/amrex.dir/build.make:1630: _deps/localamrex-build/Src/CMakeFiles/amrex.dir/LinearSolvers/MLMG/AMReX_MLTensorOp.cpp.o] Error 70
gmake[1]: *** [CMakeFiles/Makefile2:910: _deps/localamrex-build/Src/CMakeFiles/amrex.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

CC @TomSang @yxsamliu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions