How to compile project correctly (c source code) - Understanding ReadMe file/MakeFile

Thread Starter

JimmyCho

Joined Aug 1, 2020
109
Hi guys !
I'm running on my PC Ubuntu Linux , and what I'm trying to run project of decoder that's called Viterbi decoder from this website:
http://www.eccpage.com/

Under Viterbi decoder line there's a file called :
viterbi-3.0.1.tar

I've downloaded it and extracted it in my directory, Im trying to compile and it's not compiling at all, it tells me files isn't on the directory.

The file viterbi-3.0.1.tar has readme and make files and I've read them but I couldn't succeed to compile, could anyone please help me how do I compile this project successfully?

As I believe that the code doesn't have any software error/buys and it should work fine .... so I deeply believe that the error isn't compiling/downloading it correctly in my linux .. any help?
I did in my linux on the extracted file this:
$make
$./viterbi
and it didn't give me any output and gives me errors that file missing and file isn't found on directory !

All I need is to compile it right and to write correct instructions in linux in order to compile it correctly.

Any help guys?

this project has two options , one r=1/3, another r=1/2.
I want to Run Viterbi Decoder K=7 , R=1/2 program .

thanks alot for your cooperation in this.
 

nsaspook

Joined Aug 27, 2009
13,272
Running make using the included Makefile as default creates this in the directory.
encode27 encode37 genviterbi.pl metrics.o sim.o viterbi27.c viterbi37.c viterbi.c vitfilt27.c vitfilt37.c vittest27 vittest37.o
encode27.c encode37.c Makefile README tab.c viterbi27.h viterbi37.h viterbi.o vitfilt27.o vitfilt37.o vittest27.o vittest.c
encode27.o encode37.o metrics.c sim.c tab.o viterbi27.o viterbi37.o vitfilt27 vitfilt37 vittest vittest37 vittest.o
#Makefile for Viterbi decoder test programs. Edit to taste.
CC=gcc
CFLAGS=-O9

all: vittest vittest27 vittest37 encode27 encode37 vitfilt27 vitfilt37

clean:
rm -f *.o vittest vittest27 vittest37 encode27 encode37 vitfilt27 vitfilt37

vittest: vittest.o viterbi.o sim.o metrics.o tab.o
$(CC) -o vittest vittest.o viterbi.o sim.o metrics.o tab.o -lm

vittest27: vittest27.o sim.o metrics.o viterbi27.o tab.o
$(CC) -o vittest27 vittest27.o viterbi27.o sim.o metrics.o tab.o -lm

vittest37: vittest37.o sim.o metrics.o viterbi37.o tab.o
$(CC) -o vittest37 vittest37.o viterbi37.o sim.o metrics.o tab.o -lm

encode27: encode27.o tab.o
$(CC) -o encode27 encode27.o tab.o

encode37: encode37.o tab.o
$(CC) -o encode37 encode37.o tab.o

vitfilt27: vitfilt27.o
$(CC) -o vitfilt27 vitfilt27.o

vitfilt37: vitfilt37.o
$(CC) -o vitfilt37 vitfilt37.o

vittest27.o: vittest.c
$(CC) $(CFLAGS) -c -Dviterbi=viterbi27 -Dencode=encode27 vittest.c -o vittest27.o

vittest37.o: vittest.c
$(CC) $(CFLAGS) -c -Dviterbi=viterbi37 -Dencode=encode37 vittest.c -o vittest37.o

viterbi27.o: viterbi27.c viterbi27.h
viterbi37.o: viterbi37.c viterbi37.h
vitfilt27.o: vitfilt27.c viterbi27.h
vitfilt37.o: vitfilt37.c viterbi37.h
There is no program './viterbi' specified to be created in the Makefile.

This does get created.
./vittest
metric table range 4 to -17
original data:
01234567550000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055aaffff
frame 1 decoded data:
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005ab88fd000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b9b5
frame 2 decoded data:
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066bdf7e000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de255
frame 3 decoded data:
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eb9dc6000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b5e
frame 4 decoded data:
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006c39000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008aa8848359
frame 5 decoded data:
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001819b09000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b0f49226a236b
frame 6 decoded data:
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c93738000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000079cc94b
frame 7 decoded data:
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c7200c000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009e03
frame 8 decoded data:
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000281b243000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015d47cb447bdf17f4ff
frame 9 decoded data:
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e015a96000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006916894b69e5a3b522
frame 10 decoded data:
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ac630000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001eec
Seed 1606857009 Amplitude 100 units, Eb/N0 = 5 dB
Amplitude 100 units, Eb/N0 = 5 dB
Frame length = 1152 bits, #frames = 10, bits decoded = 11520
frame errors: 10 (1)
bit errors: 493 (0.0427951)
 

Thread Starter

JimmyCho

Joined Aug 1, 2020
109
Hi , thanks for your reply!
Maybe I didn't get you well ..what I did is this:
I went to file viterbi-3.0.1.tar and extracted it to specified directory on the same name so the name of directory is
viterbi-3.0.1 , so I opened my terminal on that directory and what I write ($ is from terminal prompt ) :
$make
so I see files included to my directory which its type are .o
what does that mean tho? I mean what does make (compile) mean? what do those .o files stand for?

then I write ./viterbi27 in order to run that file and I get that this file isn't on the same directory!

really weird!! .. could you please explain what did you do exactly step by step (what instructions did you type in your terminal) in order to run the project(to get valid output) ?

Appreciated for your help and bear with me Im new with this type of loading/downloading files.
 
Top