[SJTU-IPADS/PowerInfer]windows visual studio编译失败

2024-06-21 792 views
4

使用CMake构建vs 工程,编译的时候,会报下面的错误: fatal error C1083: 无法打开包括文件: “stdatomic.h”: No such file or directory

image

回答

9

感谢你的反馈,我们使用的stdatomic.h看起来不兼容Windows。目前我们正在进行Windows平台兼容的工作,我们很快能够设置好Windows的测试环境并尝试逐一解决问题。如果你对llama.cpp在Windows上的编译较为熟悉,我们欢迎你进行尝试修复,并提出PR。

Thank you for your feedback. It appears that stdatomic.h we are using is not compatible with Windows. We are currently working on Windows compatibility. We will soon set up a Windows testbed and attempt to address these issues. If you have experience compiling the llama.cpp file on Windows, we would greatly appreciate your efforts to fix it and submit a PR.

7

可以使用 /experimental:c11atomics 开启支持,另外 ATOMIC_VAR_INIT 宏也确定不提供(因为非必要,可以移除),但是之后 float vec[ne00*4]; 一行使用了 vla,这是 msvc 不支持的特性,因此并不能通过简单修改在 msvc 下通过编译(可能可以通过 _malloc 以类似 alloca 的方式替代,但比较丑)

9

我们正在PR #73 进行相关更改,它应该可以使得Windows CPU/GPU环境下可以编译运行。我们参考了 @akemimadoka 的宝贵建议,感谢!