Skip to content

omath: add new package #7619

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

Merged
merged 13 commits into from
Jul 14, 2025
Merged

omath: add new package #7619

merged 13 commits into from
Jul 14, 2025

Conversation

luadebug
Copy link
Contributor

  • Before adding new features and new modules, please go to issues to submit the relevant feature description first.
  • Write good commit messages and use the same coding conventions as the rest of the project.
  • Please commit code to dev branch and we will merge into master branch in feature
  • Ensure your edited codes with four spaces instead of TAB.

  • 增加新特性和新模块之前,请先到issues提交相关特性说明,经过讨论评估确认后,再进行相应的代码提交,避免做无用工作。
  • 编写友好可读的提交信息,并使用与工程代码相同的代码规范,代码请用4个空格字符代替tab缩进。
  • 请提交代码到dev分支,如果通过,我们会在特定时间合并到master分支上。
  • 为了规范化提交日志的格式,commit消息,不要用中文,请用英文描述。

@luadebug
Copy link
Contributor Author

checking for flags (-fPIC) ... ok
> arm-none-linux-gnueabihf-g++ "-fPIC" "-shared"
error: @programdir/core/sandbox/modules/os.lua:273: CMake Error at CMakeLists.txt:45 (find_package):
  Could not find a configuration file for package "imgui" that is compatible
  with requested version "1.0.0".

  The following configuration files were considered but not accepted:

    /home/runner/.xmake/packages/i/imgui/v1.92.0/6c5056f0648e40758c84f4716d3ac17d/lib/cmake/imgui/imguiConfig.cmake, version: 1.0.0 (64bit)



one
-- [OMATH]: Building on Linux
-- Configuring incomplete, errors occurred!

stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1075]:
    [@programdir/core/sandbox/modules/os.lua:273]:
    [@programdir/core/sandbox/modules/os.lua:291]: in function 'vrunv'
    [@programdir/modules/package/tools/cmake.lua:1338]: in function 'configure'
    [@programdir/modules/package/tools/cmake.lua:1380]: in function 'install'
    [...er/work/xmake-repo/xmake-repo/packages/o/omath/xmake.lua:34]: in function 'script'
    [...dir/modules/private/action/require/impl/utils/filter.lua:114]: in function 'call'
    [.../modules/private/action/require/impl/actions/install.lua:470]:

  => install omath v3.0.3 .. failed
error: @programdir/core/main.lua:329: @programdir/modules/async/runjobs.lua:331: .../modules/private/action/require/impl/actions/install.lua:579: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1075]:
    [.../modules/private/action/require/impl/actions/install.lua:579]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
    [.../modules/private/action/require/impl/actions/install.lua:437]:
    [...modules/private/action/require/impl/install_packages.lua:510]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:247]:

stack traceback:
	[C]: in function 'error'
	@programdir/core/base/os.lua:1075: in function 'base/os.raiselevel'
	(...tail calls...)
	@programdir/core/main.lua:329: in upvalue 'cotask'
	@programdir/core/base/scheduler.lua:406: in function <@programdir/core/base/scheduler.lua:399>
error: execv(/opt/hostedtoolcache/xmake/master/x64/bin/xmake require -f -y --build -D --extra={configs={shared=false}} omath "omath v3.0.3") failed(255)
Error: Process completed with exit code 255.

It should be 32 bit imgui but it resolves it as 64 bit imgui during cross build...

@WubiCookie
Copy link
Contributor

Isn't omath's licence MIT instead of zlib?

@luadebug
Copy link
Contributor Author

luadebug commented Jul 10, 2025

It has been changed from MIT to Zlib :) at 3.0.1 ... 3.0.3
See orange-cpp/omath@f6f8bba

@star-hengxing
Copy link
Contributor

checking for flags (-fPIC) ... ok
> arm-none-linux-gnueabihf-g++ "-fPIC" "-shared"
error: @programdir/core/sandbox/modules/os.lua:273: CMake Error at CMakeLists.txt:45 (find_package):
  Could not find a configuration file for package "imgui" that is compatible
  with requested version "1.0.0".

  The following configuration files were considered but not accepted:

    /home/runner/.xmake/packages/i/imgui/v1.92.0/6c5056f0648e40758c84f4716d3ac17d/lib/cmake/imgui/imguiConfig.cmake, version: 1.0.0 (64bit)



