def build_openssl(name: str, build_dir: str) -> [str]: """install openssl :param name: name of the version (e.g. openssl-1.1.1c) should be sliced from the official URL :type name: str :param build_dir: path where source code is stored and built :type build_dir: str :returns: list of bash commands :rtype: [str] """ cm = [] wget_ssl = wget() tar_ssl = tar() cm.append( wget_ssl.download_step(url='https://www.openssl.org/source/' + name + '.tar.gz', directory=build_dir)) cm.append( tar_ssl.untar_step(tarball=build_dir + '/' + name + '.tar.gz', directory=build_dir)) cm.append('cd ' + build_dir + '/' + name) cm.append( './config --prefix=/opt/openssl_install -Wl,-rpath=/usr/local/lib') cm.append('make -j') cm.append('make install -j') cm.append('cd -') return cm
def test_filetypes(self): t = tar() self.assertEqual(t.untar_step(tarball='foo.tar.bz2'), 'tar -x -f foo.tar.bz2 -j') self.assertEqual(t.untar_step(tarball='foo.tar.gz'), 'tar -x -f foo.tar.gz -z') self.assertEqual(t.untar_step(tarball='foo.tgz'), 'tar -x -f foo.tgz -z') self.assertEqual(t.untar_step(tarball='foo.tar'), 'tar -x -f foo.tar') self.assertEqual(t.untar_step(tarball='foo.unknown'), 'tar -x -f foo.unknown')
def test_directory(self): """Directory specified""" t = tar() self.assertEqual(t.untar_step(tarball='foo.tgz', directory='bar'), 'mkdir -p bar && tar -x -f foo.tgz -C bar -z')
def test_missing_tarball(self): """Missing tarball option""" t = tar() self.assertEqual(t.untar_step(), '')
'-DQUDA_FORCE_HISQ=ON', '-DQUDA_GPU_ARCH={}'.format(gpu_arch), '-DQUDA_INTERFACE_MILC=ON', '-DQUDA_INTERFACE_QDP=ON', '-DQUDA_LINK_HISQ=ON', '-DQUDA_MPI=ON' ]), cm.build_step(parallel=32) ] Stage0 += shell(commands=quda_cmds) # build MILC milc_version = '7.8.1' milc_cmds = [ 'mkdir -p /milc', wget().download_step( url='http://www.physics.utah.edu/~detar/milc/milc_qcd-{}.tar.gz'. format(milc_version)), tar().untar_step(tarball='/tmp/milc_qcd-{}.tar.gz'.format(milc_version), directory='/milc'), 'cd /milc/milc_qcd-{}/ks_imp_rhmc'.format(milc_version), 'cp ../Makefile .', sed().sed_step( file='/milc/milc_qcd-{}/ks_imp_rhmc/Makefile'.format(milc_version), patterns=[ r's/WANTQUDA\(.*\)=.*/WANTQUDA\1= true/g', r's/\(WANT_.*_GPU\)\(.*\)= .*/\1\2= true/g', r's/QUDA_HOME\(.*\)= .*/QUDA_HOME\1= \/quda\/build/g', r's/CUDA_HOME\(.*\)= .*/CUDA_HOME\1= \/usr\/local\/cuda/g', r's/#\?MPP = .*/MPP = true/g', r's/#\?CC = .*/CC = mpicc/g', r's/LD\(\s+\)= .*/LD\1= mpicxx/g', r's/PRECISION = [0-9]\+/PRECISION = 2/g', r's/WANTQIO = .*/WANTQIO = #true or blank. Implies HAVEQMP./g', r's/CGEOM =.*-DFIX_NODE_GEOM.*/CGEOM = #-DFIX_NODE_GEOM/g' ]), 'C_INCLUDE_PATH=/quda/build/include make su3_rhmd_hisq'
def test_args(self): """Argument given""" t = tar() self.assertEqual( t.untar_step(tarball="foo.tar.gz", args=["--strip-components=1"]), 'tar -x -f foo.tar.gz -z --strip-components=1')