cisco / mlspp

Implementation of Messaging Layer Security
BSD 2-Clause "Simplified" License
110 stars 42 forks source link

Compile error on linux - nlohmann_json #379

Closed MichaelJCole closed 11 months ago

MichaelJCole commented 12 months ago

Hi, I'm trying to compile on linux and getting this error:

michael@mc-linux ~                                                                                                                                                [12:58:45]
> $ git clone git@github.com:cisco/mlspp.git                                                                                                                      ⬡ 18.18.0 
Cloning into 'mlspp'... (redacted)

michael@mc-linux ~                                                                                                                                                [12:59:02]
> $ cd mlspp                                                                                                                                                      ⬡ 18.18.0 

michael@mc-linux ~/mlspp                                                                                                                                          [12:59:21]
> $ make                                                                                                                                                 ⬡ 18.18.0 [±main ✓]
cmake -Bbuild .
-- The CXX compiler identification is GNU 11.4.0
-- 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
-- CXX Namespace: mls
-- CMake Export Namespace: MLSPP
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "3.0.2")  
-- OpenSSL Found: 3.0.2
-- OpenSSL Include: /usr/include
-- OpenSSL Libraries: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so
CMake Error at lib/hpke/CMakeLists.txt:6 (find_package):
  By not providing "Findnlohmann_json.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "nlohmann_json", but CMake did not find one.

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

    nlohmann_jsonConfig.cmake
    nlohmann_json-config.cmake

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

-- Configuring incomplete, errors occurred!
See also "/home/michael/mlspp/build/CMakeFiles/CMakeOutput.log".
make: *** [Makefile:19: build] Error 1

I've attached CMakeOutput.log in a tar of the build directory.

This might be related to https://github.com/cisco/mlspp/issues/378

build.tar.gz

Is there any documentation on what parts of the spec are implemented and how? Thank you

bifurcation commented 11 months ago

Hi @MichaelJCole - This is a pretty standard missing dependency issue. You'll need nlohmann_json somewhere that CMake can find it. For example, you could use vcpkg, like the CI runners do, by providing CMake a vcpkg toolchain file (or running make ci). We should have better documentation on that, for which I see @glhewett filed #394.

With regard to which parts of the spec are implemented -- I believe MLSpp should cover the whole spec, though certain parts (e.g., PSKs and ReInit) have not been exercised in production AFAIK. Generally speaking, if there's a struct in the spec, it should have the same name in MLSpp, so you should just be able to seach for it to see where it is defined / used.