-
Notifications
You must be signed in to change notification settings - Fork 370
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
Windows (Shared): omp_locks
failed Symbol
#3795
Comments
I think in practice, ChatGPT has this opinion:
It suggests to use a |
## Summary Use a plain C array over a `std::array` for `omp_locks`. Primarily because this causes linker issues on MSVC/Clang-Cl, secondarily because `omp_locks` might violate in some implementations the type requirements of `std::array` (MoveConstructible and MoveAssignable type `T`). https://en.cppreference.com/w/cpp/container/array ## Additional background Potentially a fix for #3795 Testing in conda-forge/impactx-feedstock#28 ## Checklist The proposed changes: - [x] fix a bug or incorrect behavior in AMReX - [ ] add new capabilities to AMReX - [ ] changes answers in the test suite to more than roundoff level - [ ] are likely to significantly affect the results of downstream AMReX users - [ ] include documentation in the code and/or rst files, if appropriate
Make `omp_locks` a variable in an unnamed namespace instead of an extern global variable. This might potentially fix the Windows symbol issue (AMReX-Codes#3795).
Make `omp_locks` a variable in an unnamed namespace instead of an extern global variable. This might potentially fix the Windows symbol issue (AMReX-Codes#3795).
Make `omp_locks` a variable in an unnamed namespace instead of an extern global variable. This might potentially fix the Windows symbol issue (AMReX-Codes#3795).
Make `omp_locks` a variable in an unnamed namespace instead of an extern global variable. This might potentially fix the Windows symbol issue (#3795).
WarpX does not add amrex/Tests/OpenMP/atomicAdd/main.cpp Line 37 in 2cd72a3
https://github.com/search?q=repo%3AECP-WarpX%2FWarpX%20lockAdd&type=code Even though it has a default and should not need it, maybe that confuses MSVC... We could try that as a patch to |
With the new test added in AMReX via #3805, I suspect a toolchain issue in conda-forge causes this.... |
@isuruf noticed: Might be technically an alias, but is weird: I can reproduce this: if I inspect the latest .dll with radare2 I also see: $ rabin2 -s amrex_3d.dll
...
3352 0x00054390 0x180054f90 GLOBAL FUNC 0 amrex_3d.dll
?get_lock@OpenMP@amrex@@YAPEAPEAXH@Z
void * __ptr64 * __ptr64 __cdecl amrex::OpenMP::get_lock(int)
...
19 0x003e97c0 0x1803ea3c0 NONE FUNC 0 libomp.dll imp.omp_destroy_lock
20 0x003e97c8 0x1803ea3c8 NONE FUNC 0 libomp.dll imp.omp_get_max_threads
21 0x003e97d0 0x1803ea3d0 NONE FUNC 0 libomp.dll imp.omp_get_num_threads
22 0x003e97d8 0x1803ea3d8 NONE FUNC 0 libomp.dll imp.omp_get_thread_num
23 0x003e97e0 0x1803ea3e0 NONE FUNC 0 libomp.dll imp.omp_in_parallel
24 0x003e97e8 0x1803ea3e8 NONE FUNC 0 libomp.dll imp.omp_init_lock
25 0x003e97f0 0x1803ea3f0 NONE FUNC 0 libomp.dll imp.omp_set_num_threads
... |
This comment was marked as resolved.
This comment was marked as resolved.
We can also try to switch from Clang-CL back to MVSC and the new LLVM support in it: |
Fixed |
This is a Windows (shared/DLL) specific build regression to #3696.
Since this PR / the
24.02
release, we cannot build WarpX and ImpactX on Conda-Forge with a shared AMReX dependency anymore, due to this error:It is not clear to me why this happens. I checked:
clang-cl
) & linker (lld-link
) used for AMReX and applicationMaybe we need to try a standard C array instead?
The text was updated successfully, but these errors were encountered: