-
Notifications
You must be signed in to change notification settings - Fork 369
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
FORTLINK: Guess if Unknown #1126
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@JBlaschke can you add this line to your code to find out what
FortranCInterface_GLOBAL_SUFFIX
is in your case please?What's the full cmake output (including compiler identifications) if you add this? I fear the picked up C compiler and Fortran compiler might truly be incompatible. If that is the case, we might better error out with a meaningful message here instead of guessing and causing a hard to debug runtime error.
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.
Hi Axel -- I don't think your thesis matches reality :( another beautiful theory slain by and ugly fact. Here is the full cmake output:
(note: I'm using fish -- so
-DCMAKE_C_COMPILER=(which gcc-8)
is equivalent to-DCMAKE_C_COMPILER=$(which gcc-8)
)I think the problem is that cmake -- for reasons that are above my pay grade -- can't figure out the Fortran/C interface:
But I also don't know how to coax any information out of cmake RE what it actually tried to do there, and why it failed to compile.
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 added your warnings, and I get:
This means that the
FortranCInterface_GLOBAL_PREFIX
is empty -- probably not being set because the C/Fortran interface determination fails 😢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.
Thank you for those details. That explains a lot... very empty action there is.
Probably one can spot it here:
There is a
try_compile
being called which fails:https://gitlab.kitware.com/cmake/cmake/-/blob/v3.17.3/Modules/FortranCInterface/Detect.cmake#L31-41
According to the docs we can pass
--debug-trycompile
to thecmake ..
call to get more verbose output about this.cmake \ -DENABLE_PARTICLES=ON \ -DENABLE_AMRDATA=ON \ -DENABLE_EB=ON \ -DENABLE_OMP=ON \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_INSTALL_PREFIX="." \ -DCMAKE_C_COMPILER=(which gcc-8) \ -DCMAKE_CXX_COMPILER=(which g++-8) \ -DCMAKE_Fortran_COMPILER=(which gfortran-8) \ --debug-trycompile ..
(Note:
-DCMAKE_INSTALL_PREFIX="."
looks dangerous, this will at some point interleave temporary build files with install files onmake install
.)Maybe we already see more CMake output, but otherwise we should get files in
<bindir>/CMakeFiles/CMakeTmp
. We should potentially do abetween the two
include()
lines https://github.com/AMReX-Codes/amrex/blob/development/Tools/CMake/AMReX_Defines.cmake#L96 to get the latesttry_compile
files in that temporary directory.I would be curious why this compile failed for you...
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.
When I do this, I get (in the
CMakeError.log
) this:The problem was that my macOS install has howebrew's
binutils
in thePATH
(which comes with the wrong sort ofar
util) -- removing this fromPATH
fixes the problem.Cheers!