Commit 82132879 authored by Michele Invernizzi's avatar Michele Invernizzi
Browse files

detect the number of available CPU for plumed make, as suggested by @akohlmey

parent a4684e26
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -187,13 +187,16 @@ if buildflag:
  os.remove("%s/%s" % (homepath,filename))

  # build plumed
 
if buildflag:
  print("Building plumed ...")
   cmd = 'cd %s/plumed-%s; ./configure --prefix=%s --enable-static-patch ; make -j8 ; make install' % (homepath,version,homedir)
  try:
    import multiprocessing
    n_cpus = multiprocessing.cpu_count()
  except:
    n_cpus = 1
  cmd = 'cd %s/plumed-%s; ./configure --prefix=%s --enable-static-patch ; make -j%d ; make install' % (homepath,version,homedir,n_cpus)
  txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
  print(txt.decode('UTF-8'))
# 
 
# create 2 links in lib/plumed to plumed2 installation dir

if linkflag: