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

Building in parallel fails #210

Closed
zorun opened this issue May 14, 2017 · 2 comments
Closed

Building in parallel fails #210

zorun opened this issue May 14, 2017 · 2 comments

Comments

@zorun
Copy link

zorun commented May 14, 2017

When running make in parallel on a large number of CPU, the build fails:

$ make -j16
Building with optimizations for native
rm -f argon2 bench genkat
rm -f libargon2.so libargon2.a kat-argon2*
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -std=c89 -pthread -O3 -Wall -g -Iinclude -Isrc -march=native -Wl,-O1,--sort-common,--as-needed,-z,relro src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c src/opt.c src/run.c -o argon2
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -std=c89 -pthread -O3 -Wall -g -Iinclude -Isrc -march=native -shared -fPIC -fvisibility=hidden -DA2_VISCTL=1 -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-soname,libargon2.so.0 src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c src/opt.c -o libargon2.so
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -std=c89 -pthread -O3 -Wall -g -Iinclude -Isrc -march=native -D_FORTIFY_SOURCE=2  -c -o src/argon2.o src/argon2.c
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -std=c89 -pthread -O3 -Wall -g -Iinclude -Isrc -march=native -D_FORTIFY_SOURCE=2  -c -o src/core.o src/core.c
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -std=c89 -pthread -O3 -Wall -g -Iinclude -Isrc -march=native -D_FORTIFY_SOURCE=2  -c -o src/blake2/blake2b.o src/blake2/blake2b.c
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -std=c89 -pthread -O3 -Wall -g -Iinclude -Isrc -march=native -D_FORTIFY_SOURCE=2  -c -o src/thread.o src/thread.c
rm -f testcase
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -std=c89 -pthread -O3 -Wall -g -Iinclude -Isrc -march=native -D_FORTIFY_SOURCE=2  -c -o src/encoding.o src/encoding.c
rm -rf *.dSYM
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -std=c89 -pthread -O3 -Wall -g -Iinclude -Isrc -march=native -D_FORTIFY_SOURCE=2  -c -o src/opt.o src/opt.c
cd src/ && rm -f *.o
cd src/blake2/ && rm -f *.o
cd kats/ &&  rm -f kat-* diff* run_* make_*
ar rcs libargon2.a src/argon2.o src/core.o src/blake2/blake2b.o src/thread.o src/encoding.o src/opt.o
ar: src/argon2.o: No such file or directory
make: *** [Makefile:124: libargon2.a] Error 1
make: *** Waiting for unfinished jobs....

The issue is that the default target is all: clean $(RUN) libs, which means that clean is executed in parallel with the actual compilation, as demonstrated by the log above.

A solution would be to remove clean from the all target (is it really useful?), or update the README to point to this issue.

@Leont
Copy link
Contributor

Leont commented May 14, 2017

Yeah, such a construct is very problematic. It also goes against a central the idea of make: that of doing work only when necessary.

@khovratovich
Copy link
Member

Thank you for pointing this out! Please suggest a PR for this.

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

3 participants