7 May 2025 |
szlend | or maybe root.pkgsBuildHost.pkgsTargetTarget == root.pkgsHostTarget (since targetTarget is +1,+1) | 21:36:15 |
SomeoneSerge (UTC+U[-12,12]) | It's the former, because ps: ps.pkgsTargetTarget translates by the vector of (1, 0) , which is how you get from the point (0, 1) (pkgs = pkgsHostTarget ) to the point (1, 1) (pkgs.pkgsTargetTarget ) | 21:41:55 |
SomeoneSerge (UTC+U[-12,12]) | Setup-hooks here print the accumulated vectors, but not the result of translating the current' derivation's platforms (0, 1) by that vector | 21:44:01 |
szlend | I see yeah, thanks! I think I actually got it then | 21:48:52 |
8 May 2025 |
| 98765abc changed their profile picture. | 11:35:04 |
Curid | Redacted or Malformed Event | 19:03:13 |
Curid | Is there a better way to write this?
NIX_CFLAGS_COMPILE = if pkgs.system == "aarch64-unknown-linux-gnu" then "" else "-msse4.2" | 19:14:52 |
K900 | if !stdenv.hostPlatform.isx86 | 19:17:58 |
K900 | Or rather | 19:18:10 |
K900 | lib.optionalString stdenv.hostPlatform.isx86 "-msse4.2" | 19:18:21 |
9 May 2025 |
Curid | let
# latest unstable
pkgs = (import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/b3582c75c7f21ce0b429898980eddbbf05c68e55.tar.gz")
{
crossSystem = "aarch64-unknown-linux-gnu";
}).__splicedPackages;
in pkgs.mkShell {
buildInputs = [ pkgs.cpuid ];
}
src/x86/cpuid.c:138:10: fatal error: cpuid.h: No such file or directory
138 | #include <cpuid.h>
It seems to build x86 specific files https://github.com/pytorch/cpuinfo/blob/main/CMakeLists.txt
| 16:15:48 |
Tristan Ross |
- Use
packages
- Add
cmake (& optionally ninja ) to packages
| 16:24:51 |
Curid | I'm stupid, the cpuid package has nothing to do with cpuid.h | 16:37:11 |
Curid | 🤔
> CMake Error at CMakeLists.txt:71 (MESSAGE):
> Unrecognized CMAKE_SYSTEM_PROCESSOR value "x86_64"
https://github.com/google/XNNPACK/blob/659147817805d17c7be2d60bd7bbca7e780f9c82/CMakeLists.txt#L71
| 18:30:29 |
10 May 2025 |
Curid | How can I tell mkDerivation that the CMakeLists.txt isn't in the root dir? https://github.com/google/gemmlowp/tree/master/contrib | 17:16:18 |
Curid | I'd ask in the main room if I could join it | 17:16:23 |
K900 | sourceRoot | 17:16:35 |
K900 | Also invited to the main room | 17:16:50 |
11 May 2025 |
Curid | is cmake message(${CMAKE_SYSTEM_PROCESSOR}) suppose to print x86_64 ? | 08:04:19 |
Curid |
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 | Redacted or Malformed Event | 19:16:46 |
Curid | I 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 | should I upstream it? | 19:33:39 |
emily | I don't know if you need those patches? | 19:35:55 |
emily | I'm pretty sure you can point CMake to the right place with flags | 19:36:14 |
emily | or at least inject stuff into the right paths, not sure | 19:36:25 |
12 May 2025 |
Curid | ./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 | https://github.com/tensorflow/tensorflow/blob/v2.12.1/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake | 16:57:37 |
Curid | * ./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 | * ./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 |