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

Error when Linking against OpenMP #14

Closed
wangyiqiu opened this issue May 25, 2022 · 3 comments · Fixed by #21
Closed

Error when Linking against OpenMP #14

wangyiqiu opened this issue May 25, 2022 · 3 comments · Fixed by #21

Comments

@wangyiqiu
Copy link

wangyiqiu commented May 25, 2022

I was trying to use ParlayLib's algorithm with OpenMP, because I used ParlayLib in a project of ours. A user encountered segmentation faults coming from the scheduler when they try to run the code on Linux Mint 20.2, X5675 CPU and CentOS Stream 9, Dual X5670. I was thinking a quick workaround is to run the code using an alternative scheduler like OpenMP, but still using ParlayLib's algorithms.

However, when I try to compile with OpenMP, I encountered errors containing:

multiple definition of `parlay::in_par_do';

I tried to link against OpenMP using multiple repositories using ParlayLib, but got the same error. The error can be reproduced like this:

git clone -b openmp https://github.com/ParAlg/ParGeo.git pargeo
cd pargeo
git submodule init
git submodule update
mkdir build
cd build
cmake ..
make -j

Specifically, I wasn't sure if my CMake setting is correct.

Here's the full error message:

/usr/bin/ld: ../src/enclosingBall/sampling/libsamplingSebLib.a(seb.cpp.o):(.bss+0x0): multiple definition of `parlay::in_par_do'; CMakeFiles/smallestEnclosingBall.dir/smallestEnclosingBall.cpp.o:(.bss+0x20): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [example/CMakeFiles/smallestEnclosingBall.dir/build.make:85: example/smallestEnclosingBall] Error 1
make[1]: *** [CMakeFiles/Makefile2:1547: example/CMakeFiles/smallestEnclosingBall.dir/all] Error 2
@DanielLiamAnderson
Copy link
Contributor

A fix for this will be coming in #21, but we are still investigating a related bug, so it's not quite ready yet. Apologies for the delay, hopefully it will be good soon!

DanielLiamAnderson added a commit that referenced this issue Aug 9, 2022
…dded type, and CI (#21)

- Improvements to Parlay's allocators
  - parlay::allocator and parlay::type_allocator are now lock-free
  - parlay::allocator and parlay::type_allocator now guarantee proper alignment for all over-aligned types
  - parlay::p_malloc now accepts an optional alignment argument
  - Substantial code cleanup for block_allocator and pool_allocator
- New type in <parlay/utilities.h>: parlay::padded, which cache-line pads an arbitrary type
- Improvements to sequence:
  - parlay::sequence elements can now be constructed via implicit conversions
  - parlay::tabulate now allows non-copyable types to be constructed by copy eliding
- Improvements to OpenMP support:
  - Fixed linker error in OpenMP scheduler plugin (fixes #14)
  - Fixed bug in OpenMP scheduler plugin that led to duplicate worker IDs, which broke Parlay's allocator
- CI improvements:
  - CI runs now test OpenMP
  - Updated compiler and tool versions in CI
  - Added CI workflow that checks that the project version number is incremented during pull requests
@DanielLiamAnderson
Copy link
Contributor

This should be fixed now!

@wangyiqiu
Copy link
Author

wangyiqiu commented Aug 10, 2022

I will tryout the update soon, and let you know if we encounter other problems. Thank you Daniel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants