sandialabs / compadre

Compadre (Compatible Particle Discretization and Remap)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create TriBITS Build Alongside Raw CMake Build

jmgate opened this issue · comments

Part of #164.

What Needs to Be Done?

We are unable to get Compadre into Trilinos without first getting it building via TriBITS. One way to do this involves inserting a TriBITS build system alongside the raw CMake build system that already exists in Compadre. This includes the following steps:

  • Insert the include_tribits_build macro into the root CMakeLists.txt file.
  • Modify the root CMakeLists.txt file to include the following logic:
    if (${PROJECT_NAME}_TRIBITS_DIR)
      # Insert magic for TriBITS build.
    else()
      # Insert raw CMake build.
    endif()
  • Insert include_tribits_build() as the first line of all other CMakeLists.txt files.
  • Create CMakeLists.tribits.cmake files as siblings to all other CMakeLists.txt files, and insert the necessary TriBITS magic to do the equivalent to what's in the sibling file.
  • Make sure everything builds both ways.

@bartlettroscoe, Compadre includes a header-only TPL that's snapshotted into its source in src/tpl/nanoflann.hpp. How do I include that sucker in the TriBITS build? It doesn't look like including it in TRIBITS_REPOSITORY_DEFINE_TPLS() is the right thing to do. Does something still belong in TPLsList.cmake though? Alternatively, should I just treat it as one of the package's header files instead of as a TPL?

Compadre includes a header-only TPL that's snapshotted into its source in src/tpl/nanoflann.hpp

@jmgate, For now, to make your life easy, just treat as regular header files that belong to the Compadre package.

NOTE: In general it is ill advised to unconditionally build an external TPL in a your package since it causes integration problems down the line. See the M12 "For external dependencies, allow installing, building, and linking against an outside copy of external software in the document:

In the near future, TriBITS will support building this as an either internal package or point to an external pre-installed package (i.e. TPL). This is what the work in TriBITSPub/TriBITS#63 and TriBITSPub/TriBITS#299 will allow (which I am supposed to be working on right now instead of ATDM :-( ). That will satisfy that policy M12.

Hey @kuberry, is your examples directory really examples, or is it tests? If both, any chance we could subdivide it such that theres an examples directory along with a tests one?

Hi @jmgate, it is both the executables for the tests as well as the test. The test adding could be done in a tests folder. So yes, they can be divided.

Do the executables for the tests get run on their own as examples, or are they just there for the sake of the tests?

Both. They both demonstrate the ability to solve many different PDEs and also they exercise portions of the code base. We don't have any 'gold-file' type tests. Most tests either get the exact solution using a polynomial manufactured solution or perform a convergence study and check the rates.