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

some (bundled) minor changes (take 2) #176

Merged
merged 26 commits into from
Oct 31, 2016
Merged

some (bundled) minor changes (take 2) #176

merged 26 commits into from
Oct 31, 2016

Conversation

esohns
Copy link
Contributor

@esohns esohns commented Dec 2, 2015

second submission of pull request #172 (see description and commit labels).
This addresses some issues with ACE, mainly template instantiation problems with MSVC.
Has been compiled and (briefly) tested on Win32 (Windows 8 and 10, MSVC 2015) and Linux (g++ 5.2.1)

@@ -101,11 +108,22 @@ class ACE_Export ACE_Condition<ACE_Recursive_Thread_Mutex>
ACE_Recursive_Thread_Mutex &mutex_;

};
// *NOTE*: prevent implicit instantiations by includees to relieve the linker
#if defined (__GNUG__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this have a version check on g++ version, maybe add a new ACE_HAS... macro because probably this is then needed on more places?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, please see commit 4155a8c

#if defined (ACE_HAS_CPP11_EXTERN_TEMPLATES)
// suppress a warning, g++ 5.2.1 does not support attributes on template
// instantiation declarations. *TODO*: this may go back further
# if defined (__GNUG__) && (__GNUC__ == 5 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also use a new define for this, that makes it easier when this is needed in more places and for example gcc 5.2.2 has the same issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, please see commit b695f27

@jwillemsen
Copy link
Member

Looks the travis-ci build fails, have you compiled also the complete TAO codebase with these changes?

@esohns
Copy link
Contributor Author

esohns commented Dec 13, 2015

Hi. As you can see the test builds now complete successfully.

I tried compiling TAO with MSVC. However, there appears to be an issue with some headers missing from the (MPC-generated) project file(s) (e.g. $TAO_ROOT/tao/IOPC.h), so some of the projects do not compile with this approach at the moment. I have not pursued this any further.
The build completes fine otherwise.

Erik Sohns added 2 commits May 30, 2016 00:18
# Conflicts:
#	ACE/protocols/ace/HTBP/HTBP_Channel.cpp
#	ACE/protocols/ace/HTBP/HTBP_Inside_Squid_Filter.cpp
#	ACE/protocols/ace/HTBP/HTBP_Session.cpp
@jwillemsen
Copy link
Member

All checks have failed

@jwillemsen
Copy link
Member

Could you provide some more background on the "mainly template instantiation problems with MSVC." We haven't seen this problem until now and I am not sure what you are fixing.

#include "test_config.h"

// *NOTE*: explicit template instantiation required here...
template class ACE_Condition<ACE_Recursive_Thread_Mutex>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required?

Copy link
Contributor Author

@esohns esohns Oct 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed with 53bbf4b

@esohns
Copy link
Contributor Author

esohns commented Oct 24, 2016

I am using ACE in a project that has had trouble linking with MSVC 2015. The error was that of multiple defined symbols in conjunction with (explicit) template instantiations scattered over the ACE code (specifically, the ACE_Condition<ACE_Recursive_Thread_Mutex> specialization). Recent versions of MSVC support extern template declarations (the equivalent of extern variables) to address this issue, so I have introduced the notion to ACE

@jwillemsen
Copy link
Member

I am concerned about breaking user applications given the significant amount of changes you made outside of the ACE core, are they all really needed? Could you extend one of the unit tests with an use case that doesn't work before your changes? Also please make a note about these changes in the ACE/NEWS file

#include "ace/Recursive_Thread_Mutex.h"
#include "ace/Condition_Attributes.h"
#include "ace/Condition_T.h"

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

class ACE_Time_Value;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this one needed?

Copy link
Contributor Author

@esohns esohns Oct 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a 'forward declaration'; the header does not #include ace/Time_Value.h, even though it is referencing ACE_Time_Value*. Depending on what the other #includes pull in, this may not be needed (but the header is more consistent this way). As I was changing the header, I cleaned it up a little bit.

// instantiation declarations
// *TODO*: this probably goes back further than 5.2
# if (__GNUC__ >= 6 || (__GNUC__ == 5 && __GNUC_MINOR__ >= 2))
# define ACE_LACKS_CPP11_EXTERN_TEMPLATE_ATTRIBUTES
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about gcc 6.x, still needed? Your remark is just about 5.2.1

Copy link
Contributor Author

@esohns esohns Oct 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be tested against newer versions of gcc and adjusted when it integrates the C++11 extern template attributes feature in the future. Also, the targeted version range needs tuning, as the patch applies to earlier versions of gcc as well (see TODO: this probably goes back as far as gcc 4.3 when ACE_HAS_CPP11_EXTERN_TEMPLATES was introduced (not verified)).
I don't have access to any other versions of gcc, so I cannot test this exhaustively. However, as this feature merely introduces/suppresses a compiler warning, the impact ought to be minimal, while timely feedback from other users on different platforms is likely.

@esohns
Copy link
Contributor Author

esohns commented Oct 30, 2016

Updated NEWS. The only changes that are really features is the support for extern templates, and the timer queue code rework. The latter already has a unit test which covers the functionality. At this stage I am not sure how to come up with a minimal example that could serve as a unit/regression test for the former; I will add this as a Compiler_Features_xx_Test.cpp in /tests when I find time.

@jwillemsen jwillemsen merged commit bd5aaab into DOCGroup:master Oct 31, 2016
@jwillemsen
Copy link
Member

Merged to check with the full scoreboard

@jwillemsen
Copy link
Member

Had to revert, looks builds started to break

@jwillemsen
Copy link
Member

Working on some changes as part of issue #320 so that travis-ci shows the face configuration issues, please make a new pull request when you see #320 integrated in master

@jwillemsen
Copy link
Member

@esohns Issue #320 got merged to master, can you get that and look at the errors in the FACE configuration. Also check http://www.dre.vanderbilt.edu/scoreboard/integrated.html, could be that some other builds also compile the changes.

@esohns
Copy link
Contributor Author

esohns commented Nov 1, 2016

I had a look at the build failures on the Linux platform [http://scoreboard.ociweb.com/doc_master_ant_linux-sb_gcc_d0o1/2016_10_31_14_39_Totals.html](build failures). The errors are related to the removal of ace/Synch.h from ace/Thread_Manager.h. I have created a new pull request #322 that addresses this (and corelated) issues. Please refer to the explanation in the pull request for more information.

Other than that, I found nothing unusual on the scoreboard so far

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants