bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Libtool generating flags incompatible with nvcc


From: Mahesh N
Subject: Re: Libtool generating flags incompatible with nvcc
Date: Thu, 3 Sep 2009 13:33:59 +0530

Hi All,

My friends and I are porting an open-source math library to CUDA. The library defines a GNU Build System for its compilation and installation. We have suitably modified the Makefile.ams and the configure.ac to use nvcc as compiler and to generate appropriate flags for it. The aim is to generate a shared library . But during the generation of the shared library, linking fails as libtool generates flags like -Wl, -soname; --whole-archive; --no-whole-archive, etc that are not defined for nvcc. On further inspection we found that these flags were generated by the libtool script. On our communications with Ralf on the Autoconf mailing list, we were requested to submit a patch file for the `libtool' script that generated appropriate flags for nvcc as a compiler and linker for CUDA programs. I am attaching that patch here, although its not fairly complete. We would like to remove all instances of -soname, -Wl, --whole-archive, --no-whole-archive etc from the libtool script. Nonetheless, the patch gives a basic idea of what would be the required changes.

On Wed, Sep 2, 2009 at 10:51 AM, Ralf Wildenhues <address@hidden> wrote:
* mahesh.mach wrote on Wed, Sep 02, 2009 at 07:16:06AM CEST:
> > The 'libtool' script stores these flags, right.  You can edit it to
> > temporarily override flags.  However, then they will be lost the next
> > time config.status is run.  The flags are set in the configure script.
> > That in turn is generated from the macros in the libtool.m4 file (and a
> > few other ones) that need to be edited in order to fix things.
>
> We tried editing manually, but considering that during further development,
> our source tree would change considerably and we would need to rerun
> configure scripts and hence we concluded that a permanent solution would be
> the right thing to do.

Please describe (or post as diffs) all such editing you've done to the
libtool script, on the bug-libtool list.  It can provide valuable clues
what to add to libtool.m4.

Thanks for the other information.

Cheers,
Ralf

We would like to generate a command for linking like below:

nvcc --shared -o libname_of_shared_library.so sourcefiles -I<include headers> -L<library paths> -l<library1> -l<library2>

Also, in our projects, we will be having source files with extensions ".cu" indicating CUDA source files. We want to be able to detect those files in the file system and compile them with nvcc and link using nvcc. Do we have to make any specific changes in order to support that? Or would just listing them in the Makefile.am take care of that?

Thanks & Cheers!

Mahesh

--
Research Intern
IIT Madras,
Computer Science Engineering Department

Attachment: LibtoolBasicDiffs
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]