Compliling OCC with CMAKE on Ubuntu

Helllo OCC community,

I have been trying to build OCC on my Ubuntu system (13.04) with CMAKE, but I have some questions.

The compilation and linking succeeded as well as installing the libraries, but when I try to use it in my application, it is always telling me:
"check config.h file or compilation options: either HAVE_LIMITS or HAVE_LIMITS_H should be defined"

Alright, I understand what this means. I have to add "-DHAVE_CONFIG_H" to my compiler definitions, and include config.h in my project such that OCC knows what standard header files it has to look for. Okay, I did so, there were still problems. So I had to add "-DLIN" and "-DHAVE_WOK_CONFIG_H" to the definitions as well. Now I could compile my application.

The question is, if I use the standard OCC libraries provided by the Ubuntu repositories (libopencascade-dev and similar stuff) why is it that I don't have to make these adjustments in my application? Are those libraries "tailored" in such a way that they always work on the Ubuntu system?

Denis Barbier's picture

Hello,

This is an interesting issue; I am the main contributor of Debian (and thus Ubuntu) packages of OCC, so my viewpoint is of course biased.

Upstream developers have to deal with a broad variety of platforms: Linux, Windows, BSD, Solaris, etc. They often suggest to install path into /opt/foo-1.X/ (and thus requires modification of PATH variable) or heavily rely on environment variables.
On the other hand, Debian developers want to provide an integrated system which does not require extra settings, so I patched OCC to remove the need of those -D definitions.

BTW you could install liboce-* packages on Ubuntu to have newer versions of OCC libraries.

Laszlo Kudela's picture

Dear Denis,

thank you for the reply! It is good to have a little insight into how OCC packages is set up on Debian distros.

Thanks for the hint about the up-to-date libraries! I had to compile OCC myself because I am doing some profiling for bottleneck detection in our application and for that I needed the libraries compiled with the -g flags.

Best regards,
Laszlo

Laszlo Kudela's picture

Dear Denis and Ubuntu users,

I have just updated to Ubuntu 13.10, and I noticed that the package libopencascade-dev was removed from the package manager in this new version. Instead, the liboce-ocaf-dev package is introduced. I haven't seen any significant difference so far. Can you point out how the to pacakges differ, if they do at all? The only thing I saw is that the libs and headers are now installed to a different PATH.

Best regards,
László