From a7df5de73bdaeaf739c35d0268289ec53a3128f8 Mon Sep 17 00:00:00 2001 From: Weilei Zeng Date: Tue, 14 Apr 2020 19:43:20 -0700 Subject: [PATCH] rename .c to .cpp to avoid semantic warning --- .vscode/c_cpp_properties.json | 30 ++++++++++++++++++++++-- .vscode/settings.json | 2 +- .vscode/tasks.json | 33 ++++++++++++++++++++++++++ makefile | 35 ++++++++++++++-------------- hpcc_makefile => makefile_cherenkov | 33 +++++++++++++------------- my_bp4.c => my_bp4.cpp | 1 + my_bp4.out | Bin 2785288 -> 2785280 bytes 7 files changed, 97 insertions(+), 37 deletions(-) create mode 100644 .vscode/tasks.json rename hpcc_makefile => makefile_cherenkov (75%) rename my_bp4.c => my_bp4.cpp (97%) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 3d22904..8a42946 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -3,13 +3,39 @@ { "name": "Linux", "includePath": [ - "${workspaceFolder}/**" + "${workspaceFolder}/**", + "~/working/weilei_lib", + "/opt/linux/centos/7.x/x86_64/pkgs/gdal/2.1.3/include", + "/opt/linux/centos/7.x/x86_64/pkgs/ggobi/2.1.11/include/ggobi", + "/opt/linux/centos/7.x/x86_64/pkgs/R/3.6.0/lib64/R/include", + "/opt/linux/centos/7.x/x86_64/pkgs/openmpi/4.0.1-slurm-19.05.0/include", + "/opt/linux/centos/7.x/x86_64/pkgs/itpp/4.3.1/include", + "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5", + "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux", + "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward", + "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include", + "/usr/local/include", + "/usr/include" ], "defines": [], - "compilerPath": "/usr/bin/gcc", + "compilerPath": "/usr/bin/g++", "cStandard": "c11", "cppStandard": "c++14", "intelliSenseMode": "clang-x64" + }, + { + "name": "vscpp", + "includePath": [ + "${workspaceFolder}/**", + "~/working/weilei_lib" + ], + "defines": [], + "compilerPath": "/usr/bin/gcc", + "cStandard": "c11", + "cppStandard": "c++14", + "intelliSenseMode": "clang-x64", + "compilerArgs": [], + "configurationProvider": " ms-vscode.cmake-tools" } ], "version": 4 diff --git a/.vscode/settings.json b/.vscode/settings.json index cdbd9ed..6107323 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "editor.fontSize": 14 + "editor.fontSize": 16 } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..65575d7 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,33 @@ +{ + "tasks": [ + { + "type": "shell", + "label": "gcc build active file", + "command": "/usr/bin/gcc", + "args": [ + "-g", + "${file}", + "-o", + "${fileDirname}/${fileBasenameNoExtension}" + ], + "options": { + "cwd": "/usr/bin" + } + }, + { + "type": "shell", + "label": "g++ build active file", + "command": "/usr/bin/g++", + "args": [ + "-g", + "${file}", + "-o", + "${fileDirname}/${fileBasenameNoExtension}" + ], + "options": { + "cwd": "/usr/bin" + } + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/makefile b/makefile index 1b8be93..31a29da 100644 --- a/makefile +++ b/makefile @@ -1,28 +1,29 @@ -#CXX=g++ -g -Wall #for debug mode -CXX=g++ -O3 -Wall -std=c++11 -pthread -### -O2 -O5 -Os -#g++ `pkg-config --cflags itpp` -o hello.out hello.cpp `pkg-config --libs itpp` +opt = -O3 +### -O2 -O5 -Os +pkgs = -L/opt/linux/centos/7.x/x86_64/pkgs +itpp=${pkgs}/itpp/4.3.1/lib/ -litpp +# INC_DIR=weilei_lib +# CXX = g++ -Wall -g -m64 -std=c++0x ${opt} ${itpp} +CXX = g++ -Wall -g -m64 -std=c++11 -pthread ${opt} ${itpp} +CMD= -lm -lgmpxx -lgmp +INC_DIR=~/working/weilei_lib +# INC_DIR=../../weilei_lib +files=$(INC_DIR)/mm_read.c $(INC_DIR)/mm_read.h $(INC_DIR)/mmio.c $(INC_DIR)/mmio.h $(INC_DIR)/mm_write.c $(INC_DIR)/mm_write.h $(INC_DIR)/lib.cpp $(INC_DIR)/lib.h $(INC_DIR)/dist.c $(INC_DIR)/dist.h $(INC_DIR)/concatenation_lib.c $(INC_DIR)/concatenation_lib.h $(INC_DIR)/bp.c $(INC_DIR)/bp.h $(INC_DIR)/bp_decoder.h $(INC_DIR)/my_lib.h makefile +# command=$(CXX) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $^) $(word 10, $^) $(CMD) + +# command=$(CXX) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $(CMD) + +command=$(CXX) -I $(INC_DIR) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $^) $(word 10, $^) $(word 12, $^) $(word 14, $^) $(word 15, $^) $(CMD) ; echo finish making -START=`pkg-config --cflags itpp` -END=`pkg-config --libs itpp` -#files=mm_read.c mm_read.h mmio.c mmio.h mm_write.c mm_write.h lib.cpp lib.h my_lib.h makefile -#command=$(CXX) $(START) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $^) $(END) -#update: -INC_DIR=~/working/weilei_lib -files=$(INC_DIR)/mm_read.c $(INC_DIR)/mm_read.h $(INC_DIR)/mmio.c $(INC_DIR)/mmio.h $(INC_DIR)/mm_write.c $(INC_DIR)/mm_write.h $(INC_DIR)/lib.cpp $(INC_DIR)/lib.h $(INC_DIR)/dist.c $(INC_DIR)/dist.h $(INC_DIR)/concatenation_lib.c $(INC_DIR)/concatenation_lib.h $(INC_DIR)/bp.c $(INC_DIR)/bp.h $(INC_DIR)/bp_decoder.h $(INC_DIR)/my_lib.h makefile -#command=$(CXX) -I../../weilei_lib $(START) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $^) $(word 10, $^) $(word 12, $^) $(word 14, $^) $(END) -command=$(CXX) -I $(INC_DIR) $(START) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $^) $(word 10, $^) $(word 12, $^) $(word 14, $^) $(word 15, $^) $(END) ; echo finish making -#the last one is my_lib.h all: parserTest.out ldpcTest.out test.out alist_test.out -###include all headfiles into my_lib.h -#pattern_observer.out:pattern_observer.c mm_read.c mm_read.h mmio.c mmio.h mm_write.c mm_write.h lib.cpp lib.h my_lib.h makefile + partial_sum.out:partial_sum.c $(files) $(command) @@ -36,7 +37,7 @@ my_bp2.out:my_bp2.c $(files) $(command) my_bp3.out:my_bp3.c $(files) $(command) -my_bp4.out:my_bp4.c $(files) +my_bp4.out:my_bp4.cpp $(files) $(command) #bp_decoding3.out:bp_decoding3.c mm_read.c mm_read.h mmio.c mmio.h mm_write.c mm_write.h lib.cpp lib.h my_lib.h makefile bp_decoding3.out:bp_decoding3.c $(files) diff --git a/hpcc_makefile b/makefile_cherenkov similarity index 75% rename from hpcc_makefile rename to makefile_cherenkov index f83dbb3..1b8be93 100644 --- a/hpcc_makefile +++ b/makefile_cherenkov @@ -1,29 +1,28 @@ -opt = -O3 -### -O2 -O5 -Os -pkgs = -L/opt/linux/centos/7.x/x86_64/pkgs -itpp=${pkgs}/itpp/4.3.1/lib/ -litpp -# INC_DIR=weilei_lib -# CXX = g++ -Wall -g -m64 -std=c++0x ${opt} ${itpp} -CXX = g++ -Wall -g -m64 -std=c++11 -pthread ${opt} ${itpp} -CMD= -lm -lgmpxx -lgmp +#CXX=g++ -g -Wall #for debug mode +CXX=g++ -O3 -Wall -std=c++11 -pthread +### -O2 -O5 -Os +#g++ `pkg-config --cflags itpp` -o hello.out hello.cpp `pkg-config --libs itpp` -INC_DIR=~/working/weilei_lib -# INC_DIR=../../weilei_lib -files=$(INC_DIR)/mm_read.c $(INC_DIR)/mm_read.h $(INC_DIR)/mmio.c $(INC_DIR)/mmio.h $(INC_DIR)/mm_write.c $(INC_DIR)/mm_write.h $(INC_DIR)/lib.cpp $(INC_DIR)/lib.h $(INC_DIR)/dist.c $(INC_DIR)/dist.h $(INC_DIR)/concatenation_lib.c $(INC_DIR)/concatenation_lib.h $(INC_DIR)/bp.c $(INC_DIR)/bp.h $(INC_DIR)/bp_decoder.h $(INC_DIR)/my_lib.h makefile - -# command=$(CXX) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $^) $(word 10, $^) $(CMD) - -# command=$(CXX) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $(CMD) -command=$(CXX) -I $(INC_DIR) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $^) $(word 10, $^) $(word 12, $^) $(word 14, $^) $(word 15, $^) $(CMD) ; echo finish making +START=`pkg-config --cflags itpp` +END=`pkg-config --libs itpp` +#files=mm_read.c mm_read.h mmio.c mmio.h mm_write.c mm_write.h lib.cpp lib.h my_lib.h makefile +#command=$(CXX) $(START) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $^) $(END) +#update: +INC_DIR=~/working/weilei_lib +files=$(INC_DIR)/mm_read.c $(INC_DIR)/mm_read.h $(INC_DIR)/mmio.c $(INC_DIR)/mmio.h $(INC_DIR)/mm_write.c $(INC_DIR)/mm_write.h $(INC_DIR)/lib.cpp $(INC_DIR)/lib.h $(INC_DIR)/dist.c $(INC_DIR)/dist.h $(INC_DIR)/concatenation_lib.c $(INC_DIR)/concatenation_lib.h $(INC_DIR)/bp.c $(INC_DIR)/bp.h $(INC_DIR)/bp_decoder.h $(INC_DIR)/my_lib.h makefile +#command=$(CXX) -I../../weilei_lib $(START) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $^) $(word 10, $^) $(word 12, $^) $(word 14, $^) $(END) +command=$(CXX) -I $(INC_DIR) $(START) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $^) $(word 10, $^) $(word 12, $^) $(word 14, $^) $(word 15, $^) $(END) ; echo finish making +#the last one is my_lib.h all: parserTest.out ldpcTest.out test.out alist_test.out - +###include all headfiles into my_lib.h +#pattern_observer.out:pattern_observer.c mm_read.c mm_read.h mmio.c mmio.h mm_write.c mm_write.h lib.cpp lib.h my_lib.h makefile partial_sum.out:partial_sum.c $(files) $(command) diff --git a/my_bp4.c b/my_bp4.cpp similarity index 97% rename from my_bp4.c rename to my_bp4.cpp index b650670..1ce917c 100644 --- a/my_bp4.c +++ b/my_bp4.cpp @@ -219,6 +219,7 @@ int decode( BP_Decoder bp_decoder, GF2mat G, GF2mat H, double p, mat * data, in bvec bitsout = llr_output < bound; //30;//0;//output + //enhanced feedback int current_iteration = ans; for (int i_iteration = 0;i_iterationkMq|`?rp@G=|D6Ax$IWEUxAZ^@;$IFW zeYV|FLVw5L^YyofHaNS-`S&{yFFpDyUpN<#)PMwtrUa3ZC=rnKF1JB}l{%g77u2tj zb!O%MKE3IkF(&Noj|N>(@|+<$vq4xl(OiH@QCmu%0EBpI8BK#vd~F#mhiR^s(W@}S z&E@nK%F}Xs3Z_L#1uX`c%y&WdGKbd?NqxYJIr0pUOFG!tZQcF+R&%iRuIfzsok z`S4GK9P|~zmj3PZAhrmLi_YLAVXUQj1mbv^n^rhlkdW^)6U2tdV02H1f63}5*v(| zK{TbD`6D~f-^r>pvlR!Nt{B-xQiHf_RKh-Tx2f0Fw%z2Q*zIzX0iM0hWNNOyj%n_= zY#>z_g*WGo>xaXWr?fXaC>z4|8!tPFwO!z2&)5p4;4^|_PYmC7PNIYBG6A~Y-LWlj?pD)S}OD3vHg6q2k>7ImW! zv8Xtky`c4>TJ@o@4lDwz4~h{)iD6PLN|X%EC=x2@xic=m`+v^={GaEXdwY5Ua2oMu zf$g5PPEHI+=jS^o+F!X}_)BdAXJ`8cWqSaG%cbNxvlQ?T-Q}D7PIWl4+^1?4ShzA4L65ItUQrsWzGhQ+%_HmcTSuZS)e% za8n7rjxtn2yI@*uwbLyCbG)Y%-8qp_M)MV5+*v^{gUo+c&>SG#TOL=@7HkpbTKW|y34J|XPau}t8fYoR@e7(Hh)@GiW>k{NUB&ZAF_G8ZcO+Q>9kVMCE=VK`DkiNYM?8xjiOj9VXqR&_iLQ=SjG%Ma zNn(SGW)Mv|FL9(A{c2XGnWu2XQTs>@Ne$w8FJcwVYM48ZHE+$>4w9RN$str!uER?>%{C0@US;*4Kw01g6WRozH?-+ z7mxfVJ8|tj?$K_a<3#5-kkCav7B$#XvL&bIsm#|sVL