one
-- [OMATH]: Building on Linux
-- Configuring incomplete, errors occurred!

stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1075]:
    [@programdir/core/sandbox/modules/os.lua:273]:
    [@programdir/core/sandbox/modules/os.lua:291]: in function 'vrunv'
    [@programdir/modules/package/tools/cmake.lua:1338]: in function 'configure'
    [@programdir/modules/package/tools/cmake.lua:1380]: in function 'install'
    [...er/work/xmake-repo/xmake-repo/packages/o/omath/xmake.lua:34]: in function 'script'
    [...dir/modules/private/action/require/impl/utils/filter.lua:114]: in function 'call'
    [.../modules/private/action/require/impl/actions/install.lua:470]:

  => install omath v3.0.3 .. failed
error: @programdir/core/main.lua:329: @programdir/modules/async/runjobs.lua:331: .../modules/private/action/require/impl/actions/install.lua:579: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1075]:
    [.../modules/private/action/require/impl/actions/install.lua:579]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
    [.../modules/private/action/require/impl/actions/install.lua:437]:
    [...modules/private/action/require/impl/install_packages.lua:510]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:247]:

stack traceback:
	[C]: in function 'error'
	@programdir/core/base/os.lua:1075: in function 'base/os.raiselevel'
	(...tail calls...)
	@programdir/core/main.lua:329: in upvalue 'cotask'
	@programdir/core/base/scheduler.lua:406: in function <@programdir/core/base/scheduler.lua:399>
error: execv(/opt/hostedtoolcache/xmake/master/x64/bin/xmake require -f -y --build -D --extra={configs={shared=false}} omath "omath v3.0.3") failed(255)
Error: Process completed with exit code 255.

It should be 32 bit imgui but it resolves it as 64 bit imgui during cross build...

Try pkgconfig?

@luadebug
Copy link
Contributor Author

luadebug commented Jul 11, 2025

checking for flags (-fPIC) ... ok
> arm-none-linux-gnueabihf-g++ "-fPIC" "-shared"
error: @programdir/core/sandbox/modules/os.lua:273: CMake Error at CMakeLists.txt:45 (find_package):
  Could not find a configuration file for package "imgui" that is compatible
  with requested version "1.0.0".

  The following configuration files were considered but not accepted:

    /home/runner/.xmake/packages/i/imgui/v1.92.0/6c5056f0648e40758c84f4716d3ac17d/lib/cmake/imgui/imguiConfig.cmake, version: 1.0.0 (64bit)



one
-- [OMATH]: Building on Linux
-- Configuring incomplete, errors occurred!

stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1075]:
    [@programdir/core/sandbox/modules/os.lua:273]:
    [@programdir/core/sandbox/modules/os.lua:291]: in function 'vrunv'
    [@programdir/modules/package/tools/cmake.lua:1338]: in function 'configure'
    [@programdir/modules/package/tools/cmake.lua:1380]: in function 'install'
    [...er/work/xmake-repo/xmake-repo/packages/o/omath/xmake.lua:34]: in function 'script'
    [...dir/modules/private/action/require/impl/utils/filter.lua:114]: in function 'call'
    [.../modules/private/action/require/impl/actions/install.lua:470]:

  => install omath v3.0.3 .. failed
error: @programdir/core/main.lua:329: @programdir/modules/async/runjobs.lua:331: .../modules/private/action/require/impl/actions/install.lua:579: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1075]:
    [.../modules/private/action/require/impl/actions/install.lua:579]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
    [.../modules/private/action/require/impl/actions/install.lua:437]:
    [...modules/private/action/require/impl/install_packages.lua:510]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:247]:

stack traceback:
	[C]: in function 'error'
	@programdir/core/base/os.lua:1075: in function 'base/os.raiselevel'
	(...tail calls...)
	@programdir/core/main.lua:329: in upvalue 'cotask'
	@programdir/core/base/scheduler.lua:406: in function <@programdir/core/base/scheduler.lua:399>
error: execv(/opt/hostedtoolcache/xmake/master/x64/bin/xmake require -f -y --build -D --extra={configs={shared=false}} omath "omath v3.0.3") failed(255)
Error: Process completed with exit code 255.

It should be 32 bit imgui but it resolves it as 64 bit imgui during cross build...

Try pkgconfig?

error: @programdir/core/sandbox/modules/os.lua:273: CMake Error in CMakeLists.txt:
  Imported target "PkgConfig::imgui" includes non-existent path
    "/home/runner/.xmake/packages/i/imgui/v1.92.0/63bf3a23860d476f963e64ec7c284417/lib/pkgconfig/../../include/imgui"
  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
  * The path was deleted, renamed, or moved to another location.
  * An install or uninstall procedure did not complete successfully.
  * The installation package was faulty and references files it does not
  provide.
CMake Warning:
  Manually-specified variables were not used by the project:
    CMAKE_ASM_COMPILER
    CMAKE_C_COMPILER
    CMAKE_C_FLAGS_RELEASE
    CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
    CMAKE_INSTALL_LIBDIR
    HAVE_FLAG_SEARCH_PATHS_FIRST
    OMATH_SHARED
CMake Generate step failed.  Build files cannot be regenerated correctly.
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1075]:
    [@programdir/core/sandbox/modules/os.lua:273]:
    [@programdir/core/sandbox/modules/os.lua:291]: in function 'vrunv'
    [@programdir/modules/package/tools/cmake.lua:1338]: in function 'configure'
    [@programdir/modules/package/tools/cmake.lua:1380]: in function 'install'
    [...er/work/xmake-repo/xmake-repo/packages/o/omath/xmake.lua:41]: in function 'script'
    [...dir/modules/private/action/require/impl/utils/filter.lua:114]: in function 'call'
    [.../modules/private/action/require/impl/actions/install.lua:470]:

  => install omath v3.0.3 .. failed

It points to correct include path?

@luadebug
Copy link
Contributor Author

Do you have any workaround @star-hengxing ?

@star-hengxing
Copy link
Contributor

pkgconfig

  Imported target "PkgConfig::imgui" includes non-existent path

    "/home/runner/.xmake/packages/i/imgui/v1.92.0/63bf3a23860d476f963e64ec7c284417/lib/pkgconfig/../../include/imgui"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

Because

add_includedirs("include", "include/imgui", "include/backends", "include/misc/cpp")

So you can try

local imgui = package:dep("imgui")
for _, inc in ipairs(imgui:get("includedirs")) do
    os.mkdir(imgui:installdir(inc))
end

@star-hengxing
Copy link
Contributor

But I think this is a xmake bug. When generating the pc file, it needs to filter out non-existent paths.
@waruqi

@luadebug
Copy link
Contributor Author

As far as I know

MKDIR C:\Users\Admin\AppData\Local\.xmake\packages\i\imgui\v1.92.0\6c5056f0648e40758c84f4716d3ac17d\include
MKDIR C:\Users\Admin\AppData\Local\.xmake\packages\i\imgui\v1.92.0\6c5056f0648e40758c84f4716d3ac17d\include\imgui
MKDIR C:\Users\Admin\AppData\Local\.xmake\packages\i\imgui\v1.92.0\6c5056f0648e40758c84f4716d3ac17d\include\backends    
MKDIR C:\Users\Admin\AppData\Local\.xmake\packages\i\imgui\v1.92.0\6c5056f0648e40758c84f4716d3ac17d\include\misc\cpp 

The two of them would be empty folders:

MKDIR C:\Users\Admin\AppData\Local\.xmake\packages\i\imgui\v1.92.0\6c5056f0648e40758c84f4716d3ac17d\include\imgui
MKDIR C:\Users\Admin\AppData\Local\.xmake\packages\i\imgui\v1.92.0\6c5056f0648e40758c84f4716d3ac17d\include\backends    

@star-hengxing
Copy link
Contributor

These directories will only exist when other imgui configs are enabled.

@luadebug luadebug assigned luadebug and unassigned luadebug Jul 14, 2025
@luadebug luadebug requested a review from star-hengxing July 14, 2025 10:43
@star-hengxing star-hengxing merged commit 8fd53ec into xmake-io:dev Jul 14, 2025
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants