wlav / cppyy

Other
404 stars 42 forks source link

CMake tools failing #202

Open tdubose opened 10 months ago

tdubose commented 10 months ago

I am attempting to compile the nearest neighbors example (https://github.com/jclay/cppyy-knearestneighbors-example), using cppyy 2.4.2. I am getting the following errors at the linker stage:

Undefined symbols for architecture x86_64:
  "CppyyLegacy::kAssertMsg", referenced from:
      CppyyLegacy::Detail::TCollectionProxyInfo::Iterators<std::__1::vector<Point, std::__1::allocator<Point>>, false>::next(void*, void const*) in knn_example.cpp.o
  "CppyyLegacy::TDictionary::CreateAttributeMap()", referenced from:
      CppyyLegacy::Point_TClassManip(CppyyLegacy::TClass*) in knn_example.cpp.o
      CppyyLegacy::NearestNeighbors_TClassManip(CppyyLegacy::TClass*) in knn_example.cpp.o
  "CppyyLegacy::TVersionCheck::TVersionCheck(int)", referenced from:
      ___cxx_global_var_init in knn_example.cpp.o
  "CppyyLegacy::TDictAttributeMap::AddProperty(char const*, char const*)", referenced from:
      CppyyLegacy::Point_TClassManip(CppyyLegacy::TClass*) in knn_example.cpp.o
      CppyyLegacy::NearestNeighbors_TClassManip(CppyyLegacy::TClass*) in knn_example.cpp.o
  "CppyyLegacy::TGenericClassInfo::SetNewArray(void* (*)(long, void*))", referenced from:
      CppyyLegacy::GenerateInitInstanceLocal(Point const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(NearestNeighbors const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(std::__1::vector<Point, std::__1::allocator<Point>> const*) in knn_example.cpp.o
  "CppyyLegacy::TGenericClassInfo::SetDestructor(void (*)(void*))", referenced from:
      CppyyLegacy::GenerateInitInstanceLocal(Point const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(NearestNeighbors const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(std::__1::vector<Point, std::__1::allocator<Point>> const*) in knn_example.cpp.o
  "CppyyLegacy::TGenericClassInfo::SetDeleteArray(void (*)(void*))", referenced from:
      CppyyLegacy::GenerateInitInstanceLocal(Point const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(NearestNeighbors const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(std::__1::vector<Point, std::__1::allocator<Point>> const*) in knn_example.cpp.o
  "CppyyLegacy::TGenericClassInfo::AdoptCollectionProxyInfo(CppyyLegacy::Detail::TCollectionProxyInfo*)", referenced from:
      CppyyLegacy::GenerateInitInstanceLocal(std::__1::vector<Point, std::__1::allocator<Point>> const*) in knn_example.cpp.o
  "CppyyLegacy::TGenericClassInfo::SetNew(void* (*)(void*))", referenced from:
      CppyyLegacy::GenerateInitInstanceLocal(Point const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(NearestNeighbors const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(std::__1::vector<Point, std::__1::allocator<Point>> const*) in knn_example.cpp.o
  "CppyyLegacy::TGenericClassInfo::GetClass()", referenced from:
      CppyyLegacy::Point_Dictionary() in knn_example.cpp.o
      CppyyLegacy::NearestNeighbors_Dictionary() in knn_example.cpp.o
      CppyyLegacy::stdcLcLvectorlEPointgR_Dictionary() in knn_example.cpp.o
  "CppyyLegacy::TGenericClassInfo::SetDelete(void (*)(void*))", referenced from:
      CppyyLegacy::GenerateInitInstanceLocal(Point const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(NearestNeighbors const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(std::__1::vector<Point, std::__1::allocator<Point>> const*) in knn_example.cpp.o
  "CppyyLegacy::TGenericClassInfo::TGenericClassInfo(char const*, char const*, int, std::type_info const&, CppyyLegacy::Internal::TInitBehavior const*, CppyyLegacy::TClass* (*)(), CppyyLegacy::TVirtualIsAProxy*, int, int)", referenced from:
      CppyyLegacy::GenerateInitInstanceLocal(Point const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(NearestNeighbors const*) in knn_example.cpp.o
  "CppyyLegacy::TGenericClassInfo::TGenericClassInfo(char const*, int, char const*, int, std::type_info const&, CppyyLegacy::Internal::TInitBehavior const*, CppyyLegacy::TClass* (*)(), CppyyLegacy::TVirtualIsAProxy*, int, int)", referenced from:
      CppyyLegacy::GenerateInitInstanceLocal(std::__1::vector<Point, std::__1::allocator<Point>> const*) in knn_example.cpp.o
  "CppyyLegacy::TGenericClassInfo::~TGenericClassInfo()", referenced from:
      CppyyLegacy::GenerateInitInstanceLocal(Point const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(NearestNeighbors const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(std::__1::vector<Point, std::__1::allocator<Point>> const*) in knn_example.cpp.o
  "CppyyLegacy::Fatal(char const*, char const*, ...)", referenced from:
      CppyyLegacy::Detail::TCollectionProxyInfo::Iterators<std::__1::vector<Point, std::__1::allocator<Point>>, false>::next(void*, void const*) in knn_example.cpp.o
  "CppyyLegacy::TROOT::RegisterModule(char const*, char const**, char const**, char const*, char const*, void (*)(), std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, int>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, int>>> const&, char const**, bool)", referenced from:
      (anonymous namespace)::TriggerDictionaryInitialization_knn_example_Impl() in knn_example.cpp.o
  "CppyyLegacy::Internal::DefineBehavior(void*, void*)", referenced from:
      CppyyLegacy::GenerateInitInstanceLocal(Point const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(NearestNeighbors const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(std::__1::vector<Point, std::__1::allocator<Point>> const*) in knn_example.cpp.o
  "CppyyLegacy::TIsAProxy::TIsAProxy(std::type_info const&)", referenced from:
      CppyyLegacy::GenerateInitInstanceLocal(Point const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(NearestNeighbors const*) in knn_example.cpp.o
      CppyyLegacy::GenerateInitInstanceLocal(std::__1::vector<Point, std::__1::allocator<Point>> const*) in knn_example.cpp.o

It seems like maybe a library is not being properly included?

I am also getting the line CRITICAL: While parsing: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/wchar.h:123[15] 'wchar.h' file not found but it does not seem to halt the make process.

wlav commented 10 months ago

Not sure about the first (it's not my code, so haven't tried it in a long while), but for the last, MacOS has been moving the standard headers around, so now older versions of Cling can no longer find them automatically. You need to use cppyy 3.1.0 to find the automatically again or supply the paths manually.