Compiling NWChem 6.6 (ubuntu 14.04)

From NWChem

Viewed 3242 times, With a total of 8 Posts
Jump to: navigation, search

Gets Around
Threads 24
Posts 86
Hi, NwChem developers.

Some old issue returns
http://www.nwchem-sw.org/index.php/Special:AWCforum/st/id1348/Incomplete_EXTRA_LIBS_for_LI...

in Ubuntu python-config --libs returns:
-lpthread -ldl -lutil -lm -lpython2.7
without -lz for some reason.

therefore linking fails.

For this reason in NWChem 6.5 source -lz added to python-config --libs returns
https://github.com/jeffhammond/nwchem/blob/master/src/config/makefile.h#L2005

But this is not in version 6.6


P.S.

To make situation a bit clearer I want to add two links:
https://docs.python.org/2/extending/embedding.html#compiling-and-linking-under-unix-like-s...
https://bugs.python.org/issue15590

Quote:username

to link an embedded interpreter, SYSLIBS should be used,
which might not be complete.
However in this case MODLIBS is missing.


run python
>>> import sysconfig
>>> sysconfig.get_config_var('LIBS')
'-lpthread -ldl  -lutil'
>>> sysconfig.get_config_var('SYSLIBS')
'-lm'
>>> sysconfig.get_config_var('MODLIBS')
'-L/usr/lib -lz'


python-config --libs returns same as sysconfig.get_config_var('LIBS') and sysconfig.get_config_var('SYSLIBS') but sysconfig.get_config_var('MODLIBS') output is obviously missing.


with respect
Vladimir
Edited On 3:23:59 AM PDT - Wed, Sep 30th 2015 by Vladimir

Forum Vet
Threads 10
Posts 1619
Plesase set the env. variable USE_PYTHONCONFIG=Y

Once this variable is set, all the linking bits should be picked up.

At what stage does the NWChem python interface require libz? Most of my development occurs on a ubuntu 14.04 box and I have not seen this failure.
If you really need any extra library, you can add it to BLASOPT (as a temporary fix)
Edited On 8:32:18 AM PDT - Wed, Sep 30th 2015 by Edoapra

Gets Around
Threads 24
Posts 86
Quote:Edoapra Sep 30th 10:26 pm
Plesase set the env. variable USE_PYTHONCONFIG=Y

Once this variable is set, all the linking bits should be picked up.

At what stage does the NWChem python interface require libz? Most of my development occurs on a ubuntu 14.04 box and I have not seen this failure.
If you really need any extra library, you can add it to BLASOPT (as a temporary fix)


Thanks for advice Edo, tomorrow I will try to test it.

But I want to add that before compiling NWCHEM I have installed the following packages on Ubuntu 14.04 (from scratch):


sudo apt-get install build-essential
sudo apt-get install python-dev zlib1g-dev libssl-dev gfortran
sudo apt-get install libopenblas-dev
sudo apt-get install libopenmpi-dev openmpi-bin
sudo apt-get install csh
sudo ln -s /usr/lib/python2.7/config-x86_64-linux-gnu /usr/lib/python2.7/config

Vladimir
Edited On 10:45:41 AM PDT - Wed, Sep 30th 2015 by Vladimir

Forum Vet
Threads 10
Posts 1619
Quote:Vladimir Sep 30th 9:42 am


Thanks for advice Edo, tomorrow I will try to test it.

But I want to add that before compiling NWCHEM I have installed the following packages on Ubuntu 14.04 (from scratch):


sudo apt-get install build-essential
sudo apt-get install python-dev zlib1g-dev libssl-dev gfortran
sudo apt-get install libopenblas-dev
sudo apt-get install libopenmpi-dev openmpi-bin
sudo apt-get install csh
NOT NEEDED sudo ln -s /usr/lib/python2.7/config-x86_64-linux-gnu /usr/lib/python2.7/config

Vladimir


The symbolic link step should NOT be needed (sudo ln -s /usr/lib/python2.7/config-x86_64-linux-gnu /usr/lib/python2.7/config)

Once you set PYTHONHOME, PYTHONVERSION and USE_PYTHONCONFIG, all the required libraries should be taken care of

Gets Around
Threads 24
Posts 86
Quote:Edoapra Oct 1st 1:05 am


The symbolic link step should NOT be needed (sudo ln -s /usr/lib/python2.7/config-x86_64-linux-gnu /usr/lib/python2.7/config)

Once you set PYTHONHOME, PYTHONVERSION and USE_PYTHONCONFIG, all the required libraries should be taken care of



It's quite the thing

Many thanks for your help, Edoapra.

Clicked A Few Times
Threads 5
Posts 15
This is my best installation for Nwchem-Python in Ubuntu-14.04 and it run wonderful
Here is my best compilation in Ubuntu-14.04

