Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

[Issue]: lld: error: undefined symbol: memcpy #65

Closed
Ashutosh-Londhe opened this issue Feb 20, 2024 · 4 comments
Closed

[Issue]: lld: error: undefined symbol: memcpy #65

Ashutosh-Londhe opened this issue Feb 20, 2024 · 4 comments
Assignees

Comments

@Ashutosh-Londhe
Copy link

Problem Description

I am getting lld: error: undefined symbol: memcpy error when compiling with rocm compiler

my command is this:
/ext-home/asl/install/openmpi/rocm5.6/install/bin/mpicxx -O3 -fPIC -Wall -g -std=c++11 -fopenmp -fopenmp -fopenmp=libomp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx908 -DOPS_MPI -I/ext-home/asl/OPS_cg/OPS/ops/c/include -L/ext-home/asl/OPS_cg/OPS/ops/c/lib/clang laplace2d_ops.cpp -I. ./openmp_offload/openmp_offload_kernels.cpp -lops_mpi_ompoffload -o laplace2d_mpi_ompoffload

i have set CC=clang and CXX=clang++
i am using rocm5.6.0

Operating System

Ubuntu 20.04.6

CPU

AMD EPYC 7543 32-Core Processor

GPU

AMD Instinct MI100

ROCm Version

ROCm 5.6.0

ROCm Component

No response

Steps to Reproduce

No response

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

@lamb-j lamb-j self-assigned this Feb 27, 2024
@lamb-j
Copy link
Collaborator

lamb-j commented Feb 27, 2024

Thanks for reporting, I'm looking into this.

Can you provide the source files used in your compilation command, or are they available somewhere I can access?

@lamb-j
Copy link
Collaborator

lamb-j commented Feb 27, 2024 via email

@Ashutosh-Londhe
Copy link
Author

Hi,

I am trying this with OpenSource DSL library OPS
https://github.com/OP-DSL/OPS.git

After cloning, you first need to install the OPS C library, for which instructions can be found at
https://ops-dsl.readthedocs.io/en/latest/installation.html#using-makefiles
you can use the file source_amd_rocm-5.4.3_pythonenv present in OPS/scripts folder for setting up the required environment for Make

once the library build is finished, you can try building laplace example available in
"OPS/apps/c/laplace2d_tutorial/step7"
1. Open the Makefile and uncomment the following line (second last) include $(OPS_INSTALL_PATH)/../makefiles/Makefile.c_app_legacy #uncomment and comment the last line include $(OPS_INSTALL_PATH)/../makefiles/Makefile.c_app #comment 2. run the command to build MPI+OpenMP_offload target make laplace2d_mpi_ompoffload

@Ashutosh-Londhe
Copy link
Author

Hi @lamb-j

I was able to resolve this issue. I had this memcpy inside an OpenMP offload loop so it was expecting a device version for the same.
I was earlier trying with PGI compiler, where i think they had it so not coming across this error with PGI.
After replacing memcpy with normal for loop, the error is resolved.

@lamb-j lamb-j closed this as completed Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants