This class takes care of the LAPACK installation.
| def lapack.Lapack.check_lapack |
( |
|
self | ) |
|
Checks if the provided LAPACK library is good
36 def check_lapack(self):
37 """ Checks if the provided LAPACK library is good """
38 print(
'Checking if provided LAPACK works...', end=
' ')
50 call dgetrf(1,1,A,1,ipiv,info)
54 fcomm = self.mpif77+
' -o tmpf '+
'tmpf.f '+self.lapacklib+
' '+self.blaslib+
' '+self.ldflags_f77
58 print(
'\n\nLAPACK: provided LAPACK cannot be used! aborting...')
59 print(
'error is:\n',
'*'*40,
'\n',error,
'\n',
'*'*40)
65 print(
'\n\nLAPACK: provided LAPACK cannot be used! aborting...')
66 print(
'error is:\n',
'*'*40,
'\n',error,
'\n',
'*'*40)
def runShellCommand(command)
Definition: utils.py:87
def killfiles(lst)
Definition: utils.py:23
def writefile(fname, fill)
Definition: utils.py:17
References blas.Blas.blaslib, framework.Frame.blaslib, if(), utils.killfiles(), framework.Frame.lapacklib, lapack.Lapack.lapacklib, framework.Frame.ldflags_f77, framework.Frame.mpif77, Eigen::internal.print(), utils.runShellCommand(), and utils.writefile().
Referenced by lapack.Lapack.__init__().
| def lapack.Lapack.down_install_lapack |
( |
|
self | ) |
|
77 def down_install_lapack(self):
78 print(
""" Download and install LAPACK from netlib.org""")
83 if(
not os.path.isdir(os.path.join(os.getcwd(),
'build'))):
84 os.mkdir(os.path.join(os.getcwd(),
'build'))
86 if(
not os.path.isdir(os.path.join(os.getcwd(),
'lib'))):
87 os.mkdir(os.path.join(os.getcwd(),
'lib'))
89 if(
not os.path.isdir(os.path.join(os.getcwd(),
'log'))):
90 os.mkdir(os.path.join(os.getcwd(),
'log'))
93 os.chdir(os.path.join(os.getcwd(),
'build'))
95 if(
not os.path.isfile(os.path.join(os.getcwd(),
getURLName(self.lapackurl)))):
96 print(
"""Download LAPACK...""", end=
' ')
100 print(
"""Unzip and untar LAPACK...""", end=
' ')
101 comm =
'gunzip -f lapack.tgz'
104 print(
'\n\nLAPACK: cannot unzip lapack.tgz')
105 print(
'stderr:\n',
'*'*40,
'\n',error,
'\n',
'*'*40)
108 comm =
'tar xf lapack.tar'
111 print(
'\n\nLAPACK: cannot untar lapack.tgz')
112 print(
'stderr:\n',
'*'*40,
'\n',error,
'\n',
'*'*40)
114 os.remove(
'lapack.tar')
118 os.chdir(os.path.join(os.getcwd(),
'lapack-3.2'))
124 print(
'Compiling LAPACK (this will take several minutes)...', end=
' ')
126 comm = self.make+
' lib'
129 print(
'\n\nLAPACK: error building LAPACK')
130 print(
'stderr:\n',
'*'*40,
'\n',error,
'\n',
'*'*40)
134 fulllog = os.path.join(savecwd,
'log/laplog')
136 print(
'Installation of LAPACK successful.')
137 print(
'(log is in ',fulllog,
')')
140 os.rename(
'libreflapack.a',os.path.join(savecwd,
'lib/libreflapack.a'))
143 self.lapacklib = os.path.join(savecwd,
'lib/libreflapack.a ')
144 Frame.lapacklib = os.path.join(savecwd,
'lib/libreflapack.a ')
def downloader(uri, cmd)
Definition: utils.py:150
def getURLName(url)
Definition: utils.py:137
References framework.Frame.downcmd, utils.downloader(), utils.getURLName(), if(), framework.Frame.lapackurl, Eigen::internal::TensorBlockDescriptor< NumDims, IndexType >::DestinationBuffer.make(), Eigen::internal::TensorBlockDescriptor< NumDims, Index >::DestinationBuffer.make(), framework.Frame.make, Eigen::internal.print(), utils.runShellCommand(), lapack.Lapack.set_etime(), lapack.Lapack.write_makeinc(), and utils.writefile().
Referenced by lapack.Lapack.__init__().
| def lapack.Lapack.write_makeinc |
( |
|
self | ) |
|