Skip to content

Commit 10cca58

Browse files
authored
Update eb_hooks.py
1 parent 8c06920 commit 10cca58

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

eb_hooks.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,20 @@ def parse_hook_tensorflow_CUDA(ec, eprefix):
269269
)
270270

271271
if has_cuda:
272-
ec['preconfigopts'] = (
272+
ec['preconfigopts'] = ec.get('preconfigopts', '') + (
273273
'export TF_NEED_CUDA=1 && '
274274
'export CUDA_TOOLKIT_PATH=$EBROOTCUDA && '
275275
'export TF_CUDA_INCLUDE_PATH=$EBROOTCUDA/include && '
276276
'export CUDNN_INSTALL_PATH=$EBROOTCUDNN && '
277277
'export GCC_HOST_COMPILER_PATH=$EBROOTGCC/bin/gcc && '
278278
'sed -i \'s|--define=PREFIX=/usr|--define=PREFIX=\\$EESSI_EPREFIX|g\' .bazelrc && '
279279
)
280-
281-
ec['buildopts'] = [
280+
281+
current_opts = ec.get('buildopts', [])
282+
if isinstance(current_opts, str):
283+
current_opts = current_opts.split()
284+
285+
ec['buildopts'] = current_opts + [
282286
'--linkopt=-Wl,--disable-new-dtags --host_linkopt=-Wl,--disable-new-dtags --action_env=GCC_HOST_COMPILER_PATH=$EBROOTGCC/bin/gcc --host_action_env=GCC_HOST_COMPILER_PATH=$EBROOTGCC/bin/gcc --linkopt=-Wl,-rpath,$EBROOTCUDA/lib:$EBROOTCUDNN/lib:$EBROOTNCCL/lib --host_linkopt=-Wl,-rpath,$EBROOTCUDA/lib:$EBROOTCUDNN/lib:$EBROOTNCCL/lib',
283287
]
284288

0 commit comments

Comments
 (0)