Skip to content

Remove custom pytensor flags or move them to pytensor #7520

Open
@ricardoV94

Description

@ricardoV94

If these flags are needed for PyMC they are also needed for PyTensor. Doesn't make sense to have them here.

pymc/pymc/__init__.py

Lines 27 to 46 in 45069a9

def __set_compiler_flags():
# Workarounds for PyTensor compiler problems on various platforms
import pytensor
current = pytensor.config.gcc__cxxflags
augmented = f"{current} -Wno-c++11-narrowing"
# Work around compiler bug in GCC < 8.4 related to structured exception
# handling registers on Windows.
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782 for details.
# First disable C++ exception handling altogether since it's not needed
# for the C extensions that we generate.
augmented = f"{augmented} -fno-exceptions"
# Now disable the generation of stack unwinding tables.
augmented = f"{augmented} -fno-unwind-tables -fno-asynchronous-unwind-tables"
pytensor.config.gcc__cxxflags = augmented
__set_compiler_flags()

This somehow lead to problems in the CI of pymc-experimental (band-aid in pymc-devs/pytensor#1009) but that's not super relevant for the question here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions