xtensor-stack/xtl

xtl fails to build with latest nlohmann_json

sdwfrost opened this issue · 2 comments

When compiling xtl against the latest master of nlohmann_json on Ubuntu 18.04, I get the following error:

Cloning into 'xtl'...
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- xtl v0.4.16
CMake Error at /usr/local/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake:30 (add_library):
  add_library cannot create ALIAS target "nlohmann_json" because target
  "nlohmann_json::nlohmann_json" is IMPORTED.
Call Stack (most recent call first):
  CMakeLists.txt:33 (find_package)

It appears that you are building against nlohmann_json master and not the latest release.

I recommend using nlohmann_json 3.2.0. They have made a series of backward incompatible changes in changing target names and adding aliases.

Closing as outdated.