This class takes care of the BLACS installation.
| def blas.Blas.down_install_blas |
( |
|
self | ) |
|
73 def down_install_blas(self):
76 The reference BLAS library is being installed.
77 Don't expect high performance from this reference library!
78 If you want performance, you need to use an optimized BLAS library and,
79 to avoid unnecessary complications, if you need to compile this optimized BLAS
80 library, use the same compiler you're using here.""")
86 if(
not os.path.isdir(os.path.join(os.getcwd(),
'build'))):
87 os.mkdir(os.path.join(os.getcwd(),
'build'))
89 if(
not os.path.isdir(os.path.join(os.getcwd(),
'lib'))):
90 os.mkdir(os.path.join(os.getcwd(),
'lib'))
92 if(
not os.path.isdir(os.path.join(os.getcwd(),
'log'))):
93 os.mkdir(os.path.join(os.getcwd(),
'log'))
96 os.chdir(os.path.join(os.getcwd(),
'build'))
100 if(
not os.path.isfile(os.path.join(os.getcwd(),
getURLName(self.blasurl)))):
101 print(
'Downloading reference BLAS...', end=
' ')
106 print(
'Unzip and untar reference BLAS...', end=
' ')
107 comm =
'gunzip -f blas.tgz'
110 print(
'\n\nBLAS: cannot unzip blas.tgz')
111 print(
'stderr:\n',
'*'*40,
'\n',error,
'\n',
'*'*40)
114 comm =
'tar xf blas.tar'
117 print(
'\n\nBLAS: cannot untar blas.tgz')
118 print(
'stderr:\n',
'*'*40,
'\n',error,
'\n',
'*'*40)
120 os.remove(
'blas.tar')
124 os.chdir(os.path.join(os.getcwd(),
'BLAS'))
127 print(
'Compile and generate reference BLAS...', end=
' ')
129 comm = self.mpif77+
' '+self.fcflags+
' -c *.f'
132 print(
'\n\nBLAS: cannot compile blas')
133 print(
'stderr:\n',
'*'*40,
'\n',error,
'\n',
'*'*40)
138 comm =
'ar cr librefblas.a *.o'
141 print(
'\n\nBLAS: cannot create blas library')
142 print(
'stderr:\n',
'*'*40,
'\n',error,
'\n',
'*'*40)
147 log = log+output+error
148 fulllog = os.path.join(savecwd,
'log/blaslog')
150 print(
'Installation of reference BLAS successful.')
151 print(
'(log is in ',fulllog,
')')
154 os.rename(
'librefblas.a',os.path.join(savecwd,
'lib/librefblas.a'))
157 self.blaslib = os.path.join(savecwd,
'lib/librefblas.a ')
158 Frame.blaslib = os.path.join(savecwd,
'lib/librefblas.a ')
def downloader(uri, cmd)
Definition: utils.py:150
def getURLName(url)
Definition: utils.py:137
References framework.Frame.blasurl, framework.Frame.downcmd, utils.downloader(), framework.Frame.fcflags, utils.getURLName(), if(), framework.Frame.mpif77, Eigen::internal.print(), utils.runShellCommand(), and utils.writefile().
Referenced by blas.Blas.__init__().