[petsc-dev] Is there a good reason that BuildSystem's cuda.py requires GNU compilers?

Mills, Richard Tran rtmills at anl.gov
Wed Mar 13 00:25:13 CDT 2019

On 3/12/19 8:49 PM, Balay, Satish wrote:

1. You might want to check 'Feature-request: Must use GNU compilers
with CUDA' thread on petsc-maint.

Yes, I see this thread now. Thanks.

2. what does nvcc use internally on summit?

It defaults to the GCC suite but it is supposed to also support the PGI and XLF compilers on Summit.

3. On linux - nvcc defaults to using g++ internally (as far as I know)
- so we added that check. But you might want to remove that check - if
things work on summit

4. -ccbin is a wierd option - which I don't undersstand.

--compiler-bindir <path>                   (-ccbin)
        Specify the directory in which the host compiler executable resides.  The
        host compiler executable name can be also specified to ensure that the correct
        host compiler is selected.  In addition, driver prefix options ('--input-drive-prefix',
        '--dependency-drive-prefix', or '--drive-prefix') may need to be specified,
        if nvcc is executed in a Cygwin shell or a MinGW shell on Windows.

i.e you specify a PATH. But what binary does it pick up from that
PATH? The way I understood is - it looks for an alternate 'g++' in the
specified path. [well - again this is based on the usual linux
installs of cuda]

This is a really kludgy option. You can specify a directory (and then I think it just looks for g++ in there?) but you can also specify a path to xlc++ or another compiler. (There appears to be no way to control this via an environment variable, strangely.) I will see if setting '-ccbin' to the path for whatever C++ compiler has been specified to configure.py works.



On Wed, 13 Mar 2019, Mills, Richard Tran via petsc-dev wrote:

Fellow PETSc developers,

If I try to configure PETSc with CUDA support on the ORNL Summit system using non-GNU compilers, I run into an error due to the following code in packages/cuda.py:

  def configureTypes(self):
    import config.setCompilers
    if not config.setCompilers.Configure.isGNU(self.setCompilers.CC, self.log):
      raise RuntimeError('Must use GNU compilers with CUDA')

Is this just because this code predates support for other host compilers with nvcc, or is there perhaps some more subtle reason that I, with my inexperience using CUDA, don't know about? I'm guessing that I just need to add support for using '-ccbin' appropriately to set the location of the non-GNU host compiler, but maybe there is something that I'm missing. I poked around in the petsc-dev mailing list archives and can find a few old threads on using non-GNU compilers, but I'm not sure what conclusions were reached.

Best regards,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20190313/92cd59e3/attachment.html>

More information about the petsc-dev mailing list