ExtUtils-nvcc
view release on metacpan or search on metacpan
lib/ExtUtils/nvcc.pm view on Meta::CPAN
=item Bad mode; must be either 'compiler' or 'linker'
This is an internal error that gets thrown when C<build_args> is called with
an invalid mode. If you see this, either you are C<build_args> yourself, and
not supplying the string 'compiler' or 'linker', or there is an internal error.
In the latter case, please report the error to the bug-tracker listed below.
=item Bad arguments: <bad-arg-1>, <bad-arg-2>, ...
This message means that you supplied an invalid argument to one of the
user-level functions C<Inline>, C<EUMM>, or C<MB>. Check your spelling and
capitalization against L</Optional Arguments> discussed above.
=back
These are the back-end errors, errors that L<ExtUtils::nvcc::Backend> will have:
=over
=item Last argument [[<arg>]] left me expecting a value, but I didn't find one
Apparently you (or the build system) supplied a list of arguments to
L<ExtUtils::nvcc::Backend> ending with an option that expects an argument.
For example, the C<-o> option is a very common option that indicates the output
filename from the compilation or linking process. If you supply a C<-o> option
to L<ExtUtils::nvcc::Backend>, it expects the following argument to be the
output filename. If this is your last argument and you don't supply a filename,
this error will be thrown.
If the last argument is complete, to the best of your knowledge, it could be
that L<ExtUtils::nvcc::Backend> mis-parsed your command-line arguments in other
ways. You should enable verbose output and study that for more details.
=item Nothing to do! You didn't give me any arguments, not even a file!
This means that you somehow invoked L<ExtUtils::nvcc::Backend> without a single
argument. Double-check your command-line invocation and try again.
=item You must provide at least one source file
Somehow you invoked L<ExtUtils::nvcc::Backend> without a source file listed.
Double-check your command-line invocation and try again.
=item Unable to run nvcc. Is it in your path?
This error means that nvcc cannot be found (or more precisely, that nvcc -V
does not give a meaningful result). As the error suggests, be sure to check
that nVidia's nvcc is in your path. You will also get this error if you do not
have nvcc installed. In that case, install nVidia's CUDA toolkit and you should
be ready to go.
=item nvcc encountered a problem
In this case, nvcc attempted to compile or link your code and failed. Look over
the compiler/linker output for clues as to where your code went wrong. My guess
is that there is a compiler error in your code.
However, it is possible that the Backend is out-of-touch with your version of
nvcc, and it (for example) passed an nvcc argument through to your compiler.
Your compiler won't like that and it will likely complain. In that case, file
a bug report, as discussed in L</BUGS AND LIMITATIONS>.
=back
=head1 DEPENDENCIES
This toolchain requires that you have the following pieces:
=over
=item nVidia's CUDA toolkit
You must have nVidia's CUDA toolkit in order to compile CUDA code. This module
ultimately calls nvcc to perform the compilation; it cannot compile your CUDA
code itself. Furthermore, nvcc requires a C++ compiler, so you'll need to be
sure you have one of those. The CUDA toolkit is only available for a handful of
systems, and this module does not support building CUDA-capable modules for
other systems. For example, the latest version of Ubuntu or Fedora may not be
supported, and as of this time of writing Gentoo and Arch Linux (and many
others) have no support at all.
=item A Perl development environment
You will need to have access to the Perl development toolchain, either
L<ExtUtils::MakeMaker> or L<Module::Build>. (Note L<Inline> uses EU::MM on the
backend.) If you are in an environment in which you do not have these tools,
you will be able to use L<ExtUtils::nvcc::Backend>, but you'll have a hard time
tying anything into Perl.
=item gcc (Linux) or Visual Studio (Windows)
The nvcc compiler only supports gcc on Linux, and cl.exe on Windows. You cannot
specify an alternative compiler.
=back
=head1 BUGS, LIMITATIONS
The code for ExtUtils::nvcc is hosted at github, but please file bugs at
L<https://rt.cpan.org/Public/Bug/Report.html?Queue=ExtUtils-nvcc>.
A major maintainability problem is that the Backend has a very ad-hoc parsing
scheme that is not systematically tested at the moment. It would be better, I
think, to query nvcc at runtime for arguments that it accepts so that there
could never be a version skew for the arguments that the Backend parses and the
arguments that nvcc accepts. However, nvcc does not have an easily parsed
representation of its arguments, so this is probably equally troublesome.
For Windows users, a major issue is that nvcc only works with Microsoft's
compiler, cl.exe, on Windows machines. As such, C<ExtUtils::nvcc> will not
operate correctly under Cygwin or Strawberry Perl. I would like to remedy
this situation. Please let me know if you find a work-around for Strawberry
Perl or Cygwin.
Furthermore, C<ExtUtils::nvcc> doesn't even work with Windows at the moment.
This module was developed on Ubuntu and I have only dabbled with the Windows
build system. It is giving trouble, and any help would be much appreciated.
=head1 TESTING
In the few months that ExtUtils::nvcc has been quietly sitting on CPAN, it
( run in 2.143 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )