Thu, 05/16/2024 - 14:08
Forums:
Hello guys,
my build fails when activating precompiled headers and the DataExchange and DETools modules with errors.
For DETools, the output says nothing
CMake Error at /Users/.../Dev/OCCT/adm/cmake/cotire.cmake:1995 (message):
cotire: error 1 precompiling
/Users/.../Dev/cmake_testing/build/_deps/opencascade-build/src/ExpToCasExe/cotire/ExpToCasExe_CXX_prefix.hxx.
Call Stack (most recent call first):
/Users/.../Dev/OCCT/adm/cmake/cotire.cmake:3716 (cotire_precompile_prefix_header)
and for DataExchange, the errors seem to be related to C headers without include guards being included more than once.
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:20:8: error: redefinition of 'parlist'
struct parlist {
^
/Users/.../Dev/cmake_testing/build/_deps/opencascade-build/src/TKDEIGES/cotire/TKDEIGES_C_prefix.c:6:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "/Users/.../Dev/OCCT/src/IGESFile/igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/structiges.c:19:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:20:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct parlist {
^
In file included from /Users/.../Dev/OCCT/src/IGESFile/structiges.c:19:
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:25:8: error: redefinition of 'dirpart'
struct dirpart {
^
/Users/.../Dev/cmake_testing/build/_deps/opencascade-build/src/TKDEIGES/cotire/TKDEIGES_C_prefix.c:6:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "/Users/.../Dev/OCCT/src/IGESFile/igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/structiges.c:19:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:25:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct dirpart {
^
In file included from /Users/.../Dev/OCCT/src/IGESFile/analiges.c:17:
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:20:8: error: redefinition of 'parlist'
struct parlist {
^
In file included from /Users/.../Dev/OCCT/src/IGESFile/igesread.c:18:
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:20:8: error: redefinition of 'parlist'
struct parlist {
^
/Users/.../Dev/cmake_testing/build/_deps/opencascade-build/src/TKDEIGES/cotire/TKDEIGES_C_prefix.c:6:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "/Users/.../Dev/OCCT/src/IGESFile/igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/igesread.c:18:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:20:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct parlist {
^
/Users/.../Dev/cmake_testing/build/_deps/opencascade-build/src/TKDEIGES/cotire/TKDEIGES_C_prefix.c:6:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "/Users/.../Dev/OCCT/src/IGESFile/igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/analiges.c:17:10: In file included from note: /Users/.../Dev/OCCT/src/IGESFile/igesread.c:'/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here18:
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:25:#include "igesread.h"8
: ^
error: redefinition of 'dirpart'/Users/.../Dev/OCCT/src/IGESFile/igesread.h:
20:8: struct dirpart {
note: ^
unguarded header; consider using #ifdef guards or #pragma once
struct parlist {
^
/Users/.../Dev/cmake_testing/build/_deps/opencascade-build/src/TKDEIGES/cotire/TKDEIGES_C_prefix.c:6:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "/Users/.../Dev/OCCT/src/IGESFile/igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/igesread.c:18:10: note: In file included from /Users/.../Dev/OCCT/src/IGESFile/analiges.c:17:
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:25:8: error: redefinition of 'dirpart'
struct dirpart {
^
/Users/.../Dev/cmake_testing/build/_deps/opencascade-build/src/TKDEIGES/cotire/TKDEIGES_C_prefix.c:6:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "/Users/.../Dev/OCCT/src/IGESFile/igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/analiges.c:17:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:25:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct dirpart {
^
'/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:25:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct dirpart {
^
2 errors generated.
2 errors generated.
2 errors generated.
In file included from /Users/.../Dev/OCCT/src/IGESFile/liriges.c:16:
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:20:8: error: redefinition of 'parlist'
struct parlist {
^
/Users/.../Dev/cmake_testing/build/_deps/opencascade-build/src/TKDEIGES/cotire/TKDEIGES_C_prefix.c:6:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "/Users/.../Dev/OCCT/src/IGESFile/igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/liriges.c:16:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:20:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct parlist {
^
In file included from /Users/.../Dev/OCCT/src/IGESFile/liriges.c:16:
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:25:8: error: redefinition of 'dirpart'
struct dirpart {
^
/Users/.../Dev/cmake_testing/build/_deps/opencascade-build/src/TKDEIGES/cotire/TKDEIGES_C_prefix.c:6:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "/Users/.../Dev/OCCT/src/IGESFile/igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/liriges.c:16:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:25:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct dirpart {
^
make[2]: *** [_deps/opencascade-build/src/TKDEIGES/CMakeFiles/TKDEIGES.dir/Users/.../Dev/OCCT/src/IGESFile/structiges.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
2 errors generated.
make[2]: *** [_deps/opencascade-build/src/TKDEIGES/CMakeFiles/TKDEIGES.dir/Users/.../Dev/OCCT/src/IGESFile/igesread.c.o] Error 1
make[2]: *** [_deps/opencascade-build/src/TKDEIGES/CMakeFiles/TKDEIGES.dir/Users/.../Dev/OCCT/src/IGESFile/analiges.c.o] Error 1
make[2]: *** [_deps/opencascade-build/src/TKDEIGES/CMakeFiles/TKDEIGES.dir/Users/.../Dev/OCCT/src/IGESFile/liriges.c.o] Error 1
In file included from /Users/.../Dev/OCCT/src/IGESFile/IGESFile_Read.cxx:30:
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:20:8: error: redefinition of 'parlist'
struct parlist {
^
/Users/.../Dev/cmake_testing/build/_deps/opencascade-build/src/TKDEIGES/cotire/TKDEIGES_CXX_prefix.cxx:443:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "/Users/.../Dev/OCCT/src/IGESFile/igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/IGESFile_Read.cxx:30:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:20:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct parlist {
^
In file included from /Users/.../Dev/OCCT/src/IGESFile/IGESFile_Read.cxx:30:
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:25:8: error: redefinition of 'dirpart'
struct dirpart {
^
/Users/.../Dev/cmake_testing/build/_deps/opencascade-build/src/TKDEIGES/cotire/TKDEIGES_CXX_prefix.cxx:443:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "/Users/.../Dev/OCCT/src/IGESFile/igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/IGESFile_Read.cxx:30:10: note: '/Users/.../Dev/OCCT/src/IGESFile/igesread.h' included multiple times, additional include site here
#include "igesread.h"
^
/Users/.../Dev/OCCT/src/IGESFile/igesread.h:25:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct dirpart {
^
2 errors generated.
make[2]: *** [_deps/opencascade-build/src/TKDEIGES/CMakeFiles/TKDEIGES.dir/Users/.../Dev/OCCT/src/IGESFile/IGESFile_Read.cxx.o] Error 1
make[1]: *** [_deps/opencascade-build/src/TKDEIGES/CMakeFiles/TKDEIGES.dir/all] Error 2
and
In file included from /Users/.../Dev/OCCT/src/StepFile/lex.step.cxx:326:
In file included from /Users/.../Dev/cmake_testing/build/_deps/opencascade-build/include/opencascade/FlexLexer.h:1:
/Users/.../Dev/OCCT/src/FlexLexer/FlexLexer.h:119:7: error: redefinition of 'stepFlexLexer'
class yyFlexLexer : public FlexLexer {
^
/Users/.../Dev/OCCT/src/StepFile/lex.step.cxx:27:25: note: expanded from macro 'yyFlexLexer'
#define yyFlexLexer stepFlexLexer
^
/Users/.../Dev/OCCT/src/FlexLexer/FlexLexer.h:119:7: note: previous definition is here
class yyFlexLexer : public FlexLexer {
^
/Users/.../Dev/OCCT/src/StepFile/step.tab.hxx:837:21: note: expanded from macro 'yyFlexLexer'
#define yyFlexLexer stepFlexLexer
^
/Users/.../Dev/OCCT/src/StepFile/lex.step.cxx:1321:15: warning: implicit conversion loses integer precision: 'streamsize' (aka 'long') to 'int' [-Wshorten-64-to-32]
return yyin.gcount();
~~~~~~ ~~~~~^~~~~~~~
/Users/.../Dev/OCCT/src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx:99:3: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf (procver, XSTEP_PROCESSOR_VERSION, "STEP");
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
1 warning and 1 error generated.
make[2]: *** [_deps/opencascade-build/src/TKDESTEP/CMakeFiles/TKDESTEP.dir/Users/.../Dev/OCCT/src/StepFile/lex.step.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 warning generated.
make[1]: *** [_deps/opencascade-build/src/TKDESTEP/CMakeFiles/TKDESTEP.dir/all] Error 2
make: *** [all] Error 2
are these bugs or am I doing something wrong?
I am calling building as
$> mkdir build && cd build;
$> cmake .. -DBUILD_USE_PCH=ON -DBUILD_MODULE_DataExchange=ON -DBUILD_MODULE_DETools=ON && cmake --build .
with Apple Clang 15.0.0
Many thanks.
Pablo
Thu, 05/16/2024 - 23:24
>> are these bugs or am I doing something wrong?
It is internal bug related with latest versions of Clang compiler. I have some small issues with latest clang on Linux and Win(msvc and gcc are fine), but the fix still on to do status. As for MacOS the problem is not known, thank you. I will create a combined bug.
Best regards, Dmitrii.