This file is to compile nwchem-6.6 in Ubuntu 14.04
Required to be installed: OpenMPI, OpenBLAS, Python2.7, Gnuplot and Tkinter
1. Make a symbolic link of all .py files from "~/nwchem-6.6/contrib/python" to the address "/usr/lib/python2.7"
2. Make the following symbolic link for "_tkinter.so" and "_tkinter_d.so":
  A. "sudo ln -s /usr/lib/python2.7/lib-dynload/_tkinter.so /usr/lib/python2.7/config-x86_64-linux-gnu/_tkinter.so"
B. "sudo ln -s /usr/lib/python2.7/lib-dynload/_tkinter_d.so /usr/lib/python2.7/config-x86_64-linux-gnu/_tkinter_d.so"
3. Make and link "python-config" file:
      "sudo ln -s /usr/lib/python2.7/config-x86_64-linux-gnu /usr/lib/python2.7/python-config"
4. From terminal go to the path's address "~/nwchem-6.6/" and run "make.sh" file.
To run make.sh file execute the following command:
chmod +x make.sh
./make.sh

export USE_NOFSCHECK=TRUE
export TCGRSH=/usr/bin/ssh
export NWCHEM_TOP=`pwd`
export NWCHEM_TARGET=LINUX64
export NWCHEM_MODULES="all python"
export LARGE_FILES=TRUE
export ENABLE_COMPONENT=yes
export PYTHONHOME=/usr
export PYTHON_EXE=python
export PYTHONVERSION=2.7
export PYTHONPATH=/usr/lib/python2.7
export USE_PYTHONCONFIG=yes
export PYTHONCONFIGDIR=python-config
export PYTHONLIBTYPE=so
export USE_PYTHON64=yes
export USE_64TO32=yes
export CC=gcc
export FC=gfortran
export HAS_BLAS=yes
export BLAS_SIZE=4
export BLASOPT="-L/usr/lib -lopenblas"
export USE_MPI=yes
export USE_MPIF=yes
export USE_MPIF4=yes
export ARMCI_NETWORK=SOCKETS
export MPI_LOC=/usr/lib/openmpi/
export MPI_LIB=/usr/lib/openmpi/lib
export MPI_INCLUDE=/usr/lib/openmpi/include
export LIBMPI="-lpthread -L$MPI_LIB -lmpi_f90 -lmpi_f77 -lmpi"
export MRCC_METHODS=yes
export CCSD=yes
export CCSDT=yes
export CCSDTQ=yes
cd $NWCHEM_TOP/src
make clean
make nwchem_config 2>&1 | tee make.nwchem_config.log
make 64_to_32
make
cd ../contrib
./getmem.nwchem

Gets Around
Threads 24
Posts 86
What does it means?

export BLAS_SIZE=4
export USE_64TO32=y


I'm using openblas and doesn't require this.
  1. sudo apt-get install libopenblas-dev
export BLASOPT="-L/usr/lib/openblas-base -lopenblas"
export LIBRARY_PATH=$LIBRARY_PATH:/usr/lib/openblas-base
Edited On 12:58:30 AM PDT - Thu, May 12th 2016 by Vladimir

Forum Vet
Threads 10
Posts 1619
Quote:Vladimir May 11th 11:52 pm
What does it means?

export BLAS_SIZE=4
export USE_64TO32=y


I'm using openblas and doesn't require this.
  1. sudo apt-get install libopenblas-dev
export BLASOPT="-L/usr/lib/openblas-base -lopenblas"
export LIBRARY_PATH=$LIBRARY_PATH:/usr/lib/openblas-base

Yes, you need those definitions for openblas on a 64-bit architecture, unless openblas was compiled with 64-bit integers (INTERFACE64=1)

http://www.nwchem-sw.org/index.php/Compiling_NWChem#Optimized_math_libraries

Gets Around
Threads 24
Posts 86
Quote:Edoapra May 13th 1:04 am
Quote:Vladimir May 11th 11:52 pm
What does it means?

export BLAS_SIZE=4
export USE_64TO32=y


I'm using openblas and doesn't require this.
  1. sudo apt-get install libopenblas-dev
export BLASOPT="-L/usr/lib/openblas-base -lopenblas"
export LIBRARY_PATH=$LIBRARY_PATH:/usr/lib/openblas-base

Yes, you need those definitions for openblas on a 64-bit architecture, unless openblas was compiled with 64-bit integers (INTERFACE64=1)

http://www.nwchem-sw.org/index.php/Compiling_NWChem#Optimized_math_libraries


I find no difference (speed, precision) with (USE_64TO32=y; make 64_to_32) or without in my case.


Forum >> NWChem's corner >> Compiling NWChem



Who's here now Members 0 Guests 1 Bots/Crawler 0


AWC's: 2.5.10 MediaWiki - Stand Alone Forum Extension
Forum theme style by: AWC