!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

488 Members
102 Servers

Load older messages


SenderMessageTime
11 May 2025
@curid:matrix.orgCurid

When cross-compiling, a CMAKE_TOOLCHAIN_FILE should set the CMAKE_SYSTEM_PROCESSOR variable to match target architecture that it specifies (via CMAKE_<LANG>COMPILER and perhaps CMAKE<LANG>_COMPILER_TARGET).

Am I suppose to set it manually?

08:05:35
@curid:matrix.orgCuridRedacted or Malformed Event19:16:46
@curid:matrix.orgCuridI finally managed to get tensorflow lite to cross-compile to aarch64 by using cmake instead of bazel: https://paste.debian.net/1374172/19:17:16
@curid:matrix.orgCuridshould I upstream it?19:33:39
@emilazy:matrix.orgemilyI don't know if you need those patches?19:35:55
@emilazy:matrix.orgemilyI'm pretty sure you can point CMake to the right place with flags19:36:14
@emilazy:matrix.orgemilyor at least inject stuff into the right paths, not sure19:36:25
12 May 2025
@curid:matrix.orgCurid
     ./tflite_patches/fetch_farmhash.patch
     ./tflite_patches/fetch_fft2d.patch
-    ./tflite_patches/fetch_gemmlowp.patch
+    #./tflite_patches/fetch_gemmlowp.patch
     ./tflite_patches/fetch_neon2sse.patch
     ./tflite_patches/fetch_cpuinfo.patch
     ./tflite_patches/fetch_ruy.patch
