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

Optimised code not building on suse 12.1 / gcc 4.6.2 #52

Closed
osae opened this issue May 30, 2013 · 7 comments
Closed

Optimised code not building on suse 12.1 / gcc 4.6.2 #52

osae opened this issue May 30, 2013 · 7 comments

Comments

@osae
Copy link
Member

osae commented May 30, 2013

The same goes for other modules using cmake/Modules/UseOnlyNeeded.cmake
and simply leaving this out circumvents the problem.

Seems to be related to the following issue

// gcc -flto -Wl,--as-needed math.c -lm -o math
// removing either -flto or --as-needed makes it work
// also, if the argument is known at compile time the call disappears so it works

include <math.h>

int main(int argc, char **argv)
{
sqrt(argc);
}

@rolk
Copy link
Member

rolk commented May 30, 2013

Thank you for the bugreport!

I discussed this with Ove at the symposium, and I think the issue here is that the test in cmake/Modules/FindSuiteSparse.cmake (around line 215) isn't quite robust enough. It seems to only affect users on OpenSuSE, and we think it has something to do with the packaging of libraries on this platform. (It certainly works on Ubuntu).

We'll get it fixed, but it may take a while to setup the testing. In the meantime you can use the work-around Ove mentions here (commenting out include (UseOnlyNeeded) on line 112 or thereabout in CMakeLists.txt)

@bska
Copy link
Member

bska commented Jun 4, 2013

Is there any progress on this issue?

@rolk
Copy link
Member

rolk commented Jun 4, 2013

Current state of this issue is: The problem is not reproducable on OpenSuSE 12.3; I am working on a test setup for OpenSuSE 12.1.

@bska
Copy link
Member

bska commented Jun 4, 2013

Thanks a lot for the update!

@rolk
Copy link
Member

rolk commented Jun 6, 2013

I cannot reproduce this error on a minimal OpenSuSE 12.1 system because... compilation of opm-core aborts with an internal compiler error! (zypper info gcc says that I have version 4.6-15.1.3)

However, based on the test program you (@osae) provided, I have created a patch in the 256_linkplug branch of rolk/opmcore. Apply this (in opm-porsol) with:

wget -O - http://github.com/rolk/opm-core/commit/cdf8bf516f433c2a48fabedd33605577de96b267.patch | git am -

and see if this solves the problem. (It should report Performing Test HAVE_LINKER_PLUGIN_WITH_ASNEEDED - Failed somewhere near the end of the configure phase)

@rolk
Copy link
Member

rolk commented Jun 6, 2013

Sorry for the screw-up (forgot to refresh the browser window); the correct URL to test the fix should be:

wget -O - http://github.com/rolk/opm-core/commit/e2a18931990baf1e431ac946b3f4628940b34f6f.patch | git am -

@bska
Copy link
Member

bska commented Sep 24, 2013

I'll close this as no longer pertinent since the LTO-by-default setting was reversed in OPM/opm-core@bfeac75.

@bska bska closed this as completed Sep 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants