pythonocc-core icon indicating copy to clipboard operation
pythonocc-core copied to clipboard

Compilation failing on OSX 10.15.6 (Catalina) with error "<rapidjson/prettywriter.h> not found"

Open rohan-kekatpure opened this issue 4 years ago • 9 comments

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.

rohan-kekatpure avatar Feb 16 '21 01:02 rohan-kekatpure

Thank you for the report. Which pythonocc-core version are you trying to build ?

tpaviot avatar Feb 16 '21 05:02 tpaviot

I followed the instructions in Install.md and cloned the latest repo. So (I guess) Version 7.4.1.

rohan-kekatpure avatar Feb 16 '21 15:02 rohan-kekatpure

No, the current master branch is the dev version, to be 7.5.0

tpaviot avatar Feb 16 '21 16:02 tpaviot

Sorry. Yes, I built the current master branch.

rohan-kekatpure avatar Feb 16 '21 17:02 rohan-kekatpure

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

fslurrehman avatar Feb 21 '21 15:02 fslurrehman

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! :-) )

howardjones avatar Jul 09 '21 08:07 howardjones

Hi, I ran into such a problem on a mac m1. I did brew install rapidjson but it didn't help. image

oleg-medovikov avatar Jan 12 '22 17:01 oleg-medovikov

Manually configuring the CPLUS_INCLUDE_PATH works for me.

export CPLUS_INCLUDE_PATH=/usr/local/include:$CPLUS_INCLUDE_PATH

lotuc avatar Nov 10 '23 08:11 lotuc