xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
9.87k stars 776 forks source link

links not found when add_deps("openmp") #5345

Closed xq114 closed 2 months ago

xq114 commented 2 months ago

Xmake 版本

2.9.3

操作系统版本和架构

Fedora

描述问题

https://github.com/xmake-io/xmake-repo/actions/runs/9920625780/job/27407697804?pr=4611

error: @programdir/core/package/package.lua:2406: package(openmp): links not found!

openmp本来就没有link

期待的结果

正常安装package

工程配置

-

附加信息和错误日志

-

waruqi commented 2 months ago

再试试

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


try again

xq114 commented 2 months ago

还是不行,应该是#ldflags > 0才对吧;还有就是https://github.com/xmake-io/xmake/blob/dev/xmake/core/package/package.lua#L2021-L2029 这里没考虑 fetchinfo 为boolean的情况,直接判断fetchinfo.version会出问题,是不是参考https://github.com/xmake-io/xmake/blob/dev/xmake/core/package/package.lua#L1739-L1749 处理下?

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Still not working, it should be #ldflags > 0; and https://github.com/xmake-io/xmake/blob/dev/xmake/core/package/package.lua#L2021-L2029 is not considered here If fetchinfo is boolean, directly determine if there will be a problem with fetchinfo.version. Please refer to https://github.com/xmake-io/xmake/blob/dev/xmake/core/package/package.lua#L1739-L1749 for processing. Down?

waruqi commented 2 months ago

还是不行,应该是#ldflags > 0才对吧;

好了,再试试

还有就是https://github.com/xmake-io/xmake/blob/dev/xmake/core/package/package.lua#L2021-L2029 这里没考虑 fetchinfo 为boolean的情况,直接判断fetchinfo.version会出问题,是不是参考https://github.com/xmake-io/xmake/blob/dev/xmake/core/package/package.lua#L1739-L1749 处理下?

返回 boolean 原本就是不对的,当初早期可能有几个不规范的,改下包就好了。。现在统一只能返回 table

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Still not working, it should be #ldflags > 0;

Okay, try again

There is also https://github.com/xmake-io/xmake/blob/dev/xmake/core/package/package.lua#L2021-L2029. The case where fetchinfo is boolean is not considered here. Directly judge fetchinfo.version. If there is a problem, can you refer to https://github.com/xmake-io/xmake/blob/dev/xmake/core/package/package.lua#L1739-L1749 to solve it?

Returning boolean is originally wrong. There may be a few irregularities in the early days, so just change the package. . Now unified can only return table

xq114 commented 2 months ago

还是不行

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Or not

waruqi commented 2 months ago

还是不行

我这里正常,links not found 的问题没了。。可能是没更新到 master

> checking for c links(omp)
> checking for c snippet(test)
  => install openmp latest .. ok

反而是 openmp 这个包自从加了 fortran 后,ldflags 没设置对,导致 macos 下 test 测试不过,多了 -fopenmp 的 ldflags。。我改了下。。

https://github.com/xmake-io/xmake-repo/pull/4663

waruqi commented 2 months ago

应该可以了 https://github.com/xmake-io/xmake-repo/pull/4663