12 June 2013

450. Tor and Chrome on Debian

Note:
* For the Tor bundle see http://verahill.blogspot.com.au/2013/05/408-briefly-tor-on-debian-quick-option.html
* For securing your dropbox, see http://verahill.blogspot.com.au/2013/04/398-securing-your-dropbox.html
* For encrypting your filesystem with encfs, see http://verahill.blogspot.com.au/2013/05/408-briefly-tor-on-debian-quick-option.html
* For one-time passwords (OTPW), see http://verahill.blogspot.com.au/2013/04/385-otpw-connecting-from-insecure.html
* For encryption in general using PGP/GPG, OTR, SRTP for chat, email, voice and video, see http://verahill.blogspot.com.au/2013/04/381-encrypting-chat-voice-video.html
* For truecrypt with dropbox, see http://verahill.blogspot.com.au/2012/04/using-truecrypt-with-dropbox.html

Post begins:
I think it's fair to say that online privacy is in the spotlight again, temporarily,  in particular if you are not living in the US. After all, the rest of the world is offered no protection from US agencies.

There are two levels of snooping that (can) go on:
Case 1:  outright intercept of communications
In this case your emails are read, your browsing data is intercepted and your phone conversations tapped. This is the most intrusive form, and I think even in the US a warrant is required for the intercept of this type of data (whether that's too easy of difficult to get is another question entirely).

Case 2: mining of 'meta-data'
In this case data such as recipient/sender of emails, URLs that you've been visiting, and whom you have been calling/called by are collected. In addition, e.g. cell phone tower records can be collected to track your whereabouts 24/7.

While the contents of your conversations isn't known, your entire social and professional life can be charted.
As far as I understand this is what NSA has been engaging in. Likewise, knowing exactly where you are at any given point in time, a pretty detailed picture of your life can be painted.

Begin Rant
I don't have anything to hide, but I am not too keen on the government having better records of my life than I do myself. And I should be the one deciding what to share as long as the presumption of innocence holds.

Also, we're making the presumption that the government is benign, and as has been shown repeatedly, it isn't always. That goes for the US government, the UK government and just about any bloody imaginable government, and for a simple reason: the government is made up of people. In particular people who are keen on 'leading' i.e. controlling others. Even a benign despot is a despot.

There's no use being naive -- in either direction. There are legitimate reasons for clandestine organisations wanting to mine data, and there are legitimate reasons for why we should not give them a carte blanche.

Whether you use PGP/GPG or not won't affect the mining of meta-data. Nor will OTR, although it might in theory give you a somewhat better level of deniability (but not really).

Using PGP/GPG, OTR and encryption of data in general will only protect the content of your conversations, not the fact that they occurred. Not that it's easy getting people to start using encryption of their email, especially not since hotmail and gmail provided the final push into getting people to do all their email processing in the browser rather than using a more capable email client. Obviously Google would not be pleased if all communication was PGP encrypted, since this would create issues with targeted ads.

Finally, what really irks me is the fact that because John Doe won't use encryption -- or learn how to do it -- I also cannot use it. Instead we have to play according to the rules of the least technologically informed.
End Rant

Anyway. There are a few things you can do -- at least to make you feel better. Whether they have any real impact on your privacy depends on what other sources of information leakage there are in your life.

The simplest thing you can do is to do all your browsing anonymously, including setting up and checking your email. And the easiest way to do that is by using Tor.

It's easy enough to use the Tor Bundle, e.g. http://verahill.blogspot.com.au/2013/05/408-briefly-tor-on-debian-quick-option.html

However, I for some forsaken reason like using Chrome.

To set up Proxy SwitchySharp I'm following this post:
http://lifehacker.com/5614732/create-a-tor-button-in-chrome-for-on+demand-anonymous-browsing

NOTE: there are many layers to managing your privacy, and you're only as anonymous as your worst habits allow you to be. I'm a pessimist -- I think it is virtually impossible to protect yourself against a determined adversary. However, trying won't hurt.


Step 0. Block cookies by default and install an ad blocker

Cookies
Pretending to be anonymous won't help if you give the game away by exposing cookies that you acquired while surfing without Tor.

You'll be surprised how many websites require you to accept cookies -- however, it's up to you whether you want to put up with that. I only allow cookies with services that I've signed up to and that I trust. I refuse to allow in particular commercial sites to require cookies for me to simply visit.

In Chrome, go to Settings, Content Settings, and check:
* Block sites from setting any data
* Block third-party cookies and site data
* Clear cookies and other site and plug-in data when I close my browser

Disable:
* Allow local data to be set

You may want to restrict e.g. image loading, javascript, pop-ups, plugins etc. as well. It's down to you to weight inconvenience vs privacy.

Set Cookie and Site Data exceptions manually, and make sure to distinguish between Session Only and Allow.

Ads
Also, install e.g. simple adblock:
https://chrome.google.com/webstore/search/simple%20adblock



Step 1. Install the HTTPS everywhere extension
https://chrome.google.com/webstore/search/https%20everywhere?hl=en-GB



Step 2. Install Proxy SwitchySharp
https://chrome.google.com/webstore/search/proxy%20switchysharp?hl=en-GB

Set up a profile called Tor to use SOCK 5 with 127.0.0.1:9050
Go to the General Tab and enable Quick Switch.
Make sure to drag both Tor and Direct Connection into the Quick Switch field.



Step 3. Install Tor and Vidalia
Add the following to your /etc/apt/sources.list
deb http://deb.torproject.org/torproject.org wheezy main

Then do
sudo apt-get update
sudo apt-get install deb.torproject.org-keyring
sudo apt-get update
sudo apt-get install vidalia

Tor should run in the background whether you start Vidalia or not.

Step 4. Prevent DNS leaks:
[for fun, do
sudo apt-get install tcpdump
sudo tcpdump -pni eth0 'port domain'
before turning off prefetching. ]

To make sure that your DNS requests aren't being read (i.e. providing meta-data to your ISP), you will need to turn of DNS pre-fetching in Chrome.

Google is sneaky about it though -- to turn off prefetching go to Settings/Under the Bonnet and uncheck "Predict network actions to improve page load performance".

[If you set up tcpdump before you'll see how suddenly the IPs and URLs stop streaming by.]


Step 5. Start Tor/Vidalia
You don't seem to be able to launch Vidalia from the terminal, so launch Vidalia from within e.g. gnome.
In fact, you probably don't have launch vidalia as Tor should be run in the background.
Then open Chrome and navigate to e.g. whatsmyip.org or ipchicken.com:


You can turn on and off the proxy by clicking on the icon in the top right corner.

Step 6. Enable private browsing:
You don't want to risk one website being able to see what another website left behind. It shouldn't happen, but it has happened in the past.

Anyway, it's easy: open an Incognito window (ctrl + shift + N).


Done.
As far as I can tell this should give you some privacy. However, the question is how effective this is in the long run since it's difficult to maintain enough discipline to prevent any information leakage to occur.

449. Nwchem 6.3 -- updated sources. Compiling on Debian

The previous post uses the sources from the 17th of May.


What's new?
Maybe it's just me, but I can't find any obvious location where they list the differences between the 28th of June and the 17th of June releases. In fact, I wouldn't have known that there was a new version out unless someone had specifically pointed it out to me.

Anyway, luckily there's diff. There were more changes than the ones I'm showing below, but most of them were minor ones such as .stamp files and a re-done pair of QA test output files.
  1 Only in nwchem-6.3-src.2013-05-28/QA/tests: rodft-cam
  2 diff -r nwchem-6.3-src.2013-05-17/src/nwdft/scf_dft/dft_canorg.F nwchem-6.3-src.2013-05-28/src/nwdft/scf_dft/dft_canorg.F
  3 6c6
  4 < c     $Id: dft_canorg.F 23846 2013-03-19 04:08:25Z edo $
  5 ---
  6 > c     $Id: dft_canorg.F 24271 2013-05-24 06:48:33Z niri $
  7 279c279,280
  8 <          if(iter.ge.nfock/2)iswitc = iswitc+1
  9 ---
 10 >          if(iter.ge.nfock/2) iswitc = iswitc+1
 11 >          if(abs(delta).lt.1d-6) iswitc = iswitc+2
 12 diff -r nwchem-6.3-src.2013-05-17/src/nwdft/scf_dft/dft_scf.F nwchem-6.3-src.2013-05-28/src/nwdft/scf_dft/dft_scf.F
 13 9c9
 14 < c     $Id: dft_scf.F 23988 2013-04-08 23:06:52Z d3y133 $
 15 ---
 16 > c     $Id: dft_scf.F 24269 2013-05-24 00:55:11Z edo $
 17 819c819
 18 <          iswitc = 1
 19 ---
 20 >          iswitc = 2
 21 diff -r nwchem-6.3-src.2013-05-17/src/nwdft/scf_dft_cg/dft_roks_fock.F nwchem-6.3-src.2013-05-28/src/nwdft/scf_dft_cg/dft_roks_fock.F
 22 6c6
 23 < * $Id: dft_roks_fock.F 23999 2013-04-10 18:23:02Z d3y133 $
 24 ---
 25 > * $Id: dft_roks_fock.F 24274 2013-05-24 07:34:16Z niri $
 26 102c102
 27 <       double precision edisp    ! [input] dispersion corrrection
 28 ---
 29 >       double precision Edisp    ! [input] dispersion correction
 30 107c107
 31 <       double precision errmax, ebq
 32 ---
 33 >       double precision errmax, Ebq
 34 124c124
 35 <       integer g_tmp(2)
 36 ---
 37 >       integer g_tmp(nset)
 38 326a327,335
 39 >         call ga_zero(g_tmp(1))
 40 >         if (nopen.gt.0) then
 41 >           g_tmp(2) = ga_create_atom_blocked(geom, basis,
 42 >      $                                      'dft_roks_fock: tmp2')
 43 >           g_tmp(3) = ga_create_atom_blocked(geom, basis,
 44 >      $                                      'dft_roks_fock: tmp3')
 45 >           call ga_zero(g_tmp(2))
 46 >           call ga_zero(g_tmp(3))
 47 >         endif
 48 330d338
 49 <         call ga_zero(g_tmp(1))
 50 339c347
 51 <      $     tol2e, oskel, iv_dens, g_tmp(1), .false., .false.)
 52 ---
 53 >      $     tol2e, oskel, iv_dens, g_tmp, .false., .false.)
 54 340a349,352
 55 >         if (nopen.gt.0) then
 56 >           call ga_dadd(1d0,iv_fock(2),1d0,g_tmp(2),iv_fock(2))
 57 >           call ga_dadd(1d0,iv_fock(3),1d0,g_tmp(3),iv_fock(3))
 58 >         endif
 59 344a357,360
 60 >         if (nopen.gt.0) then
 61 >           call ga_zero(g_tmp(2))
 62 >           call ga_zero(g_tmp(3))
 63 >         endif
 64 353c369
 65 <      $     tol2e, oskel, iv_dens, g_tmp(1), .false., .true.)
 66 ---
 67 >      $     tol2e, oskel, iv_dens, g_tmp, .false., .true.)
 68 354a371,374
 69 >         if (nopen.gt.0) then
 70 >           call ga_dadd(1d0,iv_fock(2),1d0,g_tmp(2),iv_fock(2))
 71 >           call ga_dadd(1d0,iv_fock(3),1d0,g_tmp(3),iv_fock(3))
 72 >         endif
 73 358a379,385
 74 >         if (nopen.gt.0) then
 75 >           if (.not. ga_destroy(g_tmp(2))) call errquit
 76 >      $               ('xc_getv: ga corrupt?',0, GA_ERR)
 77 >           if (.not. ga_destroy(g_tmp(3))) call errquit
 78 >      $               ('xc_getv: ga corrupt?',0, GA_ERR)
 79 >         endif
 80 > c
 81 383c410
 82 <       etwo = etwo_closed + etwo_open + edisp
 83 ---
 84 >       etwo = etwo_closed + etwo_open + Edisp
 85 diff -r nwchem-6.3-src.2013-05-17/src/tools/GNUmakefile nwchem-6.3-src.2013-05-28/src/tools/GNUmakefile
 86 342a343,346
 87 > ifeq ($(ARMCI_NETWORK),SOCKETS)
 88 >         MAYBE_ARMCI = --with-sockets
 89 > endif # SOCKETS
 90 >
 91 Only in nwchem-6.3-src.2013-05-28/src/util: util_ga_version.F
 92 diff -r nwchem-6.3-src.2013-05-17/src/util/util_nwchem_version.F nwchem-6.3-src.2013-05-28/src/util/util_nwchem_version.F
 93 4c4
 94 <       nwrev="24252"
 95 ---
 96 >       nwrev="24277"

