-
Notifications
You must be signed in to change notification settings - Fork 1.3k
mumps: Update to 5.8.2 and enable CLANG builds #27438
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
base: master
Are you sure you want to change the base?
Conversation
3aefd22 to
b749515
Compare
|
I had atomic issue on CLANG* in #26410, but adding edit: oops, that wasn't CLANG* issue... |
|
I tried |
❯ pkgfile libatomic.a
mingw64/mingw-w64-x86_64-gcc
ucrt64/mingw-w64-ucrt-x86_64-gcc
msys/gcc
msys/mingw-w64-cross-mingw32-gcc
msys/mingw-w64-cross-mingw64-gcc
msys/mingw-w64-cross-mingwarm64-gcc
msys/mingw-w64-cross-ucrt64-gcc |
|
@ognevny but none of them have the -clang- prefix, right? I found all those too, with |
yes, none of clang packages has libatomic |
|
Well, once this #27437 is done, I got mumps building for clang64 and clangarm64 :) |
|
well, not all dependencies seem to be satisfied (from CLANG64 log): |
The official msmpi should be installed by the user manually, mingw-w64-msmpi contains just import libraries. |
8fe0b11 to
beaea34
Compare
9688444 to
b04a664
Compare
|
Maybe, I'm reading the changes wrong. But would it even be possible to link to the dll with these changes to the pkg-config files? |
89edc3b to
636f91f
Compare
|
@mmuetzel Yeah, I see what you are saying, the changes are actually much easier. I'll fix it. I saw all those .a files and thought that this was build statically, but it's a DLL. Would linking to the output of |
636f91f to
fc536e9
Compare
It appears that the pkgconf file originally only had the static libraries, right? |
mingw-w64-mumps/PKGBUILD
Outdated
| Cflags: -I\${includedir} -I\${includedir}/mumps/mpi_seq | ||
| Libs.private: -fopenmp -lmumps-${x}to -lesmumps ${_fc_libs} | ||
| Libs: -lmumps-${x}to | ||
| Libs: -lmumps-${x}to.dll |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't that mean that you would link to the dll and the static archives if you query the static linker flags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I'm asking, I'm very sorry. I'm not a pkgconf guy :(.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hmartinez82 Please remove that extra .dll, It does not serve any purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so I tested. and yes you are right, --static includes both Libs.Private and Libs
What should I do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.dll removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous flags are correct. If you'd like to link statically, you'd add -static to the flags for the linker driver, and it would prefer static archives (*.a) over import libraries (*.dll.a) or dlls.
So, the goal should be that there is (at least) one static library with the same base name as the shared library (dll).
If I understand correctly, that didn't work with the LLVM toolchain because it can't create thin archives.
One possible way to work around that (untested) could be to manually extract all objects from the existing archives and create a new archive using something like this:
for x in c z s d; do
mkdir tmp-mumps-${x}so
cd tmp-mumps-${x}so
ar x ../lib${x}mumps_seq.a
ar x ../libmumps_common_seq.a
ar x ../libmumps_pord.a
ar x ../libmumps_mpi_seq.a
ar crs ../libmumps-${x}so.a *.o
cd ..
rm -rf tmp-mumps-${x}so
mkdir tmp-mumps-${x}to
cd tmp-mumps-${x}to
ar x ../lib${x}mumps_shm.a
ar x ../libmumps_common_shm.a
ar x ../libmumps_pord.a
ar x ../libmumps_mpi_seq.a
ar crs ../libmumps-${x}to.a *.o
cd ..
rm -rf tmp-mumps-${x}to
[your commands to create the dlls go here]
if [[ ${CARCH} == x86_64 ]]; then
mkdir tmp-mumps-${x}mo
cd tmp-mumps-${x}mo
ar x ../lib${x}mumps_mpi.a
ar x ../libmumps_common_mpi.a
ar x ../libmumps_pord.a
ar crs ../libmumps-${x}mo.a *.o
cd ..
rm -rf tmp-mumps-${x}mo
[your commands to create the dll go here]
fi
done
I guess llvm-ar would be able to do that. But I haven't tested that yet.
If that works, it shouldn't be necessary to change the pkg-config files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
llvm-ar can create thin archives from, but not from other archives. The issue is that lib${x}mumps_seq.a, libmumps_common_seq.a, etc are already archives themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
llvm-ar can create thin archives from, but not from other archives. The issue is that
lib${x}mumps_seq.a,libmumps_common_seq.a, etc are already archives themselves.
This is why I was suggesting to extract the objects from the static libraries (with ar x) and then recreating the static library (with the correct name) from the extracted object files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested that approach in the MINGW64 and the CLANG64 environment. And it seems to be working.
The package size would increase because we'd essentially distribute the objects twice in different archives. But it should behave identically for anyone that is linking to the installed binaries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you could probably also add an empty archive with the base name of the dll and add the actual archives to the Libs.private line in the pkg-config file.
fc536e9 to
e86faa5
Compare
No. It had both. The flags in the lines with |
e86faa5 to
764558a
Compare
764558a to
5a7b3d6
Compare
|
Looking the build artifacts that |
|
@mmuetzel That I don't now :-( . I think that that's something only the project devs would be able to answer. I've tried to stay as close as possible to the original package recipe. |
Requires #27437