cmake不显示编译错误的轨迹

发布于 2025-02-03 18:49:39 字数 1152 浏览 1 评论 0原文

我目前正在开发一个依赖其他库(Eigen,Catch2和Kokkos)的相当大的图书馆,并使用CMake来构建和链接所有内容。因为发生了很多事情,所以很难在此处使用MWE或提供很多细节,但是当前在Catch2和Cmake的预编译版本中的编译中存在错误,并且CMAKE不会向我展示它来自我的库中的位置。一旦CMake开始编译我的代码,我最终最终会

[ 59%] Building CXX object CMakeFiles/RunTests.dir/tests/Test_File.cpp.o
/home/jovyan/installs/CATCH2/include/catch2/benchmark/catch_constructor.hpp(62): error: invalid type conversion

1 error detected in the compilation of "/home/jovyan/.../tests/Test_File.cpp".
make[2]: *** [CMakeFiles/RunTests.dir/build.make:121: CMakeFiles/RunTests.dir/tests/Test_File.cpp.o] Error 2
make[1]: *** [CMakeFiles/Makefile2:140: CMakeFiles/RunTests.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

收集所讨论的文件(此处称为test_file.cpp)不是唯一的 - 如果我删除了此测试,则任何其他包括catch2/catch_all.hpp 也将在同样的问题上也将失败汇编,或者至少我尝试过的其他几个文件已经这样做。

我如何让Cmake告诉我这是我身边的文件?

编辑:供参考,当我使用G ++时,此代码会编译。现在,我正在尝试确保代码也可以在GPU上使用,因此我正在使用NVCC包装器 Kokkos中提供的。因此,我无法真正弄清楚如何使其独立于外部库。我将继续尝试制作MRE,但显然问题是我的图书馆和Kokkos/Catch2之间的一些相互作用。

I'm currently developing a fairly large library dependent on other libraries (Eigen, Catch2, and Kokkos), and use CMake for building and linking everything. Because so much is going on, it's difficult to use a MWE here or give a lot of detail, but there's currently an error in compilation within a precompiled version of Catch2 and CMake won't show me where it's coming from in my library. Once CMake starts compiling my code, I eventually end up with

[ 59%] Building CXX object CMakeFiles/RunTests.dir/tests/Test_File.cpp.o
/home/jovyan/installs/CATCH2/include/catch2/benchmark/catch_constructor.hpp(62): error: invalid type conversion

1 error detected in the compilation of "/home/jovyan/.../tests/Test_File.cpp".
make[2]: *** [CMakeFiles/RunTests.dir/build.make:121: CMakeFiles/RunTests.dir/tests/Test_File.cpp.o] Error 2
make[1]: *** [CMakeFiles/Makefile2:140: CMakeFiles/RunTests.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

The file in question being compiled (here called Test_File.cpp) is not unique-- if I remove this test, any other file that includes Catch2/catch_all.hpp will fail compilation as well with this same problem, or at least the other few files that I've tried have done so.

How do I get CMake to tell me what file this is coming from on my side?

EDIT: For reference, this code compiles when I use g++. Right now, I'm trying to ensure that the code also works on the GPU, so I'm compiling it with the nvcc wrapper provided in Kokkos. As such, I can't really figure out how to make this independent of the external libraries. I'll keep trying to make an MRE, but obviously the problem is some interplay between my library and Kokkos/Catch2.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文