Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

condformats_serialization_generate.py: fix libClang ussage #5657

Conversation

davidlt
Copy link
Contributor

@davidlt davidlt commented Oct 2, 2014

libClang is being used incorrectly. libClang does not understand what
language you are attemping to compile, it assumes C/ObjC as default.

This comes from headers.h name. Clang relies on correct extension to
select a language, but it cannot be done with header file. Same
extension is used for ObjC/C/C++.

The first argument must not be none, but a patch to header file.
An additional option must be passed '-xc++' to tell Clang that
it will be C++.

If the header file is passed as argument to libClang then the order of
arguments is important! Otherwise libClang will ignore flags like -xc++,
and go for the default.

This behaviors are documented in Clang source code.

Because of this on Darwin C++ exception handling is disabled, there is
not need for in C front-end. Simply put you loose all default C++
language options.

This resolves majority of ERROR: messages from
condformats_serialization_generate.py

A few a left, but are the same as in CLANG IBs. More people should join
the effort to clean it up. There is <10 such issues, I might fix them. For
yet unknown reason their are not visible on standard CMSSW IB on Linux,
just on CLANG.

Signed-off-by: David Abdurachmanov David.Abdurachmanov@cern.ch

libClang is being used incorrectly. libClang does not understand what
language you are attemping to compile, it assumes C/ObjC as default.

This comes from headers.h name. Clang relies on correct extension to
select a language, but it cannot be done with header file. Same
extension is used for ObjC/C/C++.

The first argument must not be none, but a patch to header file.
An additional option must be passed '-xc++' to tell Clang that
it will be C++.

If the header file is passed as argument to libClang then the order of
arguments is important! Otherwise libClang will ignore flags like -xc++,
and go for the default.

This behaviors are documented in Clang source code.

Because of this on Darwin C++ exception handling is disabled, there is
not need for in C front-end. Simply put you loose all default C++
language options.

This resolves majority of ERROR: messages from
condformats_serialization_generate.py

A few a left, but are the same as in CLANG IBs. More people should join
the effort to clean it up.

Signed-off-by: David Abdurachmanov <David.Abdurachmanov@cern.ch>
@davidlt
Copy link
Contributor Author

davidlt commented Oct 2, 2014

For reference the following are those errors:

[2014-10-02 17:03:54,521] ERROR: Diagnostic: [2] 'HcalPedestalWidths::myname' hides overloaded virtual function
[2014-10-02 17:03:54,521] ERROR:    at line 32 in /build1/davidlt2/cms_inst/boost/CMSSW_7_3_X_2014-10-01-0200/src/CondFormats/HcalObjects/interface/HcalPedestalWidths.h

[2014-10-02 17:06:06,583] ERROR: Diagnostic: [2] class 'ChamberLocationSpec' was previously declared as a struct
[2014-10-02 17:06:06,583] ERROR:    at line 15 in /build1/davidlt2/cms_inst/boost/CMSSW_7_3_X_2014-10-01-0200/src/CondFormats/RPCObjects/interface/DccSpec.h

[2014-10-02 17:11:44,867] ERROR: Diagnostic: [2] 'pos::PixelCalibConfiguration::writeXMLHeader' hides overloaded virtual function
[2014-10-02 17:11:44,867] ERROR:    at line 177 in /build1/davidlt2/cms_inst/cmsinst/osx108_amd64_gcc481/cms/cmssw/CMSSW_7_3_X_2014-10-01-0200/src/CalibFormats/SiPixelObjects/interface/PixelCalibConfiguration.h
[2014-10-02 17:11:44,867] ERROR: Diagnostic: [2] class template 'PixelDCSObject' was previously declared as a struct template
[2014-10-02 17:11:44,867] ERROR:    at line 19 in /build1/davidlt2/cms_inst/boost/CMSSW_7_3_X_2014-10-01-0200/src/CondFormats/SiPixelObjects/src/classes.h
[2014-10-02 17:11:44,867] ERROR: Diagnostic: [2] class template 'PixelDCSObject' was previously declared as a struct template
[2014-10-02 17:11:44,868] ERROR:    at line 20 in /build1/davidlt2/cms_inst/boost/CMSSW_7_3_X_2014-10-01-0200/src/CondFormats/SiPixelObjects/src/classes.h
[2014-10-02 17:11:44,868] ERROR: Diagnostic: [2] class template 'PixelDCSObject' was previously declared as a struct template
[2014-10-02 17:11:44,868] ERROR:    at line 21 in /build1/davidlt2/cms_inst/boost/CMSSW_7_3_X_2014-10-01-0200/src/CondFormats/SiPixelObjects/src/classes.h

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 2, 2014

A new Pull Request was created by @davidlt for CMSSW_7_3_X.

condformats_serialization_generate.py: fix libClang ussage

It involves the following packages:

CondFormats/Serialization

@ggovi, @cmsbuild, @apfeiffer1, @nclopezo can you please review it and eventually sign? Thanks.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@nclopezo, @ktf you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@apfeiffer1
Copy link
Contributor

+1
David, thanks for finding and fixing this !
Just for my curiosity: is that feature maybe coming from a more recent version of clang or was it already in the one we used when we initially wrote the script (more than a year ago, IIRC) ?

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 2, 2014

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_3_X IBs unless changes or unless it breaks tests. @nclopezo, @ktf can you please take care of it?

@davidlt
Copy link
Contributor Author

davidlt commented Oct 2, 2014

@apfeiffer1 I think, it was always present. If you want concrete date/tag, I need to checkout Clang via GIT to find it fast. Do you want it?

@apfeiffer1
Copy link
Contributor

@apfeiffer1 https://github.com/apfeiffer1 I think, it was always
present. If you want concrete date/tag, I need to checkout Clang via GIT to
find it fast. Do you want it?

@davidlt, I vaguely remember that we had that in one or the other earlier
version of the script (while we were still evaluating), in the final
version it then probably got "lost" as it was working correctly (by default
??).

No need to waste time in historical details, I'd say ... :)

Thanks,
cheers, andreas

@davidlt
Copy link
Contributor Author

davidlt commented Oct 3, 2014

Double tested this morning, not changes in Serialization.cc files. All hashes mach up before and after the change.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 3, 2014

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 3, 2014

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_3_X IBs unless changes (tests are also fine). @nclopezo, @ktf can you please take care of it?

nclopezo added a commit that referenced this pull request Oct 3, 2014
…enerate.py

CondFormats/Serialization -- condformats_serialization_generate.py: fix libClang ussage
@nclopezo nclopezo merged commit 4e88af9 into cms-sw:CMSSW_7_3_X Oct 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants