-
Notifications
You must be signed in to change notification settings - Fork 90
Build fixes #5
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
Build fixes #5
Conversation
This set some very important global variables and makes sure that finding modules works as expected. As a side effect, compilers cannot be explicitly set according to Trilinos' configuration. This shouldn't happen in the main CMakeLists.txt anyways, though.
Hi Nico, Could you explain a bit more about the requirement that the compilers be specified in the Albany cmake config line? My understanding is that currently that information is provided by the Trilinos install's TrilinosConfig.cmake. Albany reads that information and sets the compilers accordingly. Hence I think the Albany build's compilers are automatically consistent with the Trilinos ones. Thanks, |
The
(One can certainly find a reference in the CMake docs for that, too.) The error-on-compiler-mismatch is the best way I've found dealing with this. See the sample |
Btw, do we really need C and Fortran compilers here? |
Let's back up a bit. Currently, Albany's CMakeLists.txt does this: SET(CMAKE_CXX_COMPILER ${Trilinos_CXX_COMPILER} ) Then, a few lines later, it issues the project command: PROJECT(Albany) Perhaps we could modify this line to PROJECT(Albany C CXX Fortran) as you suggest. But I don't see why we can't continue to use the Trilinos_*_COMPILER data. I might be missing something, but the current procedure seems to prevent mismatch errors entirely, and it saves users and tests build scripts from having to manually map Trilinos compilers -> Albany compilers. |
|
Is the requirement that PROJECT be set before FIND_PACKAGE new? |
Not that I knew, and I don't know the details. I vaguely remember having had similar problems once. I'll hit the CMake mailing list to gather some details on this. |
http://public.kitware.com/pipermail/cmake/2015-April/060322.html: |
All, I'm not going to accept this pull request at this time. Another Albany dev should feel free to do so if desired. My reasoning is as follows. Nico brings up a good point about Albany's configuration: evidently, Albany won't configure correctly with the PROJECT and FIND_PACKAGE order currently used if Trilinos is configured with -DTrilinos_USE_GNUINSTALLDIRS:BOOL=ON. However, the order that is used allows Albany to determine the compilers used to build the Trilinos installation, thus saving having to specify them again. I prefer to keep this feature. Additionally, at least at this time, Albany's configuration seems not to be preventing Nico's progress on his modifications to I think Tribits, so I don't feel that there's any immediate need to make a decision on this configuration issue. Again, others should feel free to chime in. Thanks, |
We might introduce an option to distinguish between Nico's preferred build behavior (representing users who want to use the Trilinos_USE_GNUINSTALLDIRS=ON installation configuration) and the current build. |
Changes committed. Nico tested these. Closing this PR. Thanks Nico! |
This pull request adds
project(Albany CXX C Fortran)
, a command that sets important CMake-internal variables crucial forfind_package()
. It also enforces proper compiler selection which now has to happen on terminal level whencmake
is invoked, e.g.,If the selected compilers don't match the Trilinos compilers, an error is thrown.
With the changes of this PR,
find_package(Trilinos REQUIRED)
works are expected.The PR also fixes underlinking in
libAlbany
andlibAlbanySTK
(see bug #3).