git clone https://github.com/gg-dev-05/compile.git
cd compile
chmod +x code.sh
You can also add an alias for this script to run it from any directory
for eg. add this to your .bashrc file
alias runc="YOUR_PATH_TO_THIS_SCRIPT/./code.sh"
./code.sh [options...] [args...]
Available Options:
-h display help
-l use -lpthread flag while compiling
-d don't delete the compiled file
-m compile using mpi
-f specify input file"
foo@bar:~$ ./code.sh -f main.c
Input File : main.c
C File
compiling main
gcc main.c -o main
===============
running main.c
===============
HELLO WORLD
foo@bar:~$ ./code.sh -lf main.c
using lpthread flag
Input File : main.c
C File
compiling main
gcc main.c -o main -lpthread
===============
running main.c
===============
HELLO WORLD
foo@bar:~$ ./code.sh -mf main.c
Input File : main.c
C File
compiling main
mpicc main.c -o main
===============
running main.c
===============
Enter no. of processors: 2
HELLO WORLD
HELLO WORLD