Skip to content

Commit

Permalink
Merge pull request #220 from FNALssi/fd_gcc_13
Browse files Browse the repository at this point in the history
gcc 13 changes
  • Loading branch information
gartung authored Oct 28, 2023
2 parents c657a4f + 469045f commit 0799321
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 7 deletions.
5 changes: 4 additions & 1 deletion lib/spack/spack/solver/asp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2842,7 +2842,10 @@ def reorder_flags(self):
ordered_compiler_flags = list(llnl.util.lang.dedupe(from_compiler + from_sources))
compiler_flags = spec.compiler_flags.get(flag_type, [])

msg = "%s does not equal %s" % (set(compiler_flags), set(ordered_compiler_flags))
msg = "compiler flags %s does not equal %s for %s" % (
set(compiler_flags), set(ordered_compiler_flags), spec.name
)

assert set(compiler_flags) == set(ordered_compiler_flags), msg

spec.compiler_flags.update({flag_type: ordered_compiler_flags})
Expand Down
19 changes: 19 additions & 0 deletions var/spack/repos/builtin/packages/catch2/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,25 @@ def patch(self):
filter_file(r'#include <vector>', '#include <vector>\n#include <cstdint>', 'src/catch2/internal/catch_xmlwriter.hpp')
filter_file(r'#include <vector>', '#include <vector>\n#include <cstdint>', 'src/catch2/catch_test_case_info.hpp')

def patch(self):
filter_file(
r'#include \<catch2',
'#include <cstdint>\n#include <catch2',
'src/catch2/internal/catch_string_manip.hpp'
)
filter_file(
r'#include <string>',
'#include <string>\n#include <cstdint>',
'src/catch2/catch_test_case_info.hpp'
)
filter_file(
r'#include <iomanip>',
'#include <iomanip>\n#include <cstdint>',
'src/catch2/internal/catch_xmlwriter.cpp',
)



def cmake_args(self):
spec = self.spec
args = []
Expand Down
14 changes: 14 additions & 0 deletions var/spack/repos/builtin/packages/clhep/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ class Clhep(CMakePackage):
patch("clhep-cms.patch", when="+cms", level=0)

def patch(self):
# need cstdint in some headers...
filter_file(
'#include <array>',
'#include <cstdint>\n#include <array>',
'CLHEP/Random/Random/MixMaxRng.h'
)
filter_file(
'#include <iostream>',
'#include <cstdint>\n#include <iostream>',
'CLHEP/Random/Random/RandomEngine.h',
)

# Patched line removed since 2.3.2.2
# https://gitlab.cern.ch/CLHEP/CLHEP/-/commit/5da6830d69c71dc178632f7f5121a3a00e379f94
if self.spec.satisfies("@2.3.2.2:"):
Expand All @@ -84,6 +96,8 @@ def patch(self):
"%s/CLHEP/CMakeLists.txt" % self.stage.source_path,
)



def cmake_args(self):
cmake_args = [
"-DCLHEP_BUILD_CXXSTD=-std=c++{0}".format(self.spec.variants["cxxstd"].value),
Expand Down
4 changes: 3 additions & 1 deletion var/spack/repos/builtin/packages/hwloc/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,14 @@ def configure_args(self):
args.append("--with-rocm={0}".format(self.spec["hip"].prefix))
args.append("--with-rocm-version={0}".format(self.spec["hip"].version))

if "+libxml2" in self.spec:
args.append("--with-libxml2={0}".format(self.spec["libxml2"].prefix))

args.extend(self.enable_or_disable("netloc"))
args.extend(self.enable_or_disable("cairo"))
args.extend(self.enable_or_disable("nvml"))
args.extend(self.enable_or_disable("gl"))
args.extend(self.enable_or_disable("cuda"))
args.extend(self.enable_or_disable("libxml2"))
args.extend(self.enable_or_disable("libudev"))
args.extend(self.enable_or_disable("pci"))
args.extend(self.enable_or_disable("libs"))
Expand Down
7 changes: 7 additions & 0 deletions var/spack/repos/builtin/packages/py-tensorflow/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,13 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension):
# protobuf definitions.
patch("0008-Fix-protobuf-errors-when-using-system-protobuf.patch", when="@2.5:2.6")

def patch(self):
filter_file(
'#include "absl',
'#include <cstdint>\n#include "absl',
'tensorflow/tsl/platform/stringpiece.h',
)

phases = ["configure", "build", "install"]

# https://www.tensorflow.org/install/source
Expand Down
15 changes: 10 additions & 5 deletions var/spack/repos/builtin/packages/py-torch/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,19 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage):
when="@2.0.0:2.0.1",
)

@when("@1.5.0:")
def patch(self):
# https://github.com/pytorch/pytorch/issues/52208
filter_file(
"torch_global_deps PROPERTIES LINKER_LANGUAGE C",
"torch_global_deps PROPERTIES LINKER_LANGUAGE CXX",
"caffe2/CMakeLists.txt",
"#include <string>",
"#include <string>\n#include <cstdint>",
"third_party/fbgemm/include/fbgemm/UtilsAvx2.h"
)
with when("@1.5.0:"):
# https://github.com/pytorch/pytorch/issues/52208
filter_file(
"torch_global_deps PROPERTIES LINKER_LANGUAGE C",
"torch_global_deps PROPERTIES LINKER_LANGUAGE CXX",
"caffe2/CMakeLists.txt",
)

def setup_build_environment(self, env):
"""Set environment variables used to control the build.
Expand Down
7 changes: 7 additions & 0 deletions var/spack/repos/builtin/packages/root/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,13 @@ class Root(CMakePackage):
# See https://github.com/root-project/root/issues/11135
conflicts("+ipo", msg="LTO is not a supported configuration for building ROOT")

def patch(self):
filter_file(
r'#include <sstream>',
'#include <sstream>\n#include <cstdint>',
'graf3d/eve7/inc/ROOT/REveTypes.hxx'
)

@classmethod
def filter_detected_exes(cls, prefix, exes_in_prefix):
result = []
Expand Down

0 comments on commit 0799321

Please sign in to comment.