-
Notifications
You must be signed in to change notification settings - Fork 191
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
Fix linker errors when building with shared libs on macOS Apple Silicon #6036
Fix linker errors when building with shared libs on macOS Apple Silicon #6036
Conversation
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.
We shouldn't be including the tpp
files in any hpp
s. I would expect there to be an explicit instantiation that handles this. Why is this not an issue on Linux systems? Or phrased differently, why is there no explicit instantiation for the specific case that you need already generated?
So I understand, could you please explain the problem with including top files in hpp files? I don't know why this only seems to break when I try building with shared libraries on Mac and not on Linux. This was just the first thing I learned how to do that let the shared-libraries-on-Apple-Silicon build succeed. I'd be happy to change this to adding explicit instantiations, but I wasn't sure where to add them or how many different partial derivatives instantiations I might have to add. Do you have any suggestions? |
Ah, sorry! So the idea behind So I think it should be only 1 per system. Let's chat on the technical call Thursday if you can make it to see if we can find a way that would make it 1) easy to instantiate and 2) solve the issue and allow you to build shared libs :) |
Sounds good, Nils! I should be able to make the technical call, and a discussion to find a path forward for this PR would be great. By the way, I didn't see this coming because many of our hpp's already include tpp's, including the following:
|
0d69a6f
to
8e22e65
Compare
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.
Awesome, thank you!!
You're welcome, @nilsdeppe ! @nilsvu do you still want to take a look at this PR? If so it's ready whenever you get a chance |
Proposed changes
I have succeeded in building spectre, with all tests passing, on macOS using shared libraries. (Previously, we required macOS Apple Silicon users to build with static libraries.) But to make this work, I had to fix some linker errors that appeared:
detail::initialize_coords_and_jacobians()
insrc/Elliptic/DiscontinuousGalerkin/Initialization.cpp
. Otherwise, I get an undefined symbol linker error when trying to build this file.A followup PR will update the macOS apple silicon docs.
Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments