qmcpack icon indicating copy to clipboard operation
qmcpack copied to clipboard

How to install QMCTools python files

Open ye-luo opened this issue 4 years ago • 5 comments

Describe the bug QMCTools python files need proper installation. How to organize them?

ye-luo avatar Dec 22 '21 18:12 ye-luo

Our current instructions are to export PYTHONPATH=/PATH_TO_QMCPACK/qmcpack/src/QMCTools:\$PYTHONPATH. However this does not work for an installation which needs to work with the source directory completely deleted. $INSTALL_DIR/QMCTools? $INSTALL_DIR/lib? The former seems clearer.

prckent avatar Dec 26 '21 11:12 prckent

nexus carries a similar problem.

ye-luo avatar Jan 12 '22 02:01 ye-luo

There are only 3 python files that sit inside QMCTools. In order to minimize the number of installs (PYTHONPATH updates), why not just place these 3 files inside nexus/lib or a subdirectory therein?

Perhaps this next one is a bit wilder, but maybe Nexus should finally branch out into its own repo? Nexus already exists independently of the all but one of the codes it drives, why not QMCPACK as well? This would lead to easy install instructions, e.g.,

# download Nexus
wget https://github.com/QMCPACK/nexus/archive/refs/tags/nexus-develop.tar.gz
# untar
tar -zxvf nexus-develop.tar.gz
# Define PYTHONPATH
export PYTHONPATH = \${PWD}/nexus-develop:\$PYTHONPATH
# remove tar file
rm nexus-develop.tar.gz

These few bash commands could be provided in QMCPACK as an install script.

mcbennet avatar Feb 02 '22 13:02 mcbennet

The reason we are not putting QMCTools inside Nexus is for the answer you implicitly gave - we are trying to keep Nexus and QMCPACK independent so that if it it decided to put Nexus in its own repo in future we could do so.

I think that getting a better grip of our python dependencies and giving appropriate installation advice for them will yield more immediate benefits than e.g. two repos.

prckent avatar Feb 02 '22 14:02 prckent

Then maybe a bash script could be written that asks the user where QMCTools rests, and also suggests a best guess.

#!/bin/bash
deftoolsloc=${PWD}/src/QMCTools
echo Installing QMCTools ...
# Ask the user for the path
echo Where is QMCTools located on this machine? [$deftoolsloc]
read vartoolsloc
if [ -z "$vartoolsloc" ]; then
    vartoolsloc=$deftoolsloc
fi

# Then something like
echo export PYTHONPATH = $vartoolsloc:$PYTHONPATH >> ${HOME}/.bash_profile

The above is not meant to be final form, but gets the idea across

mcbennet avatar Feb 02 '22 15:02 mcbennet