@ericirrgang
Hello everyone,
I installed Gromacs with GMXAPI=ON
(please see the command below) but when I try to import gmx in a python script (import gmxapi as gmx)
it shows Module Error: No module name gmxapi
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=OFF -DREGRESSIONTEST_PATH=/home/biomedical/gromacs/gromacs-2022.2/regressiontests-2022 -DGMX_MPI=OFF -DGMX_GPU=ON -DCMAKE_BUILD_TYPE=Debug -DGMX_GPU=CUDA -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda -DGMXAPI=ON
Gromacs Installation details:
GROMACS version: 2022.2
Precision: mixed
Memory model: 64 bit
MPI library: thread_mpi
OpenMP support: enabled (GMX_OPENMP_MAX_THREADS = 128)
GPU support: CUDA
SIMD instructions: AVX_512
CPU FFT library: fftw-3.3.8-sse2-avx-avx2-avx2_128-avx512
GPU FFT library: cuFFT
RDTSCP usage: enabled
TNG support: enabled
Hwloc support: disabled
Tracing support: disabled
C compiler: /bin/cc GNU 8.3.1
C compiler flags: -mavx512f -mfma -mavx512vl -mavx512dq -mavx512bw -Wno-missing-field-initializers -fno-inline -g
C++ compiler: /bin/c++ GNU 8.3.1
C++ compiler flags: -mavx512f -mfma -mavx512vl -mavx512dq -mavx512bw -Wno-missing-field-initializers -fno-inline -fopenmp -g
CUDA compiler: /usr/local/cuda/bin/nvcc nvcc: NVIDIA (R) Cuda compiler driver;Copyright (c) 2005-2022 NVIDIA Corporation;Built on Tue_May__3_18:49:52_PDT_2022;Cuda compilation tools, release 11.7, V11.7.64;Build cuda_11.7.r11.7/compiler.31294372_0
CUDA compiler flags:-std=c++17;;-D_FORCE_INLINES;-mavx512f -mfma -mavx512vl -mavx512dq -mavx512bw -Wno-missing-field-initializers -fno-inline -fopenmp -g
CUDA driver: 11.70
CUDA runtime: 11.70
I also tried to install gmxapi by following Full installation instructions — GROMACS 2022.2 documentation
python3 -m ensurepip --default-pip
Requirement already satisfied: setuptools in ./myvenv/lib/python3.6/site-packages
Requirement already satisfied: pip in ./myvenv/lib/python3.6/site-packages
pip install --upgrade pip setuptools wheel
Requirement already satisfied: pip in /usr/local/lib/python3.6/site-packages (21.3.1)
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/site-packages (59.6.0)
Requirement already satisfied: wheel in /usr/local/lib/python3.6/site-packages (0.37.1)
sudo pip3 install --no-cache-dir gmxapi
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.6 /usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpb41pares
cwd: /tmp/pip-install-nac_bfaf/gmxapi_6874d278d79843fd843f1b66aa4f7879
Complete output (50 lines):
The `gmxapi` package requires an existing GROMACS installation, version 2020 or higher.
To specify the GROMACS installation to use, provide a GMXTOOLCHAINDIR
environment variable when running setup.py or `pip`.
Example:
GMXTOOLCHAINDIR=/path/to/gromacs/share/cmake/gromacs pip install gmxapi
If you have multiple builds of GROMACS, distinguished by a suffix `$SUFFIX`, the
tool chain directory will use that suffix.
Example:
GMXTOOLCHAINDIR=/path/to/gromacs/share/cmake/gromacs$SUFFIX pip install gmxapi
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-f9j_55w2/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 163, in get_requires_for_build_wheel
config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-f9j_55w2/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 143, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-f9j_55w2/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 268, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-f9j_55w2/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 127, in <module>
raise GmxapiInstallError('Could not configure for GROMACS installation. Provide GMXTOOLCHAINDIR.')
__main__.GmxapiInstallError: Could not configure for GROMACS installation. Provide GMXTOOLCHAINDIR.
I also tried installing gmxapi by giving the path of gromacs installation
sudo GMXTOOLCHAINDIR=/usr/local/gromacs/share/cmake/gromacs/ pip3 install --no-cache-dir gmxapi
but shows the following error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.6 /usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmphg05fl_6
cwd: /tmp/pip-install-kiayp7g7/gmxapi_dd620b39d47646f4aa139f12a15b94a9
Complete output (78 lines):
Not searching for unused variables given on the command line.
CMake Error at /tmp/pip-build-env-rykyc8mt/overlay/lib64/python3.6/site-packages/cmake/data/share/cmake-3.22/Modules/CMakeDetermineSystem.cmake:130 (message):
Could not find toolchain file:
/usr/local/gromacs/share/cmake/gromacs/gromacs-toolchain.cmake
Call Stack (most recent call first):
CMakeLists.txt:2 (PROJECT)
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!
Not searching for unused variables given on the command line.
CMake Error at /tmp/pip-build-env-rykyc8mt/overlay/lib64/python3.6/site-packages/cmake/data/share/cmake-3.22/Modules/CMakeDetermineSystem.cmake:130 (message):
Could not find toolchain file:
/usr/local/gromacs/share/cmake/gromacs/gromacs-toolchain.cmake
Call Stack (most recent call first):
CMakeLists.txt:2 (PROJECT)
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!
--------------------------------------------------------------------------------
-- Trying "Ninja" generator
-- Trying "Ninja" generator - failure
--------------------------------------------------------------------------------
-- Trying "Unix Makefiles" generator
--------------------------------
-- Trying "Unix Makefiles" generator - failure
--------------------------------------------------------------------------------
********************************************************************************
scikit-build could not get a working generator for your system. Aborting build.
Building Linux wheels for Python 3.6 requires a compiler (e.g gcc).
But scikit-build does *NOT* know how to install it on rhel
To build compliant wheels, consider using the manylinux system described in PEP-513.
Get it with "dockcross/manylinux-x64" docker image:
https://github.com/dockcross/dockcross#readme
For more details, please refer to scikit-build documentation:
http://scikit-build.readthedocs.io/en/latest/generators.html#linux
********************************************************************************
----------------------------------------
ERROR: Failed building wheel for gmxapi
Failed to build gmxapi
ERROR: Could not build wheels for gmxapi, which is required to install pyproject.toml-based projects
Please help me in troubleshooting and installing python package for Gromacs.