how do I set the path to python library for nwchem

From NWChem

Viewed 2203 times, With a total of 7 Posts
Jump to: navigation, search

Clicked A Few Times
Threads 1
Posts 5
I am trying to compile NWCHEM with python but I get this error
gfortran: error: /usr/lib/python2.7/config/libpython2.7.a: No such file or directory

below is my environment

export LARGE_FILES=TRUE
export USE_NOFSCHECK=TRUE
export LIB_DEFINES=-DDFLT_TOT_MEM=16777216
export NWCHEM_TOP=/edfs/users/jacob/softwares/nwchem-6.0-6.3
export MRCC_METHODS=y
export USE_MPI=y
export MPI_LIB=/edfs/users/jacob/softwares/mpich-3.0.4-install/lib
export MPI_INCLUDE=/edfs/users/jacob/softwares/mpich-3.0.4-install/include
export LIBMPI="-lmpichf90 -lmpich -lopa -lmpl -lrt -lpthread"
export NWCHEM_TARGET=LINUX64
export NWCHEM_MODULES="python pnnl"
export PYTHONVERSION=2.7
export PYTHONHOME=/usr
export PYTHONLIBTYPE=a

Thank you

Forum Vet
Threads 6
Posts 988
Jacob
You probably have a dynamical version of the python library, therefore you need the following setting

export PYTHONLIBTYPE=so

Another issue might be the location of the library itself. It is in in /usr/lib64, instead of /usr, you would need

export USE_PYTHON64=y

If you still cannot link, please send the output of the command

ls /usr/lib*/python*/config*/libpython*.*

Clicked A Few Times
Threads 1
Posts 5
Hi Edo,
I did set the evironment you specified, but it did not solve problem. I have both the static and dynamic python libs but they are not where nwchem is searching as you can see

/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.a
/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7-pic.a
/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so
/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu/libpython3.4m.so
/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu/libpython3.4.so

Thanks
Jacob

Forum Vet
Threads 6
Posts 988
Jacob
You need to apply the following patch
http://www.nwchem-sw.org/images/Pythonconfigdir.patch.gz
and set the env. variable

PYTHONCONFIGDIR=config-x86_64-linux-gnu

Recipe in detail
1) cd $NWCHEM_TOP/src
2) wget http://www.nwchem-sw.org/images/Pythonconfigdir.patch.gz
3) gzip -d Pythonconfigdir.patch.gz
4) patch -p0 < Pythonconfigdir.patch
5) export PYTHONCONFIGDIR=config-x86_64-linux-gnu
6) make link


PS Are you using Ubuntu 14.04?

Clicked A Few Times
Threads 1
Posts 5
yes I am using Ubuntu 14.04

Clicked A Few Times
Threads 1
Posts 5
well, I still can not link the libraries despit adding th batch,
Now it is looking a different path
gfortran: error: /usr/lib/lib64/python2.7/config-x86_64-linux-gnu/libpython2.7.a: No such file or directory

Forum Vet
Threads 6
Posts 988
unset USE_PYTHON64

Clicked A Few Times
Threads 1
Posts 5
This error appears after unset USE_PYTHON64 with export PYTHONLIBTYPE=a
/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.a(posixmodule.o): In function `posix_tmpnam':
(.text.unlikely+0x950): warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'

when you set "export PYTHONLIBTYPE=so" everything compiles just fine.

Thank you very much Edo


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