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

add cmake support for Tpetra_ENABLE_DEPRECATED_CODE #3742

Merged
merged 4 commits into from
Jan 16, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/tpetra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ TRIBITS_ADD_SHOW_DEPRECATED_WARNINGS_OPTION()

TRIBITS_SET_ST_FOR_DEV_MODE(ST_FOR_DEV_PT_FOR_RELEASE)

# gcd 26 Oct 2018: Part of the great de-templating effort,
# allows users to switch at CMake time between using the old template
# parameters, using Tpetra_ENABLE_DEPRECATED_CODE. By default,
# this will be set to "ON", to keep old behaviors.

SET (Tpetra_ENABLE_DEPRECATED_CODE_DEFAULT ON)
MESSAGE (STATUS "Determine whether Tpetra will enable ordinal template arguments and dynamic allocation. By default, this will be ON.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please just specify a general message here. "Whether Tpetra enables deprecated code at compile time. Default is ON (deprecated code enabled)." We plan on using this macro in the future, for deprecating other things that we inevitably will want to deprecate :-) . This also imitates Kokkos, which uses its macro in a generic way, for all deprecated features.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Thanks


# mfh 06 Nov 2017: Do users want to build Tpetra with CUDA enabled?
# This doesn't meant that users actually want to instantiate Tpetra
# objects for CUDA. See Trilinos GitHub issue #1939.
Expand Down
8 changes: 8 additions & 0 deletions packages/tpetra/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ TRIBITS_ADD_EXPLICIT_INSTANTIATION_OPTION()
# template instantiation (ETI).
TRIBITS_ADD_ETI_SUPPORT()

# adding macro for deprecated code (templated L0 and G0, and dynamic allocation)
TRIBITS_ADD_OPTION_AND_DEFINE(
Tpetra_ENABLE_DEPRECATED_CODE
TPETRA_ENABLE_DEPRECATED_CODE
"Disable Tpetra deprecated code (templated ordinal types and dynamic graph/matrix allocation)"
Tpetra_ENABLE_DEPRECATED_CODE_DEFAULT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to dereference the default value here. Do this:

${Tpetra_ENABLE_DEPRECATED_CODE_DEFAULT}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I did need that for the default.

)

ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_EXPLICIT_INSTANTIATION)
# FIXME (mfh 17 Dec 2014) We really just want a macro, not a CMake option.
# This is mainly just for backwards compatibility.
Expand Down
3 changes: 3 additions & 0 deletions packages/tpetra/core/cmake/TpetraCore_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#define TPETRACORE_CONFIG_H
/* CMake uses this file to generate TpetraCore_config.h automatically */

/* define if user is using the deprecated codebase (templated ordinals, dynamicprofile) or not */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above. "Deprecated code" is a generic thing; we should not refer to specifically deprecated features here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

#cmakedefine TPETRA_ENABLE_DEPRECATED_CODE

/* define if new form of std::count is supported */
#cmakedefine HAVE_STD_NEW_COUNT_SYNTAX

Expand Down