The section in red is the Iswtch.patch in http://verahill.blogspot.com.au/2013/05/424-nwchem-63-on-debian-wheezy.html.

I'm guessing that this patch is also included: http://www.nwchem-sw.org/index.php/Special:AWCforum/st/id840/rodft_and_range_separated-functi....html
I've indicated it in blue.

Purple is probably to make sure that SOCKETS gets implemented correctly -- there were issues with that before.

I f I were to guess I'd say that if you compiled nwchem as shown here: http://verahill.blogspot.com.au/2013/05/424-nwchem-63-on-debian-wheezy.html
AND if you are not going to use CAM with open-shell molecules, then you are not in a hurry to recompile.

The former issue is manifested in slow run times, while the second issue is manifested in crashing calculations, so neither should be able to fly under the radar.

Anyway

The GabEdit Patch
The following patch allows you to use GabEdit as a GUI to nwchem, and allows you to compile nwchem with python support.
Copy the following and paste it into a file, e.g. 6.3.patch, and put it into /opt/nwchem/nwchem-6.3-src.2013-05-28:

diff -rupN src.original/config/makefile.h src/config/makefile.h
--- src.original/config/makefile.h      2013-04-15 12:41:45.016853322 +1000
+++ src/config/makefile.h       2013-04-15 12:38:44.933319544 +1000
@@ -2039,7 +2039,7 @@ endif
 
      ifeq ($(BUILDING_PYTHON),python)
 #   EXTRA_LIBS += -ltk -ltcl -L/usr/X11R6/lib -lX11 -ldl
