Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

FTBFS with GCC 13 #1281

Open
marxin opened this issue Jul 1, 2022 · 5 comments
Open

FTBFS with GCC 13 #1281

marxin opened this issue Jul 1, 2022 · 5 comments

Comments

@marxin
Copy link

marxin commented Jul 1, 2022

Fails with:

[   13s] c++ -pthread -std=c++11 -O3 -funroll-loops -DNDEBUG -c src/args.cc
[   13s] src/args.cc: In member function 'int64_t fasttext::Args::getAutotuneModelSize() const':
[   13s] src/args.cc:468:3: error: 'uint64_t' was not declared in this scope
[   13s]   468 |   uint64_t multiplier = 1;
[   13s]       |   ^~~~~~~~
[   13s] src/args.cc:17:1: note: 'uint64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
[   13s]    16 | #include <unordered_map>
[   13s]   +++ |+#include <cstdint>
[   13s]    17 | 
[   13s] src/args.cc:471:5: error: 'multiplier' was not declared in this scope
[   13s]   471 |     multiplier = units[lastCharacter];
[   13s]       |     ^~~~~~~~~~
[   13s] src/args.cc:474:11: error: expected ';' before 'size'
[   13s]   474 |   uint64_t size = 0;
[   13s]       |           ^~~~~
[   13s]       |           ;

due to:
https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes

@marxin
Copy link
Author

marxin commented Jan 24, 2023

May I please ping this?

@CyberTailor
Copy link

GCC 13 is now default in some distros

@colonelwatch
Copy link

GCC 13 is now default in some distros

Just encountered this on my Arch Linux distribution myself, and they had switched a week ago. Until this issue gets resolved, the workaround is to install GCC 12 (might be labelled as the gcc-12 or gcc12 package depending on the distro) and override the default compiler with env CC=gcc-12 <MAKE COMMAND>. With that, I was able to get fasttext Python package.

NiuBlibing added a commit to NiuBlibing/fastText that referenced this issue Jun 16, 2023
Signed-off-by: Tianyue Ren <rentianyue-jk@360shuke.com>
facebook-github-bot pushed a commit that referenced this issue Nov 27, 2023
Summary:
Due to[ header dependency changes](https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes) in GCC 13, we need to include the <cstdint> header.

Pull Request resolved: #1340

Reviewed By: jmp84

Differential Revision: D51602433

Pulled By: alexkosau

fbshipit-source-id: cc9bffb276cb00f1db8ec97a36784c484ae4563a
@mid1221213
Copy link

The change in the PR (#1340) supposed to fix this "bug" is not correct (anymore?) : while compiling src/args.cc using make, I get: src/args.h:16:1: note: 'int64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?

This is probably because args.h is included before cstdint.

@mid1221213
Copy link

Maybe better with the log of the commands used and their output, they are part of a Dockerfile build:

 > [ftbuild 3/5] RUN git clone https://github.com/facebookresearch/fastText.git /tmp/fastText &&   rm -rf /tmp/fastText/.git* &&   mv /tmp/fastText/* / &&   cd / &&   make:                                                                                                                          
0.184 Cloning into '/tmp/fastText'...                                                                                                                                                                                                                                                                 
1.368 c++ -pthread -std=c++17 -march=native -O3 -funroll-loops -DNDEBUG -c src/args.cc                                                                                                                                                                                                                
1.608 In file included from src/args.cc:9:                                                                                                                                                                                                                                                            
1.608 src/args.h:92:3: error: 'int64_t' does not name a type                                                                                                                                                                                                                                          
1.608    92 |   int64_t getAutotuneModelSize() const;
1.608       |   ^~~~~~~
1.608 src/args.h:16:1: note: 'int64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
1.608    15 | #include <vector>
1.608   +++ |+#include <cstdint>
1.608    16 | 
1.642 src/args.cc:456:9: error: no declaration matches 'int64_t fasttext::Args::getAutotuneModelSize() const'
1.642   456 | int64_t Args::getAutotuneModelSize() const {
1.642       |         ^~~~
1.642 src/args.cc:456:9: note: no functions named 'int64_t fasttext::Args::getAutotuneModelSize() const'
1.642 src/args.h:30:7: note: 'class fasttext::Args' defined here
1.642    30 | class Args {
1.642       |       ^~~~
1.688 make: *** [Makefile:30: args.o] Error 1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants