Showing posts with label dist-upgrade. Show all posts
Showing posts with label dist-upgrade. Show all posts

28 August 2014

591. Briefly: Changes to compiling nwchem 6.3 with python support on debian jessie

In general you can compile nwchem 6.3 on debian jessie just like you would on wheezy -- see here for detailed instructions: http://verahill.blogspot.com.au/2013/06/449-nwchem-63-updated-sources-compiling.html

To compile with python support you need to make an additional change in the code though:

On debian wheezy apt-file search libpython2.7.a shows 
python2.7-dev: /usr/lib/python2.7/config/libpython2.7.a

whereas on jessie it says
libpython2.7-dev: /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.a

This is causing issues, as alluded to here: http://www.nwchem-sw.org/index.php/Special:AWCforum/st/id1363/how_do_I_set_the_path_to_python_....html

However, it is easy to solve by editing src/config/makefile.h to read
2357 ifdef USE_PYTHON64 2358 CORE_LIBS += $(PYTHONHOME)/lib/python$(PYTHONVERSION)/config-x86_64-linux-gnu/libpython$(PYTHONVERSION).$(PYTHONLIBTYPE) 2359 else 2360 CORE_LIBS += $(PYTHONHOME)/lib/python$(PYTHONVERSION)/config-x86_64-linux-gnu/libpython$(PYTHONVERSION).$(PYTHONLIBTYPE) 2361 endif
(Note that I'm just guessing with the x86_64 part -- I don't have an i386 system to test on)

In addition, you will need to set
export PYTHONLIBTYPE=so
before building.

My full patch file (my.patch) for version 6.3 now looks like this (it fixes a few compilation issues, and makes nwchem more compatible with gabedit):

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),

--- src.original/config/makefile.h      2014-08-20 16:39:03.020195366 +1000
+++ src/config/makefile.h       2014-08-20 16:43:30.328351859 +1000
@@ -2355,9 +2355,9 @@ ifndef PYTHONLIBTYPE
        PYTHONLIBTYPE=a
 endif
 ifdef USE_PYTHON64
-  CORE_LIBS += $(PYTHONHOME)/lib64/python$(PYTHONVERSION)/config/libpython$(PYTHONVERSION).$(PYTHONLIBTYPE)
+  CORE_LIBS += $(PYTHONHOME)/lib/python$(PYTHONVERSION)/config-x86_64-linux-gnu/libpython$(PYTHONVERSION).$(PYTHONLIBTYPE)
 else
-  CORE_LIBS += $(PYTHONHOME)/lib/python$(PYTHONVERSION)/config/libpython$(PYTHONVERSION).$(PYTHONLIBTYPE)
+  CORE_LIBS += $(PYTHONHOME)/lib/python$(PYTHONVERSION)/config-x86_i386-linux-gnu/libpython$(PYTHONVERSION).$(PYTHONLIBTYPE)
 endif
 endif
 #

My build.sh file looks like this:

export LARGE_FILES=TRUE
export TCGRSH=/usr/bin/ssh
export NWCHEM_TOP=`pwd`
export NWCHEM_TARGET=LINUX64
export NWCHEM_MODULES="all python"
export PYTHONLIBTYPE=so
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

patch -p0 < my.patch

make clean
make nwchem_config
make FC=gfortran 1> make.log 2>make.err
cd $NWCHEM_TOP/contrib
export FC=gfortran
./getmem.nwchem

03 May 2012

130. Today's (3rd of May 2012) debian wheezy/testing updates -- Confused

You may want to be careful if you do dist-upgrade today.

Today
sudo apt-get dist-upgrade
gave

The following packages will be REMOVED:
  gnome gnome-desktop-environmentThe following NEW packages will be installed:
  gir1.2-gdesktopenums-3.0 iputils-tracepath
The following packages have been kept back:
  libboost-date-time-dev libboost-dev libboost-regex-dev libboost-signals-dev libgl1-nvidia-glx libmono-winforms2.0-cil nvidia-alternative nvidia-glx nvidia-kernel-dkms nvidia-vdpau-driver python-pyatspi2 xserver-xorg-video-nvidia
