Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Automatically exported from code.google.com/p/sim-universal-construction

License

Notifications You must be signed in to change notification settings

sandeep007734/sim-universal-construction

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sim-universal-construction

Automatically exported from code.google.com/p/sim-universal-construction

Running the Code on a x86 machine:

There is a shell script given to compile the code of your choice.
File that we will be focussing on is : simstack.c

Now running the command

./bench.sh simstack.c

gives error. What a surprise !! Digging some deep gives the comand use for compilation, which was failing. Command is:

gcc simstack.c -Wall -O3 -msse3 -ftree-vectorize -ftree-vectorizer-verbose=0 -finline-functions -lpthread -march=native -mtune=native -DN_THREADS=$2 -DUSE_CPUS=$3 -D_GNU_SOURCE -pipe -lm

gcc -Wall -pthread simstack.c

This is working

gcc -pthread -D_GNU_SOURCE simstack.c

Meaning of each of the flags passed:

  • Wall
    • This enables all the compilers warning messages.
  • O3
    • This enables the level 3 of the optimizations to be done while compiling the code. More info here.
  • msse3
    • This enables the Streaming SIMD Extensions, instruction set for the x86 and x86-64 architecture. These are useful in multimedia, gaming and other floating point intensive computing tasks.
  • ftree-vectorize
    • No need to do this independently. As per the new rules, this is enabled by default under O3.
  • ftree-vectorizer-verbose
    • This is level of the verbosity. This has been deprecated in the latest versions for the flag -fopt-info-vec.
  • finline-functions
    • This is enabled by default the optimization level O.
  • lpthread
    • pthread flag asks the comiler to link the pthread library as well as configure the compilation for the threads.
    • lpthread does the same thing, except the pre-defined macros do not get defined.
    • If possible use the pthread instead of lpthread.
  • march
    • Indeicates the instruction set that can be used by the compiler.
  • mtune
    • Tune the code according to the architecture type specified.
  • DN_THREADS *
  • DUSE_CPUS
  • D_GNU_SOURCE
  • pipe
    • This specifies using pipes for communications between the stages of compiling instead of using temporary files.
  • lm

About

Automatically exported from code.google.com/p/sim-universal-construction

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 92.0%
  • Objective-C 2.6%
  • Makefile 2.1%
  • C++ 1.7%
  • Shell 1.6%