failed to build 3D Slicer in Ubuntu 18.04

Dear experts in Slicer community,
I am a doctor and a fun of Slicer (not too much background of computer science). I am trying to build Slicer in my new PC for the convenience of working on a large data set using streamline code.
However, I got errors and can’t figure it out when I am building Slicer according the steps from here https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/linux.html#ubuntu-20-04-focal-fossa.
Any comments are appreciated.

My PC configurations:
system: Ubuntu 18.04
CPU: Intel® Core™ i9-9900 CPU @ 3.10GHz
Memory: 32 G
Python 3.7.9

ERROR shows below:

[ 10%] Python Wrapping - generating vtkOpenGLShaderComputationPython.cxx
Scanning dependencies of target vtkTeemPythonD
Scanning dependencies of target vtkAddonPythonD
/usr/lib/x86_64-linux-gnu/libSM.so: undefined reference to uuid_generate@UUID_1.0' /usr/lib/x86_64-linux-gnu/libSM.so: undefined reference to uuid_unparse_lower@UUID_1.0’
collect2: error: ld returned 1 exit status
Libs/vtkTeem/Testing/CMakeFiles/vtkTeemCxxTests.dir/build.make:200: recipe for target ‘bin/vtkTeemCxxTests’ failed
make[5]: *** [bin/vtkTeemCxxTests] Error 1
CMakeFiles/Makefile2:9178: recipe for target ‘Libs/vtkTeem/Testing/CMakeFiles/vtkTeemCxxTests.dir/all’ failed
make[4]: *** [Libs/vtkTeem/Testing/CMakeFiles/vtkTeemCxxTests.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs…
[ 10%] Building CXX object Libs/vtkTeem/CMakeFiles/vtkTeemPythonD.dir/vtkDiffusionTensorGlyphPython.cxx.o
[ 10%] Building CXX object Libs/vtkTeem/CMakeFiles/vtkTeemPythonD.dir/vtkDiffusionTensorMathematicsPython.cxx.o
[ 10%] Linking CXX shared library …/…/…/lib/Slicer-4.13/cli-modules/libResampleScalarVolumeLib.so
[ 10%] Linking CXX executable …/…/…/bin/vtkAddonCxxTests
[ 10%] Building CXX object Libs/vtkTeem/CMakeFiles/vtkTeemPythonD.dir/vtkTeemNRRDReaderPython.cxx.o
[ 10%] Building CXX object Libs/vtkTeem/CMakeFiles/vtkTeemPythonD.dir/vtkTeemNRRDWriterPython.cxx.o
/usr/lib/x86_64-linux-gnu/libSM.so: undefined reference to uuid_generate@UUID_1.0' /usr/lib/x86_64-linux-gnu/libSM.so: undefined reference to uuid_unparse_lower@UUID_1.0’
collect2: error: ld returned 1 exit status
Libs/vtkAddon/Testing/CMakeFiles/vtkAddonCxxTests.dir/build.make:239: recipe for target ‘bin/vtkAddonCxxTests’ failed
make[5]: *** [bin/vtkAddonCxxTests] Error 1
CMakeFiles/Makefile2:9041: recipe for target ‘Libs/vtkAddon/Testing/CMakeFiles/vtkAddonCxxTests.dir/all’ failed
make[4]: *** [Libs/vtkAddon/Testing/CMakeFiles/vtkAddonCxxTests.dir/all] Error 2
[ 10%] Building CXX object Libs/vtkTeem/CMakeFiles/vtkTeemPythonD.dir/vtkImageLabelCombinePython.cxx.o
[ 10%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkAddonTestingUtilitiesPython.cxx.o
[ 10%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkErrorSinkPython.cxx.o
[ 10%] Built target ResampleScalarVolumeLib
[ 10%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkLoggingMacrosPython.cxx.o
[ 10%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkTestingOutputWindowPython.cxx.o
[ 10%] Building CXX object Libs/vtkTeem/CMakeFiles/vtkTeemPythonD.dir/vtkTeemPythonInitImpl.cxx.o
[ 10%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkOrientedBSplineTransformPython.cxx.o
[ 10%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkOrientedGridTransformPython.cxx.o
[ 10%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkPersonInformationPython.cxx.o
[ 10%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkAddonMathUtilitiesPython.cxx.o
[ 10%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkAddonSetGetPython.cxx.o
[ 11%] Linking CXX shared library …/…/bin/libvtkTeemPythonD.so
[ 11%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkStreamingVolumeCodecPython.cxx.o
[ 11%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkStreamingVolumeFramePython.cxx.o
[ 11%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkStreamingVolumeCodecFactoryPython.cxx.o
[ 11%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkRawRGBVolumeCodecPython.cxx.o
[ 11%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkOpenGLTextureImagePython.cxx.o
[ 11%] Built target vtkTeemPythonD
[ 11%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkOpenGLShaderComputationPython.cxx.o
[ 11%] Building CXX object Libs/vtkAddon/CMakeFiles/vtkAddonPythonD.dir/vtkAddonPythonInitImpl.cxx.o
[ 11%] Linking CXX shared library …/…/bin/libvtkAddonPythonD.so
[ 11%] Built target vtkAddonPythonD
[ 11%] Linking CXX shared library …/…/…/lib/Slicer-4.13/cli-modules/libExpertAutomatedRegistrationLib.so
[ 11%] Built target ExpertAutomatedRegistrationLib
[ 11%] Linking CXX static library …/…/…/lib/Slicer-4.13/libBRAINSCommonLib.a
[ 11%] Built target BRAINSCommonLib
Makefile:181: recipe for target ‘all’ failed
make[3]: *** [all] Error 2
CMakeFiles/Slicer.dir/build.make:162: recipe for target ‘Slicer-prefix/src/Slicer-stamp/Slicer-build’ failed
make[2]: *** [Slicer-prefix/src/Slicer-stamp/Slicer-build] Error 2
CMakeFiles/Makefile2:454: recipe for target ‘CMakeFiles/Slicer.dir/all’ failed
make[1]: *** [CMakeFiles/Slicer.dir/all] Error 2
Makefile:113: recipe for target ‘all’ failed
make: *** [all] Error 2

You don’t need to build Slicer to use it, customize, or extend it. See more information here: https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/overview.html

Anyway, these build instructions should work: https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/linux.html (I’ve tried Ubuntu 20.04 build instructions a couple of weeks ago).

Hi Lassoan,
Many thanks for your flash reply!
Best,
SY