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

Require C++14 / remove Cygwin #1367

Merged
merged 2 commits into from Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -76,8 +76,8 @@
* Class names use `InitialCapsNames`
* Methods use `camelCaseNames`
* Do not indent the contents of namespaces
* Code should follow the C++11 standard, with minimum required compiler versions
GCC 4.8, Clang 3.4, MSVC 14.0 (2015) and Intel 15.0.
* Code should follow the C++14 standard, with minimum required compiler versions
GCC 6.1, Clang 3.4, MSVC 14.1 (2017) and Intel 17.0.
* Avoid manual memory management (that is, `new` and `delete`), preferring to use
standard library containers, as well as `std::unique_ptr` and
`std::shared_ptr` when dynamic allocation is required.
Expand Down
10 changes: 4 additions & 6 deletions SConstruct
Expand Up @@ -196,12 +196,11 @@ config_options = [
Option(
"cxx_flags",
"""Compiler flags passed to the C++ compiler only. Separate multiple
options with spaces, for example, "cxx_flags='-g -Wextra -O3 --std=c++11'"
options with spaces, for example, "cxx_flags='-g -Wextra -O3 --std=c++14'"
""",
{
"cl": "/EHsc",
"Cygwin": "-std=gnu++11", # See http://stackoverflow.com/questions/18784112
"default": "-std=c++11"
"default": "-std=c++14"
}),
Option(
"CC",
Expand Down Expand Up @@ -751,7 +750,8 @@ env = Environment(tools=toolchain+["textfile", "subst", "recursiveInstall", "wix
env["OS"] = platform.system()
env["OS_BITS"] = int(platform.architecture()[0][:2])
if "cygwin" in env["OS"].lower():
env["OS"] = "Cygwin" # remove Windows version suffix
logger.error(f"Error: Operating system {os.name!r} is no longer supported.")
sys.exit(1)

if "FRAMEWORKS" not in env:
env["FRAMEWORKS"] = []
Expand Down Expand Up @@ -791,8 +791,6 @@ if env["OS"] == "Darwin":
config.select("apple-clang")

if "gcc" in env.subst("$CC") or "gnu-cc" in env.subst("$CC"):
if env["OS"] == "Cygwin":
config.select("Cygwin")
config.select("gcc")

elif env["CC"] == "cl": # Visual Studio
Expand Down
3 changes: 0 additions & 3 deletions interfaces/cython/SConscript
Expand Up @@ -74,9 +74,6 @@ elif localenv['OS'] == 'Windows':
# See https://github.com/python/cpython/pull/11283
if py_version_full < parse_version("3.7.3"):
localenv.Append(CPPDEFINES={"_hypot": "hypot"})
elif localenv['OS'] == 'Cygwin':
# extract 'pythonX.Y' from 'libpythonX.Y.dll.a'
localenv.Append(LIBS=pylib[3:-6])

if "numpy_1_7_API" in localenv:
localenv.Append(CPPDEFINES="NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION")
Expand Down
2 changes: 1 addition & 1 deletion interfaces/python_sdist/setup.py
Expand Up @@ -146,7 +146,7 @@ def create_config(key, value):
create_config("SOLARIS", 0)

if sys.platform != "win32":
extra_compile_flags = ["-std=c++11", "-g0"]
extra_compile_flags = ["-std=c++14", "-g0"]
sundials_configh = {
"SUNDIALS_USE_GENERIC_MATH": "#define SUNDIALS_USE_GENERIC_MATH 1",
"SUNDIALS_BLAS_LAPACK": "/* #undef SUNDIALS_BLAS_LAPACK */"
Expand Down
7 changes: 0 additions & 7 deletions site_scons/buildutils.py
Expand Up @@ -1263,10 +1263,3 @@ def get_pip_install_location(
print(json.dumps(scheme))
""")
return json.loads(get_command_output(python_cmd, "-c", install_script))


# Monkey patch for SCons Cygwin bug
# See https://github.com/SCons/scons/issues/2664
if "cygwin" in platform.system().lower():
import SCons.Node.FS
SCons.Node.FS._my_normcase = lambda x: x
2 changes: 1 addition & 1 deletion test_problems/SConscript
Expand Up @@ -26,7 +26,7 @@ localenv['ENV']['CANTERA_DATA'] = (Dir('#build/data').abspath + os.pathsep +
Dir('#test/data').abspath)

# Add build/lib in order to find Cantera shared library
if env['OS'] == 'Windows' or env['OS'] == 'Cygwin':
if env["OS"] == "Windows":
localenv.PrependENVPath('PATH', Dir('#build/lib').abspath)
elif env['OS'] == 'Darwin':
localenv.PrependENVPath('DYLD_LIBRARY_PATH', Dir('#build/lib').abspath)
Expand Down