Home > Enterprise >  Rust project failing to compile trying to link to libomp
Rust project failing to compile trying to link to libomp

Time:12-26

After an update to the new macOS (Ventura 13.1, M1 Pro) version rust project started to crash on build when tries to link libomp. The error on cargo build -vv:

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-arch" "arm64" "/var/folders/_p/tgbl9k457tvbjbpxmb2q3r1m0000gn/T/rustc1sq6Z5/symbols.o" "/Users/vikulikov/projects/{project_path}/target/debug/deps/{project}-ec57ac4e6d4eed12.10102az2qpqlnssx.rcgu.o" "/Users/vikulikov/projects/{project_path}/target/debug/deps/{project}-ec57ac4e6d4eed12.10pmcgcmusc5twvn.rcgu.o" "/Users/vikulikov/projects/{project_path}/target/debug/deps/{project}-ec57ac4e6d4eed12.33ebzcr429zv4r69.rcgu.o" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/deps" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/build/ring-66285374768a0289/out" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/build/clickhouse-rs-cityhash-sys-56b125abd43a1bed/out" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/build/lz4-sys-b41f36414fcf3d57/out" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/build/lightgbm-sys-34cf0c5853566b8c/out/lib" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/build/lightgbm-sys-34cf0c5853566b8c/out" "-L" "/Users/vikulikov/projects/{project_path}/target/debug/build/bzip2-sys-55a2969129b4a854/out/lib" "-L" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librayon-a368ce40113bc0f7.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librayon_core-d9e15259c12109dd.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/lib{project_dir}-c76f044f35528d72.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtracing_loki-d0184819565b7bc6.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsnap-306d8cec31a52cce.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtracing_serde-a73889d4392e2361.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libloki_api-ddd536117f3c02da.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libprost_types-572832ad507f9de0.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libprost-e068f62c28ccc8b2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liborder_stat-25a20551870d634c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpancakeswap-4e0d114d9a2a76be.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers-a219b92e6641dbe1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_middleware-d29117ee6c7944b4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_signers-8eaf51178d999ed1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libeth_keystore-b991f15c61299d1b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libaes-85ce4a53054918f3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libopaque_debug-69d537144a36dc89.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libscrypt-688fa31c4f28c63b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsalsa20-7fa37dfb872be400.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpassword_hash-ee6e3baff74b42c1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpbkdf2-3d9567eefa71c45a.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libctr-f37779e2de156ab2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcipher-56165c31f9471ba2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcoins_bip39-4d851dd8aaf70dac.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpbkdf2-5bb0582222c9e070.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpassword_hash-e0ed827d8e9fd003.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbase64ct-74280d3beea8da8e.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbitvec-9423a5447ef68001.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libradium-a089b6a53f21f784.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcoins_bip32-3a1c2a5c010b854c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbs58-c0142c1f88c6f8b7.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcoins_core-245c3e946073f305.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libblake2-e9ec6e9f373c1ef4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbase64-908fea8ab5c201dd.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libripemd-07f318d495654f0c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbase58check-5df8d10f35a6bee5.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsha2-d597d4e6775fc17f.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libdigest-96df25a861e1e14c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libopaque_debug-c5a545cdb63802d6.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfake_simd-66c05d9faa110044.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libblock_buffer-ca3c152eaf8294ac.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libgeneric_array-4658500995f0dba1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libblock_padding-8c899def0159c457.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbyte_tools-04232adcec1f2ed9.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbase58-61c3db63dadefe01.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbech32-ecfa67b0df0f995e.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_locks-a0acad40751b0c2c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_etherscan-cbcf7d4d7670ce82.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsemver-10e716672a01011f.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libserde_aux-fd3d015d0a4edb77.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_contract-85e3f04ebf35ee9e.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_providers-573f02d8178a7edc.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_timer-fb57d40fad211b41.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtracing_futures-d170a033d12065b3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_addressbook-2a0b7a4a7e07b1d5.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethers_core-0019fb6c6704b519.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libunicode_xid-e7d1530a327bea76.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libstrum-0a5428bb6883f13c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libk256-35436dc2a3673601.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libecdsa-83480df40be69291.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librfc6979-fae22233353d569d.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsignature-2767ee0e150ba21c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libelliptic_curve-82183223f196e8bf.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsec1-0ddd593266f18fbb.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpkcs8-1b692c412fa3ede8.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libspki-9fe5635ab5e0291b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libder-19631b5bae8ff186.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbase16ct-45afe28af36516d3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libgroup-4b637aed44be1a61.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libff-092feacb084533b4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcrypto_bigint-4dceeffb77fde972.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libzeroize-6d1a20a9695545ca.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsyn-a0b333f36cf6933a.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libquote-564fbbf32ce874a1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libproc_macro2-a12129456c79b3ae.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libunicode_ident-2df767b08b5dee4e.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libproc_macro-00b05ec0a97de84e.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libconvert_case-7ad0534d8c5fd8c3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfastrlp-256bc78a1ef74915.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethabi-d8f8b392b37cd582.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethereum_types-0eb195605b40513c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libethbloom-1e54de4eae147b61.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtiny_keccak-0cb69878e52df2f3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libprimitive_types-4f54843cfb523fba.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libimpl_codec-8e47d3c4d0d7172d.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libparity_scale_codec-0d2e9771e57e0938.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbyte_slice_cast-7479fed5ff548fa4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libimpl_serde-6a5277220fa398c6.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libimpl_rlp-da0374252df098bf.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librlp-240681309e2ba0a2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfixed_hash-964906ceb0260a33.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librustc_hex-22afa64d3d0ca991.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsha3-874e48672e2f596d.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libkeccak-ad55d88ffa7ab68c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libuint-3a101f0d60a79d53.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcrunchy-aa9525a478410cd6.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libstatic_assertions-0ff83d9301a80122.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liberased_serde-c1e6cb738a619760.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbinance_{project_dir}-861a3e967128a5d3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libhmac_sha256-06695515fb30ad01.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtokio_native_tls-4c9f6996cf1ea42b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtokio-86cdf7ae56108f25.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsignal_hook_registry-1e2cd83343c3c9db.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libnum_cpus-c7ce2c947fb8cdf4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsocket2-4352fe09b768a757.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libmio-290b15fdaef97a66.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libparking_lot-34cf09bf4119fbd2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libparking_lot_core-d1fa6b2701b27516.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsmallvec-25a503f6c5b2115b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liblock_api-007f4f757f665560.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libscopeguard-e5de70d0869a1c62.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_util-b48bc9683ec1862f.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libmemchr-6c9fbfeda127ffa9.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_io-31c6c3fdbfd7acd1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libslab-875bd9101045b6dd.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_channel-20a3c3a00df83455.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpin_project_lite-ebcedf82ec43c8a1.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_sink-03bac378879c749a.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_task-ee914422cb186d20.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpin_utils-fe0d75987f40efa5.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfutures_core-cf6b91f091126cd4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtungstenite-ca8867ea48f31ee9.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbase64-63d35bb8646f0242.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librand-90b2f68f9b08d326.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librand_chacha-b44402712ed3dace.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libppv_lite86-697eeaf5f72102e4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librand_core-de8033ba78482ef2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libgetrandom-b3a5e67bd72e9479.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libnative_tls-f4934c5623c8a8a9.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtempfile-367f4cfc6447abfe.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfastrand-59e99e6b8d72a8ac.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libremove_dir_all-a13bce8a768cc08e.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsecurity_framework-538b9df5ab088483.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbitflags-6db4b7a1a2354e6b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsecurity_framework_sys-eb98a88952287665.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcore_foundation-ec930b180bb57bc2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liblazy_static-0773c577324b701d.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libutf8-0c5e5daffc553b62.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbyteorder-faf1acd975834e27.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsha1-9f15f43c46c73cd0.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libdigest-5d770a9e9e6ea149.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libsubtle-2e8596ffab1ab75f.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libconst_oid-834c0e0b1604df37.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libblock_buffer-4f4761ca28d48ae4.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcrypto_common-584dd06845a293e9.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libgeneric_array-dc3be67fb5b90830.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtypenum-2b09589daa71d801.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libhttparse-9d194949d06437af.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libthiserror-7ecb4a699b8920d3.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liburl-936a0b47da399149.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libidna-b5faa9c2ece42de8.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libunicode_normalization-1c164c59614d379d.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtinyvec-5417aa7aadc151a2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtinyvec_macros-7959d4d6443a0458.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libunicode_bidi-106b62c41d379400.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libform_urlencoded-49bcd040a7c16576.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libpercent_encoding-477b6fb21f40da87.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liblog-6ddcd53f5312ef38.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcfg_if-f043d77383bd547c.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libhttp-cf4bb2360a1f828f.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libbytes-73183855b42e1e92.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libfnv-a96d0f7e079db9b2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libchrono-08619b9cfb303392.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libiana_time_zone-8212bb41be21572b.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcore_foundation_sys-9b0150f66877fcf2.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libnum_integer-bafe1031ea8e0662.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtime-08e3f249427e3b17.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/liblibc-fc26f4dd5713c66f.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libcapnp-51990ee9b5227c5a.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libtoml-fe00432fe23ba335.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libserde_json-16a6e5424b301f9e.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libryu-5b49562fe5a7a929.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libitoa-1a7b4806aa6816d6.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/librust_decimal-81a1e6b928a08798.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libserde-b10975cd22772c38.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libarrayvec-f160a33dcc17dc71.rlib" "/Users/vikulikov/projects/{project_path}/target/debug/deps/libnum_traits-f8699bb15f4e50a3.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-8b48f6cefff7b1fb.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-77aeaad8f850e496.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-4374cc9e76b48de5.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libmemchr-71ce82846aaede9b.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-88478a43231eec41.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-219a0c42f67a2534.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-967edde4cff44b15.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-5e9bad2c7ec1f53a.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-f2d3de7828f2e1f2.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-39feb0179b2f197f.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libminiz_oxide-fe7523d51d4e2154.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libadler-1fb439e2b08a54ae.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-0ece1873dc3050cd.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-1094a874bdfc7dbb.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-8cd76113b92d6775.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-3a7cb21921429c0e.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-5b42fb3902d391c7.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-b495777441600026.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-cba95c4386a21469.rlib" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-b8f163a13cf94b5d.rlib" "-lc  " "-lomp" "-framework" "CoreFoundation" "-framework" "SystemConfiguration" "-lc  " "-framework" "Security" "-framework" "Security" "-framework" "CoreFoundation" "-liconv" "-lSystem" "-lc" "-lm" "-L" "/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/vikulikov/projects/{project_path}/target/debug/deps/{project}-ec57ac4e6d4eed12" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: ld: library not found for -lomp
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

