-
Notifications
You must be signed in to change notification settings - Fork 77
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
Link errors when running ESMF tests with ESMF_SHARED_LIB_BUILD=OFF on Darwin-gfortranclang #112
Comments
@billsacks have you tried appending |
@theurich - I have confirmed that adding |
@billsacks - thanks for confirming that this works. I also have been thinking about this from a different angle after I made my previous suggestion. Basically my thinking is that since we are setting
|
This is needed to access functions from the C++ standard library; otherwise, we get link errors when building with ESMF_SHARED_LIB_BUILD=OFF. We could alternatively specify -lstdc++, and that seems to solve the problem in at least some cases, but this may lead to problems such as those with exception handling that we encountered when linking with gfortran, which led us to use the C++ linker when linking Fortran programs. So this use of the C++ linker when linking C programs is analogous to the use of the C++ linker when linking Fortran programs with this compiler combination. See #112 for details.
Thanks, @theurich . I have made that change as well as similar changes for the various MPI compilers in 55a6394. I'll run some testing now to verify that it solves the problem - both with ESMF_SHARED_LIB_BUILD=OFF, and via the test scripts on green. Assuming all looks good, I'll merge that to develop. This does make me wonder if changes might be needed on other platforms to support the ESMF_SHARED_LIB_BUILD=OFF case. Do you think that's worth testing (e.g., I'm picturing a temporary branch that sets ESMF_SHARED_LIB_BUILD=OFF by default and then having all of our nightly testing point to that branch for a night... but I don't know if that might run into other issues if ESMF_SHARED_LIB_BUILD=OFF isn't a well-supported / well-tested option?) |
@billsacks that looks good. Thanks for moving this forward. I think general testing with For the Darwin issue, it raises the issue of whether we should include ESMF_SHARED_LIB_BUILD=OFF` in a formal test that is run when Green or Grit do their testing. Of course that adds extra cycles to the testing. It is a bit along the lines of the ticket esmf-org/esmf-test-scripts#86 that talks about testing the various ESMF_TEST_ options. Right now all our testing is done with the same options. At one point though I guess we just test for the most common combos, and take a more relaxed approach for the rest, i.e. deal with it once we (or a user) notices something is broke. It's just always a question of where that line is drawn. |
I have verified that the changes in 55a6394 solve the issue with ESMF_SHARED_LIB_BUILD=OFF, and tests pass in standard testing as well (i.e., with ESMF_SHARED_LIB_BUILD=ON). I'll merge that to develop. |
On my Mac (green, using Darwin-gfortranclang), I'm getting link errors when running ESMF tests with ESMF_SHARED_LIB_BUILD=OFF (things work fine without that setting). The problem seems to come from the recent change to use mpicc instead of mpicxx as a linker: When I run one of the link commands by hand with the now-standard mpicc as a linker:
I get a ton of link errors: see attachment.
link_errors.txt
The link works fine if I use mpicxx instead of mpicc.
The text was updated successfully, but these errors were encountered: