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.gitcommit = '7e10c8a' #maint/v5.2.1+ from june-16-2016 8 self.download = ['git://https://github.com/xiaoyeli/superlu','https://github.com/xiaoyeli/superlu/archive/'+self.gitcommit+'.tar.gz'] 9 self.downloaddirname = 'superlu' 10 self.functions = ['set_default_options'] 11 self.includes = ['slu_ddefs.h'] 12 self.liblist = [['libsuperlu.a']] 13 # SuperLU has NO support for 64 bit integers, use SuperLU_Dist if you need that 14 self.requires32bitint = 1; # 1 means that the package will not work with 64 bit integers 15 self.excludedDirs = ['SuperLU_DIST','SuperLU_MT'] 16 # SuperLU does not work with --download-fblaslapack with Compaqf90 compiler on windows. 17 # However it should work with intel ifort. 18 self.downloadonWindows= 1 19 self.hastests = 1 20 self.hastestsdatafiles= 1 21 return 22 23 def setupDependencies(self, framework): 24 config.package.CMakePackage.setupDependencies(self, framework) 25 self.blasLapack = self.framework.require('config.packages.BlasLapack',self) 26 self.deps = [self.blasLapack] 27 return 28 29 def formCMakeConfigureArgs(self): 30 args = config.package.CMakePackage.formCMakeConfigureArgs(self) 31 args.append('-DUSE_XSDK_DEFAULTS=YES') 32 33 args.append('-DTPL_BLAS_LIBRARIES="'+self.libraries.toString(self.blasLapack.dlib)+'"') 34 35 # Tests are broken on Apple since they depend on a shared library that is not resolved against BLAS 36 args.append('-Denable_tests=0') 37 # CMake in SuperLU should set this; but like many other packages it does not 38 args.append('-DCMAKE_INSTALL_NAME_DIR:STRING="'+os.path.join(self.installDir,self.libdir)+'"') 39 40 # Add in fortran mangling flag 41 if self.blasLapack.mangling == 'underscore': 42 mangledef = '-DAdd_' 43 elif self.blasLapack.mangling == 'caps': 44 mangledef = '-DUpCase' 45 else: 46 mangledef = '-DNoChange' 47 for place,item in enumerate(args): 48 if item.find('CMAKE_C_FLAGS') >= 0 or item.find('CMAKE_CXX_FLAGS') >= 0: 49 args[place]=item[:-1]+' '+mangledef+'"' 50 51 return args 52 53