10 Commits
4 changed files with 42 additions and 18 deletions
+35 -15
View File
@@ -1,17 +1,34 @@
################################################
###
### Makefile for GilberModel
###
###
###
################################################
### Projects
PROJECTS = sqnanalyzer sqngen
### Static Compilation
STC?=0
### Compilet
CPP = g++
#CPP = i686-pc-mingw32-g++
OUTPUT_DIR := Bin
PROJECTS := sqnanalyzer sqngen
################################################
# Make definitions
################################################
BIN_DIR = bin
export DBG
export STC
export M32
export OPENMP
CFLAGS= -Wall
ifeq ($(STC),1)
STATIC= -static
else
STATIC=
endif
SQNGENLIBS= `gsl-config --libs` -lgsl -lgslcblas
CFLAGS+= `gsl-config --cflags `$(STATIC)
.HONY: default all $(PROJECTS) #distclean clean tags dependP
@@ -19,11 +36,14 @@ default: all
all: $(PROJECTS)
sqngen:
g++ -Wall sqngen.c -lgsl -lgslcblas -o SQNGen
sqnanalyzer:
g++ -Wall sqnanalyzer.c -o SQNAnalyzer
bin_dir:
@echo 'Creating $(BIN_DIR) ...'
@mkdir -p $(BIN_DIR)
sqngen: bin_dir
$(CPP) $(CFLAGS) sqngen.c $(SQNGENLIBS) -o $(BIN_DIR)/sqngen
sqnanalyzer: bin_dir
$(CPP) $(CFLAGS) sqnanalyzer.c -o $(BIN_DIR)/sqnanalyzer
clean:
rm SQNGen
rm SQNAnalyzer
@echo 'Removing $(BIN_DIR) ...'
@rm $(BIN_DIR) -R
Binary file not shown.
+7 -3
View File
@@ -35,6 +35,11 @@
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#ifdef WIN32
#include <windows.h>
#define sleep(a) Sleep(a * 1000)
#endif
#define ONE 4294967295u
#include <iostream>
@@ -442,7 +447,7 @@ int main (int argc, char *argv[]) {
int gmin_max;
fstream data;
char *filename_common;
fprintf(stdout,"********************** SQNGEN (Edited by Joao Carreira) ***********************\n");
fprintf(stdout,"********************** sqngen ***********************\n");
if (argc<7) {
arg_error();
return 0;
@@ -654,7 +659,7 @@ int main (int argc, char *argv[]) {
data.close();
for (int sample=0;sample<num_of_samples;sample++) {
FILE *out_file = NULL;
char filename[100];
char filename[200];
sprintf(filename,"%s_P%d_%d.dat", filename_common, (int)(ploss*1000), sample);
out_file = fopen (filename, "w");
if (out_file == NULL)
@@ -780,5 +785,4 @@ int main (int argc, char *argv[]) {
statistics(filename, num_of_samples, ploss_ter, mean_length_of_burst_ter, density_ter, pisolated_loss_ter, mean_length_of_good_burst_ter, gmin, gmin_max);
}
}
fprintf(stdout,"********************************* Exit SQNGEN *********************************\n");
}