error building against OpenCASCADE

Two different projects give the same following error when building against OpenCASCADE. I'm looking for information on what this means and how to fix it. libTKernel.so.x is located in /usr/lib64. Any help would be appreciated. Thanks.

CMake Error at /usr/lib64/cmake/OpenCascade/OpenCASCADEFoundationClassesTargets.cmake:101 (message):
The imported target "TKernel" references the file

"/usr/lib64${OCCT_INSTALL_BIN_LETTER}/libTKernel.so.7.8.1"
but this file does not exist. Possible reasons include:

* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained

"/usr/lib64/cmake/OpenCascade/OpenCASCADEFoundationClassesTargets.cmake"

but not all the files it references.

Call Stack (most recent call first):
/usr/lib64/cmake/OpenCascade/OpenCASCADEConfig.cmake:102 (include)

Dmitrii Pasukhin's picture

Hello, that is a installed package from Ubuntu repository? Or it is result of your own installation?

Best regards, Dmitrii.

Christopher Luck's picture

Built from source on Slackware 64 post 15.0

Dmitrii Pasukhin's picture

In that case the problem not clear. The file located by this path or not? Please discribe you problem a little more.

Best regards, Dmitrii.

Christopher Luck's picture

ls /usr/lib64${OCCT_INSTALL_BIN_LETTER} | grep libTKernel.so
libTKernel.so@
libTKernel.so.7.8@
libTKernel.so.7.8.1*

I do not know what the ${OCCT_INSTALL_BIN_LETTER} is in reference to.

Dmitrii Pasukhin's picture

${OCCT_INSTALL_BIN_LETTER} it is our special symbol to define type. 'd' - debug, ''- release, 'i' - release with deb info.

So, in your case if you build release, the symbol is empty. Everything should be fine.

Best regards, Dmitrii.

Christopher Luck's picture

When I try to build against the library I get this error message and I don't understand why.

Dmitrii Pasukhin's picture

Please try to check permissions for that files.

Best regards, Dmitri.

Christopher Luck's picture

-rwxr-xr-x What should it be? Owned by root as is all my libraries.

Christopher Luck's picture

Is this an issue I need to take up with the projects that are calling for OpenCascade and having this issue?

Dmitrii Pasukhin's picture

This warning from OpenCascade CMake profile. Means OCCT problem. But for understanding needs more information. Please try to modify install directory and install occt into another folder, not default.

Best regards, Dmitrii.

Christopher Luck's picture

I am attempting to rebuild with -DCMAKE_INSTALL_PREFIX=/usr/local

Dmitrii Pasukhin's picture

Please use specific folder to check the issue, for example: "/usr/local/occt"

Christopher Luck's picture

CMake Error at /usr/local/OpenCascade/lib64/cmake/OpenCascade/OpenCASCADEFoundationClassesTargets.cmake:92 (message):
The imported target "TKernel" references the file

"/usr/local/OpenCascade/lib64${OCCT_INSTALL_BIN_LETTER}/libTKernel.so.7.8.1"

but this file does not exist. Possible reasons include:

* The file was deleted, renamed, or moved to another location.

Dmitrii Pasukhin's picture

Hello, looks interesting. Could please share CMake version. And please inject next string into /usr/local/OpenCascade/lib64/cmake/OpenCascade/OpenCASCADEFoundationClassesTargets.cmake

"message (STATUS "/usr/local/OpenCascade/lib64${OCCT_INSTALL_BIN_LETTER}/libTKernel.so.7.8.1")"

Best regards, Dmitrii.

Christopher Luck's picture

CMake version 3.29.3

-- /usr/local/OpenCascade/lib64/libTKernel.so.7.8.1

Right before the other error message shows up.

Dmitrii Pasukhin's picture

Magic, I have no ideas. But in case if you modify file and remove variable? Unfortunately, I can't help without the same OS and env. Looks like a specific bug in CMake. Could you try another CMake version?

Best regards, Dmitrii.

Christopher Luck's picture

I'm not sure how you want me to add that status line to the cmake file and should I rebuild OpenCascade with the older cmake or just the programs building against the library?

Dmitrii Pasukhin's picture

Just for tests purposes, modify file and remove any using of variable for symbol.

And as for another version - only for configure of projects based on OCCT.

Best regards, Dmitrii.

Christopher Luck's picture

After commenting out the section that was checking for the existence of the file from all the cmake files. I get a build failure from one of the programs close to the end of the build process with the following error message. Maybe this program is looking for an old library that is no longer available on newer releases of OpenCascade? Could that be the reason for the failure on the commented out portion of the cmakes?

/usr/bin/ld: cannot find -lTKSTEP: No such file or directory
/usr/bin/ld: cannot find -lTKXDESTEP: No such file or directory
collect2: error: ld returned 1 exit status

Dmitrii Pasukhin's picture

Yes, we reorginize TK structure in OCCT 7.8
Please check upgrading guide: https://dev.opencascade.org/doc/overview/html/occt__upgrade.html#upgrade...

Best regards, Dmitrii.

Christopher Luck's picture

Even at version 7.7.2 I get the same error. After commenting out all cmakes with that check I am able to bypass this check and it seems to build ok. Not sure why this check is failing.