CMake fails to search for /usr/lib/<arch> so fails to build Salome Mesh

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
kcleung
Posts: 162
Joined: Sun Apr 24, 2011 11:56 am

CMake fails to search for /usr/lib/<arch> so fails to build Salome Mesh

Post by kcleung »

I am running on Lubuntu 16.04, and have both libfreeimage3 and libfreeimage3-dev installed

[ 1%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/SMDS_VolumeOfNodes.cpp.o
[ 1%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/SMDS_VolumeTool.cpp.o
make[2]: *** No rule to make target '/usr/lib/libfreeimage.so', needed by 'lib/libSMDS.so'. Stop.
CMakeFiles/Makefile2:416: recipe for target 'src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/all' failed
make[1]: *** [src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

In Ubuntu, there are no links to /usr/lib:


abc@abc-virtual-machine:/mnt/hgfs/git/dev/freecad-bin$ ls /usr/lib/libfreeimage.so
ls: cannot access '/usr/lib/libfreeimage.so': No such file or directory
abc@abc-virtual-machine:/mnt/hgfs/git/dev/freecad-bin$ dpkg -L libfreeimage3
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libfreeimage-3.17.0.so
/usr/share
/usr/share/doc
/usr/share/doc/libfreeimage3
/usr/share/doc/libfreeimage3/copyright
/usr/share/doc/libfreeimage3/changelog.Debian.gz
/usr/lib/x86_64-linux-gnu/libfreeimage.so.3
abc@abc-virtual-machine:/mnt/hgfs/git/dev/freecad-bin$


According to:

https://wiki.ubuntu.com/MultiarchSpec

distributions are moving away from placing libraries directly in /usr/lib

Instead libraries are placed in their own architecture subdirectory:

/usr/lib/<arch>/

So CMakeLists.txt really needs to search for /usr/lib/<arch> by default
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: CMake fails to search for /usr/lib/<arch> so fails to build Salome Mesh

Post by wmayer »

ls: cannot access '/usr/lib/libfreeimage.so': No such file or directory
No idea where the path /usr/lib is coming from for freeimage. This is a library OCE and nglib uses, FreeCAD doesn't directly link to it. As a workaround for now I think you should create a symlink inside /usr/lib.
User avatar
f3nix
Posts: 346
Joined: Sat May 30, 2015 11:58 am

Re: CMake fails to search for /usr/lib/<arch> so fails to build Salome Mesh

Post by f3nix »

kcleung wrote: So CMakeLists.txt really needs to search for /usr/lib/<arch> by default
Hi kcleung,
you are probably seeing bug in liboce-visualisation-dev package in action.
https://bugs.launchpad.net/ubuntu/+sour ... ug/1556680

As @wmayer wrote a workaround is to create a symlink.

It is not a problem in FreeCAD's build system.

HTH! :)

Cheers,
Mateusz
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: CMake fails to search for /usr/lib/<arch> so fails to build Salome Mesh

Post by NormandC »

wmayer wrote:No idea where the path /usr/lib is coming from for freeimage.
It's been a problem with Debian since past January. viewtopic.php?t=13955#p111466

The latest Ubuntu version is always based on Debian unstable so it got the same bug.

libfreeimage now supports Multi-Arch. But inexplicably as shown in /usr/lib/x86_64-linux-gnu/oce-0.16/OCE04_VisualizationTargets-relwithdebinfo.cmake (from liboce-vizualisation-dev) it is the only library that OCE doesn't recognize as supporting Multi-Arch.

Another fix is to build OCE without freeimage support since FreeCAD does not link to it directly.

One thing I've been wondering Werner, does FreeCAD really need liboce-vizualisation-dev? Since it uses Coin I wouldn't think so...
User avatar
f3nix
Posts: 346
Joined: Sat May 30, 2015 11:58 am

Re: CMake fails to search for /usr/lib/<arch> so fails to build Salome Mesh

Post by f3nix »

NormandC wrote:
wmayer wrote:No idea where the path /usr/lib is coming from for freeimage.
It's been a problem with Debian since past January. viewtopic.php?t=13955#p111466

The latest Ubuntu version is always based on Debian unstable so it got the same bug.

libfreeimage now supports Multi-Arch. But inexplicably as shown in /usr/lib/x86_64-linux-gnu/oce-0.16/OCE04_VisualizationTargets-relwithdebinfo.cmake (from liboce-vizualisation-dev) it is the only library that OCE doesn't recognize as supporting Multi-Arch.
Debian does not have this problem. 0.17.1 packages are good. The issue you link above was related to package transitions: oce 0.15 to 0.17 and libfreeimage in Debian.

I hope this clears things up.

Cheers,
Mateusz
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: CMake fails to search for /usr/lib/<arch> so fails to build Salome Mesh

Post by NormandC »

f3nix wrote:Debian does not have this problem. 0.17.1 packages are good.
Sorry to disagree, but it has not been fixed in Jessie-backports.

I checked the contents of liboce-visualization-dev_0.17.1-1~bpo8+1_amd64.deb.
https://packages.debian.org/jessie-back ... zation-dev

Here's the content of /usr/lib/x86_64-linux-gnu/oce-0.16/OCE04_VisualizationTargets-relwithdebinfo.cmake:

Code: Select all

# Import target "TKService" for configuration "RelWithDebInfo"
set_property(TARGET TKService APPEND PROPERTY IMPORTED_CONFIGURATIONS RELWITHDEBINFO)
set_target_properties(TKService PROPERTIES
  IMPORTED_LINK_INTERFACE_LIBRARIES_RELWITHDEBINFO "TKMath;TKernel;TKBRep;TKShHealing;TKGeomBase;TKGeomAlgo;TKG2d;TKG3d;TKTopAlgo;/usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so;/usr/lib/x86_64-linux-gnu/libGLU.so;/usr/lib/x86_64-linux-gnu/libGL.so;/usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so;/usr/lib/x86_64-linux-gnu/libfreetype.so;/usr/lib/libfreeimage.so"
The testing and unstable packages are simply built without freeimage support and the link to /usr/lib/libfreeimage.so does not appear anymore.
User avatar
f3nix
Posts: 346
Joined: Sat May 30, 2015 11:58 am

Re: CMake fails to search for /usr/lib/<arch> so fails to build Salome Mesh

Post by f3nix »

NormandC wrote:
f3nix wrote:Debian does not have this problem. 0.17.1 packages are good.
Sorry to disagree, but it has not been fixed in Jessie-backports.

I checked the contents of liboce-visualization-dev_0.17.1-1~bpo8+1_amd64.deb.
https://packages.debian.org/jessie-back ... zation-dev

Here's the content of /usr/lib/x86_64-linux-gnu/oce-0.16/OCE04_VisualizationTargets-relwithdebinfo.cmake:

Code: Select all

# Import target "TKService" for configuration "RelWithDebInfo"
set_property(TARGET TKService APPEND PROPERTY IMPORTED_CONFIGURATIONS RELWITHDEBINFO)
set_target_properties(TKService PROPERTIES
  IMPORTED_LINK_INTERFACE_LIBRARIES_RELWITHDEBINFO "TKMath;TKernel;TKBRep;TKShHealing;TKGeomBase;TKGeomAlgo;TKG2d;TKG3d;TKTopAlgo;/usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so;/usr/lib/x86_64-linux-gnu/libGLU.so;/usr/lib/x86_64-linux-gnu/libGL.so;/usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so;/usr/lib/x86_64-linux-gnu/libfreetype.so;/usr/lib/libfreeimage.so"

https://packages.debian.org/jessie/amd6 ... 3/filelist

libfreeimage is under /usr/lib in Jessie.
NormandC wrote: The testing and unstable packages are simply built without freeimage support and the link to /usr/lib/libfreeimage.so does not appear anymore.
https://anonscm.debian.org/cgit/debian- ... bian/rules sets:

Code: Select all

-DOCE_WITH_FREEIMAGE:BOOL=ON
https://anonscm.debian.org/cgit/debian- ... an/control lists:

Code: Select all

libfreeimage-dev
as Build-Depends.

But the build log does not have "-DHAVE_FREEIMAGE" and the CMake configure step does not complain about not finding freeimage.

Is it a bug that fixes a bug? ;)

Cheers,
Mateusz
Post Reply