warning: `{project}` (bin "{project}") generated 63 warnings
error: could not compile `{project}` due to previous error; 63 warnings emitted

Caused by:
  process didn't exit successfully: `CARGO=/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/bin/cargo CARGO_BIN_NAME={project} CARGO_CRATE_NAME={project} CARGO_MANIFEST_DIR=/Users/vikulikov/projects/{project_path} CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME={project} CARGO_PKG_REPOSITORY='' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.10.7 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=10 CARGO_PKG_VERSION_PATCH=7 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 DYLD_FALLBACK_LIBRARY_PATH='/Users/vikulikov/projects/{project_path}/target/debug/deps:/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib:/Users/vikulikov/.rustup/toolchains/stable-aarch64-apple-darwin/lib:/Users/vikulikov/lib:/usr/local/lib:/usr/lib' rustc --crate-name {project} --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=ec57ac4e6d4eed12 -C extra-filename=-ec57ac4e6d4eed12 --out-dir /Users/vikulikov/projects/{project_path}/target/debug/deps -C incremental=/Users/vikulikov/projects/{project_path}/target/debug/incremental -L dependency=/Users/vikulikov/projects/{project_path}/target/debug/deps --extern anyhow=/Users/vikulikov/projects/{project_path}/target/debug/deps/libanyhow-3c4562411ebdf4c7.rlib --extern chrono=/Users/vikulikov/projects/{project_path}/target/debug/deps/libchrono-08619b9cfb303392.rlib --extern crossbeam=/Users/vikulikov/projects/{project_path}/target/debug/deps/libcrossbeam-fd8c6961f76e5aac.rlib --extern csv=/Users/vikulikov/projects/{project_path}/target/debug/deps/libcsv-1e27cf452055291a.rlib --extern itertools=/Users/vikulikov/projects/{project_path}/target/debug/deps/libitertools-b33196f4ae79cd67.rlib --extern {project_dir}=/Users/vikulikov/projects/{project_path}/target/debug/deps/lib{project_dir}-c76f044f35528d72.rlib --extern {project_dir}_core=/Users/vikulikov/projects/{project_path}/target/debug/deps/lib{project_dir}_core-ff32a9a09b2fee14.rlib --extern order_stat=/Users/vikulikov/projects/{project_path}/target/debug/deps/liborder_stat-25a20551870d634c.rlib --extern parking_lot=/Users/vikulikov/projects/{project_path}/target/debug/deps/libparking_lot-34cf09bf4119fbd2.rlib --extern rayon=/Users/vikulikov/projects/{project_path}/target/debug/deps/librayon-a368ce40113bc0f7.rlib --extern rust_decimal=/Users/vikulikov/projects/{project_path}/target/debug/deps/librust_decimal-81a1e6b928a08798.rlib --extern rust_decimal_macros=/Users/vikulikov/projects/{project_path}/target/debug/deps/librust_decimal_macros-67e08731edac8129.dylib --extern serde=/Users/vikulikov/projects/{project_path}/target/debug/deps/libserde-b10975cd22772c38.rlib --extern serde_derive=/Users/vikulikov/projects/{project_path}/target/debug/deps/libserde_derive-60aad29f37dfad23.dylib --extern serde_json=/Users/vikulikov/projects/{project_path}/target/debug/deps/libserde_json-16a6e5424b301f9e.rlib --extern tokio=/Users/vikulikov/projects/{project_path}/target/debug/deps/libtokio-86cdf7ae56108f25.rlib --extern toml=/Users/vikulikov/projects/{project_path}/target/debug/deps/libtoml-fe00432fe23ba335.rlib -L native=/Users/vikulikov/projects/{project_path}/target/debug/build/ring-66285374768a0289/out -L native=/Users/vikulikov/projects/{project_path}/target/debug/build/clickhouse-rs-cityhash-sys-56b125abd43a1bed/out -L native=/Users/vikulikov/projects/{project_path}/target/debug/build/lz4-sys-b41f36414fcf3d57/out -L /Users/vikulikov/projects/{project_path}/target/debug/build/lightgbm-sys-34cf0c5853566b8c/out/lib -L native=/Users/vikulikov/projects/{project_path}/target/debug/build/lightgbm-sys-34cf0c5853566b8c/out -L native=/Users/vikulikov/projects/{project_path}/target/debug/build/bzip2-sys-55a2969129b4a854/out/lib` (exit status: 1)

It needs the lib due to lightgbm-rs lib used in the project. I believe I've already tried all the technics needed for lightgbm to compile from the internet, even reset the OS. Installed the llvm and gcc seperately, etc.

Actions after reset:

# rust installing

brew install cmake libomp lightgbm
brew link --force libomp
cargo build

Maybe it is good to mention that lightgbm and lightgbm-sys libs are successfuly built. And crash is happenning in the very end of the build.

CodePudding user response:

Actually problem occured because homebrew made libomp keg-only. They suggest to add couple of env variables for compilers to find the lib:

For compilers to find libomp you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"

But cargo does not respect LDFLAGS variable. So I've tried to add a RUSTFLAGS variable as:

export RUSTFLAGS=-L/opt/homebrew/opt/libomp/lib

and it worked.

  • Related