Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

本地编译的vtk,使用xmake找不到 #2473

Open
mingtiancai opened this issue Jun 18, 2022 · 9 comments
Open

本地编译的vtk,使用xmake找不到 #2473

mingtiancai opened this issue Jun 18, 2022 · 9 comments
Labels

Comments

@mingtiancai
Copy link

Xmake Version

2.6.7

Operating System Version and Architecture

ubuntu20

Describe Bug

vtk使用cmake编译的,因为需要配置本地的qt版本,所以没有使用xrepo带的版本。编译完sudo make install,头文件和库文件自动被拷贝到/usr/local/include 和usr/local/lib里面。vtk版本9.1.0
然后在xmake.lua中配置
add_requires("vtk",{system=true}})
提示找不到本地的vtk

Expected Behavior

可以直接找到本地系统默认位置的包或者有什么直接配置的方法

Project Configuration

No response

Additional Information and Error Logs

No response

@mingtiancai
Copy link
Author

我自己下载了xrepo的一个vtk版本,把本地的vtk的库和include文件拷贝进去xmake package vtk对应的位置,编译,依然找不到我新加进去的那些库。有什么方法可以配置吗?

@waruqi
Copy link
Member

waruqi commented Jun 19, 2022

我自己下载了xrepo的一个vtk版本,把本地的vtk的库和include文件拷贝进去xmake package vtk对应的位置,编译,依然找不到我新加进去的那些库。有什么方法可以配置吗?

你配置了 system = true 就只会从系统找,不会从包里找

先确认下系统 pkg-config 有没有安装,找系统库,依赖 pkg-config

也可以 xmake l find_package vtk 看下有没有找到

如果还是找不到,自己 find 下 vtk 对应的 .pc 文件位置, 可以自己 pkg-config --cflags --libs vtk 查下

@mingtiancai
Copy link
Author

mingtiancai commented Jun 19, 2022 via email

@waruqi
Copy link
Member

waruqi commented Jun 19, 2022

用pkg-config就没有找到本地的vtk,是我安装vtk的问题没有被这个软件识别到?

---原始邮件--- 发件人: @.> 发送时间: 2022年6月19日(周日) 下午4:12 收件人: @.>; 抄送: @.@.>; 主题: Re: [xmake-io/xmake] 本地编译的vtk,使用xmake找不到 (Issue #2473) 我自己下载了xrepo的一个vtk版本,把本地的vtk的库和include文件拷贝进去xmake package vtk对应的位置,编译,依然找不到我新加进去的那些库。有什么方法可以配置吗? 你配置了 system = true 就只会从系统找,不会从包里找 先确认下系统 pkg-config 有没有安装,找系统库,依赖 pkg-config 也可以 xmake l find_package vtk 看下有没有找到 如果还是找不到,自己 find 下 vtk 对应的 .pc 文件位置, 可以自己 pkg-config --cflags --libs vtk 查下 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

先确认下 对应的 .pc 文件路径和名字,有可能不叫 vtk.pc 名字不对,也会找不到,如果pc文件都没有,那是找不到了

@w-qhai
Copy link

w-qhai commented Jun 29, 2022

用pkg-config就没有找到本地的vtk,是我安装vtk的问题没有被这个软件识别到?

---原始邮件--- 发件人: @.> 发送时间: 2022年6月19日(周日) 下午4:12 收件人: _@**._>; 抄送: _@.@._>; 主题: Re: [xmake-io/xmake] 本地编译的vtk,使用xmake找不到 (Issue #2473) 我自己下载了xrepo的一个vtk版本,把本地的vtk的库和include文件拷贝进去xmake package vtk对应的位置,编译,依然找不到我新加进去的那些库。有什么方法可以配置吗? 你配置了 system = true 就只会从系统找,不会从包里找 先确认下系统 pkg-config 有没有安装,找系统库,依赖 pkg-config 也可以 xmake l find_package vtk 看下有没有找到 如果还是找不到,自己 find 下 vtk 对应的 .pc 文件位置, 可以自己 pkg-config --cflags --libs vtk 查下 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: _@_.*>

先确认下 对应的 .pc 文件路径和名字,有可能不叫 vtk.pc 名字不对,也会找不到,如果pc文件都没有,那是找不到了

我也是本地库找不到。
通过apt安装的opencv,应该是没生成pc文件,xmake找不到包,但是cmake find_packages可以。

@waruqi
Copy link
Member

waruqi commented Jun 30, 2022

用pkg-config就没有找到本地的vtk,是我安装vtk的问题没有被这个软件识别到?

---原始邮件--- 发件人: @.> 发送时间: 2022年6月19日(周日) 下午4:12 收件人: _@**._>; 抄送: _@.@._>; 主题: Re: [xmake-io/xmake] 本地编译的vtk,使用xmake找不到 (Issue #2473) 我自己下载了xrepo的一个vtk版本,把本地的vtk的库和include文件拷贝进去xmake package vtk对应的位置,编译,依然找不到我新加进去的那些库。有什么方法可以配置吗? 你配置了 system = true 就只会从系统找,不会从包里找 先确认下系统 pkg-config 有没有安装,找系统库,依赖 pkg-config 也可以 xmake l find_package vtk 看下有没有找到 如果还是找不到,自己 find 下 vtk 对应的 .pc 文件位置, 可以自己 pkg-config --cflags --libs vtk 查下 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: _@_.*>

先确认下 对应的 .pc 文件路径和名字,有可能不叫 vtk.pc 名字不对,也会找不到,如果pc文件都没有,那是找不到了

我也是本地库找不到。 通过apt安装的opencv,应该是没生成pc文件,xmake找不到包,但是cmake find_packages可以。

opencv 的包,目前有仓库配置 add_extsources("apt::libopencv-dev") 来辅助查找。。

但是 apt 的 find_package 实现,目前还没加上 pc 的查找支持,所以没找到,但是你直接去 xmake l find_package opencv4 是可以找到的,因为 pc 文件是 opencv4.pc

回头我会改进下 apt 下的 find_package 查找

@waruqi
Copy link
Member

waruqi commented Jun 30, 2022

apt 下 opencv 的查找,我刚改进过了,可以更新到 dev 试试,vtk 我需要完整安装 list files ,我才能分析确定是否能找到,自己也可以确认下 是否存在 pc 文件

xmake update -s dev

@mingtiancai
Copy link
Author

mingtiancai commented Jun 30, 2022 via email

@mingtiancai
Copy link
Author

mingtiancai commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants