fatal error: stdatomic.h: No such file or directory #13

Closed
jramos opened this Issue Sep 3, 2016 · 6 comments

Projects

None yet

4 participants

@jramos
Contributor
jramos commented Sep 3, 2016

Having trouble building this on Ubuntu 14.04.

$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
Copyright (C) 2013 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.

$ make -j8
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 crypto/aesb.c -o crypto/aesb.o
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 crypto/aesb-x86-impl.c -o crypto/aesb-x86-impl.o
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 crypto/c_blake256.c -o crypto/c_blake256.o
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 crypto/c_groestl.c -o crypto/c_groestl.o
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 crypto/c_keccak.c -o crypto/c_keccak.o
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 crypto/c_jh.c -o crypto/c_jh.o
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 crypto/c_skein.c -o crypto/c_skein.o
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 crypto/oaes_lib.c -o crypto/oaes_lib.o
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 -maes cryptonight.c -o cryptonight.o
cryptonight.c: In function ‘cryptonight_hash_aesni’:
cryptonight.c:381:18: warning: initialization from incompatible pointer type [enabled by default]
  uint64_t *dst = &ctx->long_state[c[0] & 0x1FFFF0];
                  ^
cryptonight.c:424:2: warning: passing argument 1 of ‘keccakf’ from incompatible pointer type [enabled by default]
  keccakf(&ctx->state.hs, 24);
  ^
In file included from cryptonight.c:11:0:
crypto/c_keccak.h:22:6: note: expected ‘uint64_t *’ but argument is of type ‘union hash_state *’
 void keccakf(uint64_t st[25], int norounds);
      ^
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 log.c -o log.o
log.c: In function ‘Log’:
log.c:25:3: warning: format not a string literal and no format arguments [-Wformat-security]
   printf(timebuf);
   ^
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 net.c -o net.o
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 minerutils.c -o minerutils.o
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 gpu.c -o gpu.o
gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O0 -ggdb3 -pthread -c -std=c11 main.c -o main.o
main.c:8:23: fatal error: stdatomic.h: No such file or directory
 #include <stdatomic.h>
                       ^
compilation terminated.
make: *** [all] Error 1

Any idea which packages provide stdatomic.h?

@nerdralph

4.8.4 doesn't have it. Works fine for me with gcc6 on 14.0.4. gcc5 should be fine too.

@jramos
Contributor
jramos commented Sep 4, 2016

Thanks, upgrading to gcc6 worked.

@jramos jramos closed this Sep 4, 2016
@jramos
Contributor
jramos commented Sep 4, 2016

For completeness:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt-get update && \
sudo apt-get install gcc-6 g++-6 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
@sigwo
sigwo commented Sep 4, 2016

Adding sudo apt-get install libjansson-dev

@mattyg2301

Banging my head against the wall here, any help would be greatly appreciated.
Been mining on Windows but would like to give Linux mining a go.
Running Ubuntu 16.04, installed the AMD Pro drivers and the APPSDK3 but I get the below when running make.

gcc -D_POSIX_SOURCE -D_GNU_SOURCE -O2 -s -I/home/wolf/miners/sgminer-builds/sgminer-lin64/include/ -L/home/wolf/miners/sgminer-builds/sgminer-lin64/lib -c -std=c11 crypto/aesb.c -o crypto/aesb.o
gcc: error: crypto/aesb.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 1

gcc --version
gcc (Ubuntu 6.2.0-3ubuntu11~16.04) 6.2.0 20160901
Copyright (C) 2016 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.

cat Makefile
CC = gcc
LD = gcc
OPT = -O2 -s -I/home/wolf/miners/sgminer-builds/sgminer-lin64/include/ -L/home/wolf/miners/sgminer-builds/sgminer-lin64/lib
CFLAGS = -D_POSIX_SOURCE -D_GNU_SOURCE $(OPT) -c -std=c11
LDFLAGS = -DPTW32_STATIC_LIB $(OPT)
LIBS = -ljansson -lOpenCL -lpthread -ldl

all:
$(CC) $(CFLAGS) crypto/aesb.c -o crypto/aesb.o
$(CC) $(CFLAGS) crypto/aesb-x86-impl.c -o crypto/aesb-x86-impl.o
$(CC) $(CFLAGS) crypto/c_blake256.c -o crypto/c_blake256.o
$(CC) $(CFLAGS) crypto/c_groestl.c -o crypto/c_groestl.o
$(CC) $(CFLAGS) crypto/c_keccak.c -o crypto/c_keccak.o
$(CC) $(CFLAGS) crypto/c_jh.c -o crypto/c_jh.o
$(CC) $(CFLAGS) crypto/c_skein.c -o crypto/c_skein.o
$(CC) $(CFLAGS) crypto/oaes_lib.c -o crypto/oaes_lib.o
$(CC) $(CFLAGS) -maes cryptonight.c -o cryptonight.o
$(CC) $(CFLAGS) log.c -o log.o
$(CC) $(CFLAGS) net.c -o net.o
$(CC) $(CFLAGS) minerutils.c -o minerutils.o
$(CC) $(CFLAGS) gpu.c -o gpu.o
$(CC) $(CFLAGS) main.c -o main.o
$(LD) $(LDFLAGS) crypto/aesb.o crypto/aesb-x86-impl.o crypto/c_blake256.o crypto/c_groestl.o crypto/c_keccak.o crypto/c_jh.o crypto/c_skein.o crypto/oaes_lib.o cryptonight.o log.o net.o minerutils.o gpu.o main.o $(LIBS) -o miner

clean:
rm -f .o crypto/.o miner

@mattyg2301

Never mind, was me being dumb.

When I copied the files over I left out the folder :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment