diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index 71ec68575f876..66158b413688e 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -21,6 +21,13 @@ jobs: done displayName: Manage disk space + - script: | + sudo fallocate -l 10GiB /swapfile || true + sudo chmod 600 /swapfile || true + sudo mkswap /swapfile || true + sudo swapon /swapfile || true + displayName: Create swap file + - script: | # sudo pip install --upgrade pip sudo pip install setuptools shyaml diff --git a/recipes/ensmallen/0001-No-zig.patch b/recipes/ensmallen/0001-No-zig.patch new file mode 100644 index 0000000000000..2779b7e3bffc0 --- /dev/null +++ b/recipes/ensmallen/0001-No-zig.patch @@ -0,0 +1,26 @@ +From 53b57c79a209cd3ce3cd486f0a5864d27f3f6f0e Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Fri, 5 Jan 2024 17:23:52 +0530 +Subject: [PATCH] No zig + +--- + bindings/python/build.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/bindings/python/build.py b/bindings/python/build.py +index 12c3ae73..73bf2840 100644 +--- a/bindings/python/build.py ++++ b/bindings/python/build.py +@@ -117,6 +117,9 @@ def compile_target(target_name, target_settings, WHEELS_FOLDER, settings): + "CFLAGS": "-stdlib=libc++" + } + ++ zig = "" ++ env = {} ++ + env["RUSTFLAGS"] = env.get("RUST_FLAGS", "") + " " + rust_flags + + environment = os.environ.copy() +-- +2.42.0 + diff --git a/recipes/ensmallen/0001-Use-thin-lto.patch b/recipes/ensmallen/0001-Use-thin-lto.patch new file mode 100644 index 0000000000000..2d80a8a31b395 --- /dev/null +++ b/recipes/ensmallen/0001-Use-thin-lto.patch @@ -0,0 +1,41 @@ +From ff396cead32151e3013d6f05124c0602ce8b3e9c Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Thu, 18 Jan 2024 08:15:56 -0600 +Subject: [PATCH] Use thin lto + +When fat lto is used, the compiler takes too much memory and the OS +kills rustc. Thanks to @mbargull for the tip. +--- + bindings/python/Cargo.toml | 2 +- + graph/Cargo.toml | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml +index 8efa26b4..c241c6c4 100644 +--- a/bindings/python/Cargo.toml ++++ b/bindings/python/Cargo.toml +@@ -60,7 +60,7 @@ opt-level = 3 + # time. + # Perform "fat" LTO which attempts to perform optimizations across all crates + # within the dependency graph +-lto = "fat" ++lto = "thin" + + # When a crate is split into multiple codegen units, LLVM is able to process + # them in parallel. Increasing parallelism may speed up compile times, but may +diff --git a/graph/Cargo.toml b/graph/Cargo.toml +index bd43fe40..345662b9 100644 +--- a/graph/Cargo.toml ++++ b/graph/Cargo.toml +@@ -73,7 +73,7 @@ windows = { version = "0.32.0", features = ["alloc", "Win32_System_Memory", "Wi + + [profile.release] + opt-level = 3 +-lto = "fat" ++lto = "thin" + overflow-checks = false # Disable integer overflow checks. + debug = false # Include debug info. + debug-assertions = false # Enables debug assertions. +-- +2.42.0 + diff --git a/recipes/ensmallen/conda-forge.yml b/recipes/ensmallen/conda-forge.yml new file mode 100644 index 0000000000000..d61bbbc81ec9b --- /dev/null +++ b/recipes/ensmallen/conda-forge.yml @@ -0,0 +1,3 @@ +azure: + settings_linux: + swapfile_size: "10GiB" diff --git a/recipes/ensmallen/conda_build_config.yaml b/recipes/ensmallen/conda_build_config.yaml new file mode 100644 index 0000000000000..faf0fb7e41fb6 --- /dev/null +++ b/recipes/ensmallen/conda_build_config.yaml @@ -0,0 +1,2 @@ +channel_sources: +- conda-forge/label/rust_dev,conda-forge diff --git a/recipes/ensmallen/meta.yaml b/recipes/ensmallen/meta.yaml new file mode 100644 index 0000000000000..91c7240cd9ee6 --- /dev/null +++ b/recipes/ensmallen/meta.yaml @@ -0,0 +1,67 @@ +{% set version = "0.8.96" %} + +package: + name: ensmallen_graph + version: {{ version }} + +source: + # There's no github tag, but this is the commit used for PyPI publishing + # See https://github.com/AnacletoLAB/ensmallen/issues/226 + url: https://github.com/AnacletoLAB/ensmallen/archive/b2492e02dfdb9a7a10ca087d53b3207aadca3b9c.tar.gz + sha256: 044e1ac0cd53f1ec39744f7984a341e27a6c7a80850e3d23934ff2a41e8159c4 + patches: + - 0001-No-zig.patch + - 0001-Use-thin-lto.patch + +build: + script: + - cd bindings/python + - cargo-bundle-licenses --format yaml --output ${SRC_DIR}/THIRDPARTY.yml + - {{ PYTHON }} ./build.py --skip-repair + - {{ PYTHON }} -m pip install wheels/*.whl + number: 0 + skip: True # [not linux64] + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - {{ compiler('rust') }} + - cargo-bundle-licenses + host: + - python + - maturin + - pip + run: + - python + - toml >=0.10.0 + - downloaders >=1.0.15 + - compress_json >=1.0.7 + - userinput >=1.0.19 + - cache_decorator >=2.1.11 + - bioregistry >=0.5.65 + - tqdm + - pandas + - py-cpuinfo + - environments_utils >=1.0.13 + +test: + imports: + - ensmallen + commands: + - pip check + requires: + - pip + +about: + home: https://github.com/AnacletoLAB/ensmallen + summary: Ensmallen is the Rust/Python high-performance graph processing submodule of the GRAPE library. + license: MIT + license_file: + - LICENSE + - THIRDPARTY.yml + +extra: + recipe-maintainers: + - isuruf + - dillonroach