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
major cmake overhaul: #1902, #1930, #2026, #2027, #2099 #2104
Conversation
this shoudldn't be merged in yet we need to do some testing. |
CONFIGURE_FILE(kokkos.pc.in kokkos.pc @ONLY) | ||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/kokkos.pc DESTINATION lib/pkgconfig) | ||
#CONFIGURE_FILE(kokkos.pc.in kokkos.pc @ONLY) | ||
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/kokkos.pc DESTINATION lib/pkgconfig) |
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.
Did you mean to comment these?
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.
Sort of? I should delete it here. It's in the kokkos_install.cmake file now.
Issue #2161 opened to address this.
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 would prefer to revert these changes for now
|
||
SET(SOURCES "") | ||
SET(SOURCES G2L_Main.cpp) |
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'd say don't even bother with the variable :)
ELSEIF(FOUND_HPX_ROOT) | ||
SET(HPX_ROOT ${FOUND_HPX_ROOT}) | ||
ENDIF() | ||
ENDIF() |
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 find this block quite confusing. I suppose it is meant to help the downstream package to locate the same HPX that was found when building Kokkos.
Only the _DIR
variable makes sense to me because AFAIU CMake sets it to the directory containing the configuration file provided by the package that was found. Also this seems to be the only invariant in the search procedure over the last few versions of CMake.
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.
Also why would we do that for HPX
and not for other dependencies that might have been enabled at the time Kokkos was built? Specifically I am thinking about MEMKIND
, HWLOC
, or Threads
.
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.
HPX is the only TPL right now loaded directly via find_package
without a find module. CMake will attempt to load this downstream dependency automatically when a project does find_package(Kokkos)
so we need to make sure CMake has the correct HPX_DIR
hwloc and memkind, as far as I can tell, are private dependencies. The headers/libraries should not be necessary to have downstream. If these were public, we would need to do some extra work to make sure the imported Kokkos::hwloc
target can be found.
TARGET_COMPILE_OPTIONS(${TARGET} ${ARGN}) | ||
else() | ||
TARGET_COMPILE_OPTIONS(${TARGET} ${ARGN}) | ||
endif() |
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.
Uhhh?
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.
These used to be different. And then I changed tribits. And now they are same. Totally logical!
I also get
with the current version using
|
@masterleinad It is a known issue with |
Using
I currently get
when building. |
yes, type-o. This used to be a generator expression. If you want to continue, just delete the
in kokkos_tribits.cmake. I will fix in the next commit. |
MACRO(GLOBAL_APPEND VARNAME) | ||
SET(TEMP ${VARNAME}) | ||
LIST(APPEND TEMP ${ARGN}) | ||
GLOBAL_SET(${VARNAME} ${TEMP}) |
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.
GLOBAL_SET(${VARNAME} ${TEMP}) | |
SET(VARNAME "${VARNAME};${TEMP}" CACHE INTERNAL "") |
This didn't work for me. I ended up with KOKKOS_CUDA_OPTIONS
(literally) showing up in the compile arguments.
cmake/kokkos_tribits.cmake
Outdated
) | ||
SET(NODEDUP_CUDAFE_OPTIONS) | ||
FOREACH(OPT ${NODEDEUP_CUDAFE_OPTIONS}) | ||
LIST(APPEND NODEDUP_CUDAFE_OPTIONS "SHELL: -Xcudafe ${OPT}") |
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.
LIST(APPEND NODEDUP_CUDAFE_OPTIONS "SHELL: -Xcudafe ${OPT}") | |
LIST(APPEND NODEDUP_CUDAFE_OPTIONS -Xcudafe ${OPT}) |
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.
Is this breaking your build? If you don't have the SHELL part, then CMake will deduplicate all the -Xcudafe flags, which you don't want.
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.
Yes, it is breaking my build. I get
/tmp/kokkos/bin/nvcc_wrapper -I/tmp/kokkos/build_cmake/build/core/src -I/tmp/kokkos/core/src -I/tmp/kokkos/build_cmake/build -mavx "SHELL: -Xcompiler -fopenmp" -std=c++11 -std=gnu++11 -o CMakeFiles/kokkoscore.dir/impl/Kokkos_CPUDiscovery.cpp.o -c /tmp/kokkos/core/src/impl/Kokkos_CPUDiscovery.cpp
g++: error: SHELL:: No such file or directory
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.
What version of cmake are you using? Looks like I had my versions wrong. This didn't get added until 3.12, but I set minimum to 3.10.
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.
@crtrott: Do we have any scenarios where we pass more than one -Xcudafe flag to the compiler? The only one I see right now is --diag_suppress=esa_on_defaulted_function_ignored
. If we need to support more than one -Xcudafe
we will need to bump minimum to 3.12.
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 was using CMake 3.10.2
.
cmake/kokkos_tribits.cmake
Outdated
IF(KOKKOS_XCOMPILER_OPTIONS) | ||
SET(NODEDUP_XCOMPILER_OPTIONS) | ||
FOREACH(OPT ${KOKKOS_XCOMPILER_OPTIONS}) | ||
LIST(APPEND NODEDUP_XCOMPILER_OPTIONS "SHELL: -Xcompiler ${OPT}") |
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.
LIST(APPEND NODEDUP_XCOMPILER_OPTIONS "SHELL: -Xcompiler ${OPT}") | |
LIST(APPEND NODEDUP_XCOMPILER_OPTIONS -Xcompiler ${OPT}) |
With these last changes, I can at least build |
@masterleinad @jjwilke I am in favor to support finding Kokkos in the build directory but let's tackle that in a separate PR. |
Using the cmake |
Sure, it's not crucial. |
@masterleinad Daniel you got anything else problematic which needs to be resolved before we merge this finally? |
@jjwilke do you got more stuff we need to get in before merging? |
I am done except for Trilinos testing. Features and documentation are complete. @dalg24? The only sort of pending issue is #2161. pkgconfig has its idiosyncracies that don't map well to modern C++ (or projects mixing C/C++ for that matter). I don't know that we made a final decision on whether we want to install a .pc file. If not, I should probably remove all the pkgconfig stuff. |
Looking at the output of testing this pull request using
|
Forcing the relevant libraries to be found via something like
resolves that problem. |
Ah, I see the code. So the issue is that we don't error out if the library is not found rather than a transitive dependency issue? |
Yes, exactly. |
As far as I am concerned, the pull request looks OK now. |
OK the error was a system issue when trying to run the clang-format test. This is fine. I gonna pull the trigger .......... |
@jjwilke : is it possible to have KokkosConfig to contain "Kokkos_COMPILE_FLAGS" ? |
Kokkos_INCLUDE_DIRS needs to be deleted for the same reason we don't have a Kokkos_COMPILE_FLAGS. The necessary flags should be added transitively when you Do you have a special use case for needing |
@jjwilke : addind kokkos to the list of libraries when we call |
@ipdemes Do you see the correct flags in
works fine for us. |
@ipdemes I'ill bounce this over to the issue tracker |
@masterleinad : Yes I see correct flags in "INTERFACE_COMPILE_OPTIONS" for kokkoscore |
@masterleinad @jjwilke :I have found the issue in our cmake set-up and it seems like Kokkos works now |
No description provided.