Lines Matching +full:linux +full:- +full:hip +full:- +full:double

27     banner_middle = '=' * (logger.get_global_divider_length() - 2 * len(banner_ends))
40 help.addArgument('PETSc', '-prefix=<dir>', nargs.Arg(None, '', 'Specifiy location to install PETSc (eg. /usr/local)'))
41 help.addArgument('PETSc', '-with-prefetch=<bool>', nargs.ArgBool(None, 1,'Enable checking for prefetch instructions'))
42 help.addArgument('Windows','-with-windows-graphics=<bool>', nargs.ArgBool(None, 1,'Enable check for Windows Graphics'))
43 help.addArgument('PETSc', '-with-default-arch=<bool>', nargs.ArgBool(None, 1, 'Allow using the last configured arch without setting PETSC_ARCH'))
44 help.addArgument('PETSc','-with-single-library=<bool>', nargs.ArgBool(None, 1,'Put all PETSc code into the single -lpetsc library'))
45 help.addArgument('PETSc','-with-fortran-bindings=<bool>', nargs.ArgBool(None, 1,'Build PETSc fortran bindings in the library and corresponding module files'))
46 help.addArgument('PETSc', '-with-library-name-suffix=<string>', nargs.Arg(None, '', 'Add a suffix to PETSc library names'))
47 help.addArgument('PETSc', '-with-ios=<bool>', nargs.ArgBool(None, 0, 'Build an iPhone/iPad version of PETSc library'))
48 help.addArgument('PETSc', '-with-display=<x11display>', nargs.Arg(None, '', 'Specifiy DISPLAY environmental variable for use with MATLAB test)'))
49 help.addArgument('PETSc', '-with-package-scripts=<pyscripts>', nargs.ArgFileList(None,None,'Specify configure package scripts for user provided packages'))
50 help.addArgument('PETSc', '-with-coverage=<bool>', nargs.ArgFuzzyBool(None, value=0, help='Enable or disable code-coverage collection'))
51 help.addArgument('PETSc', '-with-coverage-exec=<executable>', nargs.ArgExecutable(None, value='default-auto', mustExist=0, help='Name of executable to use for post-processing coverage data, e.g. \'gcov\' or \'llvm-cov\'. Pass \'auto\' to let configure infer from compiler'))
52 help.addArgument('PETSc', '-with-tau-perfstubs=<bool>', nargs.ArgBool(None, 1,'Enable TAU profiler stubs'))
53 help.addArgument('PETSc', '-with-strict-petscerrorcode=<bool>', nargs.ArgFuzzyBool(None, value=0, help='Enable strict PetscErrorCode mode, which enables additional compile-time checking for misuse of PetscErrorCode and error handling'))
132 if 'with-package-scripts' in self.framework.argDB:
133 for script in self.framework.argDB['with-package-scripts']:
135 raise RuntimeError('Only python scripts compatible with configure package script format should be specified! Invalid option -with-package-scripts='+script)
164 ''' Create a pkg-config file '''
168 cflags_inc = ['-I${includedir}']
173 cflags_inc.append('-I' + os.path.join(self.petscdir.dir, 'include'))
214 fd.write('Libs: '+self.libraries.toStringNoDupes(['-L${libdir}', self.petsclib], with_rpath=False)+'\n')
216 # pkg-config --variable=ldflag_rpath and pkg-config --libs-only-L
239 puts stderr "This module sets the path and environment variables for petsc-%s"
243 module-whatis "PETSc - Portable, Extensible Toolkit for Scientific Computation"
250 prepend-path PATH "%s"
257 # eventually everything between -- should be gone
261 self.executeShellCommand('rm -rf '+os.path.join(self.petscdir.dir,self.arch.arch,'include','mpi*')+' '+os.path.join(self.petscdir.dir,self.arch.arch,'include','opa*'), log = self.log)
264 # Test for compiler-specific macros that need to be defined.
278 output = self.executeShellCommand(compiler + ' -show', log = self.log)[0]
286 #-----------------------------------------------------------------------------------------------------
337 if self.framework.argDB['with-fortran-bindings']:
341 raise RuntimeError('Error! Fortran compiler "'+self.compilers.FC+'" does not have a C-interoperable Bool type! PETSc Fortran bindings require an interoperable Bool')
366 else: # for non-f90 compilers like g77
367 self.addMakeMacro('FC_MODULE_FLAG', '-I')
380 self.setCompilers.pushLanguage('HIP')
409 #-----------------------------------------------------------------------------------------------------
418 # double or float
421 if self.framework.argDB['with-batch']:
424 #-----------------------------------------------------------------------------------------------------
437 raise RuntimeError('Cannot use --with-devicelanguage=C with the device package ' + i.name)
439 self.addDefine('HAVE_'+i.PACKAGE.replace('-','_'), 1) # ONLY list package if it is used directly by PETSc (and not only by another package)
443 self.addMakeMacro(i.PACKAGE.replace('-','_')+'_LIB', self.libraries.toStringNoDupes(i.lib))
448 self.addMakeMacro(i.PACKAGE.replace('-','_')+'_INCLUDE',self.headers.toStringNoDupes(i.include))
451 raise RuntimeError('Cannot use --with-devicelanguage=C++ without a valid C++ compiler')
477 self.LIB_NAME_SUFFIX = self.framework.argDB['with-library-name-suffix']
481 if self.framework.argDB['with-single-library']:
482 self.petsclib = '-lpetsc'+self.LIB_NAME_SUFFIX
486 self.addMakeMacro('PETSC_WITH_EXTERNAL_LIB',self.libraries.toStringNoDupes(['-L'+PREINSTALL_LIB_DIR, '-lpetsc'+self.LIB_NAME_SUFFIX]+self.packagelibs+self.complibs))
499 return [ '-lpetsc'+lib+self.LIB_NAME_SUFFIX for lib in libs]
501 return self.libraries.toStringNoDupes(['-L'+PREINSTALL_LIB_DIR]+liblist_basic(libs)+self.packagelibs+self.complibs)
503 self.addMakeMacro('PETSC_SYS_LIB', liblist(pkgs[-1:]))
504 self.addMakeMacro('PETSC_VEC_LIB', liblist(pkgs[-2:]))
505 self.addMakeMacro('PETSC_MAT_LIB', liblist(pkgs[-3:]))
506 self.addMakeMacro('PETSC_DM_LIB', liblist(pkgs[-4:]))
507 self.addMakeMacro('PETSC_KSP_LIB', liblist(pkgs[-5:]))
508 self.addMakeMacro('PETSC_SNES_LIB',liblist(pkgs[-6:]))
509 self.addMakeMacro('PETSC_TS_LIB', liblist(pkgs[-7:]))
510 self.addMakeMacro('PETSC_TAO_LIB', liblist(pkgs[-8:]))
511 self.addMakeMacro('PETSC_ML_LIB', liblist(pkgs[-9:]))
519 if self.framework.argDB['with-display']:
520 self.addMakeMacro('DISPLAY',self.framework.argDB['with-display'])
525 if self.framework.argDB['with-tau-perfstubs']:
550 fd.write('\"-----------------------------------------\\n\"\n')
559 fd.write('\"-----------------------------------------\\n\";\n')
568 fd.write('\"-----------------------------------------\\n\";\n')
571 fd.write('\"-----------------------------------------\\n\";\n')
580 fd.write('\"Using libraries: %s%s -L%s %s %s\\n\"\n' % (escape(self.setCompilers.CSharedLinkerFlag), escape(os.path.join(self.installdir.petscDir, self.installdir.petscArch, 'lib')), escape(os.path.join(self.installdir.petscDir, self.installdir.petscArch, 'lib')), escape(self.petsclib), escape(self.PETSC_EXTERNAL_LIB_BASIC)))
581 fd.write('\"-----------------------------------------\\n\";\n')
587 if config.setCompilers.Configure.isSolaris(self.log) or self.framework.argDB['with-ios'] or not self.framework.argDB['with-prefetch']:
618 # The value of rw is a compile-time constant one or zero; one
621 # preparing for a read. The value locality must be a compile-time
629 # Here we adopt Intel's x86/x86-64 naming scheme for the locality
662 if self.framework.argDB['with-ios']:
675 if not self.framework.argDB['with-batch']:
704 self.logPrint('configureDeprecated: Intel has conspired to make a supremely environment-sensitive compiler. The Intel compiler looks at the gcc executable in the environment to determine the language compatibility that it should attempt to emulate. Some important Cray installations have built PETSc using the Intel compiler, but with a newer gcc module loaded (e.g. 4.7). Thus at PETSc configure time, the Intel compiler decides to support the string argument, but the gcc found in the default user environment is older and does not support the argument.\n'.format(attr_def))
733 char assert_aligned[(sizeof(struct mystruct)==16)*2-1];
775 return self.checkCompile(inc, ('#define STATIC_ASSERT(cond) char negative_length_if_false[2*(!!(cond))-1]\n'
826 flag = getattr(self.setCompilers, self.language[-1]+'SharedLinkerFlag')
830 self.compilers.LIBS += ' -L/usr/ucblib'
845 '''Linux specific stuff'''
851 '''Win32 non-cygwin specific stuff'''
862 if self.framework.argDB['with-windows-graphics']:
908 (petscdir,error,status) = self.executeShellCommand('cygpath -w '+self.installdir.petscDir, log = self.log)
910 (petscdir,error,status) = self.executeShellCommand('cygpath -m '+self.installdir.petscDir, log = self.log)
913 (datafilespath,error,status) = self.executeShellCommand('cygpath -m '+self.dataFilesPath.datafilespath, log = self.log)
928 Check that a compiler accepts code-coverage flags. If the compiler does accept code-coverage flags
929 try to set debugging flags equivalent to -Og.
932 - lang: the language to check the coverage flag for
933 - extra_coverage_flags: a list of extra flags to use when checking the coverage flags
934 - extra_debug_flags: a list of extra flags to try when setting debug flags
937 - defines PETSC_USE_COVERAGE to 1
963 log_print('Don\'t know how to add coverage for compiler {}. Only know how to add coverage for gnu-like compilers (either gcc or clang). Skipping it!'.format(quoted(compiler)))
966 coverage_flags = make_flag_list('--coverage', extra_coverage_flags)
1011 allowed_opt_flags = re.compile(r'|'.join((r'-O[01g]', r'-g[1-9]*')))
1018 self.logPrintWarning('Coverage requested, but optimization flag(s) {} found in {}. Coverage collection will work, but may be less accurate. Suggest removing the flag and/or using -Og (or equivalent) instead'.format(', '.join(map(quoted, opt_flags)), quoted(flagsname)))
1025 debug_flags = make_flag_list('-Og', extra_debug_flags)
1045 - defines PETSC_USE_COVERAGE to 1
1048 - If no compilers supported the coverage flag, throws RuntimeError
1049 -
1069 argdb_flag = 'with-coverage'
1076 for LANG in ['C', 'Cxx', 'CUDA', 'HIP', 'SYCL', 'FC']:
1092 '-Xcompiler --coverage -Xcompiler -fPIC --keep --keep-dir={}'.format(nvcc_tmp_dir)
1097 # for whatever reason this works if you dont use the --keep and --keep-dir
1099 kwargs['extra_coverage_flags'].append('-arch=native')
1100 kwargs['extra_debug_flags'] = ['-Xcompiler -Og']
1107 'Coverage was requested (--{}={}) but none of the compilers supported it:\n{}\n'.format(
1109 '\n'.join([' - {} ({})'.format(self.getCompiler(lang=lang), lang) for lang in tested_langs])
1115 # "undefined reference to __gcov_flush()" but if we add -lgcov we get:
1129 log_print('Checking if compilers can cross-link disparate coverage libraries')
1134 log_print('No fortran compiler detected. No need to check cross-linking!')
1140 log_print('C-language ({}) compiler is not clang, assuming it is GCC, so cross-linking with FC ({}) assumed to be OK'.format(c_lang, self.getCompiler(lang='FC')))
1148 # Now we check if we can cross-link
1157 log_print('Trying to cross-link WITHOUT extra libs')
1159 log_print('Successfully cross-linked WITHOUT extra libs')
1160 # success, we already can cross-link
1163 extra_libs = ['-lgcov']
1164 log_print('Trying to cross-link with extra libs: {}'.format(extra_libs))
1167 'Successfully cross-linked using extra libs: {}, adding them to LIBS'.format(extra_libs)
1172 self.logPrintWarning("Could not successfully cross-link covered code between {} and FC. Sometimes this is a false positive. Assuming this does eventually end up working when the full link-line is assembled when building PETSc. If you later encounter linker errors about missing __gcov_exit(), __gcov_init(), __llvm_cov_flush() etc. this is why!".format(c_lang))
1177 Check that a code-coverage collecting tool exists and is on PATH.
1180 - Adds PETSC_COVERAGE_EXEC make macro containing the full path to the coverage tool executable.
1183 - User explicitly requests auto-detection of the coverage tool from command line, and this
1185 - The routine fails to find the tool, and --with-coverage is true
1194 required = bool(self.argDB['with-coverage'])
1195 arg_opt = self.argDB['with-coverage-exec']
1200 if arg_opt in {'auto', 'default-auto', '1'}:
1204 log_print('User did not explicitly set coverage exec (got {}), trying to auto-detect based on compiler {}'.format(quoted(arg_opt), quoted(compiler)))
1206 compiler_version_re = re.compile(r'[gG][cC\+\-]+[0-9]* \(.+\) (\d+)\.(\d+)\.(\d+)')
1210 exec_names = ['llvm-cov']
1212 # macOS masquerades llvm-cov as just 'gcov', so we add this to the list in case
1213 # bare llvm-cov does not work
1215 elif arg_opt == 'default-auto' and not required:
1216 # default-auto implies the user did not set it via command line!
1217 log_print('Could not auto-detect coverage tool for {}, not a gnuish compiler. Bailing since user did not explicitly set exec on the commandline'.format(quoted(compiler)))
1222 raise RuntimeError('Could not auto-detect coverage tool for {}, please set coverage tool name explicitly'.format(quoted(compiler)))
1233 # form [llvm-cov-14, llvm-cov-14.0, llvm-cov, etc.]
1236 # llvm-cov-14
1237 '{}-{}'.format(cov_exec_name, compiler_version.group(1)),
1238 # llvm-cov-14.0
1239 '{}-{}.{}'.format(cov_exec_name, compiler_version.group(1), compiler_version.group(2))
1245 # arg_opt is path-like, we should only search the provided directory when we go
1252 log_print('Checking for coverage tool(s):\n{}'.format('\n'.join('- '+t for t in exec_names)))
1265 if 'llvm-cov' in found_exec_name and 'gcov' not in found_exec_name:
1266 # llvm-cov needs to be called as 'llvm-cov gcov' to work
1274 If --with-strict-petscerrorcode = 1:
1275 - defines PETSC_USE_STRICT_PETSCERRORCODE to 1
1278 - deletes any prior PETSC_USE_STRICT_PETSCERRORCODE definitions (if they exist)
1281 if self.argDB['with-strict-petscerrorcode']:
1288 #-----------------------------------------------------------------------------------------------------
1290 '''Cygwin version <= 1.7.18 had issues with pipes and long commands invoked from gnu-make
1291 http://cygwin.com/ml/cygwin/2013-05/msg00340.html '''
1295 r=re.compile("([0-9]+).([0-9]+).([0-9]+)")
1304 #-----------------------------------------------------------------------------------------------------
1307 if self.framework.argDB['with-default-arch']:
1321 #-----------------------------------------------------------------------------------------------------
1326 scriptName = os.path.join(self.arch.arch,'lib','petsc','conf', 'reconfigure-'+self.arch.arch+'.py')
1328 if 'with-clean' in args:
1329 del args['with-clean']
1365 ['-@echo "========================================="',
1366 '-@echo "Now to install the libraries do:"',
1367 '-@echo "%s${MAKE_USER} PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} install"' % self.installdir.installSudo,
1368 '-@echo "========================================="'])
1371 ['-@echo "========================================="',
1372 '-@echo "Now to check if the libraries are working do:"',
1373 '-@echo "${MAKE_USER} PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} check"',
1374 '-@echo "========================================="'])
1384 # tacky fix for dependency of Aluimia on Pflotran; requested via petsc-dev Matt provide a correct fix
1401 if hasattr(self.compilers, 'FC') and self.framework.argDB['with-fortran-bindings']:
1411 if 'package-prefix-hash' in self.argDB:
1425 raise RuntimeError('Incorrect option --prefix='+self.framework.argDB['prefix']+' specified. It cannot be same as PETSC_DIR!')
1426 if self.framework.argDB['prefix'] and self.framework.argDB['prefix'].find(' ') > -1:
1427 raise RuntimeError('Your --prefix '+self.framework.argDB['prefix']+' has spaces in it; this is not allowed.\n Use a --prefix that does not have spaces in it')
1429 raise RuntimeError('Incorrect option --prefix='+self.framework.argDB['prefix']+' specified. It cannot be same as PETSC_DIR/PETSC_ARCH!')
1437 raise RuntimeError('PETSc requires a functional math library. Please send configure.log to petsc-maint@mcs.anl.gov.')