Commit 426a6c2f authored by george's avatar george
Browse files

More Linux compatible Makefiles and syntax adjustments

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2848 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 4f09fc89
# $Id: Makefile 531 2005-11-30 13:49:48Z kamenik $
# Copyright 2005, Ondra Kamenik
DEBUG = yes
#LD_LIBS := -llapack -lcblas -lf77blas -latlas -lg2c
# $Id: Makefile 531 2005-11-30 13:49:48Z kamenik $
# Copyright 2005, Ondra Kamenik
#DEBUG = yes
#LD_LIBS := -llapack -lcblas -lf77blas -latlas -lg2c
#CC_FLAGS := -DWINDOWS -mno-cygwin
CC_FLAGS := -DMATLAB -DNO_BLAS_H -DNO_LAPACK_H \
-Wall -fpic -I../qt/cc -I../sylv/cc -I../cc \
-I$(MATLAB_PATH)/extern/include #-pg
ifeq ($(DEBUG),yes)
CC_FLAGS := -DDEBUG $(CC_FLAGS) -g
# CC_FLAGS := -DTIMING_LOOP -DDEBUG $(CC_FLAGS) -g #-pg #-Wl,-pg
KALMANLIB := kalmanlib_dbg.a
else
# CC_FLAGS := $(CC_FLAGS) -O3
CC_FLAGS := -DTIMING_LOOP $(CC_FLAGS) -O3
KALMANLIB := kalmanlib.a
endif
# Added by GP
# LDFLAGS := -llapack -lcblas -lf77blas -latlas -lg2c -lstdc++ -lmingw32
#LDFLAG := -Wl,--library-path $(LD_LIBRARY_PATH)
#-Wl,-L'C:/MinGW/lib/gcc-lib/i686-pc-mingw32/4.0.4'
#-Wl,-llibmex -Wl,-llibmx -Wl,-llibmwlapack -Wl,-llibdflapack -lf95
#-lg2c -lmingw32 kalmanlib.def -Wl,-lmwm_ir
#-Wl,-L'f:/CygWin/lib'
#LD_LIBS := -Wl,--library-path
# -Wl,-L'/usr/lib'
CC_FLAGS := -DMATLAB -DNO_BLAS_H -DNO_LAPACK_H \
-Wall -fpic -I../qt/cc -I../sylv/cc -I../cc \
-I$(MATLAB_PATH)/extern/include #-pg
ifeq ($(DEBUG),yes)
CC_FLAGS := -DDEBUG $(CC_FLAGS) -g
# CC_FLAGS := -DTIMING_LOOP -DDEBUG $(CC_FLAGS) -g #-pg #-Wl,-pg
KALMANLIB := kalmanlib_dbg.a
else
# CC_FLAGS := $(CC_FLAGS) -O3
CC_FLAGS := -DTIMING_LOOP $(CC_FLAGS) -O3
KALMANLIB := kalmanlib.a
endif
# Added by GP
# LDFLAGS := -llapack -lcblas -lf77blas -latlas -lg2c -lstdc++ -lmingw32
#LDFLAG := -Wl,--library-path $(LD_LIBRARY_PATH)
#-Wl,-L'C:/MinGW/lib/gcc-lib/i686-pc-mingw32/4.0.4'
#-Wl,-llibmex -Wl,-llibmx -Wl,-llibmwlapack -Wl,-llibdflapack -lf95
#-lg2c -lmingw32 kalmanlib.def -Wl,-lmwm_ir
#-Wl,-L'f:/CygWin/lib'
#LD_LIBS := -Wl,--library-path
# -Wl,-L'/usr/lib'
LD_LIBS := -Wl,-rpath-link,$(MATLAB_PATH)/bin/glnxa64 \
-Wl,-L$(MATLAB_PATH)/bin/glnxa64 \
-Wl,-lmex -lmx -lmwlapack -lmwblas -lmat -lm \
-Wl,-lstdc++ $(LDFLAGS)
#-Wl,-L'/usr/lib'
# -Wl,-L'f:/CygWin/usr/local/atlas/lib'
# -Wl,-L'f:/CygWin/lib'
# -Wl,-L'f:/MinGW/lib'
# $(LDFLAGS)
# LD_LIBS :=$(LDFLAGS)
# end add
matrix_interface := GeneralMatrix Vector SylvException
matobjs := $(patsubst %, ../sylv/cc/%.o, $(matrix_interface))
mathsource := $(patsubst %, ../sylv/cc/%.h, $(matrix_interface))
matcppsource := $(patsubst %, ../sylv/cc/%.cpp, $(matrix_interface))
qtf90source := $(wildcard ../qt/f90/*.f90)
qtobjs := $(patsubst %.f90,%.o,$(qtf90source))
# cppsource := $(patsubst %.cweb,%.cpp,$(cwebsource))
kalmancppsource := $(wildcard ../cc/*.cpp)
kalmanhsource := $(wildcard ../cc/*.h)
kalmanobjects := $(patsubst %.cpp,%.o,$(kalmancppsource))
cppsource := $(wildcard *.cpp)
hsource := $(wildcard *.h)
objects := $(patsubst %.cpp,%.o,$(cppsource))
hwebsource := $(wildcard *.hweb)
cwebsource := $(wildcard *.cweb)
dummy.ch:
touch dummy.ch
# %.cpp: %.cweb dummy.ch
# ctangle -bhp $*.cweb dummy.ch $*.cpp
# %.h: %.hweb dummy.ch
# ctangle -bhp $*.hweb dummy.ch $*.h
#%.o: %.cpp $(hsource) $(cppsource) #$(kalmanhsource) $(mathsource)
%.o: %.cpp $(hsource) $(cppsource)
c++ $(CC_FLAGS) -c $*.cpp
$(KALMANLIB): $(objects) # $(matobjs) $(qtobjs) #$(kalmanobjects)
ar cr $(KALMANLIB) $(kalmanobjects) $(matobjs) $(qtobjs)
ranlib $(KALMANLIB)
kalman_smoother_dll.dll: kalman_smoother.o $(KALMANLIB) #$(hsource) $(cppsource)
gcc -shared $(CC_FLAGS) -o kalman_smoother_dll.dll kalman_smoother.o \
kalmanlib.a $(LD_LIBS)
minv.dll: minv.o $(KALMANLIB) # $(hsource) $(cppsource)
gcc -shared $(CC_FLAGS) -o minv.dll minv.o \
kalmanlib.a $(LD_LIBS)
gmvm.dll: gmvm.o $(KALMANLIB) # $(hsource) $(cppsource)
gcc -shared $(CC_FLAGS) -o gmvm.dll gmvm.o \
kalmanlib.a $(LD_LIBS)
qtamvm.dll: qtamvm.o $(KALMANLIB) # $(hsource) $(cppsource)
gcc -shared $(CC_FLAGS) -o qtamvm.dll qtamvm.o \
kalmanlib.a $(LD_LIBS)
qtmvm.dll: qtmvm.o $(KALMANLIB) # $(hsource) $(cppsource)
gcc -shared $(CC_FLAGS) -o qtmvm.dll qtmvm.o \
kalmanlib.a $(LD_LIBS)
kalman_filter_dll.dll: kalman_filters.o $(KALMANLIB) # $(hsource) $(cppsource)
gcc -shared $(CC_FLAGS) -o kalman_filter_dll.dll kalman_filters.o \
$(KALMANLIB) $(LD_LIBS)
kalman_filters_testx.exe: kalman_filters_testx.o $(KALMANLIB) # $(hsource) $(cppsource)
gcc $(CC_FLAGS) -pg -o kalman_filters_testx.exe kalman_filters_testx.o \
$(KALMANLIB) $(LD_LIBS)
all: $(objects) $(KALMANLIB) kalman_smoother_dll.dll kalman_filter_dll.dll # $(cppsource) $(hsource) $(kalmanhsource) $(kalmancppsource)
#kalman_filter_loop.o: kalman_filters.cpp
# c++ -DTIMING_LOOP $(CC_FLAGS) -o kalman_filter_loop.o kalman_filters.cpp
#kalman_filter_loop.dll: kalman_filter_loop.o kalmanlib.a # $(hsource) $(cppsource)
# gcc -shared -DTIMING_LOOP $(CC_FLAGS) -o kalman_filter_loop.dll kalman_filter_loop.o \
# kalmanlib.a $(LD_LIBS)
doc: main.web $(hwebsource) $(cwebsource)
cweave -bhp main.web
pdftex main
mv main.pdf ts.pdf
clear:
rm -f *.o
rm -f *.{pdf,dvi,log,scn,idx,toc}
# rm -f *.cpp
# rm -f *.h
-Wl,-L$(MATLAB_PATH)/bin/glnxa64 \
-Wl,-lmex -lmx -lmwlapack -lmwblas -lmat -lm \
-Wl,-lstdc++ $(LDFLAGS)
#-Wl,-L'/usr/lib'
# -Wl,-L'f:/CygWin/usr/local/atlas/lib'
# -Wl,-L'f:/CygWin/lib'
# -Wl,-L'f:/MinGW/lib'
# $(LDFLAGS)
# LD_LIBS :=$(LDFLAGS)
# end add
matrix_interface := GeneralMatrix Vector SylvException
matobjs := $(patsubst %, ../sylv/cc/%.o, $(matrix_interface))
mathsource := $(patsubst %, ../sylv/cc/%.h, $(matrix_interface))
matcppsource := $(patsubst %, ../sylv/cc/%.cpp, $(matrix_interface))
qtf90source := $(wildcard ../qt/f90/*.f90)
qtobjs := $(patsubst %.f90,%.o,$(qtf90source))
# cppsource := $(patsubst %.cweb,%.cpp,$(cwebsource))
kalmancppsource := $(wildcard ../cc/*.cpp)
kalmanhsource := $(wildcard ../cc/*.h)
kalmanobjects := $(patsubst %.cpp,%.o,$(kalmancppsource))
cppsource := $(wildcard *.cpp)
hsource := $(wildcard *.h)
objects := $(patsubst %.cpp,%.o,$(cppsource))
hwebsource := $(wildcard *.hweb)
cwebsource := $(wildcard *.cweb)
dummy.ch:
touch dummy.ch
# %.cpp: %.cweb dummy.ch
# ctangle -bhp $*.cweb dummy.ch $*.cpp
# %.h: %.hweb dummy.ch
# ctangle -bhp $*.hweb dummy.ch $*.h
#%.o: %.cpp $(hsource) $(cppsource) #$(kalmanhsource) $(mathsource)
%.o: %.cpp $(hsource) $(cppsource)
c++ $(CC_FLAGS) -c $*.cpp
$(KALMANLIB): $(objects) # $(matobjs) $(qtobjs) #$(kalmanobjects)
ar cr $(KALMANLIB) $(kalmanobjects) $(matobjs) $(qtobjs)
ranlib $(KALMANLIB)
kalman_smoother_dll.dll: kalman_smoother.o $(KALMANLIB) #$(hsource) $(cppsource)
gcc -shared $(CC_FLAGS) -o kalman_smoother_dll.dll kalman_smoother.o \
kalmanlib.a $(LD_LIBS)
minv.dll: minv.o $(KALMANLIB) # $(hsource) $(cppsource)
gcc -shared $(CC_FLAGS) -o minv.dll minv.o \
kalmanlib.a $(LD_LIBS)
gmvm.dll: gmvm.o $(KALMANLIB) # $(hsource) $(cppsource)
gcc -shared $(CC_FLAGS) -o gmvm.dll gmvm.o \
kalmanlib.a $(LD_LIBS)
qtamvm.dll: qtamvm.o $(KALMANLIB) # $(hsource) $(cppsource)
gcc -shared $(CC_FLAGS) -o qtamvm.dll qtamvm.o \
kalmanlib.a $(LD_LIBS)
qtmvm.dll: qtmvm.o $(KALMANLIB) # $(hsource) $(cppsource)
gcc -shared $(CC_FLAGS) -o qtmvm.dll qtmvm.o \
kalmanlib.a $(LD_LIBS)
kalman_filter_dll.dll: kalman_filters.o $(KALMANLIB) # $(hsource) $(cppsource)
gcc -shared $(CC_FLAGS) -o kalman_filter_dll.dll kalman_filters.o \
$(KALMANLIB) $(LD_LIBS)
kalman_filters_testx.exe: kalman_filters_testx.o $(KALMANLIB) # $(hsource) $(cppsource)
gcc $(CC_FLAGS) -pg -o kalman_filters_testx.exe kalman_filters_testx.o \
$(KALMANLIB) $(LD_LIBS)
all: $(objects) $(KALMANLIB) kalman_smoother_dll.dll kalman_filter_dll.dll # $(cppsource) $(hsource) $(kalmanhsource) $(kalmancppsource)
#kalman_filter_loop.o: kalman_filters.cpp
# c++ -DTIMING_LOOP $(CC_FLAGS) -o kalman_filter_loop.o kalman_filters.cpp
#kalman_filter_loop.dll: kalman_filter_loop.o kalmanlib.a # $(hsource) $(cppsource)
# gcc -shared -DTIMING_LOOP $(CC_FLAGS) -o kalman_filter_loop.dll kalman_filter_loop.o \
# kalmanlib.a $(LD_LIBS)
doc: main.web $(hwebsource) $(cwebsource)
cweave -bhp main.web
pdftex main
mv main.pdf ts.pdf
clear:
rm -f *.o
rm -f *.{pdf,dvi,log,scn,idx,toc}
# rm -f *.cpp
# rm -f *.h
# $Header: /var/lib/cvs/dynare_cpp/sylv/cc/Makefile,v 1.4 2005/01/18 21:28:26 kamenik Exp $
# Tag $Name: $
FF=f95
CC_FLAGS := -Wall -Winline -fpic
#CC_FLAGS := -Wall -Winline -I../testing -I../cc -DMATLAB \
# $(CC_INCLUDE_PATH) -I$(MATLAB_PATH)/extern/include #-pg
LDFLAGS = -Wl,-L$(MATLAB_PATH)/extern/lib/win32/microsoft/ \
-Wl,-llibmex -Wl,-llibmx -Wl,-llibmwlapack -Wl,-llibdflapack \
-lg2c -lmingw32 -lstdc++
LD_LIBS=$(LDFLAGS)
ifeq ($(DEBUG),yes)
# CC_FLAGS := $(CC_FLAGS) -g -DTL_DEBUG=2
CC_FLAGS := $(CC_FLAGS) -g -DPOSIX_THREADS
else
CC_FLAGS := $(CC_FLAGS) -O3
endif
ifeq ($(OS),Windows_NT)
CC_FLAGS := -mno-cygwin -mthreads $(CC_FLAGS)
endif
objects := $(patsubst %.f90,%.o,$(wildcard *.f90))
all: $(objects)
clear:
rm -f *.o
%.o : %.f90
$(FF) $(CC_FLAGS) $(EXTERN_DEFS) -c $*.f90
# $Header: /var/lib/cvs/dynare_cpp/sylv/cc/Makefile,v 1.4 2005/01/18 21:28:26 kamenik Exp $
# Tag $Name: $
FF=gfortran
CC_FLAGS := -Wall -Winline -fpic
#CC_FLAGS := -Wall -Winline -I../testing -I../cc -DMATLAB \
# $(CC_INCLUDE_PATH) -I$(MATLAB_PATH)/extern/include #-pg
LDFLAGS = -Wl,-L$(MATLAB_PATH)/extern/lib/win32/microsoft/ \
-Wl,-llibmex -Wl,-llibmx -Wl,-llibmwlapack -Wl,-llibdflapack \
-lg2c -lmingw32 -lstdc++
LD_LIBS=$(LDFLAGS)
ifeq ($(DEBUG),yes)
# CC_FLAGS := $(CC_FLAGS) -g -DTL_DEBUG=2
CC_FLAGS := $(CC_FLAGS) -g -DPOSIX_THREADS
else
CC_FLAGS := $(CC_FLAGS) -O3
endif
ifeq ($(OS),Windows_NT)
CC_FLAGS := -mno-cygwin -mthreads $(CC_FLAGS)
endif
objects := $(patsubst %.f90,%.o,$(wildcard *.f90))
all: $(objects)
clear:
rm -f *.o
%.o : %.f90
$(FF) $(CC_FLAGS) $(EXTERN_DEFS) -c $*.f90
# $Id: Makefile 531 2005-11-30 13:49:48Z kamenik $
# Copyright 2005, Ondra Kamenik
#DEBUG = yes
#LD_LIBS := -llapack -lcblas -lf77blas -latlas -lg2c
CC_FLAGS := -DMATLAB -DWINDOWS -DNO_BLAS_H -DNO_LAPACK_H \
-Wall -I../cc -I../../sylv/cc -I../cc -mno-cygwin -mwindows \
-Ic:/"Program Files"/MATLAB_SV71/extern/include #-pg
ifeq ($(DEBUG),yes)
CC_FLAGS := -DDEBUG $(CC_FLAGS) -g -pg
# CC_FLAGS := -DTIMING_LOOP -DDEBUG $(CC_FLAGS) -g
KALMANLIB := kalmanlib_dbg.a
else
# CC_FLAGS := $(CC_FLAGS) -O3
CC_FLAGS := -DTIMING_LOOP $(CC_FLAGS) -O3
KALMANLIB := kalmanlib.a
endif
# Added by GP
# LDFLAGS := -llapack -lcblas -lf77blas -latlas -lg2c -lstdc++ -lmingw32
#LDFLAGS := -Wl,--library-path $(LD_LIBRARY_PATH)
LD_LIBS := -Wl,--library-path \
-Wl,-L'f:/MinGW/lib' \
-Wl,-L'C:/MinGW/lib/gcc-lib/i686-pc-mingw32/4.0.4' -Wl,-L'C:/MinGW/lib' \
-Wl,-L"c:/Program Files"/MATLAB_SV71/extern/lib/win32/microsoft/ \
-Wl,-llibmex -Wl,-llibmx -Wl,-llibmwlapack -Wl,-llibdflapack \
-lf95 -lg2c -lmingw32 -lstdc++ $(LDFLAGS)
# -Wl,-L'f:/CygWin/usr/local/atlas/lib'
# -Wl,-L'f:/CygWin/lib'
# $(LDFLAGS)
# LD_LIBS :=$(LDFLAGS)
# end add
#matrix_interface := GeneralMatrix Vector SylvException
#matobjs := $(patsubst %, ../sylv/cc/%.o, $(matrix_interface))
#mathsource := $(patsubst %, ../sylv/cc/%.h, $(matrix_interface))
#matcppsource := $(patsubst %, ../sylv/cc/%.cpp, $(matrix_interface))
qtf90source := $(wildcard ../f90/*.f90)
qtobjs := $(patsubst %.f90,%.o,$(qtf90source))
cppsource := $(wildcard *.cpp)
hsource := $(wildcard *.h)
objects := $(patsubst %.cpp,%.o,$(cppsource))
dummy.ch:
touch dummy.ch
%.o: %.cpp $(hsource) $(cppsource)
c++ $(CC_FLAGS) -c $*.cpp
dgemmmtm_exe.exe: dgemmmtm_exe.o $(objects) $(qtobjs) $(hsource) $(cppsource)
gcc $(CC_FLAGS) -o dgemmmtm_exe.exe dgemmmtm_exe.o ascii_array.o \
$(qtobjs) $(LD_LIBS)
qtmmmtm_exe.exe: qtmmmtm_exe.o $(objects) $(qtobjs) $(hsource) $(cppsource)
gcc $(CC_FLAGS) -o qtmmmtm_exe.exe qtmmmtm_exe.o ascii_array.o \
$(qtobjs) $(LD_LIBS)
dgemvm_exe.exe: dgemvm_exe.o $(qtobjs) $(hsource) $(cppsource)
gcc $(CC_FLAGS) -o dgemvm_exe.exe dgemvm_exe.o ascii_array.o \
$(qtobjs) $(LD_LIBS)
qtamvm_exe.exe: qtamvm_exe.o $(qtobjs) $(hsource) $(cppsource)
gcc $(CC_FLAGS) -o qtamvm_exe.exe qtamvm_exe.o ascii_array.o \
$(qtobjs) $(LD_LIBS)
qtvmvm_exe.exe: qtvmvm_exe.o $(qtobjs) $(hsource) $(cppsource)
gcc $(CC_FLAGS) -o qtvmvm_exe.exe qtvmvm_exe.o ascii_array.o \
$(qtobjs) $(LD_LIBS)
qtv1mvm_exe.exe: qtv1mvm_exe.o $(qtobjs) $(hsource) $(cppsource)
gcc $(CC_FLAGS) -o qtv1mvm_exe.exe qtv1mvm_exe.o ascii_array.o \
$(qtobjs) $(LD_LIBS)
all: $(objects) dgemmmtm_exe.exe qtmmmtm_exe.exe qtv1mvm_exe.exe dgemvm_exe.exe qtvmvm_exe.exe qtamvm_exe.exe # $(cppsource) $(hsource) $(kalmanhsource) $(kalmancppsource)
clear:
rm -f *.o
rm -f *.a
rm -f *.{exe,dll}
# $Id: Makefile 531 2005-11-30 13:49:48Z kamenik $
# Copyright 2005, Ondra Kamenik
#DEBUG = yes
#LD_LIBS := -llapack -lcblas -lf77blas -latlas -lg2c
#-mno-cygwin -DWINDOWS
CC_FLAGS := -DMATLAB -DNO_BLAS_H -DNO_LAPACK_H \
-Wall -I../cc -I../../sylv/cc -I../cc \
-I$(MATLAB_PATH)/extern/include #-pg
ifeq ($(DEBUG),yes)
CC_FLAGS := -DDEBUG $(CC_FLAGS) -g -pg
# CC_FLAGS := -DTIMING_LOOP -DDEBUG $(CC_FLAGS) -g
KALMANLIB := kalmanlib_dbg.a
else
# CC_FLAGS := $(CC_FLAGS) -O3
CC_FLAGS := -DTIMING_LOOP $(CC_FLAGS) -O3
KALMANLIB := kalmanlib.a
endif
# Added by GP
# LDFLAGS := -llapack -lcblas -lf77blas -latlas -lg2c -lstdc++ -lmingw32
#LDFLAGS := -Wl,--library-path $(LD_LIBRARY_PATH)
# -Wl,-L'f:/MinGW/lib'
#-Wl,-L'C:/MinGW/lib/gcc-lib/i686-pc-mingw32/4.0.4' -Wl,-L'C:/MinGW/lib'
LD_LIBS := -Wl,-rpath-link,$(MATLAB_PATH)/bin/glnxa64 \
-Wl,-L$(MATLAB_PATH)/bin/glnxa64 \
-Wl,-lmex -lmx -lmwlapack -lmwblas -lmat -lm \
-Wl,-lstdc++ -lgfortran $(LDFLAGS)
# -Wl,-L'f:/CygWin/usr/local/atlas/lib'
# -Wl,-L'f:/CygWin/lib'
# $(LDFLAGS)
# LD_LIBS :=$(LDFLAGS)
# end add
#matrix_interface := GeneralMatrix Vector SylvException
#matobjs := $(patsubst %, ../sylv/cc/%.o, $(matrix_interface))
#mathsource := $(patsubst %, ../sylv/cc/%.h, $(matrix_interface))
#matcppsource := $(patsubst %, ../sylv/cc/%.cpp, $(matrix_interface))
qtf90source := $(wildcard ../f90/*.f90)
qtobjs := $(patsubst %.f90,%.o,$(qtf90source))
cppsource := $(wildcard *.cpp)
hsource := $(wildcard *.h)
objects := $(patsubst %.cpp,%.o,$(cppsource))
dummy.ch:
touch dummy.ch
%.o: %.cpp $(hsource) $(cppsource)
c++ $(CC_FLAGS) -c $*.cpp
dgemmmtm_exe.exe: dgemmmtm_exe.o $(objects) $(qtobjs) $(hsource) $(cppsource)
gcc $(CC_FLAGS) -o dgemmmtm_exe.exe dgemmmtm_exe.o ascii_array.o \
$(qtobjs) $(LD_LIBS)
qtmmmtm_exe.exe: qtmmmtm_exe.o $(objects) $(qtobjs) $(hsource) $(cppsource)
gcc $(CC_FLAGS) -o qtmmmtm_exe.exe qtmmmtm_exe.o ascii_array.o \
$(qtobjs) $(LD_LIBS)
dgemvm_exe.exe: dgemvm_exe.o $(qtobjs) $(hsource) $(cppsource)
gcc $(CC_FLAGS) -o dgemvm_exe.exe dgemvm_exe.o ascii_array.o \
$(qtobjs) $(LD_LIBS)
qtamvm_exe.exe: qtamvm_exe.o $(qtobjs) $(hsource) $(cppsource)
gcc $(CC_FLAGS) -o qtamvm_exe.exe qtamvm_exe.o ascii_array.o \
$(qtobjs) $(LD_LIBS)
qtvmvm_exe.exe: qtvmvm_exe.o $(qtobjs) $(hsource) $(cppsource)
gcc $(CC_FLAGS) -o qtvmvm_exe.exe qtvmvm_exe.o ascii_array.o \
$(qtobjs) $(LD_LIBS)
qtv1mvm_exe.exe: qtv1mvm_exe.o $(qtobjs) $(hsource) $(cppsource)
gcc $(CC_FLAGS) -o qtv1mvm_exe.exe qtv1mvm_exe.o ascii_array.o \
$(qtobjs) $(LD_LIBS)
all: $(objects) dgemmmtm_exe.exe qtmmmtm_exe.exe qtv1mvm_exe.exe dgemvm_exe.exe qtvmvm_exe.exe qtamvm_exe.exe # $(cppsource) $(hsource) $(kalmanhsource) $(kalmancppsource)
clear:
rm -f *.o
rm -f *.a
rm -f *.{exe,dll}
......@@ -2,7 +2,7 @@
// Based on work of 2005, Ondra Kamenik
#include "ascii_array.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
......
......@@ -4,12 +4,12 @@
struct AsciiNumberArray {
int rows;
int cols;
int cols;
double * data;
char* fname;
void GetMX(const char* fname, int rows, int cols);
void WriteMX();
char* fname;
void GetMX(const char* fname, int rows, int cols);
void WriteMX();
};
void WriteMX(char* fname, double* data, int rows, int cols);
void WriteMX(char* fname, double* data, int rows, int cols);
/*
* Copyright (C) 2008-2009 Dynare Team
*
* This file is part of Dynare.
*
* Dynare is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Dynare is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
/******************************************************
%
% This provides an interface to BLAS dgemv f90 library function
% to multiply Quasi trinagular matrix (T) with a vector a
%
%
% use:
% dgemmmtm_exe QTt_file SS_file size [loops - if enabled]
%
% NOTE: due to fortran matrix orientation, input matrices need to be passed
% as transposed so QTt instead QT
%
%
% INPUTS
% QT [double] mm*mm transition matrix of the state equation.
% SS [double] mm*mm state cov matrix.
%
% OUTPUTS
% TSTt update [double] mm*mm state cov matrix updated.
% as file: a_file_out
**********************************************************/
#include "cppblas.h"
#include <stdio.h>
#include <math.h>
#include "ascii_array.h"
#include <iostream>
#include <stdexcept>
#include <malloc.h>
int main(int argc, char* argv[])
{
if (argc < 3 )
{
printf("Must have min 2 input parameters.\n");
exit(1);
}
try
{
// make input matrices
int n=atoi(argv[3]);
double *TSTt, *TS ;
AsciiNumberArray QT, SS;
QT.GetMX(argv[1],n,n);
SS.GetMX(argv[2],n,n);
const double alpha=1.0;
const double beta=0.0;
// create output and upload output data
TS=(double *)calloc(n*n, sizeof(double));
TSTt=(double *)calloc(n*n, sizeof(double));
#ifdef TIMING_LOOP
int loops=1;//000;
if (argc >3 )
loops = atoi(argv[4]);
for (int tt=0;tt<loops;++tt)
{