Build error: undefined reference to `omp_get_num_threads'
Nobody has claimed this yet.
- Dominant language
- Cuda
- Stars
- 692
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
When I build my project, cmake throw three errors. I had installed openmp for my envionment.
/usr/bin/ld: /home/Software/AMGX-main/build/libamgxsh.so: undefined reference to omp_get_num_threads'
/usr/bin/ld: /home/Software/AMGX-main/build/libamgxsh.so: undefined reference to 'GOMP_parallel'
/usr/bin/ld: /home/Software/AMGX-main/build/libamgxsh.so: undefined reference to 'omp_get_thread_num'
collect2: error: ld returned 1 exit status
make[2]: *** [src/MPS/src/CMakeFiles/MPS.dir/build.make:229: src/MPS/src/MPS] Error 1
make[1]: *** [CMakeFiles/Makefile2:259: src/MPS/src/CMakeFiles/MPS.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
How to solve this problem? Is there any error in CMakeList.txt? I had downloaded latest zip file AMGX-main.zip on 17th Oct.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with CMakeLists.txt and the generated src/MPS/src/CMakeFiles/MPS.dir/build.make for the MPS target. Check how the target links the OpenMP symbols reported by the linker, then rebuild and confirm the MPS target completes without undefined-reference errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100