[petsc-dev] Building PETSc on LLNL Lassen
Barry Smith
bsmith at petsc.dev
Sun Dec 13 16:08:20 CST 2020
Something is strange with Jacob's configure.log regardless.
configure decides to use the -std=gnu++14 flag so never even gets to testing the -std=c++14 which is fine and normal
When nvcc is originally tested it uses
===== Checking compiler
Executing: nvcc -c -o /var/tmp/petsc-2v0k4k61/config.setCompilers/conftest.o -I/var/tmp/petsc-2v0k4k61/config.setCompilers -Wno-deprecated-gpu-targets /var/tmp/petsc-2v0k4k61/config.setCompilers/conftest.cu
Successful compile:
Source:
#include "confdefs.h"
#include "conffix.h"
int main() {
;
return 0;
}
and everything is fine. And continues to be for more nvcc tests. Never using the -std=c++14
But when testing nvcc for the MPI include files the -std=c++14 flag just pops up as argument to nvcc (never seen before in the configure.log) results in a warning message that configure does not understand so it rejects the include file being tested (since the test is about the include file).
This is in MPI.py line 653
self.logPrint('Found include option: '+arg, 4, 'compilers')
self.setCompilers.pushLanguage('CUDA')
self.setCompilers.addCompilerFlag(arg)
self.setCompilers.popLanguage()
So why here does the -std=c++14 appear?
Executing: mpicc -show
stdout: /usr/tce/packages/xl/xl-2020.11.12-cuda-11.1.1/bin/xlc_r -I/usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/include -pthread -L/usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/lib -lmpiprofilesupport -lmpi_ibm -Wl,-rpath,/usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/lib
compilers: Checking arg /usr/tce/packages/xl/xl-2020.11.12-cuda-11.1.1/bin/xlc_r
compilers: Checking arg -I/usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/include
compilers: Found include option: -I/usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/include
Executing: nvcc -c -o /var/tmp/petsc-2v0k4k61/config.setCompilers/conftest.o -I/var/tmp/petsc-2v0k4k61/config.setCompilers -I/var/tmp/petsc-2v0k4k61/config.types -g -std=c++14 -I/usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/include -Wno-deprecated-gpu-targets /var/tmp/petsc-2v0k4k61/config.setCompilers/conftest.cu
Possible ERROR while running compiler:
stderr:
nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored.
Source:
def checkCompilerFlag(self, flag, includes = '', body = '', compilerOnly = 0):
'''Determine whether the compiler accepts the given flag'''
flagsArg = self.getCompilerFlagsArg(compilerOnly)
oldFlags = getattr(self, flagsArg)
setattr(self, flagsArg, oldFlags+' '+flag)
(output, error, status) = self.outputCompile(includes, body)
It seems that getattr(self, flagsArg) on CUDA gives back the -std=c++14 but how did it get in there?
To debug I would first put a print in checkCompilerFlag that shows oldFlags and see if the -std=c++14 comes up in this nvcc test, which doesn't explain how it could get there so somehow you would need to back track to see how it got in there.
> On Dec 13, 2020, at 3:36 PM, Jed Brown <jed at jedbrown.org> wrote:
>
> I use Clang because XL compilers are buggy and not faster. This worked as of a few months ago:
>
> #!/usr/tce/packages/python/python-3.7.2/bin/python3
> if __name__ == '__main__':
> import sys
> import os
> sys.path.insert(0, os.path.abspath('config'))
> import configure
> configure_options = [
> '--with-blaslapack-lib=/usr/tcetmp/packages/essl/essl-6.2.1/lib64/liblapackforessl.so /usr/tcetmp/packages/essl/essl-6.2.1/lib64/libessl.so',
> '--with-cuda=1',
> '--with-debugging=0',
> '--with-fc=0',
> '--with-mpi-dir=/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-ibm-2019.10.03',
> 'COPTFLAGS=-O3 -mcpu=native -ffp-contract=fast',
> 'CUDAFLAGS=--gpu-architecture=sm_70 -ccbin clang++',
> 'CXXOPTFLAGS=-O3 -mcpu=native -ffp-contract=fast',
> 'PETSC_ARCH=lassen-clang-essl-opt',
> ]
> configure.petsc_configure(configure_options)
>
> Jacob Faibussowitsch <jacob.fai at gmail.com> writes:
>
>> Hello All,
>>
>> Does anyone have any experience building petsc with cuda support on Lassen? I’ve been having trouble building with ibm xl compilers + spectrum-mpi + nvcc. NVCC seems to not like -std=c++14 argument, complaining that its configured host compiler doesn’t support it, but compiling the following “test.cc <http://test.cc/>":
>>
>> #include <stdlib.h>
>>
>> int main(int argc, char **argv)
>> {
>> int i = 1;
>> i += argc;
>> return(i);
>> }
>>
>> With mpicc -std=c++14 test.cc <http://test.cc/> produces zero errors.
>> ------------------------------------------------------------------------
>>
>> Modules loaded:
>>
>> module load xl/2020.11.12-cuda-11.1.1
>> module load spectrum-mpi
>> module load cuda/11.1.1
>> module load python/3.8.2
>> module load cmake
>> module load valgrind
>> module load lapack
>>
>> My configure commands:
>>
>> ./configure --with-cc=mpicc --with-cxx=mpiCC --with-fc=mpifort --with-cuda --with-debugging=1 PETSC_ARCH=arch-linux-c-debug
>>
>> The error:
>>
>> TESTING: findMPIInc from config.packages.MPI(config/BuildSystem/config/packages/MPI.py:636) *******************************************************************************
>> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):
>> -------------------------------------------------------------------------------
>> Bad compiler flag: -I/usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/include
>> *******************************************************************************
>>
>> The actual configure.log error:
>>
>> Executing: nvcc -c -o /var/tmp/petsc-2v0k4k61/config.setCompilers/conftest.o -I/var/tmp/petsc-2v0k4\
>> k61/config.setCompilers -I/var/tmp/petsc-2v0k4k61/config.types -g -std=c++14 -I/usr/tce/packages/s\
>> pectrum-mpi/ibm/spectrum-mpi-rolling-release/include -Wno-deprecated-gpu-targets /var/tmp/petsc-2v\
>> 0k4k61/config.setCompilers/conftest.cu
>> Possible ERROR while running compiler:
>> stderr:
>> nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be\
>> ignored.
>> Source:
>> #include "confdefs.h"
>> #include "conffix.h"
>>
>> int main() {
>> ;
>> return 0;
>> }
>> Rejecting compiler flag -I/usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/include due to
>> nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored.
>>
>>
>> Best regards,
>>
>> Jacob Faibussowitsch
>> (Jacob Fai - booss - oh - vitch)
>> Cell: (312) 694-3391
More information about the petsc-dev
mailing list