Compiling not successfully

Hello fiends, i wanted to compile the program myself. Unfortunately it looked successful
at first, but still i got some warnings and one error and the exe file was not generated. How do i get
rid of the error?

Here is the protocol:

C:\Users\Privat>cargo --version
cargo 1.70.0 (ec8a8a0ca 2023-04-25)

C:\Users\Privat\Desktop\velvet-chess-5.2.1\velvet-chess-5.2.1>cargo build --release
    Updating crates.io index
  Downloaded base64ct v1.5.3
  Downloaded btoi v0.4.2
  Downloaded zip v0.6.3
  Downloaded torch-sys v0.11.0
  Downloaded atty v0.2.14
  Downloaded time-core v0.1.0
  Downloaded tinyvec_macros v0.1.1
  Downloaded cfg-if v1.0.0
  Downloaded rustc-hash v1.1.0
  Downloaded spin v0.5.2
  Downloaded peeking_take_while v0.1.2
  Downloaded textwrap v0.11.0
  Downloaded subtle v2.4.1
  Downloaded rand_core v0.6.4
  Downloaded serde v1.0.152
  Downloaded rustls v0.20.8
  Downloaded twox-hash v1.6.3
  Downloaded untrusted v0.7.1
  Downloaded num-integer v0.1.45
  Downloaded rand_chacha v0.3.1
  Downloaded winapi-util v0.1.5
  Downloaded shlex v1.1.0
  Downloaded clang-sys v1.4.0
  Downloaded crossbeam-deque v0.8.2
  Downloaded password-hash v0.4.2
  Downloaded version_check v0.9.4
  Downloaded zstd-safe v5.0.2+zstd.1.5.2
  Downloaded percent-encoding v2.2.0
  Downloaded unicode-ident v1.0.6
  Downloaded zstd v0.11.2+zstd.1.5.2
  Downloaded generic-array v0.14.6
  Downloaded flate2 v1.0.25
  Downloaded rayon-core v1.10.1
  Downloaded tinyvec v1.6.0
  Downloaded webpki v0.22.0
  Downloaded shakmaty-syzygy v0.18.0
  Downloaded time v0.3.17
  Downloaded url v2.3.1
  Downloaded aho-corasick v0.7.20
  Downloaded unicode-normalization v0.1.22
  Downloaded nom v7.1.3
  Downloaded itertools v0.10.5
  Downloaded minimal-lexical v0.2.1
  Downloaded ureq v2.6.2
  Downloaded rayon v1.6.1
  Downloaded aes v0.7.5
  Downloaded crossbeam-channel v0.5.6
  Downloaded cc v1.0.79
  Downloaded clap v2.34.0
  Downloaded idna v0.3.0
  Downloaded webpki-roots v0.22.6
  Downloaded regex v1.7.0
  Downloaded regex-syntax v0.6.28
  Downloaded ndarray v0.15.6
  Downloaded syn v1.0.107
  Downloaded bindgen v0.64.0
  Downloaded env_logger v0.9.3
  Downloaded crc32fast v1.3.2
  Downloaded base64 v0.13.1
  Downloaded zstd-sys v2.0.5+zstd.1.5.2
  Downloaded sha1 v0.10.5
  Downloaded proc-macro2 v1.0.49
  Downloaded shakmaty v0.20.7
  Downloaded positioned-io-preview v0.3.5
  Downloaded num-traits v0.2.15
  Downloaded matrixmultiply v0.3.2
  Downloaded half v2.2.1
  Downloaded libc v0.2.133
  Downloaded crossbeam-utils v0.8.11
  Downloaded bzip2-sys v0.1.11+1.0.8
  Downloaded unicode-bidi v0.3.13
  Downloaded typenum v1.16.0
  Downloaded libloading v0.7.4
  Downloaded jobserver v0.1.25
  Downloaded crossbeam-epoch v0.9.13
  Downloaded lazy_static v1.4.0
  Downloaded which v4.4.0
  Downloaded vec_map v0.8.2
  Downloaded termcolor v1.1.3
  Downloaded humantime v2.1.0
  Downloaded glob v0.3.1
  Downloaded either v1.8.0
  Downloaded anyhow v1.0.68
  Downloaded strsim v0.8.0
  Downloaded static_assertions v1.1.0
  Downloaded once_cell v1.15.0
  Downloaded tch v0.11.0
  Downloaded winapi v0.3.9
  Downloaded lz4_flex v0.9.5
  Downloaded hmac v0.12.1
  Downloaded getrandom v0.2.7
  Downloaded bzip2 v0.4.4
  Downloaded byteorder v1.4.3
  Downloaded scopeguard v1.1.0
  Downloaded ppv-lite86 v0.2.16
  Downloaded constant_time_eq v0.1.5
  Downloaded num-complex v0.4.2
  Downloaded lazycell v1.3.0
  Downloaded unicode-width v0.1.10
  Downloaded form_urlencoded v1.1.0
  Downloaded digest v0.10.6
  Downloaded crypto-common v0.1.6
  Downloaded cpufeatures v0.2.5
  Downloaded time-macros v0.2.6
  Downloaded thiserror-impl v1.0.38
  Downloaded thiserror v1.0.38
  Downloaded ring v0.16.20
  Downloaded rand v0.8.5
  Downloaded cipher v0.3.0
  Downloaded cexpr v0.6.0
  Downloaded block-buffer v0.10.3
  Downloaded bitflags v1.3.2
  Downloaded autocfg v1.1.0
  Downloaded arrayvec v0.7.2
  Downloaded miniz_oxide v0.6.2
  Downloaded memchr v2.5.0
  Downloaded quote v1.0.23
  Downloaded pkg-config v0.3.26
  Downloaded log v0.4.17
  Downloaded adler v1.0.2
  Downloaded sha2 v0.10.6
  Downloaded sct v0.7.0
  Downloaded rawpointer v0.2.1
  Downloaded pbkdf2 v0.11.0
  Downloaded num_cpus v1.14.0
  Downloaded memoffset v0.7.1
  Downloaded opaque-debug v0.3.0
  Downloaded itoa v1.0.5
  Downloaded 128 crates (16.8 MB) in 50.56s (largest was `ring` at 5.1 MB)
   Compiling jobserver v0.1.25
   Compiling winapi v0.3.9
   Compiling libc v0.2.133
   Compiling typenum v1.16.0
   Compiling cc v1.0.79
   Compiling version_check v0.9.4
   Compiling cfg-if v1.0.0
   Compiling pkg-config v0.3.26
   Compiling generic-array v0.14.6
   Compiling autocfg v1.1.0
   Compiling log v0.4.17
   Compiling memchr v2.5.0
   Compiling zstd-sys v2.0.5+zstd.1.5.2
   Compiling once_cell v1.15.0
   Compiling proc-macro2 v1.0.49
   Compiling unicode-ident v1.0.6
   Compiling quote v1.0.23
   Compiling syn v1.0.107
   Compiling glob v0.3.1
   Compiling crc32fast v1.3.2
   Compiling bzip2-sys v0.1.11+1.0.8
   Compiling ring v0.16.20
   Compiling zstd-safe v5.0.2+zstd.1.5.2
   Compiling clang-sys v1.4.0
   Compiling subtle v2.4.1
   Compiling minimal-lexical v0.2.1
   Compiling nom v7.1.3
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.3
   Compiling aho-corasick v0.7.20
   Compiling libloading v0.7.4
   Compiling bindgen v0.64.0
   Compiling spin v0.5.2
   Compiling untrusted v0.7.1
   Compiling regex-syntax v0.6.28
   Compiling either v1.8.0
   Compiling which v4.4.0
   Compiling cexpr v0.6.0
   Compiling digest v0.10.6
   Compiling num-traits v0.2.15
   Compiling getrandom v0.2.7
   Compiling regex v1.7.0
   Compiling lazycell v1.3.0
   Compiling byteorder v1.4.3
   Compiling shlex v1.1.0
   Compiling bitflags v1.3.2
   Compiling rustc-hash v1.1.0
   Compiling lazy_static v1.4.0
   Compiling cpufeatures v0.2.5
   Compiling tinyvec_macros v0.1.1
   Compiling time-core v0.1.0
   Compiling peeking_take_while v0.1.2
   Compiling time-macros v0.2.6
   Compiling tinyvec v1.6.0
   Compiling rand_core v0.6.4
   Compiling adler v1.0.2
   Compiling miniz_oxide v0.6.2
   Compiling unicode-normalization v0.1.22
   Compiling unicode-bidi v0.3.13
   Compiling rustls v0.20.8
   Compiling percent-encoding v2.2.0
   Compiling base64ct v1.5.3
   Compiling form_urlencoded v1.1.0
   Compiling password-hash v0.4.2
   Compiling idna v0.3.0
   Compiling flate2 v1.0.25
   Compiling itertools v0.10.5
   Compiling sha2 v0.10.6
   Compiling hmac v0.12.1
   Compiling cipher v0.3.0
   Compiling anyhow v1.0.68
   Compiling opaque-debug v0.3.0
   Compiling itoa v1.0.5
   Compiling crossbeam-utils v0.8.11
   Compiling time v0.3.17
   Compiling aes v0.7.5
   Compiling fathomrs v1.0.0 (C:\Users\Privat\Desktop\velvet-chess-5.2.1\velvet-chess-5.2.1\fathomrs)
   Compiling pbkdf2 v0.11.0
   Compiling url v2.3.1
   Compiling sha1 v0.10.5
   Compiling memoffset v0.7.1
   Compiling constant_time_eq v0.1.5
   Compiling base64 v0.13.1
   Compiling ppv-lite86 v0.2.16
   Compiling rand_chacha v0.3.1
   Compiling webpki v0.22.0
   Compiling sct v0.7.0
   Compiling webpki-roots v0.22.6
   Compiling crossbeam-epoch v0.9.13
   Compiling rand v0.8.5
   Compiling atty v0.2.14
   Compiling num-integer v0.1.45
   Compiling scopeguard v1.1.0
   Compiling static_assertions v1.1.0
   Compiling twox-hash v1.6.3
   Compiling ureq v2.6.2
