File tree Expand file tree Collapse file tree 3 files changed +31
-14
lines changed Expand file tree Collapse file tree 3 files changed +31
-14
lines changed Original file line number Diff line number Diff line change @@ -379,10 +379,14 @@ install_build_tools () {
379
379
echo " [INSTALL] Adding symlink librhash.so.0, which is needed by CMake ..."
380
380
# shellcheck disable=SC2155,SC2086
381
381
local conda_prefix=$( conda run ${env_prefix} printenv CONDA_PREFIX)
382
- (print_exec ln -s " ${conda_prefix} /lib/librhash.so" " ${conda_prefix} /lib/librhash.so.0" ) || return 1
382
+ if [ ! -e " ${conda_prefix} /lib/librhash.so.0" ]; then
383
+ (print_exec ln -s " ${conda_prefix} /lib/librhash.so" " ${conda_prefix} /lib/librhash.so.0" ) || return 1
384
+ fi
383
385
384
386
echo " [INSTALL] Adding symlink libtbb.so, which is needed by HIPCC ..."
385
- (print_exec ln -s " ${conda_prefix} /lib/libtbb.so.12" " ${conda_prefix} /lib/libtbb.so" ) || return 1
387
+ if [ ! -e " ${conda_prefix} /lib/libtbb.so" ]; then
388
+ (print_exec ln -s " ${conda_prefix} /lib/libtbb.so.12" " ${conda_prefix} /lib/libtbb.so" ) || return 1
389
+ fi
386
390
387
391
# For some reason, the build package for Python 3.12+ is missing from conda,
388
392
# so we have to install through pip instead.
Original file line number Diff line number Diff line change @@ -162,6 +162,30 @@ gpu_cpp_library(
162
162
DESTINATION
163
163
fbgemm_gpu)
164
164
165
+ # For the ROCm case on non-Nova, an explicit link to
166
+ # libtbb is required, or the following error is
167
+ # encountered on library load:
168
+ # undefined symbol: _ZN3tbb6detail2r117deallocate_memoryEPv
169
+ if (DEFINED ENV{BUILD_FROM_NOVA})
170
+ message (STATUS "BUILD_FROM_NOVA is $ENV{BUILD_FROM_NOVA} ." )
171
+ if ($ENV{BUILD_FROM_NOVA} STREQUAL "0" )
172
+ set (IS_NOVA FALSE )
173
+ else ()
174
+ set (IS_NOVA TRUE )
175
+ endif ()
176
+ else ()
177
+ message (STATUS "BUILD_FROM_NOVA is not defined." )
178
+ set (IS_NOVA FALSE )
179
+ endif ()
180
+ if (FBGEMM_BUILD_VARIANT STREQUAL BUILD_VARIANT_ROCM AND NOT IS_NOVA)
181
+ message (STATUS "Adding tbb as dep." )
182
+ find_library (DEP_MAYBE_TBB NAMES tbb HINTS $ENV{CONDA_ENV} /lib)
183
+ if (DEP_MAYBE_TBB)
184
+ message (STATUS "Found tbb: ${DEP_MAYBE_TBB} " )
185
+ else ()
186
+ message (FATAL_ERROR "tbb not found" )
187
+ endif ()
188
+ endif ()
165
189
166
190
gpu_cpp_library(
167
191
PREFIX
@@ -184,5 +208,6 @@ gpu_cpp_library(
184
208
fbgemm_gpu_tbe_cache
185
209
fbgemm_gpu_tbe_optimizers
186
210
fbgemm_gpu_tbe_utils
211
+ ${DEP_MAYBE_TBB}
187
212
DESTINATION
188
213
fbgemm_gpu)
Original file line number Diff line number Diff line change @@ -379,18 +379,6 @@ def _get_cxx11_abi():
379
379
]
380
380
)
381
381
382
- if self .nova_flag () is None :
383
- cxx_flags .extend (
384
- [
385
- # For the ROCm case on non-Nova, an explicit link to
386
- # libtbb is required, or the following error is
387
- # encountered on library load:
388
- #
389
- # undefined symbol: _ZN3tbb6detail2r117deallocate_memoryEPv
390
- "-ltbb" ,
391
- ]
392
- )
393
-
394
382
cmake_args .extend (
395
383
[
396
384
f"-DCMAKE_C_FLAGS='{ ' ' .join (cxx_flags )} '" ,
You can’t perform that action at this time.
0 commit comments