-
Notifications
You must be signed in to change notification settings - Fork 6
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
FLiT shared library and C++ standard library incompatibility #210
Comments
Thanks for the brave debugging ventures, Ian.
Like Mike said, do not stress excessively. We are trying a complex
experiment for which such breakages of software are impending. Mike also
likes to involve in writing more, and not submit a version that we do not
get time to polish.
Given all this, let's still plug away, but not over-stress. Let's do a good
job.
I'm going to continue to write. If some magic happens and you get good #s
and working libraries by evening, one push to finish is worthwhile. Else we
cool off and seek a new venue.
Not to deflate anyone, but telling everyone what's reality and what's not
:-)
I'm sitting in my backyard and writing (too many students looking for me as
an assignment is due)
Watching bees and writing is fun
…On Fri, Sep 7, 2018 at 1:20 PM Ian Briggs ***@***.***> wrote:
I've run into errors trying to use newer versions of gcc and clang, as
well as errors when compiling flit with one version of a compiler and using
another version for the tests.
Problem 1:
The first is caused by different c++ standard libraries. As of version 5.0
gcc uses two abi incompatible versions of libstdc++, they call this 'dual
abi'. This website documents their change:
https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
<http://url>. To force gcc to use the same abi it used before 5.0 the
command line argument -D_GLIBCXX_USE_CXX11_ABI=0 needs to be used.
Along the same vein llvm has introduced their own c++ standard library
documented at this website https://libcxx.llvm.org/ <http://url>. The fix
for this is -stdlib=libstdc++.
Problem 2:
When compiling flit itself with a different version of gcc then used in
the tests I have run into errors along the lines of "version GLIBC_2.2.5
not defined in file libc.so.6". The quick fix is to recompile flit with the
version used for the tests, but this is a special case of a more general
problem. When a compiler uses it's own libraries and leaves resolution to
link time, but another compiler is used to perform linking then expected
symbols or even whole libraries can be missing. This is a problem seen when
using the xlc compiler, as it will want to link against libibmc++ and
libxlopt.
Solutions:
For the first problem, the flags make everything link to a common abi
compatible stdlibc++.
The solution to the second problem is not so clear. Since GLIBC is
backwards compatible we could use the libc.so.6 that has the most up to
date versions, but this leaves the general case of compiler libraries.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#210>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEyiCmFfSSBvS5hEQZpdSfAjxhGDJfWSks5uYsbdgaJpZM4WfWJS>
.
|
Ian,
The problems you describe are of a general nature that patchwork solutions
won't get us anywhere. If we realize FLiT, we should have these checks
performed a priori before bisect etc are launched.
That means there are more paper opportunities hidden here. Some of our
papers could be just the precise question of how to aggressively mix
compilers. We can also investigate the ABI issues.
The work is at a good point, but if we cannot be completely happy with our
build and deploy methods, we can't claim a lot in our paper.
So let's try to solve all this today but working sanely.
I'll meanwhile write more, and also be ready with other deadlines we can
aim for. In particular, PLDI is a good venue. It is highly prestigious. We
can develop a TON of good material. It is in November. Gives enough time.
Just a thought
Ganesh
On Fri, Sep 7, 2018 at 1:27 PM Ganesh Gopalakrishnan <ganesh@cs.utah.edu>
wrote:
… Thanks for the brave debugging ventures, Ian.
Like Mike said, do not stress excessively. We are trying a complex
experiment for which such breakages of software are impending. Mike also
likes to involve in writing more, and not submit a version that we do not
get time to polish.
Given all this, let's still plug away, but not over-stress. Let's do a
good job.
I'm going to continue to write. If some magic happens and you get good #s
and working libraries by evening, one push to finish is worthwhile. Else we
cool off and seek a new venue.
Not to deflate anyone, but telling everyone what's reality and what's not
:-)
I'm sitting in my backyard and writing (too many students looking for me
as an assignment is due)
Watching bees and writing is fun
On Fri, Sep 7, 2018 at 1:20 PM Ian Briggs ***@***.***>
wrote:
> I've run into errors trying to use newer versions of gcc and clang, as
> well as errors when compiling flit with one version of a compiler and using
> another version for the tests.
> Problem 1:
> The first is caused by different c++ standard libraries. As of version
> 5.0 gcc uses two abi incompatible versions of libstdc++, they call this
> 'dual abi'. This website documents their change:
> https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
> <http://url>. To force gcc to use the same abi it used before 5.0 the
> command line argument -D_GLIBCXX_USE_CXX11_ABI=0 needs to be used.
>
> Along the same vein llvm has introduced their own c++ standard library
> documented at this website https://libcxx.llvm.org/ <http://url>. The
> fix for this is -stdlib=libstdc++.
>
> Problem 2:
> When compiling flit itself with a different version of gcc then used in
> the tests I have run into errors along the lines of "version GLIBC_2.2.5
> not defined in file libc.so.6". The quick fix is to recompile flit with the
> version used for the tests, but this is a special case of a more general
> problem. When a compiler uses it's own libraries and leaves resolution to
> link time, but another compiler is used to perform linking then expected
> symbols or even whole libraries can be missing. This is a problem seen when
> using the xlc compiler, as it will want to link against libibmc++ and
> libxlopt.
>
> Solutions:
> For the first problem, the flags make everything link to a common abi
> compatible stdlibc++.
> The solution to the second problem is not so clear. Since GLIBC is
> backwards compatible we could use the libc.so.6 that has the most up to
> date versions, but this leaves the general case of compiler libraries.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#210>, or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AEyiCmFfSSBvS5hEQZpdSfAjxhGDJfWSks5uYsbdgaJpZM4WfWJS>
> .
>
|
I found documentation from Intel specifying how to specifically choose which gcc is used in the backend. You would want to use the |
Currently the I like Ian's suggestion to add to the flit-config.toml, an entry of which gcc to use for the standard library. For both clang and intel types of compilers, the required field of As for me, I'd prefer to do the latter approach of using the gcc toolkit provided by the
I would prefer number 1. If we choose to do it this way, then it would need to be documented what we are doing and why. |
It seems we have decided to move away from this direction of automagically inserting the correct I propose that we add further documentation on how to achieve these results for Clang to use a particular GCC from a standard installation (e.g., We were thinking of adding another feature to the |
I now keep this issue around to document the following problem: Problem When compiling the FLiT shared library, one has to decide which standard library implementation they wish to use. Only that one standard library implementation will be available for their use when they are trying to use FLiT. I find it extremely limiting to allow only one standard library implementation to be explored, especially in situations where the user may want to explore differences when using various standard library implementations. Proposed Solution For each specified compiler, either within
We would not need to do this for every compilation, but rather just for each compiler, since the compiler should be static about which standard library is being used. Note: This assumption may be wrong if the user is specifying different standard libraries in their search space of flags. In that case, we would want to recompile the flit library for each compilation. I propose that we create a separate
Alternative Approaches
Discussion I am open for discussion on this topic. It is a fairly large rework of FLiT's architecture. We can talk in person if desired, but I think it would be good to capture here any relevant points from discussions. |
One other option is to compile the FLiT source code into each compilation as a separate set of source files (so that they are not included in bisect search). With this option, we can do what's called a "Unity Build" where all of the FLiT code will be compiled into a single object file. This significantly reduces the built time for FLiT. In order to do this, you make a single source file that does |
Unity build resources:
|
I did a timing experiment to determine which approach is best: Header-Only Timing ExperimentI now want to estimate the effect of using header-only FLiT to compile FLiT Compiler Versions
Empty TestRunning only on the project containing a single empty test.
For Granted, this is the worst-case situation where there is absolutely no user Litmus Tests
For This is also nearly a worst-case scenario since there are many tests that are MFEM Tests
For This is more like a real-world situation. I'm actually surprised that the It's just that for the tests, each test is essentially compiling its own FLiT source compiled in timing experimentsHere, we want to see the impact of compiling the FLiT source code with each Empty TestRunning only on the project containing a single empty test.
Litmus Tests
MFEM Tests
|
I've run into errors trying to use newer versions of gcc and clang, as well as errors when compiling flit with one version of a compiler and using another version for the tests.
Problem 1:
The first is caused by different c++ standard libraries. As of version 5.0 gcc uses two abi incompatible versions of libstdc++, they call this 'dual abi'.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html.
To force gcc to use the same abi it used before 5.0 the command line argument
-D_GLIBCXX_USE_CXX11_ABI=0
needs to be used.Along the same vein llvm has introduced their own c++ standard library. This is documented at https://libcxx.llvm.org/. The fix for this is
-stdlib=libstdc++
.Problem 2:
When compiling flit itself with a different version of gcc then used in the tests I have run into errors along the lines of "version GLIBC_2.2.5 not defined in file libc.so.6". The quick fix is to recompile flit with the version used for the tests, but this is a special case of a more general problem. When a compiler uses it's own libraries and leaves resolution to link time, but another compiler is used to perform linking then expected symbols or even whole libraries can be missing. This is a problem seen when using the xlc compiler, as it will want to link against libibmc++ and libxlopt.
Solutions:
For the first problem, the flags make everything link to a common abi compatible stdlibc++.
The solution to the second problem is not so clear. Since GLIBC is backwards compatible we could use the libc.so.6 that has the most up to date versions, but this leaves the general case of compiler libraries.
The text was updated successfully, but these errors were encountered: