PV-compilation problems with libSM and uuid

hi,

i’m trying to compile paraview on ubuntu 18.04;
it is built with:

  • CMAKE_BUILD_TYPE=Release
  • CMAKE_INSTALL_PREFIX=/usr/local/
  • PARAVIEW_ENABLE_PYTHON=ON
  • PARAVIEW_INSTALL_DEVELOPMENT_FILES=ON

in the consecutive compilation step i get:

/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 touuid_unparse_lower@UUID_1.0’

do you know how that can be fixed?

one of the solutions i found online (e.g. here: https://stackoverflow.com/questions/45584275/getting-error-usr-lib-lib64-libsm-so-undefined-reference-to-uuid-unparse-l) is to add a " -luuid" to a variable that collects libs

do you know where can i try it out? (which libs might be missing this flag?)

thank you!
and best wishes,
gosia

What link step is failing with the error message?

dear Ben,

thank you for the prompt answer!
here are the last few lines from the terminal:

[ 80%] Linking CXX executable …/…/bin/vtkLegacyColorMapXMLToJSON
/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 touuid_unparse_lower@UUID_1.0’
collect2: error: ld returned 1 exit status
Utilities/LegacyColorMapXMLToJSON/CMakeFiles/vtkLegacyColorMapXMLToJSON.dir/build.make:184: recipe for target ‘bin/vtkLegacyColorMapXMLToJSON’ failed
make[2]: *** [bin/vtkLegacyColorMapXMLToJSON] Error 1
CMakeFiles/Makefile2:18588: recipe for target ‘Utilities/LegacyColorMapXMLToJSON/CMakeFiles/vtkLegacyColorMapXMLToJSON.dir/all’ failed
make[1]: *** [Utilities/LegacyColorMapXMLToJSON/CMakeFiles/vtkLegacyColorMapXMLToJSON.dir/all] Error 2
Makefile:151: recipe for target ‘all’ failed
make: *** [all] Error 2

best wishes,
g.

Try adding -luuid to X11_SM_LIBRARY. I don’t know if it should take a space or semicolon, so I’d try both to see which works.

thank you!

can you please point me to a file in which i should set up this variable?
grep in paraview does not show anything, also echo $X11_SM_LIBRARY is empty

best wishes,
gosia

It’s in CMakeCache.txt in the build directory.

thank you!
i see now (i didn’t find it before as in m CMakeCache.txt it is “X11_SM_LIB”)
i tried:

  1. //Path to a library.
    X11_SM_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libSM.so -luuid

it gave this error:
make[2]: *** No rule to make target ‘/usr/lib/x86_64-linux-gnu/libSM.so -luuid’, needed by ‘lib/libvtkRenderingOpenGL2-pv5.5.so.1’. Stop.
CMakeFiles/Makefile2:3296: recipe for target ‘VTK/Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/all’ failed
make[1]: *** [VTK/Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/all] Error 2
Makefile:151: recipe for target ‘all’ failed
make: *** [all] Error 2

the same with:
X11_SM_LIB:“FILEPATH=/usr/lib/x86_64-linux-gnu/libSM.so -luuid”
X11_SM_LIB:“STRING=/usr/lib/x86_64-linux-gnu/libSM.so -luuid”

  1. X11_SM_LIB:FILEPATH="/usr/lib/x86_64-linux-gnu/libSM.so -luuid" ended with:
    /usr/bin/ld: cannot find -l/usr/lib/x86_64-linux-gnu/libSM.so -luuid
    collect2: error: ld returned 1 exit status
    VTK/Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/build.make:3093: recipe for target ‘lib/libvtkRenderingOpenGL2-pv5.5.so.1’ failed
    make[2]: *** [lib/libvtkRenderingOpenGL2-pv5.5.so.1] Error 1
    CMakeFiles/Makefile2:3296: recipe for target ‘VTK/Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/all’ failed
    make[1]: *** [VTK/Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/all] Error 2
    Makefile:151: recipe for target ‘all’ failed
    make: *** [all] Error 2

  2. X11_SM_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libSM.so;-luuid
    took the longest but also gave an error:
    [100%] Linking CXX executable …/bin/pvdataserver
    //usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to uuid_generate@UUID_1.0' //usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference touuid_unparse_lower@UUID_1.0’
    collect2: error: ld returned 1 exit status
    CommandLineExecutables/CMakeFiles/pvdataserver.dir/build.make:129: recipe for target ‘bin/pvdataserver’ failed
    make[2]: *** [bin/pvdataserver] Error 1
    CMakeFiles/Makefile2:49614: recipe for target ‘CommandLineExecutables/CMakeFiles/pvdataserver.dir/all’ failed
    make[1]: *** [CommandLineExecutables/CMakeFiles/pvdataserver.dir/all] Error 2
    Makefile:151: recipe for target ‘all’ failed
    make: *** [all] Error 2

hi,

do you know where i could add this “-luuid” flag to build the pvdataserver? (tried few places with no success)
thank you!

from the point 3 in my last post:

[100%] Linking CXX executable …/bin/pvdataserver
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to uuid_generate@UUID_1.0’ //usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference touuid_unparse_lower@UUID_1.0’
collect2: error: ld returned 1 exit status
CommandLineExecutables/CMakeFiles/pvdataserver.dir/build.make:129: recipe for target ‘bin/pvdataserver’ failed
make[2]: *** [bin/pvdataserver] Error 1
CMakeFiles/Makefile2:49614: recipe for target ‘CommandLineExecutables/CMakeFiles/pvdataserver.dir/all’ failed
make[1]: *** [CommandLineExecutables/CMakeFiles/pvdataserver.dir/all] Error 2
Makefile:151: recipe for target ‘all’ failed
make: *** [all] Error 2

Doing make VERBOSE=1 shows the command line which fails. There should be -luuid in there somewhere.

here is the output from make VERBOSE=1 (there is no luuid…):

[100%] Linking CXX executable …/bin/pvdataserver
cd /home/gosia/software/ParaView-v5.5.2/build/CommandLineExecutables && /usr/bin/cmake -E cmake_link_script CMakeFiles/pvdataserver.dir/link.txt --verbose=1
/usr/bin/c++ -O3 -DNDEBUG -rdynamic CMakeFiles/pvdataserver.dir/pvdataserver.cxx.o -o …/bin/pvdataserver -Wl,-rpath,/home/gosia/software/ParaView-v5.5.2/build/lib:/home/gosia/software/anaconda3/lib: …/lib/libvtkPVServerManagerApplication-pv5.5.so.1 …/lib/libvtkUtilitiesPythonInitializer-pv5.5.so.1 …/lib/libvtkPVServerManagerCore-pv5.5.so.1 …/lib/libvtkPVServerImplementationCore-pv5.5.so.1 …/lib/libvtkPVClientServerCoreCore-pv5.5.so.1 …/lib/libvtkFiltersParallel-pv5.5.so.1 …/lib/libvtkFiltersExtraction-pv5.5.so.1 …/lib/libvtkFiltersModeling-pv5.5.so.1 …/lib/libvtkFiltersGeometry-pv5.5.so.1 …/lib/libvtkFiltersProgrammable-pv5.5.so.1 …/lib/libvtkPVVTKExtensionsCore-pv5.5.so.1 …/lib/libvtkPVCommon-pv5.5.so.1 …/lib/libvtkClientServer-pv5.5.so.1 …/lib/libvtkIOXMLParser-pv5.5.so.1 …/lib/libvtkFiltersSources-pv5.5.so.1 …/lib/libvtkFiltersGeneral-pv5.5.so.1 …/lib/libvtkFiltersCore-pv5.5.so.1 …/lib/libvtkIOImage-pv5.5.so.1 …/lib/libvtkParallelCore-pv5.5.so.1 …/lib/libvtkIOLegacy-pv5.5.so.1 …/lib/libvtkIOCore-pv5.5.so.1 …/lib/libvtkCommonExecutionModel-pv5.5.so.1 …/lib/libvtkCommonDataModel-pv5.5.so.1 …/lib/libvtkCommonSystem-pv5.5.so.1 …/lib/libvtkCommonTransforms-pv5.5.so.1 …/lib/libvtkPVVTKExtensionsSIL-pv5.5.so.1 …/lib/libprotobuf.so -lpthread …/lib/libvtkjsoncpp-pv5.5.so.1 …/lib/libvtkPythonInterpreter-pv5.5.so.1 …/lib/libvtkCommonMisc-pv5.5.so.1 …/lib/libvtkCommonMath-pv5.5.so.1 /home/gosia/software/anaconda3/lib/libpython3.6m.so …/lib/libvtkWrappingPython36Core-pv5.5.so.1 …/lib/libvtkCommonCore-pv5.5.so.1 …/lib/libvtksys-pv5.5.so.1 -ldl -Wl,-rpath-link,/home/gosia/software/ParaView-v5.5.2/build/lib
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to uuid_generate@UUID_1.0' //usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference touuid_unparse_lower@UUID_1.0’
collect2: error: ld returned 1 exit status
CommandLineExecutables/CMakeFiles/pvdataserver.dir/build.make:129: recipe for target ‘bin/pvdataserver’ failed
make[2]: *** [bin/pvdataserver] Error 1
make[2]: Leaving directory ‘/home/gosia/software/ParaView-v5.5.2/build’
CMakeFiles/Makefile2:49614: recipe for target ‘CommandLineExecutables/CMakeFiles/pvdataserver.dir/all’ failed
make[1]: *** [CommandLineExecutables/CMakeFiles/pvdataserver.dir/all] Error 2
make[1]: Leaving directory ‘/home/gosia/software/ParaView-v5.5.2/build’
Makefile:151: recipe for target ‘all’ failed
make: *** [all] Error 2

i tried to add -luuid to
CommandLineExecutables/CMakeFiles/pvdataserver.dir/link.txt
but it gave the same error

What happens if you compile this small program:

#include <X11/SM/SMlib.h>
#include <stdlib.h>

int main(int argc, char* argv[]) {
  SmcProtocolVersion(NULL);
  return 0;
}

via:

gcc test.c -lSM -luuid

If this doesn’t work, I suspect something is wrong with the system. What happens without the -luuid might also be interesting.

when i compile with -luuid i get:

gosia@nela:~/jobs$ ./a.out
Segmentation fault (core dumped)

without -luuid it’s the same

and when i compile with “-v”:

(it’s ubuntu 18.04 freshly upgraded from 16.04)

gosia@nela:~/jobs$ c
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: …/src/configure -v --with-pkgversion=‘Ubuntu 7.3.0-27ubuntu1~18.04’ --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
COLLECT_GCC_OPTIONS=’-v’ ‘-mtune=generic’ ‘-march=x86-64’
/usr/lib/gcc/x86_64-linux-gnu/7/cc1 -quiet -v -imultiarch x86_64-linux-gnu test.c -quiet -dumpbase test.c -mtune=generic -march=x86-64 -auxbase test -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/cc5lHcHh.s
GNU C11 (Ubuntu 7.3.0-27ubuntu1~18.04) version 7.3.0 (x86_64-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory “/usr/local/include/x86_64-linux-gnu”
ignoring nonexistent directory “/usr/lib/gcc/x86_64-linux-gnu/7/…/…/…/…/x86_64-linux-gnu/include”
#include “…” search starts here:
#include <…> search starts here:
/usr/lib/gcc/x86_64-linux-gnu/7/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
GNU C11 (Ubuntu 7.3.0-27ubuntu1~18.04) version 7.3.0 (x86_64-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c8081a99abb72bbfd9129549110a350c
COLLECT_GCC_OPTIONS=’-v’ ‘-mtune=generic’ ‘-march=x86-64’
as -v --64 -o /tmp/cc4TiOCg.o /tmp/cc5lHcHh.s
GNU assembler version 2.30 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.30
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/…/…/…/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/…/…/…/…/lib/:/lib/x86_64-linux-gnu/:/lib/…/lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/…/lib/:/usr/lib/gcc/x86_64-linux-gnu/7/…/…/…/:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS=’-v’ ‘-mtune=generic’ ‘-march=x86-64’
/usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/cc1LEeBf.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro /usr/lib/gcc/x86_64-linux-gnu/7/…/…/…/x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/…/…/…/x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/…/…/…/x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/…/…/…/…/lib -L/lib/x86_64-linux-gnu -L/lib/…/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/…/lib -L/usr/lib/gcc/x86_64-linux-gnu/7/…/…/… /tmp/cc4TiOCg.o -lSM -luuid -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/…/…/…/x86_64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS=’-v’ ‘-mtune=generic’ ‘-march=x86-64’

A segfault is expected. I guess more will have to be done to track down where the libuuid requirement is actually coming from and how to get it into the build.

dear Ben,
thank you for your continuous help,

finally i decided to try with paraview 5.6.0 - there the error was the same at first, but then adding -luuid as in:

X11_SM_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libSM.so;-luuid

in CMakeCache.txt helped and paraview compiled without problems,
there must be some difference between PV 5.5.2 and 5.6.0 related to that error, as i didn’t install/reinstall any other software on my laptop in between,

thanks again!
best wishes,
gosia

Thanks for reporting back. There probably is some difference, but if anyone needs to know in the future, bisecting would probably show the change which fixed it.

Hi, I don’t know if I should start a new thread but I’m having the same issue with ParaView 5.6.0.

I tried adding the following to my CMakeCache.txt as suggested above:

X11_SM_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libSM.so;-luuid

but I do not seem to be able to get past this issue. Running make with VERBOSE=1, the result line which fails is:

$ cd /opt/paraview/ParaView-5.6.0_build/CommandLineExecutables && /opt/cmake/cmake-3.11.0/bin/cmake -E cmake_link_script CMakeFiles/pvpython.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -O3 -DNDEBUG -rdynamic CMakeFiles/pvpython.dir/pvpython.cxx.o -o …/bin/pvpython -Wl,-rpath,/opt/paraview/ParaView-5.6.0_build/lib:/home/tjim/anaconda3/envs/pv/lib: …/lib/libvtkPVServerManagerApplication-pv5.6.so.1 …/lib/libvtkUtilitiesPythonInitializer-pv5.6.so.1 …/lib/libvtkPVServerManagerCore-pv5.6.so.1 …/lib/libvtkPVServerImplementationCore-pv5.6.so.1 …/lib/libvtkPVClientServerCoreCore-pv5.6.so.1 …/lib/libvtkFiltersParallel-pv5.6.so.1 …/lib/libvtkFiltersExtraction-pv5.6.so.1 …/lib/libvtkFiltersModeling-pv5.6.so.1 …/lib/libvtkFiltersGeometry-pv5.6.so.1 …/lib/libvtkFiltersProgrammable-pv5.6.so.1 …/lib/libvtkPVVTKExtensionsCore-pv5.6.so.1 …/lib/libvtkPVCommon-pv5.6.so.1 …/lib/libvtkClientServer-pv5.6.so.1 …/lib/libvtkIOXMLParser-pv5.6.so.1 …/lib/libvtkFiltersSources-pv5.6.so.1 …/lib/libvtkFiltersGeneral-pv5.6.so.1 …/lib/libvtkFiltersCore-pv5.6.so.1 …/lib/libvtkIOImage-pv5.6.so.1 …/lib/libvtkParallelCore-pv5.6.so.1 …/lib/libvtkIOLegacy-pv5.6.so.1 …/lib/libvtkIOCore-pv5.6.so.1 …/lib/libvtkCommonExecutionModel-pv5.6.so.1 …/lib/libvtkCommonDataModel-pv5.6.so.1 …/lib/libvtkCommonSystem-pv5.6.so.1 …/lib/libvtkCommonTransforms-pv5.6.so.1 …/lib/libvtkPVVTKExtensionsSIL-pv5.6.so.1 …/lib/libprotobuf.so -lpthread …/lib/libvtkjsoncpp-pv5.6.so.1 …/lib/libvtkPythonInterpreter-pv5.6.so.1 …/lib/libvtkCommonMisc-pv5.6.so.1 …/lib/libvtkCommonMath-pv5.6.so.1 /home/tjim/anaconda3/envs/pv/lib/libpython3.7m.so …/lib/libvtkWrappingPython37Core-pv5.6.so.1 …/lib/libvtkCommonCore-pv5.6.so.1 …/lib/libvtksys-pv5.6.so.1 -ldl -Wl,-rpath-link,/opt/paraview/ParaView-5.6.0_build/lib
//usr/lib64/libSM.so.6: undefined reference to uuid_generate@UUID_1.0' //usr/lib64/libSM.so.6: undefined reference touuid_unparse_lower@UUID_1.0’
collect2: error: ld returned 1 exit status

Can you give any advice?

Many thanks!
Tim

Similar to what Ben said I think one just needs to do this in the CMake-way. Therefore, add the following line to the file ParaView-v*/CMakeLists.txt:
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -luuid")
I’m not sure where to put it, I just placed it before the first include(...) statement. Solved the issue at least for me.