Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
NUM_NODES = 10
WORLD_SIZE = 1000

COMMON_CFLAGS = -g -std=gnu99 -O2 -mcpu=native -fomit-frame-pointer -Wall -Wextra
COMMON_CFLAGS = -std=gnu99 -O2 -march=native -fomit-frame-pointer -Wall -Wextra
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-march=native is not equivalent to -mcpu=native. It needs to be -march=native -mtune=native.

Copy link
Copy Markdown
Author

@bjourne bjourne Jun 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

@lgeek lgeek Jun 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not documented to work like that in the GCC ARM docs. Also, the options accepted by -march are generic architectures, while the options accepted by -mtune are specific cores.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But previously the makefile didn't even specify -mtune. -march at least implies -mcpu.


buildall: c_fast c_fast_arm f03 c fsharp cpp_gcc cpp_clang cpp_cached racket csharp java haskell ocaml lisp rust rust_unsafe go gccgo d nim oraclejava crystal

clean:
rm -f c_fast_arm c_fast f03 fs.exe cpp_gcc cpp_clang cpp_plain cpp_cached \
cs.exe jv.class hs ml lisp rs rs_unsafe go gccgo d nim crystal d \
c
# C targets
c: c.c
$(CC) $(COMMON_CFLAGS) c.c -o c -DUSE_HIGHBIT

c_fast_arm: c_fast.c
gcc -marm -falign-functions=32 $(COMMON_CFLAGS) c_fast.c -o ./c_fast_arm
$(CC) -marm -falign-functions=32 $(COMMON_CFLAGS) c_fast.c -o ./c_fast_arm

c_fast: c_fast.c
gcc -falign-functions=32 $(COMMON_CFLAGS) c_fast.c -o ./c_fast
$(CC) -falign-functions=32 $(COMMON_CFLAGS) c_fast.c -o ./c_fast
Copy link
Copy Markdown
Contributor

@lgeek lgeek Jun 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compiler was hardcoded to gcc on purpose, because I haven't evaluated or optimised clang's output for this implementation and therefore the code or flags might need some tweaks to achieve the optimum performance. I don't insist on keeping it that way, but maybe adding a comment about that would be in order.


# Other
f03: f03.f03
gfortran -O2 -mcpu=native f03.f03 -o f03

Expand All @@ -34,9 +38,6 @@ cpp_plain: cpp_plain.cpp
cpp_cached: cpp_cached.cpp
clang++ cpp_cached.cpp -std=c++14 -Wall -O2 -mcpu=native -o cpp_cached

c: c.c
gcc $(COMMON_CFLAGS) c.c -o c -DUSE_HIGHBIT

racket: rkt.rkt
raco exe rkt.rkt

Expand Down