@@ -139,11 +139,12 @@ in stdenv.mkDerivation rec {
   configurePhase = ''
     cmake \
       -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON \
+      -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=true \
       -Dabseil_SOURCE_DIR2=${abseil_src} \
       -Deigen_SOURCE_DIR2=$(pwd)/eigen_src \
       -Dfarmhash_SOURCE_DIR2=${farmhash_src} \
       -Dfft2d_SOURCE_DIR2=${fft2d_src} \
-      -Dgemmlowp_SOURCE_DIR2=${gemmlowp_src} \
+      -DFETCHCONTENT_SOURCE_DIR_gemmlowp=${gemmlowp_src} \
       -Dneon2sse_SOURCE_DIR2=${neon2sse_src} \
       -Dcpuinfo_SOURCE_DIR2=${cpuinfo_src} \

error: could not find git for clone of gemmlowp-populate

16:56:59
@curid:matrix.orgCuridhttps://github.com/tensorflow/tensorflow/blob/v2.12.1/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake16:57:37
@curid:matrix.orgCurid *
     ./tflite_patches/fetch_farmhash.patch
     ./tflite_patches/fetch_fft2d.patch
-    ./tflite_patches/fetch_gemmlowp.patch
+    #./tflite_patches/fetch_gemmlowp.patch
     ./tflite_patches/fetch_neon2sse.patch
     ./tflite_patches/fetch_cpuinfo.patch
     ./tflite_patches/fetch_ruy.patch
@@ -139,11 +139,12 @@ in stdenv.mkDerivation rec {
   configurePhase = ''
     cmake \
       -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON \
+      -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=true \
       -Dabseil_SOURCE_DIR2=${abseil_src} \
       -Deigen_SOURCE_DIR2=$(pwd)/eigen_src \
       -Dfarmhash_SOURCE_DIR2=${farmhash_src} \
       -Dfft2d_SOURCE_DIR2=${fft2d_src} \
-      -Dgemmlowp_SOURCE_DIR2=${gemmlowp_src} \
+      -DFETCHCONTENT_SOURCE_DIR_gemmlowp=${gemmlowp_src} \
       -Dneon2sse_SOURCE_DIR2=${neon2sse_src} \
       -Dcpuinfo_SOURCE_DIR2=${cpuinfo_src} \
       > CMake Error at /nix/store/6fg3in4qihi93dp1p7in016d062dhw2b-cmake-3.22.3/share/cmake-3.22/Modules/FetchContent.cmake:1075 (message):
       >   CMake step for gemmlowp failed: 1
       > Call Stack (most recent call first):
       >   /nix/store/6fg3in4qihi93dp1p7in016d062dhw2b-cmake-3.22.3/share/cmake-3.22/Modules/FetchContent.cmake:1216:EVAL:2 (__FetchContent_directPopulate)
       >   /nix/store/6fg3in4qihi93dp1p7in016d062dhw2b-cmake-3.22.3/share/cmake-3.22/Modules/FetchContent.cmake:1216 (cmake_language)
       >   /build/source/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake:531 (FetchContent_Populate)
       >   /build/source/tensorflow/lite/tools/cmake/modules/gemmlowp.cmake:38 (OverridableFetchContent_Populate)
       >   /build/source/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake:18 (include)
       >   /build/source/tensorflow/lite/CMakeLists.txt:147 (find_package)

17:00:00
@curid:matrix.orgCurid *
     ./tflite_patches/fetch_farmhash.patch
     ./tflite_patches/fetch_fft2d.patch
-    ./tflite_patches/fetch_gemmlowp.patch
+    #./tflite_patches/fetch_gemmlowp.patch
     ./tflite_patches/fetch_neon2sse.patch
     ./tflite_patches/fetch_cpuinfo.patch
     ./tflite_patches/fetch_ruy.patch
@@ -139,11 +139,12 @@ in stdenv.mkDerivation rec {
   configurePhase = ''
     cmake \
       -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON \
+      -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=true \
       -Dabseil_SOURCE_DIR2=${abseil_src} \
       -Deigen_SOURCE_DIR2=$(pwd)/eigen_src \
       -Dfarmhash_SOURCE_DIR2=${farmhash_src} \
       -Dfft2d_SOURCE_DIR2=${fft2d_src} \
-      -Dgemmlowp_SOURCE_DIR2=${gemmlowp_src} \
+      -DFETCHCONTENT_SOURCE_DIR_gemmlowp=${gemmlowp_src} \
       -Dneon2sse_SOURCE_DIR2=${neon2sse_src} \
       -Dcpuinfo_SOURCE_DIR2=${cpuinfo_src} \
error: could not find git for clone of gemmlowp-populate
       > CMake Error at /nix/store/6fg3in4qihi93dp1p7in016d062dhw2b-cmake-3.22.3/share/cmake-3.22/Modules/FetchContent.cmake:1075 (message):
       >   CMake step for gemmlowp failed: 1
       > Call Stack (most recent call first):
       >   /nix/store/6fg3in4qihi93dp1p7in016d062dhw2b-cmake-3.22.3/share/cmake-3.22/Modules/FetchContent.cmake:1216:EVAL:2 (__FetchContent_directPopulate)
       >   /nix/store/6fg3in4qihi93dp1p7in016d062dhw2b-cmake-3.22.3/share/cmake-3.22/Modules/FetchContent.cmake:1216 (cmake_language)
       >   /build/source/tensorflow/lite/tools/cmake/modules/OverridableFetchContent.cmake:531 (FetchContent_Populate)
       >   /build/source/tensorflow/lite/tools/cmake/modules/gemmlowp.cmake:38 (OverridableFetchContent_Populate)
       >   /build/source/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake:18 (include)
       >   /build/source/tensorflow/lite/CMakeLists.txt:147 (find_package)

17:00:38
14 May 2025
@diamondburned:matrix.orgdiamond (it/its) changed their profile picture.01:20:08
@diamondburned:matrix.orgdiamond (it/its) changed their profile picture.02:47:47
@siraben:matrix.orgsiraben joined the room.04:34:53
16 May 2025
@winter:catgirl.cloudWinter joined the room.06:13:00
@.siev:matrix.org.siev joined the room.15:52:39
17 May 2025
@terrorjack:matrix.orgterrorjack set a profile picture.08:53:57
19 May 2025
@oak:universumi.fioak 🏳️‍🌈♥️ changed their display name from oak 🫱⭕🫲 to oak.10:59:15
@oak:universumi.fioak 🏳️‍🌈♥️ changed their display name from oak to oak 🏳️‍🌈♥️.11:01:00
@aliarokapis:matrix.orgAlexandros Liarokapisthis is kind of stupid but, does nixpkgs support using the avr pkgsCross with libstdc++ available ?13:17:59
@k900:0upti.meK900Uhh 13:19:39
@k900:0upti.meK900 I'm not even sure libstdc++ supports 8-bit targets 13:19:57
@aliarokapis:matrix.orgAlexandros LiarokapisI had this working through https://gitlab.com/avr-libstdcxx a few years back for gcc-11 but was using docker back then. It's too niche really, so I don't have many hopes.13:22:57
@emilazy:matrix.orgemilyhthis is a silly question but… how do you actually specify all of build/host/target when instantiating Nixpkgs?13:25:11
@emilazy:matrix.orgemily* this is a silly question but… how do you actually specify all of build/host/target when instantiating Nixpkgs?13:25:16
@k900:0upti.meK900You don't13:28:53
@k900:0upti.meK900You pass in system and crossSystem13:29:02
@k900:0upti.meK900You can't actually specify all three13:29:07
@emilazy:matrix.orgemilyright, but then…13:31:50
@emilazy:matrix.orgemilyhow do you actually build stuff for that combo?13:31:54

Show newer messages


Back to Room ListRoom Version: 6