The following packages will be upgraded:
  gnome-core gnome-nettool gsettings-desktop-schemas gsettings-desktop-schemas-dev
No worries there, so I continued.

However, having seen the removal of gnome, gnome-core etc. cause issues before (http://verahill.blogspot.com.au/2012/04/fixed-no-internet-on-old-dell-after.html) I did
apt-get -s autoremove
afterwards.

The following packages will be REMOVED:
  abiword abiword-common abiword-plugin-grammar abiword-plugin-mathview aisleriot cheese ekiga file-roller gdebi gedit gedit-common gedit-plugins gir1.2-gdata-0.0 gir1.2-goa-1.0 gir1.2-gucharmap-2.90 gir1.2-javascriptcoregtk-3.0 gir1.2-rb-3.0 gir1.2-tracker-0.14 gir1.2-webkit-3.0 glchess glines gnect gnibbles gnobots2 gnome-cards-data gnome-documents gnome-games gnome-games-data gnome-games-extra-data gnome-nettool gnome-sudoku gnome-video-effects gnomine gnotravex gnotski gnuchess gnuchess-book gnumeric gnumeric-common grilo-plugins-0.1 gtali hamster-applet iagno iputils-tracepath libabiword-2.9 libatk-adaptor-schemas libboost-date-time1.49.0 libboost-serialization1.49.0 libboost-signals1.49.0 libcec1 libdmapsharing-3.0-2 libgdome2-0 libgdome2-cpp-smart0c2a libgexiv2-0 libgpod-common libgpod4 libgrilo-0.1-0 libgtkmathview0c2a libgupnp-av-1.0-2 libhal-storage1 liblink-grammar4 libmagick++4 libmagickcore4 libmagickcore4-extra libmagickwand4 libminiupnpc5 libnatpmp1 libnet1 libnfs1 libopal3.10.4 libots0 libpt2.10.4 librhythmbox-core5 libwv-1.2-4 liferea liferea-data link-grammar-dictionaries-en mahjongg media-player-info minissdpd python-evolution python-wnck quadrapassel rhythmbox rhythmbox-data rhythmbox-plugin-cdrecorder rhythmbox-plugins seahorse shotwell simple-scan sound-juicer tcptraceroute telepathy-idle transmission-common transmission-gtk unoconv xdg-user-dirs-gtk
  ... 97 to remove and 12 not upgraded.
Yeah, that doesn't sound good - I use seahorse, ekiga etc.

If the package version is given (libboost-date-time1.49.0) it's often ok to remove. But removing un-versioned packages is a better indication of something major being underway.

Anyway, taking a quick gander at gnome-desktop-enviroment which got removed:

Package: gnome-desktop-environment    
State: not installed
Version: 1:3.0+8
Priority: optional
Section: gnome
Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
Architecture: all
Uncompressed Size: 43.0 k
Depends: gnome (>= 1:3.0+8)
Description: The GNOME Desktop Environment - transitional package
 This is the GNOME Desktop environment, an intuitive and attractive desktop.

 This meta-package is obsolete and has been replaced by “gnome”.

Then checking gnome (which also got removed):

  Package: gnome                        
State: not installed
Version: 1:3.0+8
Priority: optional
Section: gnome

Seems like gnome got marked for removal although it shouldn't have been.

sudo apt-get install gnome
followed by
sudo apt-get -s autoremove
 The following packages will be REMOVED:
  dasher dasher-data gnome-accessibility-themes libboost-date-time1.49.0 libboost-serialization1.49.0 libboost-signals1.49.0 libcec1 libgail-gnome-module libhal-storage1 libmagick++4 libmagickcore4 libmagickcore4-extra libmagickwand4
  libnet1 libnfs1 tcptraceroute
0 upgraded, 0 newly installed, 16 to remove and 12 not upgraded.
Which makes a lot more sense.

Ergo, be careful when you use autoremove -- sometimes it will kill your desktop. Keep an eye at what dist-upgrade does.