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

fix[next]: Default to Release in CMake #1420

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions src/gt4py/next/otf/compilation/build_systems/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CMakeFactory(
"""Create a CMakeProject from a ``CompilableSource`` stage object with given CMake settings."""

cmake_generator_name: str = "Ninja"
cmake_build_type: BuildType = BuildType.DEBUG
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DropD please check if the default make sense in 3 different places and consider this example in the configuration project

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, sort of. I would argue that CMakeProject does not need to have a default value, since we never instanciate it directly. It makes sense though, that the factories can have separate default values.
Consider that using pure cmake leads to slightly simpler debugging, and in debugging the compilation times might not be as crucial.

There is, therefore an argument for leaving the default for CMakeFactory at DEBUG, while changing it to RELEASE for CompiledbFactory... However, in practice this might be more consfusing than helpful...

cmake_build_type: BuildType = BuildType.RELEASE
cmake_extra_flags: Optional[list[str]] = None

def __call__(
Expand Down Expand Up @@ -105,7 +105,7 @@ class CMakeProject(
source_files: dict[str, str]
program_name: str
generator_name: str = "Ninja"
build_type: BuildType = BuildType.DEBUG
build_type: BuildType = BuildType.RELEASE
extra_cmake_flags: list[str] = dataclasses.field(default_factory=list)

def build(self):
Expand Down
2 changes: 1 addition & 1 deletion src/gt4py/next/otf/compilation/build_systems/compiledb.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CompiledbFactory(
Generate a compiledb only if there isn't one for the given combination of cmake configuration and library dependencies.
"""

cmake_build_type: cmake.BuildType = cmake.BuildType.DEBUG
cmake_build_type: cmake.BuildType = cmake.BuildType.RELEASE
cmake_extra_flags: list[str] = dataclasses.field(default_factory=list)
renew_compiledb: bool = False

Expand Down