-     EXTRA_LIBS +=    -lnwcutil  -lpthread -lutil -ldl
+     EXTRA_LIBS +=    -lnwcutil  -lpthread -lutil -ldl -lssl -lz
   LDOPTIONS = -Wl,--export-dynamic 
      endif
 ifeq ($(NWCHEM_TARGET),CATAMOUNT)
diff -rupN src.original/ddscf/movecs_pr_anal.F src/ddscf/movecs_pr_anal.F
--- src.original/ddscf/movecs_pr_anal.F 2013-04-15 12:41:45.036852381 +1000
+++ src/ddscf/movecs_pr_anal.F  2013-04-15 12:23:28.100409225 +1000
@@ -195,7 +195,7 @@ c
  22         format(1x,2('  Bfn.  Coefficient  Atom+Function  ',5x))
             write(LuOut,23)
  23         format(1x,2(' ----- ------------  ---------------',5x))
-            do klo = 0, min(n-1,9), 2
+            do klo = 0, min(n-1,199), 2
                khi = min(klo+1,n-1)
                write(LuOut,2) (
      $              int_mb(k_list+k)+1, 
diff -rupN src.original/ddscf/rohf.F src/ddscf/rohf.F
--- src.original/ddscf/rohf.F   2013-04-15 12:41:45.036852381 +1000
+++ src/ddscf/rohf.F    2013-04-15 12:23:28.100409225 +1000
@@ -153,7 +153,7 @@ c
             ilo = 1
             ihi = nmo
          endif
-         call movecs_print_anal(basis, ilo, ihi, 0.15d0, g_movecs, 
+         call movecs_print_anal(basis, ilo, ihi, 0.01d0, g_movecs, 
      $        'ROHF Final Molecular Orbital Analysis', 
      $        .true., dbl_mb(k_eval), oadapt, int_mb(k_irs),
      $        .true., dbl_mb(k_occ))
diff -rupN src.original/ddscf/scf_vec_guess.F src/ddscf/scf_vec_guess.F
--- src.original/ddscf/scf_vec_guess.F  2013-04-15 12:41:45.036852381 +1000
+++ src/ddscf/scf_vec_guess.F   2013-04-15 12:23:28.100409225 +1000
@@ -511,19 +511,19 @@ c
          nprint = min(nclosed+nopen+30,nmo)
          if (scftype.eq.'RHF' .or. scftype.eq.'ROHF') then
             call movecs_print_anal(basis, 1,
-     &           nprint, 0.15d0, g_movecs, 
+     &           nprint, 0.01d0, g_movecs, 
      &           'ROHF Initial Molecular Orbital Analysis', 
      &           .true., dbl_mb(k_eval), oadapt, int_mb(k_irs),
      &           .true., dbl_mb(k_occ))
          else
             nprint = min(nalpha+20,nmo)
             call movecs_print_anal(basis, max(1,nbeta-20),
-     &           nprint, 0.15d0, g_movecs, 
+     &           nprint, 0.01d0, g_movecs, 
      &           'UHF Initial Alpha Molecular Orbital Analysis', 
      &           .true., dbl_mb(k_eval), oadapt, int_mb(k_irs),
      &           .true., dbl_mb(k_occ))
             call movecs_print_anal(basis, max(1,nbeta-20),
-     &           nprint, 0.15d0, g_movecs(2), 
+     &           nprint, 0.01d0, g_movecs(2), 
      &           'UHF Initial Beta Molecular Orbital Analysis', 
      &           .true., dbl_mb(k_eval+nbf), oadapt, int_mb(k_irs+nmo),
      &           .true., dbl_mb(k_occ+nbf))
diff -rupN src.original/ddscf/uhf.F src/ddscf/uhf.F
--- src.original/ddscf/uhf.F    2013-04-15 12:41:45.036852381 +1000
+++ src/ddscf/uhf.F     2013-04-15 12:23:28.096409414 +1000
@@ -144,11 +144,11 @@ C
          enddo
          ihi = max(ihi-1,1)
  9611    continue
-         call movecs_print_anal(basis, ilo, ihi, 0.15d0, g_movecs, 
+         call movecs_print_anal(basis, ilo, ihi, 0.01d0, g_movecs, 
      $        'UHF Final Alpha Molecular Orbital Analysis', 
      $        .true., dbl_mb(k_eval), oadapt, int_mb(k_irs),
      $        .true., dbl_mb(k_occ))
-         call movecs_print_anal(basis, ilo, ihi, 0.15d0, g_movecs(2), 
+         call movecs_print_anal(basis, ilo, ihi, 0.01d0, g_movecs(2), 
      $        'UHF Final Beta Molecular Orbital Analysis', 
      $        .true., dbl_mb(k_eval+nbf), oadapt, int_mb(k_irs+nmo),
      $        .true., dbl_mb(k_occ+nbf))
diff -rupN src.original/mcscf/mcscf.F src/mcscf/mcscf.F
--- src.original/mcscf/mcscf.F  2013-04-15 12:41:45.000854073 +1000
+++ src/mcscf/mcscf.F   2013-04-15 12:23:23.748613695 +1000
@@ -719,7 +719,7 @@ c
       if (util_print('final vectors analysis', print_default))
      $     call movecs_print_anal(basis, 
      $     max(1,nclosed-10), min(nbf,nclosed+nact+10),
-     $     0.15d0, g_movecs, 'Analysis of MCSCF natural orbitals',
+     $     0.01d0, g_movecs, 'Analysis of MCSCF natural orbitals',
      $     .true., dbl_mb(k_evals), .true., int_mb(k_sym), 
      $     .true., dbl_mb(k_occ))
 c     
diff -rupN src.original/nwdft/scf_dft/dft_mxspin_ovlp.F src/nwdft/scf_dft/dft_mxspin_ovlp.F
--- src.original/nwdft/scf_dft/dft_mxspin_ovlp.F        2013-04-15 12:41:45.604825677 +1000
+++ src/nwdft/scf_dft/dft_mxspin_ovlp.F 2013-04-15 12:23:28.228403211 +1000
@@ -184,14 +184,14 @@ c
       call ga_sync()
 c
       call movecs_print_anal(basis,int_mb(k_non),int_mb(k_non)
-     & ,0.15d0,g_alpha,'Alpha Orbitals without Beta Partners',
+     & ,0.01d0,g_alpha,'Alpha Orbitals without Beta Partners',
      &   .false., 0.0 ,.false., 0 , .false., 0 )
 c
       if (nct.GE.2) then
       do i = 2,nct
       ind = int_mb(k_non+i-1)
       call movecs_print_anal(basis,ind,ind
-     & ,0.15d0,g_alpha,' ',
+     & ,0.01d0,g_alpha,' ',
      &   .false., 0.0 ,.false., 0 , .false., 0 )
       enddo
       endif
@@ -350,7 +350,7 @@ c      endif
 c      endif
 c 9990 format(/,18x,'THERE ARE',i3,1x,'UN-PARTNERED ALPHA ORBITALS')
 c
-       call movecs_print_anal(basis, 1, nalp, 0.15d0, g_ualpha,
+       call movecs_print_anal(basis, 1, nalp, 0.01d0, g_ualpha,
      & 'Alpha Orb. w/o Beta Partners (after maxim. alpha/beta overlap)',
      &   .false., 0.0 ,.false., 0 , .false., 0 )
 c
diff -rupN src.original/nwdft/scf_dft/dft_scf.F src/nwdft/scf_dft/dft_scf.F
--- src.original/nwdft/scf_dft/dft_scf.F        2013-04-15 12:41:45.608825490 +1000
+++ src/nwdft/scf_dft/dft_scf.F 2013-04-15 12:23:28.228403211 +1000
@@ -1774,7 +1774,7 @@ c
             else
                blob='DFT Final Beta Molecular Orbital Analysis' 
             endif
-            call movecs_print_anal(ao_bas_han, ilo, ihi, 0.15d0, 
+            call movecs_print_anal(ao_bas_han, ilo, ihi, 0.01d0, 
      &           g_movecs(ispin), 
      &           blob, 
      &           .true., dbl_mb(k_eval(ispin)), oadapt, 
diff -rupN src.original/nwdft/scf_dft_cg/dft_cg_solve.F src/nwdft/scf_dft_cg/dft_cg_solve.F
--- src.original/nwdft/scf_dft_cg/dft_cg_solve.F        2013-04-15 12:41:45.612825303 +1000
+++ src/nwdft/scf_dft_cg/dft_cg_solve.F 2013-04-15 12:23:28.220403588 +1000
@@ -183,7 +183,7 @@ c
             blob = 'DFT Final Beta Molecular Orbital Analysis'
           endif
           call movecs_fix_phase(g_movecs(ispin))
-          call movecs_print_anal(basis, ilo, ihi, 0.15d0,
+          call movecs_print_anal(basis, ilo, ihi, 0.01d0,
      &         g_movecs(ispin),blob,
      &         .true., dbl_mb(k_eval+(ispin-1)*nbf),
      &         oadapt, int_mb(k_irs+(ispin-1)*nbf),




Compiling nwchem
First install ACML or OpenBlas:
http://verahill.blogspot.com.au/2013/05/423-openblas-on-debian-wheezy.html
http://verahill.blogspot.com.au/2013/05/422-set-up-acml-on-linux.html


sudo apt-get install build-essential gfortran python2.7-dev libopenmpi-dev openmpi-bin
sudo mkdir /opt/nwchem -p
sudo chown $USER:$USER /opt/nwchem
cd /opt/nwchem
wget http://www.nwchem-sw.org/download.php?f=Nwchem-6.3.revision1-src.2013-05-28.tar.gz -O Nwchem-6.3.revision1-src.2013-05-28.tar.gz
tar xvf Nwchem-6.3.revision1-src.2013-05-28.tar.gz
cd nwchem-6.3-src.2013-05-28/

Apply the Gabedit patch:
patch -p0 < 6.3.patch 
patching file src/config/makefile.h patching file src/ddscf/movecs_pr_anal.F patching file src/ddscf/rohf.F patching file src/ddscf/scf_vec_guess.F patching file src/ddscf/uhf.F patching file src/mcscf/mcscf.F patching file src/nwdft/scf_dft/dft_mxspin_ovlp.F patching file src/nwdft/scf_dft/dft_scf.F patching file src/nwdft/scf_dft_cg/dft_cg_solve.F

export NWCHEM_TOP=`pwd`
export LARGE_FILES=TRUE
export TCGRSH=/usr/bin/ssh
export NWCHEM_TOP=`pwd`
export NWCHEM_TARGET=LINUX64
export NWCHEM_MODULES="all python"
export PYTHONVERSION=2.7
export PYTHONHOME=/usr
export BLASOPT="-L/opt/acml/acml5.3.1/gfortran64_int64/lib -lacml"
#export BLASOPT="-L/opt/openblas/lib -lopenblas"

export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export MPI_LOC=/usr/lib/openmpi/lib
export MPI_INCLUDE=/usr/lib/openmpi/include
export LIBRARY_PATH="$LIBRARY_PATH:/usr/lib/openmpi/lib:/opt/acml/acml5.3.1/gfortran64_int64/lib"
#export LIBRARY_PATH=$LIBRARY_PATH:/usr/lib/openmpi/lib:/opt/openblas/lib

export LIBMPI="-lmpi -lopen-rte -lopen-pal -ldl -lmpi_f77 -lpthread"
export ARMCI_NETWORK=SOCKETS

cd $NWCHEM_TOP/src

make clean
make nwchem_config
make FC=gfortran 1> make.log 2>make.err

cd $NWCHEM_TOP/contrib
export FC=gfortran
./getmem.nwchem

Comment out the bold parts and uncomment the commented parts to compile with openblas instead of ACML e.g. if you're compiling on an intel machine instead of AMD.

Setting up your ~/.bashrc
As usual, do
echo 'export NWCHEM_EXECUTABLE=/opt/nwchem/nwchem-6.3-src.2013-05-28/bin/LINUX64/nwchem' >> ~/.bashrc
echo 'export NWCHEM_BASIS_LIBRARY=/opt/nwchem/nwchem-6.3-src.2013-05-28/src/basis/libraries/' >> ~/.bashrc
echo 'export PATH=$PATH:/opt/nwchem/nwchem-6.3-src.2013-05-28/bin/LINUX64' >> ~/.bashrc

Also, put a .nwchemrc in your home folder:
nwchem_basis_library /opt/nwchem/nwchem-6.3-src.2013-05-28/src/basis/libraries/
ffield amber
amber_1 /opt/nwchem/nwchem-6.3-src.2013-05-28/src/data/amber_s/
amber_2 /opt/nwchem/nwchem-6.3-src.2013-05-28/src/data/amber_x/
amber_3 /opt/nwchem/nwchem-6.3-src.2013-05-28/src/data/amber_q/
amber_4 /opt/nwchem/nwchem-6.3-src.2013-05-28/src/data/amber_u/
amber_5 /opt/nwchem/nwchem-6.3-src.2013-05-28/src/data/custom/
spce /opt/nwchem/nwchem-6.3-src.2013-05-28/src/data/solvents/spce.rst
charmm_s /opt/nwchem/nwchem-6.3-src.2013-05-28/src/data/charmm_s/
charmm_x /opt/nwchem/nwchem-6.3-src.2013-05-28/src/data/charmm_x/

You're done.

448. Metal-pi bonds in ECCE

It should be easy, since it's one of the implemented bond types in ECCE together with single, double, triple and pi-arene bonds, but it doesn't function quite as advertised (supposed to ignore nubs).

I think it might be a bug, but given the very few resources currently given to ECCE, it's better to develop work-arounds than to demand quick bug fixes.

A reasonable criticism of this post would be that it really doesn't matter in the long run though, as the bonds that we make here are eye-candy only -- DFT doesn't 'know' what bonds are in the sense of the ball-and-stick model. On the other hand, ECCE will complain loudly if there's a discrepancy between oxidation states, multiplicity and number of vacant sites.

In the end, if you have a crystal structure to start from, use that. If not, then this is a fairly simple way of yielding a visually pleasing and reasonably intuitive model.

Anyway, let's use Noyori's catalyst as an example:


Start ECCE, set up a new job and click on Builder.

Click on Import from Structure Library, select Alicycles, and click on Cyclooctane, then click in the main window.


Delete one hydrogen on each of the sp2 carbons, and change the bond type to double bond:

 Change the sp2 carbons to TrigonalPlanar, and Clean (click the broom which does MM (UFF) geometry optimization).

Insert an octahedral iridium atom -- you'll need two 'nubs' for each pi bond, and two nubs for the two phosphine ligands.

 Change the sp2 carbons back to tetrahedral so you get 'nubs' to bond to (not supposed to be necessary according to the manual, but it is). Make Metal-pi bonds.
 Make sure all the bonds (check the first one in particular) are Metal-Pi bonds, and Clean the structure (i.e. MM/UFF optimization)


 Insert two tetrahedral phosphorous atoms, and make single bonds
Click on Add H if you want PH3 ligands, and clean the structure (i.e. optimize geo with MM/UFF):


At this point the structure isn't quite perfectly square planar like we would like it to be. The easiest way to sort that out is to set the torsional angles between the H-C(=)-Ir-P to 0 (uncheck rotate group around bond) for each P, then Clean. The result isn't perfect, but still not too shabby: