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_opts(self): """wget with non-default command line options""" w = wget(opts=['-fast']) self.assertEqual(w.download_step(url='http://mysite.com/foo.tgz'), 'mkdir -p /tmp && wget -fast -P /tmp http://mysite.com/foo.tgz')
'-DQUDA_DIRAC_TWISTED_CLOVER=ON', '-DQUDA_DIRAC_TWISTED_MASS=ON', '-DQUDA_DIRAC_WILSON=ON', '-DQUDA_FORCE_GAUGE=ON', '-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',
def test_outfile(self): """wget with non-default output file""" w = wget() self.assertEqual(w.download_step(url='http://mysite.com/foo.tgz', outfile='bar.tgz'), 'mkdir -p /tmp && wget -q -nc --no-check-certificate -O bar.tgz -P /tmp http://mysite.com/foo.tgz')
def test_directory(self): """wget with non-default output directory""" w = wget() self.assertEqual(w.download_step(url='http://mysite.com/foo.tgz', directory='/scratch'), 'mkdir -p /scratch && wget -q -nc --no-check-certificate -P /scratch http://mysite.com/foo.tgz')
def test_referer(self): """wget with referer""" w = wget() self.assertEqual(w.download_step(url='http://mysite.com/foo.tgz', referer='http://mysite.com/foo.html'), 'mkdir -p /tmp && wget -q -nc --no-check-certificate --referer http://mysite.com/foo.html -P /tmp http://mysite.com/foo.tgz')
def test_basic(self): """Basic wget""" w = wget() self.assertEqual(w.download_step(url='http://mysite.com/foo.tgz'), 'mkdir -p /tmp && wget -q -nc --no-check-certificate -P /tmp http://mysite.com/foo.tgz')
def test_missing_url(self): """Missing url option""" w = wget() self.assertEqual(w.download_step(), '')