tpaviot / oce

OpenCASCADE Community Edition (OCE): a community driven fork of the Open CASCADE library.
http://groups.google.com/group/oce-dev
GNU Lesser General Public License v2.1
808 stars 284 forks source link

occt 7.2/7.4 build error: cannot find -lXmu #727

Closed roipoussiere closed 4 years ago

roipoussiere commented 4 years ago

I installed these dependencies:

Then when I build opencascade 7.4, extracted from the last release, the build stop at 36% without a clear error message:

# [ 36%] Linking CXX shared library ../../lin64/gcc/lib/libTKShHealing.so
# [ 36%] Built target TKShHealing
# make: *** [Makefile:130: all] Error 2
# Error: module oce: Child process exited with code 2

Note: when building occt 7.2 I'm facing an other problem (#728) (edit: probably not related).

roipoussiere commented 4 years ago

After redirecting stderr to a file, I found the error message (which was hidden by some really verbose unfinished jobs):

/usr/lib/gcc/x86_64-unknown-linux-gnu/9.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lXmu
collect2: error: ld returned 1 exit status
make[2]: *** [src/TKService/CMakeFiles/TKService.dir/build.make:440: lin64/gcc/lib/libTKService.so.7.2.0] Error 1
make[1]: *** [CMakeFiles/Makefile2:1190: src/TKService/CMakeFiles/TKService.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

This error appears on both occt 7.2 and 7.4

roipoussiere commented 4 years ago

As suggested here I ran ld -lXmu --verbose:

[...]
ld: mode elf_x86_64
attempt to open /usr/x86_64-unknown-linux-gnu/lib64/libXmu.so failed
attempt to open /usr/x86_64-unknown-linux-gnu/lib64/libXmu.a failed
attempt to open /usr/lib/x86_64-linux-gnu/libXmu.so failed
attempt to open /usr/lib/x86_64-linux-gnu/libXmu.a failed
attempt to open /usr/lib/libXmu.so failed
attempt to open /usr/lib/libXmu.a failed
attempt to open /usr/x86_64-unknown-linux-gnu/lib/libXmu.so failed
attempt to open /usr/x86_64-unknown-linux-gnu/lib/libXmu.a failed
ld: cannot find -lXmu

So libxmu was missing, installing it fixed the problem.