Compliling nwchem with python

103 views
Skip to first unread message

Malsha Jayasinghe

unread,
Jul 31, 2023, 8:46:22 PM7/31/23
to NWChem Forum
Hello,

I'm trying to compile nwchem with python with this environment.

NWTOP=/home/maljayas/nwchem-7.2.0/
MODULES="all python"
export NWCHEM_TOP="${fulltop}"
export NWCHEM_MODULES="$MODULES"
export NWCHEM_BASIS_LIBRARY="$NWCHEM_TOP/src/basis/libraries/"
export NWCHEM_EXECUTABLE="$NWCHEM_TOP/bin/LINUX64/nwchem"
export NWCHEM_TARGET="LINUX64"
export NWCHEM_LONG_PATHS=Y
export USE_NOFSCHECK=Y
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export MPI_INCLUDE=""
export MPI_LIB=""
export USE_SCALAPACK=y
export USE_64to32=y
export USE_INTERNALBLAS=y
export PYTHONLIBTYPE=so
export PYTHONVERSION="2.7"
export USE_PYTHON64=yes
export PYTHONHOME="/usr/include/python2.7"
export CC=icc
export CXX=icpc
export FC=ifort

I keep getting this error " task_python.c(1): catastrophic error: cannot open source file "Python.h" 
But I can find python.h inside /usr/include/python2.7 which I have made PYTHONHOME.

Any suggestions on this ?

Thanks,
Malsha Jayasinghe.

Edoardo Aprà

unread,
Jul 31, 2023, 9:08:52 PM7/31/23
to NWChem Forum
Please unset PYTHONLIBTYPE, USE_PYTHON64 and PYTHONHOME.
You simply need to set PYTHONVERSION for NWChem 7.2.0

unset PYTHONLIBTYPE
unset PYTHONLIBTYPE
unset PYTHONHOME
export PYTHONVERSION=2.7

I would recommend the use of Python 3.

Malsha Jayasinghe

unread,
Aug 1, 2023, 3:59:13 PM8/1/23
to nwchem...@googlegroups.com
Thanks for the quick reply.

I tried unsetting PYTHONLIBTYPE, USE_PYTHON64 and PYTHONHOME.

Now the compilation works. But when I try to run an input file, I get this error.

rrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source
nwchem             0000000004B482C3  for__signal_handl     Unknown  Unknown
libpthread-2.17.s  00002AD912272630  Unknown               Unknown  Unknown
nwchem             0000000004A9C278  Unknown               Unknown  Unknown
nwchem             000000000493C26A  ycopy_                Unknown  Unknown
nwchem             000000000101CDE9  pstat_init_           Unknown  Unknown
nwchem             000000000051FB43  MAIN__                Unknown  Unknown
nwchem             000000000051F862  main                  Unknown  Unknown
libc-2.17.so       00002AD912F76545  __libc_start_main     Unknown  Unknown
nwchem             000000000051F769  Unknown               Unknown  Unknown

--
You received this message because you are subscribed to a topic in the Google Groups "NWChem Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nwchem-forum/-QGq6vdzrBE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nwchem-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nwchem-forum/eea46944-3a1b-4e51-8ac7-38d7328a4e6fn%40googlegroups.com.

Edoardo Aprà

unread,
Aug 1, 2023, 4:00:13 PM8/1/23
to NWChem Forum
Same issue already discussed in the previous forum entry https://groups.google.com/g/nwchem-forum/c/3MDiu3TLgaY/m/lsQmNOsCAAAJ

The following should fix your problem (bash syntax)

export BLAS_SIZE=8
cd $NWCHEM_TOP/src/64to32blas
make clean
make
cd ..
make link

Malsha Jayasinghe

unread,
Aug 1, 2023, 9:14:56 PM8/1/23
to NWChem Forum
Again another error when try to run an input. ImportError: No module named site

This time it keeps running (doesn't crash) but won't go beyond task python line of the input file. ImportError: No module named site is in the errfile.

Malsha Jayasinghe

unread,
Aug 1, 2023, 9:16:34 PM8/1/23
to nwchem...@googlegroups.com
Again another error when try to run an input ImportError: No module named site. 

This time it keeps running (doesn't crash ) but won't run beyond the task python line of the input file. ImportError: No module named site is in the errfile.

Malsha Jayasinghe

unread,
Aug 1, 2023, 11:48:40 PM8/1/23
to nwchem...@googlegroups.com
Nevermind. It works now.
Thanks so much for helping!

Reply all
Reply to author
Forward
0 new messages