Skip to content

Commit

Permalink
fix libraries list
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaehashi committed Oct 21, 2023
1 parent 7328623 commit 385fce3
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions install/cupy_builder/_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ def _from_dict(d: Dict[str, Any], ctx: Context) -> Feature:
'cupy._util',
]

# Libraries required for cudart_static
_cudart_static_libs = (
['pthread', 'rt', 'dl'] if sys.platform == 'linux' else []
)


def get_features(ctx: Context) -> Dict[str, Feature]:
# We handle nvtx (and likely any other future support) here, because
Expand Down Expand Up @@ -265,10 +270,7 @@ def get_features(ctx: Context) -> Dict[str, Feature]:
'include': [
'cub/util_namespace.cuh', # dummy
],
'libraries': [
# Dependencies for cudart_static
'pthread', 'rt', 'dl',
] if sys.platform == 'linux' else [],
'libraries': list(_cudart_static_libs),
'static_libraries': [
# Dependency from CUB header files
'cudart_static',
Expand All @@ -291,10 +293,7 @@ def get_features(ctx: Context) -> Dict[str, Feature]:
# Dependency from Jitify header files
'cuda',
'nvrtc',
] + [
# Dependencies for cudart_static
'pthread', 'rt', 'dl',
] if sys.platform == 'linux' else [],
] + _cudart_static_libs,
'static_libraries': [
# Dependency from Jitify header files
'cudart_static',
Expand All @@ -314,10 +313,7 @@ def get_features(ctx: Context) -> Dict[str, Feature]:
],
'libraries': [
'curand',
] + [
# Dependencies for cudart_static
'pthread', 'rt', 'dl',
] if sys.platform == 'linux' else [],
] + _cudart_static_libs,
'static_libraries': [
'cudart_static',
],
Expand Down Expand Up @@ -408,10 +404,7 @@ def get_features(ctx: Context) -> Dict[str, Feature]:
'thrust/sequence.h',
'thrust/sort.h',
],
'libraries': [
# Dependencies for cudart_static
'pthread', 'rt', 'dl',
] if sys.platform == 'linux' else [],
'libraries': list(_cudart_static_libs),
'static_libraries': [
# Dependency from Thrust header files
'cudart_static',
Expand Down Expand Up @@ -479,8 +472,8 @@ def __init__(self, ctx: Context):
# CUDA Driver
([] if ctx.use_cuda_python else ['cuda']) +

# Dependencies for cudart_static
(['pthread', 'rt', 'dl'] if sys.platform == 'linux' else []) +
# CUDA Runtime
_cudart_static_libs +

# CUDA Toolkit
['cublas', 'cufft', 'curand', 'cusparse']
Expand Down

0 comments on commit 385fce3

Please sign in to comment.