1import config.package 2import os 3 4class Configure(config.package.CMakePackage): 5 def __init__(self, framework): 6 config.package.CMakePackage.__init__(self, framework) 7 self.version = '5.2.1' 8 self.minversion = '5.2.1' # bugs in 5.2.0 prevent it from functioning 9 self.versionname = 'SUPERLU_MAJOR_VERSION.SUPERLU_MINOR_VERSION.SUPERLU_PATCH_VERSION' 10 self.gitcommit = 'a3d5233' # master mar-15-2020 11 self.download = ['git://https://github.com/xiaoyeli/superlu','https://github.com/xiaoyeli/superlu/archive/'+self.gitcommit+'.tar.gz'] 12 self.downloaddirnames = ['SuperLU','superlu'] 13 self.functions = ['set_default_options'] 14 self.includes = ['slu_ddefs.h'] 15 self.liblist = [['libsuperlu.a']] 16 # SuperLU has NO support for 64 bit integers, use SuperLU_Dist if you need that 17 self.requires32bitint = 1; # 1 means that the package will not work with 64 bit integers 18 self.excludedDirs = ['superlu_dist','SuperLU_DIST','SuperLU_MT'] 19 # SuperLU does not work with --download-fblaslapack with Compaqf90 compiler on windows. 20 # However it should work with intel ifort. 21 self.downloadonWindows= 1 22 self.hastests = 1 23 self.hastestsdatafiles= 1 24 self.precisions = ['single','double'] 25 return 26 27 def setupDependencies(self, framework): 28 config.package.CMakePackage.setupDependencies(self, framework) 29 self.blasLapack = self.framework.require('config.packages.BlasLapack',self) 30 self.deps = [self.blasLapack] 31 return 32 33 def formCMakeConfigureArgs(self): 34 args = config.package.CMakePackage.formCMakeConfigureArgs(self) 35 args.append('-DUSE_XSDK_DEFAULTS=YES') 36 37 args.append('-DTPL_BLAS_LIBRARIES="'+self.libraries.toString(self.blasLapack.dlib)+'"') 38 39 # Tests are broken on Apple since they depend on a shared library that is not resolved against BLAS 40 args.append('-Denable_tests=0') 41 # CMake in SuperLU should set this; but like many other packages it does not [and its different from superlu_dist] 42 args.append('-DCMAKE_INSTALL_LIBDIR:STRING="'+os.path.join(self.installDir,self.libdir)+'"') 43 44 if not hasattr(self.compilers, 'FC'): 45 args.append('-DXSDK_ENABLE_Fortran=OFF') 46 47 # Add in fortran mangling flag 48 if self.blasLapack.mangling == 'underscore': 49 mangledef = '-DAdd_' 50 elif self.blasLapack.mangling == 'caps': 51 mangledef = '-DUpCase' 52 else: 53 mangledef = '-DNoChange' 54 for place,item in enumerate(args): 55 if item.find('CMAKE_C_FLAGS') >= 0 or item.find('CMAKE_CXX_FLAGS') >= 0: 56 args[place]=item[:-1]+' '+mangledef+'"' 57 58 return args 59 60