The following warnings were emitted during compilation:

warning: fathom/src/tbprobe.c:196:9: warning: 'max' macro redefined [-Wmacro-redefined]
warning: #define max(a,b) a > b ? a : b
warning:         ^
warning: C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\stdlib.h:1282:17: note: previous definition is here
warning:         #define max(a,b) (((a) > (b)) ? (a) : (b))
warning:                 ^
warning: fathom/src/tbprobe.c:197:9: warning: 'min' macro redefined [-Wmacro-redefined]
warning: #define min(a,b) a < b ? a : b
warning:         ^
warning: C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\stdlib.h:1283:17: note: previous definition is here
warning:         #define min(a,b) (((a) < (b)) ? (a) : (b))
warning:                 ^
warning: fathom/src/tbprobe.c:2459:41: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
warning:   if (popcount(pos->white | pos->black) <= cardinalityDTM) {
warning:       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~
warning: fathom/src/tbprobe.c:2459:7: error: always_inline function '_mm_popcnt_u64' requires target feature 'popcnt', but would be inlined into function 'tb_expand_mate' that is compiled without support for 'popcnt'
warning:   if (popcount(pos->white | pos->black) <= cardinalityDTM) {
warning:       ^
warning: fathom/src/tbprobe.c:125:38: note: expanded from macro 'popcount'
warning: #define popcount(x)             (int)_mm_popcnt_u64((x))
warning:                                      ^
warning: 3 warnings and 1 error generated.

error: failed to run custom build command for `fathomrs v1.0.0 (C:\Users\Privat\Desktop\velvet-chess-5.2.1\velvet-chess-5.2.1\fathomrs)`

Can you help me eliminate the error?

The error is caused when compiling a C file (fathomrs/fathom/src/tbprobe.c). What compiler toolchain are you using? You can find out by running rustup toolchain list at a command line.

1 Like

This:

C:\Users\Privat>rustup toolchain list
stable-x86_64-pc-windows-msvc (default)

C:\Users\Privat>

You can try going to fathomrs/fathom/src/tbprobe.c. On Line 118, change

#undef TB_SOFTWARE_POP_COUNT

to

#define TB_SOFTWARE_POP_COUNT

and try re-compiling:

cargo clean
cargo build --release

You need to build the project with the right compiler flags: velvet-chess/.github/workflows/release.yml at ccfe1adf6261a50d84172ad8ca4f30ca4f57c0b2 · mhonert/velvet-chess · GitHub

E.g. if your CPU supports the AVX2 instruction set, you would build it like this (in bash):

$ RUSTFLAGS='-Ctarget-feature=+crt-static,-bmi2 -Ctarget-cpu=x86-64-v3' CFLAGS='-march=x86-64-v3' cargo build --release

Or like this in cmd:

> set RUSTFLAGS=-Ctarget-feature=+crt-static,-bmi2 -Ctarget-cpu=x86-64-v3
> set CFLAGS=-march=x86-64-v3
> cargo build --release

You will still get the warnings, but the error will go away.

Many, many thanks. :slight_smile: It worked like that, but for me it was a different line, #114.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.