10 October 2014

595. Issue upgrading debian jessie -- stuck at systemd

Doing a dist-upgrade yesterday (9th of October 2014) it failed because of issues with configuring systemd. In the end my troubleshooting didn't help, but google did.

Dead-end troubleshooting:

Trying to work through it:
sudo apt-get dist-upgrade Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: systemd-sysv : Depends: systemd (= 208-8) but 215-5+b1 is installed E: Unmet dependencies. Try using -f.
Checking why systemd-sysv is mentioning 208-8 instead of 215-5:
apt-cache policy systemd-sysv systemd-sysv: Installed: 208-8 Candidate: 215-5+b1 Version table: 215-5+b1 0 500 http://ftp.iinet.net.au/debian/debian/ testing/main amd64 Packages *** 208-8 0 100 /var/lib/dpkg/status
Let's try forcing 215-5:
sudo apt-get install systemd-sysv=215-5+b1 Reading package lists... Done Building dependency tree Reading state information... Done [..] The following packages will be upgraded: systemd-sysv 1 upgraded, 0 newly installed, 0 to remove and 531 not upgraded. 422 not fully installed or removed. Need to get 0 B/29.1 kB of archives. After this operation, 3,072 B of additional disk space will be used. Retrieving bug reports... Done Parsing Found/Fixed information... Done Setting up systemd (215-5+b1) ... dpkg: error processing package systemd (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: systemd E: Sub-process /usr/bin/dpkg returned an error code (1)
OK, let's try working on systemd:
sudo dpkg -D2 --configure systemd Setting up systemd (215-5+b1) ... D000002: fork/exec /var/lib/dpkg/info/systemd.postinst ( configure 208-8 ) dpkg: error processing package systemd (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: systemd

Solving it:
No luck. Google wasn't too helpful initially, until I came across https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762275
sudo delgroup systemd-journal Removing group `systemd-journal' ... Done.
Then tried
sudo dpkg -D2 --configure systemd Setting up systemd (215-5+b1) ... D000002: fork/exec /var/lib/dpkg/info/systemd.postinst ( configure 208-8 ) /var/lib/dpkg/info/systemd.postinst: 128: /var/lib/dpkg/info/systemd.postinst: cannot open /run/systemd/was-enabled: No such file
and
sudo apt-get install -f [..] Do you want to continue? [Y/n] Y Retrieving bug reports... Done Parsing Found/Fixed information... Done (Reading database ... 462023 files and directories currently installed.) Preparing to unpack .../systemd-sysv_215-5+b1_amd64.deb ... Unpacking systemd-sysv (215-5+b1) over (208-8) ... Processing triggers for man-db (2.6.7.1-1) ... Setting up systemd-sysv (215-5+b1) ... [..]
and then
sudo apt-get dist-upgrade
works again!

Many reasons to dislike systemd, although in this case I guess it's poor packaging.

15 September 2014

594. Very, very briefly: Speedtest your WLAN

As shown here: http://firstin-lastout.com/2013/07/how-to-test-wifi-speed/

Install iperf: sudo apt-get install iperf

Open two terminal windows on the same computer:

Terminal 1$ iperf -s -u -i1
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
Terminal 2$ iperf -c 192.168.2.1 -u -i1 -l 1300 -b 100m -t 600
------------------------------------------------------------
Client connecting to 192.168.2.1, UDP port 5001
Sending 1300 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 192.168.2.110 port 56520 connected with 192.168.2.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 1.0 sec  4.46 MBytes  37.4 Mbits/sec
[  3]  1.0- 2.0 sec  4.45 MBytes  37.3 Mbits/sec
[  3]  2.0- 3.0 sec  4.28 MBytes  35.9 Mbits/sec
[  3]  3.0- 4.0 sec  4.32 MBytes  36.2 Mbits/sec
[  3]  4.0- 5.0 sec  4.42 MBytes  37.1 Mbits/sec
[  3]  5.0- 6.0 sec  4.35 MBytes  36.5 Mbits/sec
[  3]  6.0- 7.0 sec  4.39 MBytes  36.8 Mbits/sec
[  3]  7.0- 8.0 sec  4.35 MBytes  36.5 Mbits/sec
[  3]  8.0- 9.0 sec  4.41 MBytes  37.0 Mbits/sec

Where 192.168.2.1 is my wireless router.


593. nwchem 6.5 on debian jessie and wheezy

A new version of nwchem is out now, and this time we're seeing a new solvation model: SMD! Given how long it took to get COSMO right, the involvement of Truhlar in implementing SMD is a very good thing.

Either way, in order to be able to compile nwchem 6.5 on wheezy you'll need to do a few things:
sudo apt-get install build-essential libopenmpi-dev openmpi-bin
wget http://www.nwchem-sw.org/download.php?f=Nwchem-6.5.revision26243-src.2014-09-10.tar.gz -O Nwchem-6.5.revision26243-src.2014-09-10.tar.gz
tar xvf Nwchem-6.5.revision26243-src.2014-09-10.tar.gz 
cd Nwchem-6.5.revision26243-src.2014-09-10/


Create a patch file, e.g. 6.5.patch with the following content (most of the patches are for compatibility with gabedit, but a few of them are needed in order to compile nwchem on debian):
diff -rupN src.original/config/makefile.h src/config/makefile.h --- src.original/config/makefile.h 2014-09-15 12:28:58.153787833 +1000 +++ src/config/makefile.h 2014-09-15 12:30:58.745787161 +1000 @@ -2208,7 +2208,7 @@ endif ifeq ($(BUILDING_PYTHON),python) # EXTRA_LIBS += -ltk -ltcl -L/usr/X11R6/lib -lX11 -ldl - EXTRA_LIBS += -lnwcutil -lpthread -lutil -ldl -lz + EXTRA_LIBS += -lnwcutil -lpthread -lutil -ldl -lz -lssl 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 2014-09-15 12:28:58.229787833 +1000 +++ src/ddscf/movecs_pr_anal.F 2014-09-15 12:32:33.801786632 +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 2014-09-15 12:28:58.229787833 +1000 +++ src/ddscf/rohf.F 2014-09-15 12:33:12.897786414 +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 2014-09-15 12:28:58.229787833 +1000 +++ src/ddscf/scf_vec_guess.F 2014-09-15 12:34:41.533785920 +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 2014-09-15 12:28:58.229787833 +1000 +++ src/ddscf/uhf.F 2014-09-15 12:35:25.225785676 +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 2014-09-15 12:28:58.441787832 +1000 +++ src/mcscf/mcscf.F 2014-09-15 12:35:55.233785509 +1000 @@ -723,7 +723,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 2014-09-15 12:28:58.457787831 +1000 +++ src/nwdft/scf_dft/dft_mxspin_ovlp.F 2014-09-15 12:37:23.401785018 +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 2014-09-15 12:28:58.457787831 +1000 +++ src/nwdft/scf_dft/dft_scf.F 2014-09-15 12:38:29.713784648 +1000 @@ -2097,7 +2097,7 @@ c endif c ... jochen: replaced 0.15 at the end of the line with 'tanalyze' c which can be read from input -c call movecs_print_anal(ao_bas_han, ilo, ihi, 0.15d0, +c call movecs_print_anal(ao_bas_han, ilo, ihi, 0.01d0, call movecs_print_anal(ao_bas_han, ilo, ihi, tanalyze, & g_movecs(ispin), & blob, 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 2014-09-15 12:28:58.445787832 +1000 +++ src/nwdft/scf_dft_cg/dft_cg_solve.F 2014-09-15 12:39:25.497784337 +1000 @@ -193,7 +193,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), @@ -216,7 +216,7 @@ c endif call movecs_fix_phase(g_movecs) blob = 'DFT Final Molecular Orbital Analysis' - call movecs_print_anal(basis, ilo, ihi, 0.15d0, + call movecs_print_anal(basis, ilo, ihi, 0.01d0, & g_movecs,blob, & .true., dbl_mb(k_eval), & oadapt, int_mb(k_irs),

Apply it with
patch -p0 < 6.5.patch

Then build using something along the lines of
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/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/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

See other posts for using different math libs: openblas, intel mkl, AMD acml

If you're building for Jessie, set the following flags before building:
export PYTHONCONFIGDIR=config-x86_64-linux-gnu
export PYTHONLIBTYPE=so