Skip to content

Commit 5547f71

Browse files
committed
Update the libjpeg installation for rhel
1 parent 8eb36de commit 5547f71

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

CMakeLists.txt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,19 @@ set(OPENCV_LIBS
231231
"libopencv_flann.so"
232232
"libopencv_features2d.so"
233233
"libpng16.so"
234-
"libjpeg.so"
235234
)
235+
if(${RHEL_BUILD})
236+
set(OPENCV_LIBS
237+
${OPENCV_LIBS}
238+
"libjpeg.so.62" # RHEL uses only .so.62 version
239+
)
240+
else()
241+
set(OPENCV_LIBS
242+
${OPENCV_LIBS}
243+
"libjpeg.so" # Non-RHEL uses both .so and .so.62
244+
"libjpeg.so.62"
245+
)
246+
endif()
236247

237248
# The patchelf commands ensure the MKL libraries are loaded correctly during runtime
238249
# Without these, the framework/backend complains of missing libraries / symbols and
@@ -283,8 +294,7 @@ if (${TRITON_PYTORCH_DOCKER_BUILD})
283294
COMMAND docker cp -L pytorch_backend_ptlib:/usr/local/${LIB_DIR}/libopencv_flann.so libopencv_flann.so
284295
#COMMAND docker cp -L pytorch_backend_ptlib:/usr/local/lib/libjpeg.so.62 libjpeg.so.62
285296
COMMAND /bin/sh -c "if [ ${RHEL_BUILD} = 'OFF' ]; then docker cp -L pytorch_backend_ptlib:/usr/local/lib/libjpeg.so.62 libjpeg.so.62; else docker cp -L pytorch_backend_ptlib:/usr/lib64/libjpeg.so.62 libjpeg.so.62; fi;"
286-
COMMAND /bin/sh -c "if [ ${RHEL_BUILD} = 'OFF' ]; then docker cp pytorch_backend_ptlib:/usr/lib/${LIBS_ARCH}-linux-gnu/libpng16.so* libpng16.so; else docker cp -L pytorch_backend_ptlib:/usr/lib64/libpng16.so.16 libpng16.so; fi;"
287-
COMMAND /bin/sh -c "if [ ${RHEL_BUILD} = 'OFF' ]; then docker cp pytorch_backend_ptlib:/usr/lib/${LIBS_ARCH}-linux-gnu/libjpeg.so.8.2.2 libjpeg.so; fi;"
297+
COMMAND /bin/sh -c "if [ ${RHEL_BUILD} = 'ON' ]; then docker cp -L pytorch_backend_ptlib:/usr/lib64/libjpeg.so.62 libjpeg.so.62; else docker cp -L pytorch_backend_ptlib:/usr/local/lib/libjpeg.so.62 libjpeg.so.62 && docker cp pytorch_backend_ptlib:/usr/lib/${LIBS_ARCH}-linux-gnu/libjpeg.so.8.2.2 libjpeg.so; fi;"
288298
COMMAND /bin/sh -c "if [ -f libmkl_def.so.1 ]; then patchelf --add-needed libmkl_gnu_thread.so.1 libmkl_def.so.1; fi"
289299
COMMAND /bin/sh -c "if [ -f libmkl_def.so.1 ]; then patchelf --add-needed libmkl_core.so.1 libmkl_def.so.1; fi"
290300
COMMAND /bin/sh -c "if [ -f libmkl_avx2.so.1 ]; then patchelf --add-needed libmkl_gnu_thread.so.1 libmkl_avx2.so.1; fi"

0 commit comments

Comments
 (0)