Skip to content
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

Several issues with new CMake build infrastructure (reported by Eric Phipps) #1365

Closed
etphipp opened this issue Jan 25, 2018 · 7 comments
Closed
Assignees
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)
Milestone

Comments

@etphipp
Copy link
Contributor

etphipp commented Jan 25, 2018

I have a (non-Trilinos) project that builds Kokkos with CMake inline with the rest of the project, and I have come across a few issues with the CMake build infrastructure that was updated recently (this is with the latest Kokkos master).

  1. You now have to use CMake version 3.3 or greater, even though it only checks for version 3.1 or greater. The issue is in kokkos_build.cmake you have
target_compile_options(
    kokkoscore
    PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${KOKKOS_CXX_FLAGS}>
  )

and $<COMPILE_LANGUAGE:CXX> is a valid generator expression only in cmake 3.3 or greater. With 3.2.2 I get

  Error evaluating generator expression:

    $<COMPILE_LANGUAGE:CXX>

  Expression did not evaluate to a known generator expression
  1. There appears to be no way to set the HWLOC path. If I enable HWLOC and set KOKKOS_HWLOC_DIR to its installation directory, I get:
/home/etphipp/project/tensors/genten/genten/kokkos/core/src/impl/Kokkos_hwloc.cpp:221:19: fatal error: hwloc.h: No such file or directory
 #include <hwloc.h>

Looking through the CMake logic in Kokkos, it appears that KOKKOS_HWLOC_DIR is a valid option, but it is never used anywhere. Setting HWLOC_PATH doesn't work either.

  1. At the end of the configure, Kokkos spews out some annoying output:
CMake Warning at kokkos/cmake/tribits.cmake:6 (MESSAGE):
  The project name is: Kokkos
Call Stack (most recent call first):
  kokkos/CMakeLists.txt:50 (include)


-- ProjectName: Kokkos
-- Tests: OFF
-- ProjectName: Kokkos
-- Tests: OFF
-- ProjectName: Kokkos
-- Tests: OFF
-- ProjectName: Kokkos
-- Tests: OFF
-- ProjectName: Kokkos
-- Tests: OFF

It would be nice if this could be cleaned up.

@etphipp
Copy link
Contributor Author

etphipp commented Jan 25, 2018

Another issue:
4. If I make a CMakeLists.txt change and run "make" as usual, I now get the error:

CMake Error at kokkos/cmake/kokkos_settings.cmake:20 (message):
  SNB,Kepler35 is not an accepted value for KOKKOS_ARCH.  Please pick from
  these choices: None

         AMDAVX
         ARMv80
         ARMv81
         ARMv8-ThunderX
         WSM
         SNB
         HSW
         BDW
         SKX
         KNC
         KNL
         BGQ
         Power7
         Power8
         Power9
         Kepler
         Kepler30
         Kepler32
         Kepler35
         Kepler37
         Maxwell
         Maxwell50
         Maxwell52
         Maxwell53
         Pascal60
         Pascal61

It looks to me that the KOKKOS_ARCH list I specify as

-D KOKKOS_ARCH="SNB;Kepler35"

is internally being transformed to "SNB,Kepler35", which is no longer valid CMake list syntax. To work around this I now have to blow away the CMakeCache.txt and reconfigure from scratch each time I make a change that requires a reconfigure.

@mhoemmen
Copy link
Contributor

(following)

@ibaned ibaned self-assigned this Jan 26, 2018
@ibaned ibaned added this to the 2018 April milestone Jan 26, 2018
@ibaned ibaned added the Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) label Jan 26, 2018
@ibaned
Copy link
Contributor

ibaned commented Jan 26, 2018

@etphipp Thanks for reporting!
My recent pull request #1361 should fix the 4th item you raised.
Also my pull request #1346 fixes part of the annoying output (the warning in the 3rd item), but not the repeated stuff after it.

@crtrott
Copy link
Member

crtrott commented Jan 26, 2018

We can kill that project output alltogether, I don't think we care.

ibaned added a commit to ibaned/kokkos that referenced this issue Feb 1, 2018
see issue kokkos#1365:
$<COMPILE_LANGUAGE:CXX>
is only understood by CMake 3.3 and up
@ibaned
Copy link
Contributor

ibaned commented Feb 1, 2018

@etphipp I just created a branch and pull request to fix all the remaining issues: #1382. Would you be able to check out that branch and confirm whether it fixes all of this for you?

@ibaned ibaned modified the milestones: 2018 April, 2018 February Feb 1, 2018
@etphipp
Copy link
Contributor Author

etphipp commented Feb 1, 2018

HWLOC is still not working. I have -D KOKKOS_HWLOC_DIR=/usr/local/software/hwloc/current and you can see that it still isn't being added to the include path:

[  1%] Building CXX object kokkos/CMakeFiles/kokkos.dir/core/src/impl/Kokkos_hwloc.cpp.o
cd /home/etphipp/project/tensors/genten/build/opt_intel_inline/kokkos && /home/software/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/icpc    -I/home/etphipp/project/tensors/genten/genten/kokkos/core/src -I/home/etphipp/project/tensors/genten/genten/kokkos/containers/src -I/home/etphipp/project/tensors/genten/genten/kokkos/algorithms/src -I/home/etphipp/project/tensors/genten/build/opt_intel_inline/kokkos  -g -xHost -restrict -gxx-name=g++-4.9 -g   --std=c++11 -mavx -fopenmp -o CMakeFiles/kokkos.dir/core/src/impl/Kokkos_hwloc.cpp.o -c /home/etphipp/project/tensors/genten/genten/kokkos/core/src/impl/Kokkos_hwloc.cpp
/home/etphipp/project/tensors/genten/genten/kokkos/core/src/impl/Kokkos_hwloc.cpp(221): catastrophic error: cannot open source file "hwloc.h"
  #include <hwloc.h>

@ibaned
Copy link
Contributor

ibaned commented Feb 9, 2018

I think all the items in this issue have been fixed after a series of several pull requests. This will all be available on master and in Trilinos at the next Kokkos release.

@crtrott crtrott changed the title Several issues with new CMake build infrastructure Several issues with new CMake build infrastructure (reported by Eric Phipps) Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)
Projects
None yet
Development

No branches or pull requests

5 participants