Entering edit mode
8.2 years ago
marongiu.luigi
▴
730
Dear all,
I want to install wgsim on my Ubuntu 16.04 machine; I downloaded the zip file wgsim from the website, unpack it and moved it to /usr/local/lib/. I then ran the suggested commands (both with gcc and make) and I got:
:/usr/local/lib/wgsim$ sudo make wgsim
[sudo] password :
cc wgsim.c -o wgsim
/tmp/ccUBK42c.o: In function `ks_getc':
wgsim.c:(.text+0xe1): undefined reference to `gzread'
/tmp/ccUBK42c.o: In function `ks_getuntil':
wgsim.c:(.text+0x1df): undefined reference to `gzread'
/tmp/ccUBK42c.o: In function `ran_normal':
wgsim.c:(.text+0xab2): undefined reference to `log'
wgsim.c:(.text+0xacc): undefined reference to `sqrt'
/tmp/ccUBK42c.o: In function `wgsim_core':
wgsim.c:(.text+0x17d5): undefined reference to `log'
wgsim.c:(.text+0x1825): undefined reference to `gzopen'
wgsim.c:(.text+0x18f9): undefined reference to `gzclose'
wgsim.c:(.text+0x190d): undefined reference to `gzopen'
wgsim.c:(.text+0x2499): undefined reference to `gzclose'
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'wgsim' failed
make: *** [wgsim] Error 1
:/usr/local/lib/wgsim$ sudo gcc -g -Wall -O2 wgsim.c -o wgsim
/tmp/ccexR4pu.o: In function `ks_getuntil':
/usr/local/lib/wgsim/wgsim.c:41: undefined reference to `gzread'
/tmp/ccexR4pu.o: In function `ran_normal':
/usr/local/lib/wgsim/wgsim.c:77: undefined reference to `log'
/usr/local/lib/wgsim/wgsim.c:77: undefined reference to `sqrt'
/tmp/ccexR4pu.o: In function `ks_getc':
/usr/local/lib/wgsim/wgsim.c:41: undefined reference to `gzread'
/usr/local/lib/wgsim/wgsim.c:41: undefined reference to `gzread'
/usr/local/lib/wgsim/wgsim.c:41: undefined reference to `gzread'
/usr/local/lib/wgsim/wgsim.c:41: undefined reference to `gzread'
/tmp/ccexR4pu.o: In function `wgsim_core':
/usr/local/lib/wgsim/wgsim.c:250: undefined reference to `gzopen'
/usr/local/lib/wgsim/wgsim.c:260: undefined reference to `gzclose'
/usr/local/lib/wgsim/wgsim.c:262: undefined reference to `gzopen'
/usr/local/lib/wgsim/wgsim.c:370: undefined reference to `gzclose'
/usr/local/lib/wgsim/wgsim.c:248: undefined reference to `log'
collect2: error: ld returned 1 exit status
What I am missing? are there some dependencies?
Thanks
G
Get from the github readme:
I ran
gcc -o wgsim wgsim.c -lm -lz
and a wgsim command is created but when i run it on an example from the web i got:Don't run user program using
sudo
. Not a good practice.If you are trying to run
wgsim
from the directory where it is present then you need to either do it explicitly as./wgsim
or add the directory (inbash
shell) where wgsim is located to$PATH
simply by doingexport PATH=$PATH:/path_to_wgsim
You can add this line to~/.profile
file make the change permanent.