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

[package] hdf5/1.14.3: "Recipe doesn't support cross-building" #23803

Open
li-dl opened this issue Apr 28, 2024 · 4 comments
Open

[package] hdf5/1.14.3: "Recipe doesn't support cross-building" #23803

li-dl opened this issue Apr 28, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@li-dl
Copy link

li-dl commented Apr 28, 2024

Description

Using an Apple Silicon Mac to cross-compile hdf5 to x86_64 gives:

ERROR: There are invalid packages (packages that cannot exist for this configuration):
hdf5/1.14.3: Invalid ID: Current recipe doesn't support cross-building (yet)

Related to #14018.

Package and Environment Details

  • Package Name/Version: hdf5/1.14.3
  • Operating System+version: macOS v13.6.4
  • Compiler+version: apple-clang v15.0.0 (Xcode v15.2)
  • Conan version: conan v1.61.0

Conan profile

profile-build:

[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.version=15
compiler.libcxx=libc++
os=Macos

profile-host:

[settings]
arch=x86_64
build_type=Release
compiler=apple-clang
compiler.version=15
compiler.libcxx=libc++
os=Macos

Steps to reproduce

% cat conanfile.txt 
[requires]
hdf5/1.14.3
[generators]
make

% mkdir build

% cd build

% conan install -pr:b ../profile-build -pr:h ../profile-host -b missing ..

Logs

Click to expand log
Configuration (profile_host):
[settings]
arch=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=15
os=Macos
[options]
[build_requires]
[env]

Configuration (profile_build):
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=15
os=Macos
[options]
[build_requires]
[env]

hdf5/1.14.3: Not found in local cache, looking in remotes...
hdf5/1.14.3: Trying with 'conancenter'...
Downloading conanmanifest.txt completed [0.10k]                                          
Downloading conanfile.py completed [14.37k]                                              
Downloading conan_export.tgz completed [0.32k]                                           
Decompressing conan_export.tgz completed [0.00k]                                         
hdf5/1.14.3: Downloaded recipe revision 31ccd8d4de83844f5db48471df1944a1
Version ranges solved
    Version range '>=1.2.11 <2' required by 'hdf5/1.14.3' resolved to 'zlib/1.2.12' in local cache

conanfile.txt: Installing package
Requirements
    hdf5/1.14.3 from 'conancenter' - Downloaded
    zlib/1.2.12 from 'conancenter' - Cache
Packages
    hdf5/1.14.3:INVALID - Invalid
    zlib/1.2.12:da30db767be49786b38801a5ea2c89bc58b35168 - Build

Cross-build from 'Macos:armv8' to 'Macos:x86_64'
Installing (downloading, building) binaries...
ERROR: There are invalid packages (packages that cannot exist for this configuration):
hdf5/1.14.3: Invalid ID: Current recipe doesn't support cross-building (yet)
@uilianries
Copy link
Member

The HDF5 recipe runs some executable when cross-building, which is not using the architecture as same as from the build context: https://github.com/conan-io/conan-center-index/blob/master/recipes/hdf5/all/conanfile.py#L89

It's possible to fix it, but need further investigation.

@li-dl
Copy link
Author

li-dl commented Apr 30, 2024

The HDF5 recipe runs some executable when cross-building

Looks like that may no longer be true.

According to upstream HDF v1.14.3 release notes:

  • Running H5make_libsettings is no longer required for cross-compiling.
  • Running H5detect is no longer required for cross-compiling.

[Edit] See also upstream issue 1203, Cross-compilation support, where derobins said on 2023-06-14:

Cross compiling should basically just work now

@jcar87
Copy link
Contributor

jcar87 commented Apr 30, 2024

Hi @li-dl , thank you for reporting this.

I've tried cross-compiling the most recent version (by relaxing the condition in the recipe), and still get errors:

CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately:
   H5_LDOUBLE_TO_LONG_SPECIAL_RUN (advanced)
   H5_LDOUBLE_TO_LONG_SPECIAL_RUN__TRYRUN_OUTPUT (advanced)
For details see /Users/luisc/.conan2/p/b/hdf5c8c52f0f185ab/b/build/Release/TryRunResults.cmake
CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately:
   H5_LONG_TO_LDOUBLE_SPECIAL_RUN (advanced)
   H5_LONG_TO_LDOUBLE_SPECIAL_RUN__TRYRUN_OUTPUT (advanced)
For details see /Users/luisc/.conan2/p/b/hdf5c8c52f0f185ab/b/build/Release/TryRunResults.cmake
CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately:
   H5_LDOUBLE_TO_LLONG_ACCURATE_RUN (advanced)
   H5_LDOUBLE_TO_LLONG_ACCURATE_RUN__TRYRUN_OUTPUT (advanced)
For details see /Users/luisc/.conan2/p/b/hdf5c8c52f0f185ab/b/build/Release/TryRunResults.cmake
CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately:
   H5_LLONG_TO_LDOUBLE_CORRECT_RUN (advanced)
   H5_LLONG_TO_LDOUBLE_CORRECT_RUN__TRYRUN_OUTPUT (advanced)
For details see /Users/luisc/.conan2/p/b/hdf5c8c52f0f185ab/b/build/Release/TryRunResults.cmake
CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately:
   H5_DISABLE_SOME_LDOUBLE_CONV_RUN (advanced)
   H5_DISABLE_SOME_LDOUBLE_CONV_RUN__TRYRUN_OUTPUT (advanced)
For details see /Users/luisc/.conan2/p/b/hdf5c8c52f0f185ab/b/build/Release/TryRunResults.cmake
-- Found Perl: /usr/bin/perl (found version "5.34.1")

So it looks like support may not be fully there yet. I'll try to troubleshoot and report this unstream.

on the other hand, if you have Rosetta installed, the following works for me:

conan install --require=hdf5/1.14.3 --settings:host arch=x86_64 --settings:build arch=x86_64

This tells Conan that we are running natively on x86_64, which "can" be true if Rosetta is installed. However please note that this approach may not work with all recipes, if build systems perform auto-detections. But I can confirm it works for building hdf5

@li-dl
Copy link
Author

li-dl commented Apr 30, 2024

on the other hand, if you have Rosetta installed, the following works for me:

conan install --require=hdf5/1.14.3 --settings:host arch=x86_64 --settings:build arch=x86_64

[...] However please note that this approach may not work with all recipes [...]

Yeah, that's what we've been doing, but one of our other dependencies (capnproto) is one of the recipes that doesn't work with that approach, as discussed in #23765.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants