Archived issue #0020716
Eliminate usage of "config.h" header file
Description
In fact, during compilation of any product based on Open CASCADE on linux I see
warnings:
config.h:<line numbner>: warning "PACKAGE" redefined
config.h:<line numbner>: warning "PACKAGE_VERSION" redefined
...etc
And there a lot of such warnings about string defines redefinition.
With assistance of ABV it is decided that it would be more better
and comfortable to leave config.h (which generates automatically by configure
or automake) without changes and add special occ_config.h that will contain
the following construction
#ifndef OCC_CONFIG_H
#define OCC_CONFIG_H
// for Linux platforms
#ifdef WIN32
// make some changes and definitions for Windows platforms
#else ...// for Linux platforms
...
#include <config.h>
...
#endif
#endif // OCC_CONFIG_H
and to include this occ_config.h in Open CASCADE files instead of automatically
generated config.h
warnings:
config.h:<line numbner>: warning "PACKAGE" redefined
config.h:<line numbner>: warning "PACKAGE_VERSION" redefined
...etc
And there a lot of such warnings about string defines redefinition.
With assistance of ABV it is decided that it would be more better
and comfortable to leave config.h (which generates automatically by configure
or automake) without changes and add special occ_config.h that will contain
the following construction
#ifndef OCC_CONFIG_H
#define OCC_CONFIG_H
// for Linux platforms
#ifdef WIN32
// make some changes and definitions for Windows platforms
#else ...// for Linux platforms
...
#include <config.h>
...
#endif
#endif // OCC_CONFIG_H
and to include this occ_config.h in Open CASCADE files instead of automatically
generated config.h
Public activity
29 archived notes
Participants are labeled by their role within this record.
Usage of config.h should be completely revised. If possible, it should be eliminated completely -- we can rely on macros defined by compiler for detection of compiler and its settings, and on macros provided externally for definition of build environment (presence and location on third-party libraries etc.). If still necessary, config file should be made occt-specific to avoid conflicts, and there should be clear policy on how it is generated and used.
It is agreed to get rid of config.h file completely, so as not to depend on its external generation:
- all inclusions of this header should be removed
- all places where macros defined by config.h were are used should be revised to either just remove this check (if obsolete) or use compiler-defined macros (like _MSC_VER, __GNUC, etc.)
- if the same complex check is needed in many places, specific macro can be defined in Standard_Macro.hxx for it
- all inclusions of this header should be removed
- all places where macros defined by config.h were are used should be revised to either just remove this check (if obsolete) or use compiler-defined macros (like _MSC_VER, __GNUC, etc.)
- if the same complex check is needed in many places, specific macro can be defined in Standard_Macro.hxx for it
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: ski
Date: Thu Aug 21 13:02:37 2014 +0400
All inclusions of "config.h" were removed.
[revision removed]
Detailed log of new commits:
Author: ski
Date: Thu Aug 21 13:02:37 2014 +0400
All inclusions of "config.h" were removed.
Branch [archived branch] has been updated by Participant.
[revision removed]
Detailed log of new commits:
Author: Maintenance team (INV)
Date: Fri Aug 22 10:07:30 2014 +0400
All places where macros defined by config.h were checked and removed
[revision removed]
Detailed log of new commits:
Author: Maintenance team (INV)
Date: Fri Aug 22 10:07:30 2014 +0400
All places where macros defined by config.h were checked and removed
Branch [archived branch] has been updated forcibly by Commenter 4.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated by Commenter 4.
[revision removed]
Detailed log of new commits:
Author: Commenter 4
Date: Fri Aug 22 16:32:26 2014 +0400
Small corrections for mac os.
[revision removed]
Detailed log of new commits:
Author: Commenter 4
Date: Fri Aug 22 16:32:26 2014 +0400
Small corrections for mac os.
Branch CR20716 was successfully compiled on WNT, Debian60-64 and MacOS. Could you please review.
One minor remark: please remove completely the commented out code in OSD_Disk.cxx.
Then, please check building on older Linux platforms (take one with lowest version of GCC).
Then, please check building on older Linux platforms (take one with lowest version of GCC).
Branch [archived branch] has been updated by Participant.
[revision removed]
Detailed log of new commits:
Author: ski
Date: Mon Aug 25 12:04:39 2014 +0400
Unused code in file OSD_Disk.cxx was removed.
[revision removed]
Detailed log of new commits:
Author: ski
Date: Mon Aug 25 12:04:39 2014 +0400
Unused code in file OSD_Disk.cxx was removed.
In samples\qt\IESample\IESample.pro
Since HAVE_x_header_H staff is not used anymore - please remove these macros from samples (including Products branch).
DEFINES += OCC_CONVERT_SIGNALS HAVE_CONFIG_H HAVE_WOK_CONFIG_H QT_NO_STL
Since HAVE_x_header_H staff is not used anymore - please remove these macros from samples (including Products branch).
Branch [archived branch] has been updated by Participant.
[revision removed]
Detailed log of new commits:
Author: ski
Date: Mon Aug 25 16:45:14 2014 +0400
Unused macros and includes were removed from samples and code.
[revision removed]
Detailed log of new commits:
Author: ski
Date: Mon Aug 25 16:45:14 2014 +0400
Unused macros and includes were removed from samples and code.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated by Commenter 4.
[revision removed]
Detailed log of new commits:
Author: Commenter 4
Date: Thu Aug 28 11:10:29 2014 +0400
Added necessary includes for MacOS.
[revision removed]
Detailed log of new commits:
Author: Commenter 4
Date: Thu Aug 28 11:10:29 2014 +0400
Added necessary includes for MacOS.
Branch [archived branch] has been updated forcibly by Commenter 4.
[revision removed]
[revision removed]
Unused macros and includes were removed from samples and code.
Branch CR20716 was compiled on WNT, Debian60-64, MacOS and rebased on current state of master. Could you please review.
Branch CR20716 was compiled on WNT, Debian60-64, MacOS and rebased on current state of master. Could you please review.
No remarks, please test, including compilation in Debug mode and on older Linux versions.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Dear Commenter 1,
Branch CR20716 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 16 (15 on master)
Windows: 0 (0 on master)
There is new additional compilation warning on Linux platform:
http://jenkins-test-03.nnov.opencascade.com:8080/user/mnt/my-views/view/A_mnt_warnings/job/mnt-CR20716-master_build_occt_linux/1/warnings16Result/package.-165224203/
OSD_signal.cxx:42, GNU C Compiler 4 (gcc), Priority: Normal
‘pthread_t getOCCThread()’ defined but not used
products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
Not needed
Testing on Linux:
occt component :
Total MEMORY difference: 353529232 / 353638312
Total CPU difference: 46208.89000000007 / 44814.86999999998
products component :
Total MEMORY difference: 110249976 / 109158944
Total CPU difference: 18657.12000000001 / 17204.64000000002
Testing on Windows:
occt component :
Total MEMORY difference: 241393012 / 241452652
Total CPU difference: 40336.71875 / 34905.625
products component :
Total MEMORY difference: 66514436 / 66471812
Total CPU difference: 11447.875 / 10985.390625
There are no differences in images found by testdiff.
Branch CR20716 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 16 (15 on master)
Windows: 0 (0 on master)
There is new additional compilation warning on Linux platform:
http://jenkins-test-03.nnov.opencascade.com:8080/user/mnt/my-views/view/A_mnt_warnings/job/mnt-CR20716-master_build_occt_linux/1/warnings16Result/package.-165224203/
OSD_signal.cxx:42, GNU C Compiler 4 (gcc), Priority: Normal
‘pthread_t getOCCThread()’ defined but not used
products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
Not needed
Testing on Linux:
occt component :
Total MEMORY difference: 353529232 / 353638312
Total CPU difference: 46208.89000000007 / 44814.86999999998
products component :
Total MEMORY difference: 110249976 / 109158944
Total CPU difference: 18657.12000000001 / 17204.64000000002
Testing on Windows:
occt component :
Total MEMORY difference: 241393012 / 241452652
Total CPU difference: 40336.71875 / 34905.625
products component :
Total MEMORY difference: 66514436 / 66471812
Total CPU difference: 11447.875 / 10985.390625
There are no differences in images found by testdiff.
Branch [archived branch] has been updated by Commenter 4.
[revision removed]
Detailed log of new commits:
Author: Commenter 4
Date: Wed Sep 3 16:28:58 2014 +0400
Correct new additional compilation warning on Linux platform.
[revision removed]
Detailed log of new commits:
Author: Commenter 4
Date: Wed Sep 3 16:28:58 2014 +0400
Correct new additional compilation warning on Linux platform.
Corrections for compilation warning on Linux platform were pushed to CR20716.
Reviewed. Please, test.
Branch [archived branch] has been created by Commenter 2.
[revision removed]
Detailed log of new commits:
Author: ski
Date: Thu Sep 4 10:23:50 2014 +0400
0020716: Eliminate usage of config.h header file
[revision removed]
Detailed log of new commits:
Author: ski
Date: Thu Sep 4 10:23:50 2014 +0400
0020716: Eliminate usage of config.h header file
Branch CR20716_1 contains squashed commits from CR20716.
Dear Commenter 1,
Branch CR20716 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 15 (15 on master)
Windows: 0 (0 on master)
products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
Not needed
Testing on Linux:
occt component :
Total MEMORY difference: 353365616 / 353627656
Total CPU difference: 47072.82999999993 / 44814.669999999984
products component :
Total MEMORY difference: 66532652 / 66471812
Total CPU difference: 11755.859375 / 10985.390625
Testing on Windows:
occt component :
Total MEMORY difference: 241311504 / 241460332
Total CPU difference: 32964.09375 / 34905.734375
products component :
Total MEMORY difference: 66532652 / 66471812
Total CPU difference: 11755.859375 / 10985.390625
There are no differences in images found by testdiff.
Branch CR20716 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 15 (15 on master)
Windows: 0 (0 on master)
products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
Not needed
Testing on Linux:
occt component :
Total MEMORY difference: 353365616 / 353627656
Total CPU difference: 47072.82999999993 / 44814.669999999984
products component :
Total MEMORY difference: 66532652 / 66471812
Total CPU difference: 11755.859375 / 10985.390625
Testing on Windows:
occt component :
Total MEMORY difference: 241311504 / 241460332
Total CPU difference: 32964.09375 / 34905.734375
products component :
Total MEMORY difference: 66532652 / 66471812
Total CPU difference: 11755.859375 / 10985.390625
There are no differences in images found by testdiff.
Branch [archived branch] has been updated by Commenter 4.
[revision removed]
Detailed log of new commits:
Author: Commenter 4
Date: Fri Sep 5 10:30:06 2014 +0400
Fix for error in OSD_Chronometer on Debian70/Fedora18
[revision removed]
Detailed log of new commits:
Author: Commenter 4
Date: Fri Sep 5 10:30:06 2014 +0400
Fix for error in OSD_Chronometer on Debian70/Fedora18
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
There are still two occurrences of HAVE_PTHREAD_H in OSD_signal.cxx which should be eliminated:
#if defined(HAVE_PTHREAD_H) && defined(NO_CXX_EXCEPTION)
if (pthread_self() != getOCCThread() || !Standard_ErrorHandler::IsInTryBlock()) {
Related records