c-script provides the function of script language for c++.
This is made for throwaway, short, and fast programs.
This gives weight to runtime speed for solving image processing problems.
You needs only script to run your program.
Makefile and other build tool are not needed.
This supports following functions.
- Shebang
- Cache : When compiled once, executable cache is used the next time.
- Debugger(gdb,ddd,emacs,VC++) and reasonable compile error message.
- #pragma : Compilation option is controlled by #pragma.
- Image manipulation : This can read and write bmp, jpg and png.
- Matrix function like eigen: This uses blas and lapack.
- Drawing graph funtion by gnuplot
- c++, cuda, c, obj-c and c# are supported.
Set path for root directory of this program.
export PATH=$PATH:program_root
Case1:
c-script my_cpp_program.cpp
Case2:
1.Write script
For example,
#!/usr/bin/env c-script
int
main(){
printf("hello world\n");
return 0;
}
2.Chmod
chmod +x above_cpp_program.cpp
3.Run
./above_cpp_program.cpp
Usage: c-script [options] script-file [script-options]
-no_chk_main disable of main-function-insertion
-nocache compile the program everytime
-d run the program under the gdb
-gdb run the program under the gdb
-ddd run the program under the ddd
-vc run the program under the visual studio
-show output code after preprocess
-cmd output compiler-options
-clean remove cache of both exe and source
#pragma c-script:src "file1" "file2" ..
compile with "file1" "file2" ..
#pragma c-script:opt "additional compile options"
add compile options
#pragma c-script:eval "Run perl-expression"
#pragma c-script:do "Run perl-script"
#pragma c-script:cc "compiler command name(default:g++)"
#pragma c-script:libs "liked library options"
#pragma c-script:no_default_header
init/init.pl
init/suffix_cu.pl
init/suffix_cs.pl
init/suffix_m.pl
$HOME/init.pl
$HOME/.c-script/cache
This runs following steps.
- Read initialization script for reading compilation paramater.
- Generate compiled code (For example, header like '#include' is added.)
- Compile
- Run complied binary