Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsoncpp error #248

Open
Evert-Homan opened this issue Mar 18, 2024 · 7 comments
Open

jsoncpp error #248

Evert-Homan opened this issue Mar 18, 2024 · 7 comments

Comments

@Evert-Homan
Copy link

Issue summary

Hi, following the installation instructions for Ubuntu 22.04 I successfully compiled OpenBabel3 and then tried to do the same for Gnina, but at the cmake .. step I get:

CMake Error at gninasrc/CMakeLists.txt:8 (find_package):
By not providing "Findjsoncpp.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "jsoncpp", but
CMake did not find one.

Could not find a package configuration file provided by "jsoncpp" with any
of the following names:

jsoncppConfig.cmake
jsoncpp-config.cmake

Add the installation prefix of "jsoncpp" to CMAKE_PREFIX_PATH or set
"jsoncpp_DIR" to a directory containing one of the above files. If
"jsoncpp" provides a separate development package or SDK, be sure it has
been installed.

Your system configuration

Operating system: Ubuntu 22.04
Compiler: gcc 11.4.0
CUDA version (if applicable): 12.2
CUDNN version (if applicable): NA
Python version: 3.10.12

Please advise.

Thanks/Evert

@dkoes
Copy link
Contributor

dkoes commented Mar 18, 2024

jsoncpp is a new dependency recently introduced. If you check out the latest release you won't need it.
I will update the instructions.

@P4j45
Copy link

P4j45 commented Mar 18, 2024

Thanks. How do I check out the latest release?

@dkoes
Copy link
Contributor

dkoes commented Mar 18, 2024

git checkout v1.1

@Evert-Homan
Copy link
Author

Hi,

