Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 715610

Summary: sci-libs/cholmod-3.0.13: emake failed: nvcc fatal: Unknown option '-fPIC'
Product: Gentoo Linux Reporter: Constantin Runge <c.runge>
Component: Current packagesAssignee: Gentoo Science Related Packages <sci>
Status: RESOLVED FIXED    
Severity: normal CC: agrigo2001, alex, bugzilla, chn, dan, fatzer2, fordfrog, frp.bissey, ivan, jstein, kkrizka, leonchik1976, pacho, peter.gustafson, phobosk, poncho, sam, stefantalpalaru, waebbl-gentoo
Priority: Normal Keywords: PATCH, PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/34020
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
emerge --info
libtool file from 3.0.14
cholmod_gpu.h
cholmod-3.0.14-fix-CUDA.patch

Description Constantin Runge 2020-03-31 12:20:59 UTC
Created attachment 627938 [details]
build.log

Building the GPU target for cholmod fails with the message `nvcc fatal: Unknown option '-fPIC''.

AFAIK, nvcc wants the '-fPIC' option with either '--compiler-options' or '-Xcompiler' prepended.
Comment 1 Jonas Stein gentoo-dev 2020-04-01 00:14:43 UTC
Thank you for the report. We need to have all information at hand before ticket assignment. That is why I ask you to 
* attach the logs and 
* paste the emerge info 
as described on 
https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
Comment 2 Constantin Runge 2020-04-01 15:29:13 UTC
Created attachment 628474 [details]
emerge --info

Added output of `emerge --info` as well. I've already attached the build.log when creating the ticket. Please tell, if something went wrong there.
Comment 3 Constantin Runge 2020-04-16 13:24:40 UTC
It looks like this is a libtool problem. In theory, the build system should prepend the `lt_prog_compiler_pic` with `-Xcompiler` for the nvcc compiler. But I'm not really sure, why this rule is not applied.
Comment 4 François Bissey 2020-10-05 09:13:00 UTC
Could generate a new log (3.0.13 or 3.0.14) at -j1. Just to make things clearer. I think you have identified the most likely cause of trouble in any case.
Comment 5 François Bissey 2020-10-05 09:44:01 UTC
(In reply to François Bissey from comment #4)
> Could generate a new log (3.0.13 or 3.0.14) at -j1. Just to make things
> clearer. I think you have identified the most likely cause of trouble in any
> case.

No need for that now that I have looked more closely. Trying to identify what is going wrong in libtool.
Comment 6 François Bissey 2020-10-05 09:50:27 UTC
Can you attach the generated libtool file?
Comment 7 Miroslav Šulc gentoo-dev 2020-10-05 09:58:20 UTC
Created attachment 663847 [details]
libtool file from 3.0.14
Comment 8 François Bissey 2020-10-05 18:47:30 UTC
Thanks. That libtool doesn't contain any bits for nvcc, which explains why things fail. Either there is something to fix in configure.ac/Makefile.am to get the bits included or I use an alternative approach.
Comment 9 François Bissey 2020-10-05 21:43:27 UTC
I have ideas to test. I can put some ebuild in the sage-on-gentoo overlay or attach some files here for you to try. Which works better for you?
Comment 10 Miroslav Šulc gentoo-dev 2020-10-06 03:51:20 UTC
(In reply to François Bissey from comment #9)
> I have ideas to test. I can put some ebuild in the sage-on-gentoo overlay or
> attach some files here for you to try. Which works better for you?

you can attach it here, thank you :-)
Comment 11 François Bissey 2020-10-22 09:16:17 UTC
Sorry for the silence I am completely overloaded left and right.
Comment 12 Peter Gustafson 2021-04-19 14:39:50 UTC
Created attachment 700836 [details]
cholmod_gpu.h

Bump.  I've tried and failed to debug this.

Note also that the current tar.bz2 file for 3.0.14 doesn't include the headers for GPU.

cholmod-3.0.14/Include/cholmod_gpu.h

I'm attaching it here.

I also tried sage-on-gentoo overlay (3.0.13-r3) and no luck.
Comment 13 François Bissey 2021-04-19 20:42:35 UTC
(In reply to Peter Gustafson from comment #12)
> Created attachment 700836 [details]
> cholmod_gpu.h
> 
> Bump.  I've tried and failed to debug this.
> 
> Note also that the current tar.bz2 file for 3.0.14 doesn't include the
> headers for GPU.
> 
> cholmod-3.0.14/Include/cholmod_gpu.h
> 
> I'm attaching it here.
> 
> I also tried sage-on-gentoo overlay (3.0.13-r3) and no luck.

Yes, I am sorry. I am completely overwhelmed with various things and that one has taken the back seat. I know precisely why this is failing. Fixing it is another story, I have some leads from a few other packages though.

But at the end of the day, it looks like doing C+nvcc is easier with cmake than autoconf.
Comment 14 Reza Fard 2021-08-31 09:50:30 UTC
Any news or further actions or possible fixes/workarounds on this issue?
Comment 15 Fat-Zer 2021-11-08 08:15:16 UTC
Note that this failure is caused by USE="cuda". It builds fine without it.
Comment 16 Fat-Zer 2021-11-08 23:50:35 UTC
Created attachment 749631 [details, diff]
cholmod-3.0.14-fix-CUDA.patch

A proposed patch: it's a bit hacky, but it should do the trick.

Also I'd suggest to inherit cuda.eclass to avoid problems with some other cuda-related stuff.
Comment 17 Peter Gustafson 2021-12-03 02:35:15 UTC
Worked for me!
Comment 18 hReZ@ 2022-01-23 16:25:30 UTC
(In reply to Fat-Zer from comment #16)
> Created attachment 749631 [details, diff] [details, diff]
> cholmod-3.0.14-fix-CUDA.patch
> 
> A proposed patch: it's a bit hacky, but it should do the trick.
> 
> Also I'd suggest to inherit cuda.eclass to avoid problems with some other
> cuda-related stuff.

Works for me! thx for your patch!
Comment 19 Pacho Ramos gentoo-dev 2022-01-23 18:18:06 UTC
This should probably be upstreamed:
https://github.com/DrTimothyAldenDavis/SuiteSparse/issues

I see they have plenty of cuda bugs and commits in their repo and, then, this is likely to break again soon 

I also wonder if maybe we should move everything to a sci-libs/suitesparse ebuild to follow more easily upstream bumps and use their tarballs :/
Comment 20 François Bissey 2022-01-23 18:41:13 UTC
(In reply to Pacho Ramos from comment #19)
> This should probably be upstreamed:
> https://github.com/DrTimothyAldenDavis/SuiteSparse/issues
> 
> I see they have plenty of cuda bugs and commits in their repo and, then,
> this is likely to break again soon 
> 
> I also wonder if maybe we should move everything to a sci-libs/suitesparse
> ebuild to follow more easily upstream bumps and use their tarballs :/

That would make some things easier and some things more complicated. There wouldn't really be a configuration phase. Who wants to deal with a superbuild which is directed by a big Makefile? I did some very hackish monolithic build in sagemath and that's not pretty.

That being said, getting more stuff upstream would be a great thing.
Comment 21 Fat-Zer 2022-01-25 11:56:09 UTC
(In reply to Pacho Ramos from comment #19)
> This should probably be upstreamed:
> https://github.com/DrTimothyAldenDavis/SuiteSparse/issues
> 

That's a build-system-related issue, they don't use autotools upstream. It looks like a purely gentoo thing, so IMHO there is no reason to bother upstream with that.

I suppose, the patch should be applied to what-ever repository where gentoo tarballs are maintained, but I got no idea where it is.
Comment 22 Oleg Korsak 2022-04-08 23:38:56 UTC
same issue with sci-libs/cholmod-3.0.14
Comment 23 Stephan Hartmann (RETIRED) gentoo-dev 2022-09-18 08:23:01 UTC
*** Bug 870583 has been marked as a duplicate of this bug. ***
Comment 24 Ștefan Talpalaru 2022-11-10 01:13:35 UTC
A working cholmod-3.0.14-r1 ebuild is available in my overlay: https://github.com/stefantalpalaru/gentoo-overlay

I had to copy and fix "cuda.eclass" because of https://bugs.gentoo.org/880675
Comment 25 François Bissey 2022-11-10 01:26:40 UTC
cholmod 4.0.0 is coming and it comes with a cmake build system that will solve the cuda issue once for all (cross fingers).
Comment 26 Luke A. Guest 2023-02-07 08:15:06 UTC
This is still an issue in Gentoo, when is this being updated to fix it?
Comment 27 François Bissey 2023-02-07 08:28:23 UTC
In sage-on-gentoo (https://github.com/cschwan/sage-on-gentoo) I have the latest suitesparse software suite. The build system has been changed to cmake and that move alone should take care of the issue.

If you want to try cholmod 4.0.3 from the overlay and report if cuda now behaves, I'd be quite happy.

I am still pondering on the best way to migrate the new suitesparse to the main tree and whether or not I should write a small eclass for it.
Comment 28 Larry the Git Cow gentoo-dev 2023-12-16 09:21:11 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c0474cc8a08172cdc244af680edba8be5ada95b

commit 6c0474cc8a08172cdc244af680edba8be5ada95b
Author:     Paul Zander <negril.nx+gentoo@gmail.com>
AuthorDate: 2023-11-27 19:58:40 +0000
Commit:     Pacho Ramos <pacho@gentoo.org>
CommitDate: 2023-12-16 09:20:20 +0000

    sci-libs/cholmod: fix cuda build
    
    - include cuda patch from https://bugs.gentoo.org/715610#c16
    - make use of cuda.eclass for nvcc
    
    Closes: https://bugs.gentoo.org/913921
    Closes: https://bugs.gentoo.org/904973
    Closes: https://bugs.gentoo.org/715610
    Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/34020
    Signed-off-by: Pacho Ramos <pacho@gentoo.org>

 sci-libs/cholmod/cholmod-3.0.13.ebuild             |  14 ++-
 sci-libs/cholmod/cholmod-3.0.14.ebuild             |  14 ++-
 .../cholmod/files/cholmod-3.0.14-fix-CUDA.patch    | 109 +++++++++++++++++++++
 3 files changed, 133 insertions(+), 4 deletions(-)