Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ビルド時にエラー #6

Closed
Asari-Science opened this issue Dec 24, 2022 · 2 comments
Closed

ビルド時にエラー #6

Asari-Science opened this issue Dec 24, 2022 · 2 comments

Comments

@Asari-Science
Copy link

手元のUbuntu環境でビルドすることができません。

実行環境

$ g++ --version
g++ (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

以下の手順でコンパイルを試みたところ、以下のようなエラーになりました。

$ cd Egaroucid/src/
$  g++ -O2 Egaroucid_console.cpp -o Egaroucid_for_console.exe -mtune=native -march=native -mfpmath=both -pthread -std=c++17 -Wall -Wextra 

In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:47,
                 from /usr/lib/gcc/x86_64-linux-gnu/11/include/x86intrin.h:32,
                 from engine/bit_simd.hpp:17,
                 from engine/bit.hpp:16,
                 from engine/mobility_simd.hpp:13,
                 from engine/mobility.hpp:14,
                 from engine/board.hpp:14,
                 from engine/midsearch.hpp:18,
                 from engine/ai.hpp:17,
                 from engine/engine_all.hpp:12,
                 from Egaroucid_console.cpp:12:
/usr/lib/gcc/x86_64-linux-gnu/11/include/avx2intrin.h: In function ‘u64_4 operator>>(u64_4, size_t)’:
/usr/lib/gcc/x86_64-linux-gnu/11/include/avx2intrin.h:787:1: error: inlining failed in call to ‘always_inline’ ‘__m256i _mm256_srli_epi64(__m256i, int)’: target specific option mismatch
  787 | _mm256_srli_epi64 (__m256i __A, int __B)
      | ^~~~~~~~~~~~~~~~~
In file included from engine/bit.hpp:16,
                 from engine/mobility_simd.hpp:13,
                 from engine/mobility.hpp:14,
                 from engine/board.hpp:14,
                 from engine/midsearch.hpp:18,
                 from engine/ai.hpp:17,
                 from engine/engine_all.hpp:12,
                 from Egaroucid_console.cpp:12:
engine/bit_simd.hpp:129:41: note: called from here
  129 |     return _mm256_srli_epi64(lhs.data, n);
      |                                         ^
In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:47,
                 from /usr/lib/gcc/x86_64-linux-gnu/11/include/x86intrin.h:32,
                 from engine/bit_simd.hpp:17,
                 from engine/bit.hpp:16,
                 from engine/mobility_simd.hpp:13,
                 from engine/mobility.hpp:14,
                 from engine/board.hpp:14,
                 from engine/midsearch.hpp:18,
                 from engine/ai.hpp:17,
                 from engine/engine_all.hpp:12,
                 from Egaroucid_console.cpp:12:
/usr/lib/gcc/x86_64-linux-gnu/11/include/avx2intrin.h:787:1: error: inlining failed in call to ‘always_inline’ ‘__m256i _mm256_srli_epi64(__m256i, int)’: target specific option mismatch
  787 | _mm256_srli_epi64 (__m256i __A, int __B)
      | ^~~~~~~~~~~~~~~~~
In file included from engine/bit.hpp:16,
                 from engine/mobility_simd.hpp:13,
                 from engine/mobility.hpp:14,
                 from engine/board.hpp:14,
                 from engine/midsearch.hpp:18,
                 from engine/ai.hpp:17,
                 from engine/engine_all.hpp:12,
                 from Egaroucid_console.cpp:12:
engine/bit_simd.hpp:129:41: note: called from here
  129 |     return _mm256_srli_epi64(lhs.data, n);
      |                                         ^

@Nyanyan
Copy link
Owner

Nyanyan commented Dec 24, 2022

おそらくAVX2(相当)命令が使えないCPUのようですので、コンパイルオプションに以下を追加してみてください。

-DHAS_NO_AVX2

@Asari-Science
Copy link
Author

ビルドできました。ありがとうございました。

@Nyanyan Nyanyan closed this as completed Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants