Issues compiling freecad(opencascade)

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Gip-Gip
Posts: 3
Joined: Mon Jul 05, 2021 2:10 am

Issues compiling freecad(opencascade)

Post by Gip-Gip »

I've had issues trying to compile freecad using cmake and I have yet to be able to rectify them

At first I thought it was a pthreads issue but that is, for some reason, an error that crops up when other things also fail.

This is the only other error I have. I do have open cascade installed.

Code: Select all

CMake Error at cMake/FindOpenCasCade.cmake:101 (file):
  file STRINGS file "//include/opencascade/Standard_Version.hxx" cannot be
  read.
Call Stack (most recent call first):
  cMake/FreeCAD_Helpers/SetupOpenCasCade.cmake:4 (find_package)
  CMakeLists.txt:51 (SetupOpenCasCade)


CMake Error at cMake/FindOpenCasCade.cmake:104 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  cMake/FreeCAD_Helpers/SetupOpenCasCade.cmake:4 (find_package)
  CMakeLists.txt:51 (SetupOpenCasCade)


CMake Error at cMake/FindOpenCasCade.cmake:105 (file):
  file STRINGS file "//include/opencascade/Standard_Version.hxx" cannot be
  read.
Call Stack (most recent call first):
  cMake/FreeCAD_Helpers/SetupOpenCasCade.cmake:4 (find_package)
  CMakeLists.txt:51 (SetupOpenCasCade)


CMake Error at cMake/FindOpenCasCade.cmake:108 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  cMake/FreeCAD_Helpers/SetupOpenCasCade.cmake:4 (find_package)
  CMakeLists.txt:51 (SetupOpenCasCade)


CMake Error at cMake/FindOpenCasCade.cmake:109 (file):
  file STRINGS file "//include/opencascade/Standard_Version.hxx" cannot be
  read.
Call Stack (most recent call first):
  cMake/FreeCAD_Helpers/SetupOpenCasCade.cmake:4 (find_package)
  CMakeLists.txt:51 (SetupOpenCasCade)


CMake Error at cMake/FindOpenCasCade.cmake:112 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  cMake/FreeCAD_Helpers/SetupOpenCasCade.cmake:4 (find_package)
  CMakeLists.txt:51 (SetupOpenCasCade)


CMake Warning (dev) at /usr/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (OCC) does
  not match the name of the calling package (OpenCasCade).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cMake/FindOpenCasCade.cmake:120 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  cMake/FreeCAD_Helpers/SetupOpenCasCade.cmake:4 (find_package)
  CMakeLists.txt:51 (SetupOpenCasCade)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OCC: //include/opencascade (found version "..")
-- -- Found OCE/OpenCASCADE version: ..
-- -- OCE/OpenCASCADE include directory: //include/opencascade
-- -- OCE/OpenCASCADE shared libraries directory: //lib
jeinzi
Posts: 1
Joined: Wed Jan 19, 2022 4:43 pm

Re: Issues compiling freecad(opencascade)

Post by jeinzi »

Sorry for necrobumping - I just faced the same issue and want to leave my solution here.

I am using Arch Linux and have no /include directory, so the solution for me was to simply edit cMake/FindOpenCasCade.cmake and replace

Code: Select all

set(OCC_INCLUDE_DIR ${OpenCASCADE_INCLUDE_DIR})
with

Code: Select all

set(OCC_INCLUDE_DIR "/usr/include/opencascade")
Hope this helps someone :)
Post Reply