Commit e787f015 authored by Patrick McCormick's avatar Patrick McCormick
Browse files

More work to sort through adding the Realm ABI target into the build

system w/ realm as a FetchContent component.  This means some dependency
and target work within cmake, some ordering details about where the
FetchContent occurs, and also some fixes to the code base that were lost
for realm support (e.g., missing switch entries).

There is some point where the overall cmake config becomes more difficult
to reason about than the llvm+clang+... source code.  ;-)

A few additional fixes for the config file (.cfg) settings and supporting
cmake pieces.  The default config files are autogenerated to handle both
the in-tree and install use cases.  It is probably worth tailoring for
your own use cases at some point but adding them to your user directory.

TODO: there is currently a "collision" between the use of a cmake option
and the ABI libraries to build within kitsune.  At present you will have
both enable and add the abi library to the configuration (see the cache
file under kitsune/cmake/caches/kitsune-dev.cmake).
parent fcf3c0b5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ if (KITSUNE_ENABLE_REALM_TARGET)
      STRING "Link library flags (-L, -lxx) needed for the Realm runtime ABI target.")
  #
  configure_file(${CLANG_SOURCE_DIR}/kitsune/realm.cfg.in
      ${LLVM_BINARY_DIR}/share/kitsune/${KITSUNE_REALM_TARGET_CFG_FILENAME})
      ${LLVM_BINARY_DIR}/share/kitsune/${TAPIR_REALM_TARGET_CFG_FILENAME})
endif()

option(KITSUNE_ENABLE_CUDATK_TARGET
+16 −8
Original line number Diff line number Diff line
# Flags for the Kokkos mode (-fkokkos).
# CXX flags
# Flags for the Kokkos mode (-fkokkos).  Note that link libraries used
# here can end up out of order and cause the associated symbols to be
# flagged as missing at link time.  The driver will add the kokkos
# libraries to the argument list automatically but you may need to
# tweak the search paths depending upon your use case.
#
#
${KITSUNE_KOKKOS_CXX_FLAGS}

# in-tree paths
-I${LLVM_BINARY_DIR}/kokkos/core/src/
-I${LLVM_BINARY_DIR}/kokkos/containers/src/
-I${LLVM_BINARY_DIR}/runtimes/runtimes-bins/_deps/kokkos-build/
-L${LLVM_BINARY_DIR}/runtimes/runtimes-bins/_deps/kokkos-build/core/src/
# install paths
-I${CMAKE_INSTALL_PREFIX}/include
-I${CMAKE_INSTALL_PREFIX}/include/kokkos
-L${CMAKE_INSTALL_PREFIX}/lib/
-Wl,--start-group
${KITSUNE_KOKKOS_LINK_LIBS_FLAGS}
--end-group
+10 −2
Original line number Diff line number Diff line
# Flags for the Realm runtime ABI target.
${KITSUNE_REALM_TARGET_EXTRA_LINK_FLAGS} ${KITSUNE_REALM_TARGET_LINK_LIBS_FLAGS}
# Flags for -ftapir=realm.  Note that link libraries used here can end up
# out of order and cause the associated symbols to be flagged as missing
# at link time.  The driver should now add the realm libraries but we will
# control the library search paths from here.

# in-tree paths
-L${LLVM_BINARY_DIR}/runtimes/runtimes-bins/kitsune/runtimes/realm/
-L${LLVM_BINARY_DIR}/runtimes/runtimes-bins/_deps/realm-build/lib/

# install paths
-L${CMAKE_INSTALL_PREFIX}/lib
+1 −0
Original line number Diff line number Diff line
@@ -857,6 +857,7 @@ bool Driver::readConfigFile(StringRef FileName) {

    for(Arg *A: *NextCfgOpts)
      CfgOptions->append(A);
    NextCfgOpts.release();
  }

  if (CfgOptions->hasArg(options::OPT_config)) {
+10 −0
Original line number Diff line number Diff line
@@ -1190,6 +1190,16 @@ void ToolChain::AddTapirRuntimeLibArgs(const ArgList &Args,
  case TapirTargetID::Realm:
    if (! KITSUNE_ENABLE_REALM_TARGET)
      getDriver().Diag(diag::warn_drv_realm_target_disabled);
    else {
      CmdArgs.push_back("-lrealm-abi");
      CmdArgs.push_back("-lrealm");
      CmdArgs.push_back("-lpthread");
      CmdArgs.push_back("-ldl");
      CmdArgs.push_back("-lrt");
      #if defined(KITSUNE_REALM_EXTRA_LINK_LIBS)
      ExtractArgsFromString(KITSUNE_KOKKOS_EXTRA_LINK_LIBS, CmdArgs, Args);
      #endif
    }
    break;

  case TapirTargetID::Cuda:
Loading