GithubHelp home page GithubHelp logo

Can't compile about demolito HOT 6 CLOSED

iandoug avatar iandoug commented on July 17, 2024
Can't compile

from demolito.

Comments (6)

lucasart avatar lucasart commented on July 17, 2024

As the error message suggest: not a git repository. Did you download it with git clone?

from demolito.

iandoug avatar iandoug commented on July 17, 2024

Whoops, I saw the error message but did not "click" what it meant.... I normally just download the .zip and it works.

Anyway, did a git clone, then default makefile produced this:

~/chess/Demolito (master) $ make
clang -march=native -DPEXT -std=gnu11 -DNDEBUG -O3 -flto -Wfatal-errors -Wall -Wextra -Wshadow -DVERSION="2019-11-03" ./src/*.c -o demolito -s -lm -lpthread
./src/bitboard.c:106:12: fatal error: always_inline function '_pext_u64' requires target feature 'bmi2', but would be inlined into function 'slider_index' that is compiled without support for 'bmi2'
return _pext_u64(occ, mask);
^
1 error generated.
make: *** [makefile:20: all] Error 1

So I tried using gcc instead of clang, which produced this:

~/chess/Demolito (master) $ make
gcc -march=native -DPEXT -std=gnu11 -DNDEBUG -O3 -flto -Wfatal-errors -Wall -Wextra -Wshadow -DVERSION="2019-11-03" ./src/.c -o demolito -s -lm -lpthread
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/immintrin.h:95,
from ./src/bitboard.c:20:
./src/bitboard.c: In function ‘slider_index’:
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/bmi2intrin.h:76:1: error: inlining failed in call to always_inline ‘_pext_u64’: target specific option mismatch
_pext_u64 (unsigned long long __X, unsigned long long __Y)
^~~~~~~~~
compilation terminated due to -Wfatal-errors.
./src/search.c: In function ‘search_go’:
./src/search.c:617:43: warning: cast between incompatible function types from ‘void (
)(Worker )’ {aka ‘void ()(struct )’} to ‘void * ()(void )’ [-Wcast-function-type]
pthread_create(&threads[i], NULL, (void
()(void))iterate, &Workers[i]);
^
./src/uci.c: In function ‘go’:
./src/uci.c:146:34: warning: cast between incompatible function types from ‘int64_t ()()’ {aka ‘long int ()()’} to ‘void * ()(void )’ [-Wcast-function-type]
pthread_create(&Timer, NULL, (void
(
)(void*))search_go, NULL);
^
make: *** [makefile:20: all] Error 1

Is this some issue with my system?

Thanks, Ian

from demolito.

lucasart avatar lucasart commented on July 17, 2024

march=native tells the compiler to auto detect CPU features. It turns out that your CPU doesn't have BMI2 instructions. That's ok, just remove -DPEXT and it should work. Demolito will use a fallback technique called magic bitboards instead of hardware instruction PEXT to compute attacks for sliding pieces. A bit slower, but still quite fast.

I should probably make my makefile smarter, and do the auto detect there. But with somany architectures, OS, compilers, libc, etc. it's a real pain.

from demolito.

lucasart avatar lucasart commented on July 17, 2024

Note that windows compiles are produced automatically with each commit, using appveyor. No need to compile for windows users.

from demolito.

iandoug avatar iandoug commented on July 17, 2024

Thanks, compiles and works.
Did produce these errors:

~/chess/Demolito (master) $ make
gcc -march=native -std=gnu11 -DNDEBUG -O3 -flto -Wfatal-errors -Wall -Wextra -Wshadow -DVERSION="2019-11-03" ./src/.c -o demolito -s -lm -lpthread
./src/search.c: In function ‘search_go’:
./src/search.c:617:43: warning: cast between incompatible function types from ‘void (
)(Worker )’ {aka ‘void ()(struct )’} to ‘void * ()(void )’ [-Wcast-function-type]
pthread_create(&threads[i], NULL, (void
()(void))iterate, &Workers[i]);
^
./src/uci.c: In function ‘go’:
./src/uci.c:146:34: warning: cast between incompatible function types from ‘int64_t ()()’ {aka ‘long int ()()’} to ‘void * ()(void )’ [-Wcast-function-type]
pthread_create(&Timer, NULL, (void
(
)(void*))search_go, NULL);

Cheers, Ian

from demolito.

lucasart avatar lucasart commented on July 17, 2024

Yes, I know. These warnings are benign, and related to non standard function pointer casting, which are correct and done with intent.

from demolito.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.