mphowardlab / azplugins

A HOOMD-blue component for soft matter simulations.
BSD 3-Clause "New" or "Revised" License
20 stars 12 forks source link

Issues with installation of azplugins in HOOMD-blue #70

Closed kesavanekambaram closed 1 year ago

kesavanekambaram commented 1 year ago

Hi all, I am trying to install the azplugins from the given readme file but couldn't able to install it successfully. File "/home/srinivasan/azplugins-main/CMake/find_hoomd.py", line 12 print(os.path.dirname(hoomd.file), end='') ^ SyntaxError: invalid syntax /home/srinivasan/azplugins-main/CMake/parse_version.py:15: Warning: 'with' will become a reserved keyword in Python 2.6 File "/home/srinivasan/azplugins-main/CMake/parse_version.py", line 15 with open(sys.argv[1]) as f: ^ SyntaxError: invalid syntax CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find HOOMD: Found unsuitable version "", but required is at least "2.6.0" (found HOOMD_ROOT-NOTFOUND) Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:391 (_FPHSA_FAILURE_MESSAGE) CMake/FindHOOMD.cmake:36 (find_package_handle_standard_args) CMakeLists.txt:22 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/srinivasan/azplugins-main/build/CMakeFiles/CMakeOutput.log".

Could you please help me out?

astatt commented 1 year ago

There is a few things that come to mind:

  1. It appears that you are using python 2.6 - I highly recommend switching to a newer Python 3.X version.
  2. How did you install hoomd-blue? Please give us all the details.

Right now, azplugins cannot locate a hoomd-blue installation, which can have multiple reasons:

  1. it is not installed - then you will need to follow the official documentation to install it. See here: https://hoomd-blue.readthedocs.io/en/v2.9.4/installation.html#
  2. it is installed, but not the correct version. Currently, azplugins work with hoomd-2.6 to 2.9, NOT hoomd-3.
  3. the correct version of hoomd-blue is installed, but in a location where azplugins isn't able to find it - if this is the case use the "-DHOOMD_ROOT" flag to specify the location.
mphoward commented 1 year ago
  1. It appears that you are using python 2.6 - I highly recommend switching to a newer Python 3.X version.

Yes, the error is because CMake is using python 2.6 to try to run some code that uses python 3 syntax. HOOMD (and azplugins) has required python3 for quite some time. If you successfully installed HOOMD, the most likely reason for the error is that CMake is auto-detecting a system python installation rather than the one you used to install HOOMD. You can specify a different python installation with -DPYTHON_EXECUTABLE when you invoke cmake.

The easiest way to manage this automatically is with a Python virtual environment.

kesavanekambaram commented 1 year ago

Thank you so much for you help. The problem was with the version of HOOMD I was using ver3, which messed up the installation. I again installed Ver2.9.0 $ cd hoomd-blue $ mkdir build $ cd build $ cmake ../ -DCMAKE_INSTALL_PREFIX=python3 -c "import site; print(site.getsitepackages()[0])" $ make -j4
$ make install

After sucessful installation I installed AZplugin too

Thank you