Skip to content

Commit 0fd95bc

Browse files
authored
Package updates and update Spack (#351)
1 parent 645634a commit 0fd95bc

File tree

10 files changed

+919
-1
lines changed

10 files changed

+919
-1
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright Spack Project Developers. See COPYRIGHT file for details.
2+
#
3+
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
4+
5+
from spack_repo.builtin.build_systems.cmake import CMakePackage
6+
7+
from spack.package import *
8+
9+
10+
class Ccls(CMakePackage):
11+
"""C/C++ language server"""
12+
13+
homepage = "https://github.com/MaskRay/ccls"
14+
git = "https://github.com/MaskRay/ccls.git"
15+
url = "https://github.com/MaskRay/ccls/archive/0.20201025.tar.gz"
16+
17+
maintainers("jacobmerson")
18+
19+
license("Apache-2.0")
20+
21+
version(
22+
"0.20241108", sha256="76224663c3554eef9102dca66d804874d0252312d7c7d02941c615c87dcb68af"
23+
)
24+
version(
25+
"0.20240505", sha256="4ea6d90a9f93d5503e59c3bd0e5568ab262ff3dcf1b7539b50a0ede4a0e32fea"
26+
)
27+
version(
28+
"0.20240202", sha256="355ff7f5eb5f24d278dda05cccd9157e89583272d0559d6b382630171f142d86"
29+
)
30+
version(
31+
"0.20230717", sha256="118e84cc17172b1deef0f9c50767b7a2015198fd44adac7966614eb399867af8"
32+
)
33+
version(
34+
"0.20220729", sha256="af19be36597c2a38b526ce7138c72a64c7fb63827830c4cff92256151fc7a6f4"
35+
)
36+
version(
37+
"0.20210330", sha256="28c228f49dfc0f23cb5d581b7de35792648f32c39f4ca35f68ff8c9cb5ce56c2"
38+
)
39+
40+
depends_on("cxx", type="build")
41+
depends_on("c", type="build")
42+
43+
depends_on("cmake@3.8:", type="build")
44+
depends_on("llvm@10:19", when="@=0.20241108")
45+
depends_on("llvm@7:19", when="@=0.20240505")
46+
depends_on("llvm@7:18", when="@:0.20240202")
47+
depends_on("rapidjson")
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
diff --git a/lldb/bindings/python/get-python-config.py b/lldb/bindings/python/get-python-config.py
2+
index ae84cbb12..1e4175470 100755
3+
--- a/lldb/bindings/python/get-python-config.py
4+
+++ b/lldb/bindings/python/get-python-config.py
5+
@@ -45,17 +45,21 @@ def main():
6+
elif args.variable_name == "LLDB_PYTHON_EXE_RELATIVE_PATH":
7+
tried = list()
8+
exe = sys.executable
9+
- prefix = os.path.realpath(sys.prefix)
10+
+ prefix = sys.prefix
11+
while True:
12+
try:
13+
print(relpath_nodots(exe, prefix))
14+
break
15+
except ValueError:
16+
tried.append(exe)
17+
- # Retry if the executable is symlinked or similar.
18+
- # This is roughly equal to os.path.islink, except it also works for junctions on Windows.
19+
- if os.path.realpath(exe) != exe:
20+
- exe = os.path.realpath(exe)
21+
+ real_exe_dirname = os.path.realpath(os.path.dirname(exe))
22+
+ real_prefix = os.path.realpath(prefix)
23+
+ if prefix != real_prefix:
24+
+ prefix = real_prefix
25+
+ exe = os.path.join(real_exe_dirname, os.path.basename(exe))
26+
+ continue
27+
+ elif os.path.islink(exe):
28+
+ exe = os.path.join(real_exe_dirname, os.readlink(exe))
29+
continue
30+
else:
31+
print(
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import os
2+
from spack.package import *
3+
from spack_repo.builtin.packages.llvm.package import Llvm as bLlvm
4+
5+
6+
class Llvm(bLlvm):
7+
patch("lldb_python_exe_relative_path.patch", when="@16:+lldb+python")
8+
depends_on("python@3.8:3.12", when="@:19 +python")
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index ba66a6d4..217aa712 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -856,7 +856,7 @@ IF(USE_HDF5)
6+
# This needs to be near the beginning since we
7+
# need to know whether to add "-lz" to the symbol
8+
# tests below.
9+
- CHECK_C_SOURCE_COMPILES("#include <H5public.h>
10+
+ CHECK_C_SOURCE_COMPILES("#include <H5pubconf.h>
11+
#if !H5_HAVE_ZLIB_H
12+
#error
13+
#endif
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index de95010c..25229f9c 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -664,6 +664,7 @@ ENDIF(ENABLE_STRICT_NULL_BYTE_HEADER_PADDING)
6+
# *
7+
##
8+
SET(USE_HDF5 ${ENABLE_HDF5})
9+
+SET(IMPORT_HDF5 "")
10+
IF(USE_HDF5)
11+
12+
##
13+
@@ -671,7 +672,6 @@ IF(USE_HDF5)
14+
##
15+
SET(HDF5_VERSION_REQUIRED 1.8.10)
16+
17+
-
18+
##
19+
# Accommodate developers who have hdf5 libraries and
20+
# headers on their system, but do not have a the hdf
21+
@@ -744,6 +744,9 @@ IF(USE_HDF5)
22+
ELSE(MSVC)
23+
FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED)
24+
ENDIF(MSVC)
25+
+ # Export HDF5 Dependency so consumers can properly use
26+
+ # exported link interface
27+
+ set(IMPORT_HDF5 "find_dependency(HDF5 COMPONENTS C HL)")
28+
29+
##
30+
# Next, check the HDF5 version. This will inform which
31+
@@ -1481,6 +1484,7 @@ ENDIF()
32+
33+
# Enable Parallel IO with netCDF-4/HDF5 files using HDF5 parallel I/O.
34+
SET(STATUS_PARALLEL "OFF")
35+
+set(IMPORT_MPI "")
36+
OPTION(ENABLE_PARALLEL4 "Build netCDF-4 with parallel IO" "${HDF5_PARALLEL}")
37+
IF(ENABLE_PARALLEL4 AND ENABLE_HDF5)
38+
IF(NOT HDF5_PARALLEL)
39+
@@ -1502,6 +1506,7 @@ IF(ENABLE_PARALLEL4 AND ENABLE_HDF5)
40+
FILE(COPY "${netCDF_BINARY_DIR}/tmp/run_par_tests.sh"
41+
DESTINATION ${netCDF_BINARY_DIR}/h5_test
42+
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
43+
+ set(IMPORT_MPI "find_dependency(MPI COMPONENTS C)")
44+
ENDIF()
45+
ENDIF()
46+
47+
@@ -2652,6 +2657,8 @@ endif(DEFINED ENV{LIB_FUZZING_ENGINE})
48+
# cmake should be able to find netcdf using find_package and find_library.
49+
# The EXPORT call is paired with one in liblib.
50+
set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/netCDF)
51+
+set(IMPORT_FIND_DEP "include(CMakeFindDependencyMacro)")
52+
+
53+
54+
install(EXPORT netCDFTargets
55+
DESTINATION ${ConfigPackageLocation}
56+
diff --git a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt
57+
index e3eddc0f..0493cb9d 100644
58+
--- a/liblib/CMakeLists.txt
59+
+++ b/liblib/CMakeLists.txt
60+
@@ -50,6 +50,7 @@ ADD_LIBRARY(netcdf nc_initialize.c ${LARGS} )
61+
62+
IF(MPI_C_INCLUDE_PATH)
63+
target_include_directories(netcdf PUBLIC ${MPI_C_INCLUDE_PATH})
64+
+ target_link_libraries(netcdf MPI::MPI_C)
65+
ENDIF(MPI_C_INCLUDE_PATH)
66+
67+
IF(MOD_NETCDF_NAME)
68+
diff --git a/netCDFConfig.cmake.in b/netCDFConfig.cmake.in
69+
index 9d68eec5..eece09cb 100644
70+
--- a/netCDFConfig.cmake.in
71+
+++ b/netCDFConfig.cmake.in
72+
@@ -14,6 +14,10 @@ set(netCDF_LIBRARIES netCDF::netcdf)
73+
# include target information
74+
include("${CMAKE_CURRENT_LIST_DIR}/netCDFTargets.cmake")
75+
76+
+@IMPORT_FIND_DEP@
77+
+@IMPORT_MPI@
78+
+@IMPORT_HDF5@
79+
+
80+
# Compiling Options
81+
#
82+
set(netCDF_C_COMPILER "@CC_VERSION@")
83+
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
84+
index 65891d82..15567c8f 100644
85+
--- a/plugins/CMakeLists.txt
86+
+++ b/plugins/CMakeLists.txt
87+
@@ -62,6 +62,9 @@ MACRO(buildplugin TARGET TARGETLIB)
88+
set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "/INCREMENTAL:NO /DEBUG /OPT:REF /OPT:ICF")
89+
# Set file name & location
90+
set_target_properties(${TARGET} PROPERTIES COMPILE_PDB_NAME ${TARGET} COMPILE_PDB_OUTPUT_DIR ${CMAKE_BINARY_DIR})
91+
+ IF(MPI_C_INCLUDE_PATH)
92+
+ target_include_directories(${TARGET} PRIVATE ${MPI_C_INCLUDE_PATH})
93+
+ ENDIF(MPI_C_INCLUDE_PATH)
94+
ENDIF()
95+
ENDMACRO()
96+

0 commit comments

Comments
 (0)