I manged to compile gnina 1.1 under WSL2 (Debian) without any errors (haven't tested it yet) but on Ubuntu 22.04 I now get:

`evehom  ~  whereis obabel
obabel: /usr/bin/obabel /usr/local/bin/obabel /usr/share/man/man1/obabel.1.gz
 evehom  ~  obabel
No input file or format spec or possibly a misplaced option.
Most options must come after the input files. (-i -o -O -m can be anywhwere.)

Open Babel 3.1.1 -- Mar 18 2024 -- 16:50:56
Usage:
obabel [-i<input-type>] <infilename> [-o<output-type>] -O<outfilename> [Options]
Try  -H option for more information.
 evehom  ~  1  nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Jun_13_19:16:58_PDT_2023
Cuda compilation tools, release 12.2, V12.2.91
Build cuda_12.2.r12.2/compiler.32965470_0
 evehom  ~  git clone https://github.com/gnina/gnina.git
Cloning into 'gnina'...
remote: Enumerating objects: 43817, done.
remote: Counting objects: 100% (1154/1154), done.
remote: Compressing objects: 100% (552/552), done.
remote: Total 43817 (delta 571), reused 1082 (delta 535), pack-reused 42663
Receiving objects: 100% (43817/43817), 174.00 MiB | 23.23 MiB/s, done.
Resolving deltas: 100% (28857/28857), done.
Updating files: 100% (1489/1489), done.
 evehom  ~  cd gnina
 evehom   master  ~  gnina  git checkout v1.1
Note: switching to 'v1.1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at e4cb380c Update README to reflect covalent docking
 evehom   e4cb380  ~  gnina  mkdir build
 evehom   e4cb380  ~  gnina  cd build
 evehom   e4cb380  ~  gnina  build  cmake ..
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- The CUDA compiler identification is NVIDIA 12.2.91
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
CMake Deprecation Warning at CMakeLists.txt:10 (cmake_policy):
  The OLD behavior for policy CMP0104 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Warning (dev) at CMakeLists.txt:33 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake
  --help-policy CMP0146" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda (found suitable version "12.2", minimum required is "11.0") 
openbabel BINARY_DIR = /home/evehom/gnina/build
openbabel BINARY_DIR = /home/evehom/gnina/build
openbabel CXX_MODULE_SETS = 
openbabel HEADER_SETS = 
openbabel IMPORTED = TRUE
openbabel IMPORTED_CONFIGURATIONS = RELEASE
openbabel IMPORTED_GLOBAL = FALSE
openbabel INTERFACE_CXX_MODULE_SETS = 
openbabel INTERFACE_HEADER_SETS = 
openbabel INTERFACE_INCLUDE_DIRECTORIES = /usr/local/include/openbabel3
openbabel NAME = openbabel
openbabel POSITION_INDEPENDENT_CODE = True
openbabel SOURCE_DIR = /home/evehom/gnina
openbabel SOURCE_DIR = /home/evehom/gnina
openbabel SYSTEM = ON
openbabel SYSTEM = ON
openbabel TYPE = SHARED_LIBRARY
openbabel TYPE = SHARED_LIBRARY
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")  
-- Could NOT find libmolgrid (missing:  LIBMOLGRID_INCLUDE_DIR LIBMOLGRID_LIBRARY) 
libmolgrid will be fetched from git
-- Found Git: /usr/bin/git (found version "2.34.1") 
-- Found Python: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter Development Development.Module Development.Embed 
CMake Warning (dev) at caffe/cmake/Cuda.cmake:250 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake
  --help-policy CMP0146" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

Call Stack (most recent call first):
  CMakeLists.txt:101 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- CUDA detected: 12.2
-- Added CUDA NVCC flags for: sm_86
CMake Deprecation Warning at caffe/CMakeLists.txt:13 (cmake_policy):
  The OLD behavior for policy CMP0104 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.54") found components: system thread filesystem iostreams timer 
-- Found libmolgrid: /home/evehom/gnina/build/external/include  
-- Found GFlags: /usr/include  
-- Found gflags  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
-- Found Glog: /usr/include  
-- Found glog    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so (found version "3.12.4") 
-- Found PROTOBUF Compiler: /usr/bin/protoc
-- Found HDF5: /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;/usr/lib/x86_64-linux-gnu/libcurl.so;/usr/lib/x86_64-linux-gnu/libpthread.a;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.a;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_cpp.so;/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;/usr/lib/x86_64-linux-gnu/libcurl.so;/usr/lib/x86_64-linux-gnu/libpthread.a;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.a;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.10.7") found components: HL 
CMake Warning (dev) at caffe/cmake/Cuda.cmake:250 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake
  --help-policy CMP0146" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

Call Stack (most recent call first):
  caffe/cmake/Dependencies.cmake:87 (include)
  caffe/CMakeLists.txt:50 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- CUDA detected: 12.2
-- Added CUDA NVCC flags for: sm_86
-- Found Atlas: /usr/include/x86_64-linux-gnu  
-- Found Atlas (include: /usr/include/x86_64-linux-gnu library: /usr/lib/x86_64-linux-gnu/libatlas.so lapack: /usr/lib/x86_64-linux-gnu/liblapack.so
CMake Warning (dev) at caffe/cmake/Dependencies.cmake:159 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  caffe/CMakeLists.txt:50 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.10.12", minimum required is "3.0") 
CMake Warning (dev) at caffe/cmake/Dependencies.cmake:160 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  caffe/CMakeLists.txt:50 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.10.so (found suitable version "3.10.12", minimum required is "3.0") 
-- Found NumPy: /usr/lib/python3/dist-packages/numpy/core/include (found suitable version "1.21.5", minimum required is "1.7.1") 
-- NumPy ver. 1.21.5 found (include: /usr/lib/python3/dist-packages/numpy/core/include)
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.58") found components: python310 
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- 
-- ******************* Caffe Configuration Summary *******************
-- General:
--   Version           :   1.0.0
--   Git               :   v1.1
--   System            :   Linux
--   C++ compiler      :   /usr/bin/c++
--   Release CXX flags :   -O3 -DNDEBUG -Wno-deprecated-declarations -Wno-unknown-pragmas -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
--   Debug CXX flags   :   -g -Wno-deprecated-declarations -Wno-unknown-pragmas -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
--   Build type        :   Release
-- 
--   BUILD_SHARED_LIBS :   ON
--   BUILD_python      :   ON
--   BUILD_matlab      :   OFF
--   BUILD_docs        :   ON
--   CPU_ONLY          :   OFF
--   USE_OPENCV        :   0
--   USE_LEVELDB       :   0
--   USE_LMDB          :   0
--   USE_NCCL          :   OFF
--   ALLOW_LMDB_NOLOCK :   OFF
-- 
-- Dependencies:
--   BLAS              :   Yes (Atlas)
--   Boost             :   Yes (ver. 1.74)
--   glog              :   Yes
--   gflags            :   Yes
--   OpenBabel         :   No
--   protobuf          :   Yes (ver. ..)
--   CUDA              :   Yes (ver. 12.2)
-- 
-- NVIDIA CUDA:
--   Target GPU(s)     :   Auto
--   GPU arch(s)       :   sm_86
--   cuDNN             :   Not found
-- 
-- Python:
--   Interpreter       :   /usr/bin/python3 (ver. 3.10.12)
--   Libraries         :   /usr/lib/x86_64-linux-gnu/libpython3.10.so (ver 3.10.12)
--   NumPy             :   /usr/lib/python3/dist-packages/numpy/core/include (ver 1.21.5)
-- 
-- Documentaion:
--   Doxygen           :   No
--   config_file       :   
-- 
-- Install:
--   Install path      :   /usr/local
-- 
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0") found components: program_options system iostreams timer thread serialization filesystem date_time regex unit_test_framework 
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Found RDKit include files at /usr/include/rdkit
-- Found RDKit libraries at /lib
-- Found RDKit library files at /lib/libRDKitFileParsers.so;/lib/libRDKitSmilesParse.so;/lib/libRDKitSubstructMatch.so;/lib/libRDKitGraphMol.so;/lib/libRDKitRDGeometryLib.so;/lib/libRDKitRDGeneral.so;/lib/libRDKitSubgraphs.so;/lib/libRDKitDataStructs.so;/lib/libRDKitDepictor.so
-- Found RDKit: /usr/include/rdkit  
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0") found components: unit_test_framework system 
CMake Warning (dev) at test/CMakeLists.txt:10 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonInterp: /usr/bin/python3 (found version "3.10.12") 
CMake Error at test/CMakeLists.txt:20 (message):
  Pytest package not available: Traceback (most recent call last):

    File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
      exec(code, run_globals)
    File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 5, in <module>
      raise SystemExit(pytest.console_main())
    File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 185, in console_main
      code = main()
    File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 143, in main
      config = _prepareconfig(args, plugins)
    File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 318, in _prepareconfig
      config = pluginmanager.hook.pytest_cmdline_parse(
    File "/usr/lib/python3/dist-packages/pluggy/hooks.py", line 286, in __call__
      return self._hookexec(self, self.get_hookimpls(), kwargs)
    File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 92, in _hookexec
      return self._inner_hookexec(hook, methods, kwargs)
    File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 83, in <lambda>
      self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
    File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 203, in _multicall
      gen.send(outcome)
    File "/usr/lib/python3/dist-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse
      config: Config = outcome.get_result()
    File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 80, in get_result
      raise ex[1].with_traceback(ex[2])
    File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 187, in _multicall
      res = hook_impl.function(*args)
    File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 1003, in pytest_cmdline_parse
      self.parse(args)
    File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 1283, in parse
      self._preparse(args, addopts=addopts)
    File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 1172, in _preparse
      self.pluginmanager.load_setuptools_entrypoints("pytest11")
    File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 297, in load_setuptools_entrypoints
      plugin = ep.load()
    File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
      module = import_module(match.group('module'))
    File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
    File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
    File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
    File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
    File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
    File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
    File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
    File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
    File "/usr/lib/python3/dist-packages/_pytest/assertion/rewrite.py", line 170, in exec_module
      exec(co, module.__dict__)
    File "/home/evehom/.local/lib/python3.10/site-packages/dash/__init__.py", line 5, in <module>
      from .dependencies import (  # noqa: F401,E402
    File "/usr/lib/python3/dist-packages/_pytest/assertion/rewrite.py", line 170, in exec_module
      exec(co, module.__dict__)
    File "/home/evehom/.local/lib/python3.10/site-packages/dash/dependencies.py", line 4, in <module>
      from ._validate import validate_callback
    File "/usr/lib/python3/dist-packages/_pytest/assertion/rewrite.py", line 170, in exec_module
      exec(co, module.__dict__)
    File "/home/evehom/.local/lib/python3.10/site-packages/dash/_validate.py", line 5, in <module>
      import flask

  ModuleNotFoundError: No module named 'flask'

-- Configuring incomplete, errors occurred!`

Any clues? Thanks/Evert

@dkoes
Copy link
Contributor

dkoes commented Mar 21, 2024

It says it couldn't find pytest, was python3-pytest not installed?

@Evert-Homan
Copy link
Author

sudo apt-get install build-essential git cmake wget libboost-all-dev libeigen3-dev libgoogle-glog-dev libprotobuf-dev protobuf-compiler libhdf5-dev libatlas-base-dev python3-dev librdkit-dev python3-numpy python3-pip python3-pytest [sudo] password for evehom: Reading package lists... Done Building dependency tree... Done Reading state information... Done build-essential is already the newest version (12.9ubuntu3). wget is already the newest version (1.21.2-2ubuntu1). libatlas-base-dev is already the newest version (3.10.3-12ubuntu1). libboost-all-dev is already the newest version (1.74.0.3ubuntu7). libeigen3-dev is already the newest version (3.4.0-2ubuntu2). libgoogle-glog-dev is already the newest version (0.5.0+really0.4.0-2). libhdf5-dev is already the newest version (1.10.7+repack-4ubuntu2). librdkit-dev is already the newest version (202109.2-1build1). python3-pytest is already the newest version (6.2.5-1ubuntu2). cmake is already the newest version (3.22.1-1ubuntu1.22.04.2). git is already the newest version (1:2.34.1-1ubuntu1.10). libprotobuf-dev is already the newest version (3.12.4-1ubuntu7.22.04.1). python3-dev is already the newest version (3.10.6-1~22.04). python3-numpy is already the newest version (1:1.21.5-1ubuntu22.04.1). protobuf-compiler is already the newest version (3.12.4-1ubuntu7.22.04.1). python3-pip is already the newest version (22.0.2+dfsg-1ubuntu0.4). The following packages were automatically installed and are no longer required: linux-headers-5.15.0-92 linux-headers-5.15.0-92-generic linux-image-5.15.0-92-generic linux-modules-5.15.0-92-generic linux-modules-extra-5.15.0-92-generic linux-modules-nvidia-535-5.15.0-92-generic linux-objects-nvidia-535-5.15.0-92-generic linux-signatures-nvidia-5.15.0-92-generic nvidia-firmware-535-535.154.05 Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.  evehom   e4cb380  ~  gnina  build  

@dkoes
Copy link
Contributor

dkoes commented Mar 22, 2024

This dockerfile works to install on base ubuntu, so it must be an issue with your python environment:
https://github.com/gnina/gnina/blob/master/docker/ubuntu-22.04/Dockerfile

You can check which python cmake configured by looking at the PYTHON_EXECUTABLE variable in CMakeCache.txt and then make sure when you run that python you can import pytest and flask (most likely not and you need to either change PYTHON_EXECUTABLE to the system version or install the python dependencies in your preferred python environment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants