Skip to content

Commit

Permalink
rename .c to .cpp to avoid semantic warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Weilei Zeng committed Apr 15, 2020
1 parent 948f015 commit a7df5de
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 37 deletions.
30 changes: 28 additions & 2 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"editor.fontSize": 14
"editor.fontSize": 16
}
33 changes: 33 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -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"
}
35 changes: 18 additions & 17 deletions makefile
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Expand Down
33 changes: 16 additions & 17 deletions hpcc_makefile → makefile_cherenkov
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions my_bp4.c → my_bp4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_iteration<max_repetition;i_iteration++){
Expand Down
Binary file modified my_bp4.out
Binary file not shown.

0 comments on commit a7df5de

Please sign in to comment.