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

Link errors with crayclanggpu target on frontier #47

Open
philipwjones opened this issue Jan 19, 2024 · 2 comments
Open

Link errors with crayclanggpu target on frontier #47

philipwjones opened this issue Jan 19, 2024 · 2 comments
Assignees
Labels
bug Something isn't working CMake CMake-related issues Omega

Comments

@philipwjones
Copy link

When trying to build omega for gpu on frontier, I get some link errors like:

ld.lld: error: undefined symbol: __cray_sset_detect

referenced by pio_rearrange.c
pio_rearrange.c.o:(define_iodesc_datatypes) in archive ../external/scorpio/src/clib/libpioc.a
referenced by pio_rearrange.c
pio_rearrange.c.o:(compute_counts) in archive ../external/scorpio/src/clib/libpioc.a
referenced by pio_rearrange.c
pio_rearrange.c.o:(compute_counts) in archive ../external/scorpio/src/clib/libpioc.a
referenced 45 more times
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)

Poking around a bit online, it seems like people who see this with other libs seem to point to the cray wrappers (CC) as a potential source - is scorpio not being built with CC? The crayclang cpu option works fine. It only fails with a gpu build.

This was using omega_build.sh after the Cmake invocation:
cmake -DOMEGA_CIME_MACHINE=frontier -DOMEGA_CIME_COMPILER=crayclanggpu -DOMEGA_ARCH=HIP -DOMEGA_PARMETIS_ROOT=${PARMETIS_ROOT} -DOMEGA_BUILD_TEST=ON ..

@philipwjones philipwjones added bug Something isn't working Omega CMake CMake-related issues labels Jan 19, 2024
@grnydawn
Copy link

@philipwjones , Scorpio is being built with CC cray compiler wrapper, but testDecomp.exe is compiled and linked with hipcc when OMEGA_ARCH is set to HIP.
I think what happened was that the hipcc just could not find the symbols of : __cray_sset_detect and __cray_dset_detect during linking testDecomp.exe because it is not a cray wrapper.

After some tries, I found that adding C language support in "$E3SM/compoinets/omega/CMakeLists.txt" fixed the issue in my test cases:

BEFORE:
project(${OMEGA_PROJECT_NAME}
LANGUAGES CXX
)
AFTER:
project(${OMEGA_PROJECT_NAME}
LANGUAGES C CXX
)

Adding C language support seems to configure several language-specific cmake-internal variables such as MPI flags, additional library for linking, etc. While it is not clear to me why the change fixed this issue, so far all the tests that I have done were passed on Frontier.

@philipwjones
Copy link
Author

Interesting...thanks for tracking it down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CMake CMake-related issues Omega
Projects
None yet
Development

No branches or pull requests

2 participants