pythonocc-core
pythonocc-core copied to clipboard
Compilation failing on OSX 10.15.6 (Catalina) with error "<rapidjson/prettywriter.h> not found"
I'm new to CMake but familiar with compilation of C++ projects from source. When trying to compile pythonocc from source on OSX-catalina, the compilation fails with the following error
In file included from /.../pythonocc/pythonocc-core/cmake-build/Darwin/x86_64-Release-/RWGltfPYTHON_wrap.cxx:4875:
In file included from /.../pythonocc/pythonocc-core/src/SWIG_files/headers/RWGltf_module.hxx:34:
/usr/local/include/opencascade/RWGltf_GltfOStreamWriter.hxx:17:10: fatal error: 'rapidjson/prettywriter.h' file not found
#include <rapidjson/prettywriter.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~
I installed rapidjson using brew install rapidjson and confirmed that the required files (specifically prettywriter.h) was present in the include directories. Yet CMake was not including the header files in /usr/local/include (my guess).
EDIT Adding
include_directories("/usr/local/include")
inside the
if(APPLE)
endif(APPLE)
solved the issue.
Thank you for the report. Which pythonocc-core version are you trying to build ?
I followed the instructions in Install.md and cloned the latest repo. So (I guess) Version 7.4.1.
No, the current master branch is the dev version, to be 7.5.0
Sorry. Yes, I built the current master branch.
Hi, I was compiling latest source of pythonocc on debian buster and face this issue. I installed rapidjson-dev and applied make command again and issue was resolved.
I think there is need of adding dependency of rapidjson in the installation instructions. Like for debian, before compilation, install the following package:
sudo apt install rapidjson-dev
FR
Just ran into the same thing with building 7.5.1 - @fslurrehman is correct for Ubuntu. (I hope this library does what I want - compiling it and opencascade has been quite an adventure! :-) )
Hi, I ran into such a problem on a mac m1. I did
brew install rapidjson
but it didn't help.

Manually configuring the CPLUS_INCLUDE_PATH works for me.
export CPLUS_INCLUDE_PATH=/usr/local/include:$CPLUS_INCLUDE_PATH