conda-forge / proj.4-feedstock

A conda-smithy repository for proj.4.
BSD 3-Clause "New" or "Revised" License
4 stars 26 forks source link

OSX CMake cross-compiling confusion #132

Open hobu opened 1 year ago

hobu commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

When trying to do

find_package(PROJ CONFIG REQUIRED)

in an external library using OSX arm64 and PROJ 9.1.x or PROJ 9.2 from Conda Forge, I get the following complaint from CMake

CMake Error at CMakeLists.txt:4 (find_package):
  Could not find a configuration file for package "PROJ" that is compatible
  with requested version "".

  The following configuration files were considered but not accepted:

    /Users/hobu/miniforge3/envs/lapis/lib/cmake/proj/proj-config.cmake, version: 9.1.1 (cross-compiling = TRUE)

When I self-build my own PROJ 9.2 and install it, find_package succeeds as expected.

I think the hint about what's going on is

(cross-compiling = TRUE)

Is there something about how our cross-compiled OSX arm64 build is built that is confusing CMake when it writes its config files?

Installed packages

# packages in environment at /Users/hobu/miniforge3/envs/proj:
#
# Name                    Version                   Build  Channel
c-ares                    1.18.1               h3422bc3_0    conda-forge
ca-certificates           2022.12.7            h4653dfc_0    conda-forge
krb5                      1.20.1               h69eda48_0    conda-forge
lerc                      4.0.0                h9a09cb3_0    conda-forge
libcurl                   8.0.1                heffe338_0    conda-forge
libcxx                    16.0.1               h75e25f2_0    conda-forge
libdeflate                1.18                 h1a8c8d9_0    conda-forge
libedit                   3.1.20191231         hc8eb9b7_2    conda-forge
libev                     4.33                 h642e427_1    conda-forge
libjpeg-turbo             2.1.5.1              h1a8c8d9_0    conda-forge
libnghttp2                1.52.0               hae82a92_0    conda-forge
libsqlite                 3.40.0               h76d750c_0    conda-forge
libssh2                   1.10.0               h7a5bd25_3    conda-forge
libtiff                   4.5.0                h4f7d55c_6    conda-forge
libwebp-base              1.3.0                h1a8c8d9_0    conda-forge
libzlib                   1.2.13               h03a7124_4    conda-forge
ncurses                   6.3                  h07bb92c_1    conda-forge
openssl                   3.1.0                h03a7124_0    conda-forge
proj                      9.2.0                h13f728c_0    conda-forge
readline                  8.2                  h92ec313_1    conda-forge
sqlite                    3.40.0               h2229b38_0    conda-forge
xz                        5.2.6                h57fd34a_0    conda-forge
zstd                      1.5.2                hf913c23_6    conda-forge

### Environment info

```shell
active environment : proj
    active env location : /Users/hobu/miniforge3/envs/proj
            shell level : 2
       user config file : /Users/hobu/.condarc
 populated config files : /Users/hobu/miniforge3/.condarc
          conda version : 22.9.0
    conda-build version : not installed
         python version : 3.9.15.final.0
       virtual packages : __osx=13.2.1=0
                          __unix=0=0
                          __archspec=1=arm64
       base environment : /Users/hobu/miniforge3  (writable)
      conda av data dir : /Users/hobu/miniforge3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/hobu/miniforge3/pkgs
                          /Users/hobu/.conda/pkgs
       envs directories : /Users/hobu/miniforge3/envs
                          /Users/hobu/.conda/envs
               platform : osx-arm64
             user-agent : conda/22.9.0 requests/2.28.1 CPython/3.9.15 Darwin/22.3.0 OSX/13.2.1
                UID:GID : 501:20
             netrc file : None
           offline mode : False
venabled commented 1 year ago

This is happening on aarch64 Linux as well.

Works on 9.0.0 and not on 9.2.1