conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.26k stars 980 forks source link

Do you have a plan to support LoongArch? #14146

Closed taogeng closed 1 year ago

taogeng commented 1 year ago

Do you have a plan to support LoongArch?

memsharded commented 1 year ago

What do you mean to support LoongArch?

It is possible to define any architecture in your settings.yml or in your settings_user.yml: https://docs.conan.io/2/reference/config_files/settings.html#customizing-settings. So this wouldn't be a blocker, you can add it there and use in your recipes with self.settings.arch.

A different issue is if build-systems like CMake understand that architecture. It would be necessary to understand the possible gaps, compilation flags, architecture mapping that the different build systems (CMake, Autotools, Meson, etc would be doing)

taogeng commented 1 year ago

What do you mean to support LoongArch?

It is possible to define any architecture in your settings.yml or in your settings_user.yml: https://docs.conan.io/2/reference/config_files/settings.html#customizing-settings. So this wouldn't be a blocker, you can add it there and use in your recipes with self.settings.arch.

A different issue is if build-systems like CMake understand that architecture. It would be necessary to understand the possible gaps, compilation flags, architecture mapping that the different build systems (CMake, Autotools, Meson, etc would be doing)

Thanks for your reply.

Kairo-Dai commented 3 months ago
-------- Installing package libcap/2.69 (7 of 34) --------
libcap/2.69: Building from source
libcap/2.69: Package libcap/2.69:676ef7e9380812a1e5ae12c0e0a6720b2972f1d7
libcap/2.69: Copying sources to build folder
libcap/2.69: Building your package in /home/seewo/dev/conan2_home/p/b/libcade016b7842ff8/b
libcap/2.69: Calling generate()
libcap/2.69: Generators folder: /home/seewo/dev/conan2_home/p/b/libcade016b7842ff8/b/build-debug/conan
ERROR: libcap/2.69: Error in generate() method, line 53
        tc = AutotoolsToolchain(self)
        ConanException: Unknown 'loongarch64' machine, Conan doesn't know how to translate it to the GNU triplet, please report at  https://github.com/conan-io/conan/issues

It appears that autotools are not compatible with the Loongson platform. my settings_user.yml is

arch: [loongarch64]
X1aomu commented 3 months ago
-------- Installing package libcap/2.69 (7 of 34) --------
libcap/2.69: Building from source
libcap/2.69: Package libcap/2.69:676ef7e9380812a1e5ae12c0e0a6720b2972f1d7
libcap/2.69: Copying sources to build folder
libcap/2.69: Building your package in /home/seewo/dev/conan2_home/p/b/libcade016b7842ff8/b
libcap/2.69: Calling generate()
libcap/2.69: Generators folder: /home/seewo/dev/conan2_home/p/b/libcade016b7842ff8/b/build-debug/conan
ERROR: libcap/2.69: Error in generate() method, line 53
        tc = AutotoolsToolchain(self)
        ConanException: Unknown 'loongarch64' machine, Conan doesn't know how to translate it to the GNU triplet, please report at  https://github.com/conan-io/conan/issues

It appears that autotools are not compatible with the Loongson platform. my settings_user.yml is

arch: [loongarch64]

It seems that you are in cross-building. That would happen if someone forget to tweak the defaut profile and then run with -pr <host-profile>. Try -pr:a <profile> instead, or manually specify tools.gnu:host_triplet and tools.gnu:build_triplet.

Reference: https://github.com/conan-io/conan/blob/369a3d0751b20cdb19abf7547b8b98e8cbd6dec9/conan/tools/gnu/autotoolstoolchain.py#L60-L83

Kairo-Dai commented 3 months ago
-------- Installing package libcap/2.69 (7 of 34) --------
libcap/2.69: Building from source
libcap/2.69: Package libcap/2.69:676ef7e9380812a1e5ae12c0e0a6720b2972f1d7
libcap/2.69: Copying sources to build folder
libcap/2.69: Building your package in /home/seewo/dev/conan2_home/p/b/libcade016b7842ff8/b
libcap/2.69: Calling generate()
libcap/2.69: Generators folder: /home/seewo/dev/conan2_home/p/b/libcade016b7842ff8/b/build-debug/conan
ERROR: libcap/2.69: Error in generate() method, line 53
        tc = AutotoolsToolchain(self)
        ConanException: Unknown 'loongarch64' machine, Conan doesn't know how to translate it to the GNU triplet, please report at  https://github.com/conan-io/conan/issues

It appears that autotools are not compatible with the Loongson platform. my settings_user.yml is

arch: [loongarch64]

It seems that you are in cross-building. That would happen if someone forget to tweak the defaut profile and then run with -pr <host-profile>. Try -pr:a <profile> instead, or manually specify tools.gnu:host_triplet and tools.gnu:build_triplet.

Reference:

https://github.com/conan-io/conan/blob/369a3d0751b20cdb19abf7547b8b98e8cbd6dec9/conan/tools/gnu/autotoolstoolchain.py#L60-L83

Thank you for your feedback. I'm pleased to hear that modifying the default profile correctly resolved your issue.