Gitlab will migrate to a new storage backend starting 0300 UTC on 2020-04-04. We do not anticipate a maintenance window for this migration. Performance may be impacted over the weekend. Thanks for your patience.

Commit d843ad5f authored by Daniel Brown's avatar Daniel Brown

refs #164 - Altering code so that Windows binaries can be built that do not depend on cygwin dll's

parent 63b9cf46
......@@ -9,6 +9,97 @@ fixed bugs.
This list starts with Version 0.53 since there were just too many
changes before. Not every version number is listed.
2.0 -> 2.1 (.....2014)
main changes:
o This is mainly a bug fix release. At the same time it includes some
features we are working on at the moment, for example testing of
experimental speed improvements, and the new homodyne detector.
syntax change:
o The 'quantum_scaling' parameter in the kat.ini file has been
replaced by dedicated 'scale' commands, see below.
added features:
o Added a homodyne detector output. The main usage is:
hd name phase node1 node2
qhd name phase node1 node2
These detectors require two input ports, the result is then combined
with the phase difference specified. Thus to subtract results
phase = 180 or to add the results phase = 0 (other values can
also be chosen if desired). The 'hd' command provides the signal
output, the 'qhd' outputs the quantum noise. You can also use
qhdS for a sensitivty output (qdS=qhd/hd), and qhdN for a signal to
noise output (qdN= hd/qhd). The homodyne detectors is typically
used with a beamsplitter to mix a local oscillator field with the
signal; An example of a homodyne readout for measuring a
squeezed field:
sq l1 0 20 0 nin
l LO 1 0 0 nLO
fsig noise 1
bs dHD .5 .5 0 0 nin nout1 nout2 nLO
qhd hd0 0 nout2 nout1
qhd hd180 180 nout2 nout1
yaxis log abs
xaxis LO phase lin 0 360 1000
o Adding 'dither' modulation to mirrors and beam splitters. The new
command is:
dither component f m order phase
Where component is the name of a mirror or beamsplitter, f is the
frequency of the modulation, m is the amplitude of the mirror motion
in metres, order is the maximum order of sidebands to compute and
phase is an additional phase of the modulation in degrees. A simple
example:
l l1 1 0 n1
s s2 1 1 n1 n4
m mN 1 0 0 n4 n5
dither mN 10M 1n 2 0
ad ap0 0 n4
ad ap10 10M n4
ad am20 20M n4
# vary the dither amplitude
xaxis mN dither_m lin 0 1e-6 1000
o Added new command '!include' to read in a separate kat file and
particular blocks:
!include katFilename [block1 [block2 ...]]
Note, that you cannot nest include statements.
o Added 'power' in diopters as new tunable variable to lenses, e.g.
xaxis lens P lin 1u 10u 100
Also the lens* command sets the lens power rather than the focal
length.
o Added 'm stability factor' to cavity parameters output.
o Added two following pre-set scaling options: PSD, PSD_HF, ASD and
ASD_HF. These can be used to scale the shot, qshot and qnoised
detector outputs. These select respectively PSD, PSD/hf, ASD or
ASD/hf (where h is plancks constant and f the carrier
frequency).
o Experimental feature, not yet ready for use: flag cr=on/off
bug fixes:
o Fixed bug with scaling of qshotS and qnoisedS commands, also fixed
a bug where scale commands didn't affect qshot and qnoised.
All these occured only for some example files, so that our test
cases where not affected but the changes.
o Fixed a bug with the Matlab output files (where the function name
inside was just a . so that Matlab would not execute these files)
o Added warning when a function name length is too long.
known issues:
1.1 -> 2.0 (19.05.2014)
http://kvasir.sr.bham.ac.uk/redmine/versions/10
......
......@@ -2,17 +2,7 @@
#
# Main Makefile for Finesse
# work out the name of the host we're on
HOSTNAME = $(shell uname -n)
#echo "seeting CC=gcc"
#CC ?= gcc
#export CC = gcc
ARCH=linux
.PHONY: clean lib src doc/manual api api_clean realclean
.PHONY: clean lib src doc/manual api api_clean realclean setup
default: kat
......@@ -20,23 +10,46 @@ kat: lib src
fast: kat
setup:
# work out the name of the host we're on
HOSTNAME = $(shell uname -n)
# Set defaults for including libraries
ifeq "$(ARCH)" "mac"
INCLUDE_NICSLU=1
INCLUDE_CUBA=1
INCLUDE_NET=1
else ifeq "$(ARCH)" "linux"
INCLUDE_NICSLU=1
INCLUDE_CUBA=1
INCLUDE_NET=1
else ifeq "$(ARCH)" "win32"
INCLUDE_NICSLU=0
INCLUDE_CUBA=0
INCLUDE_NET=0
else ifeq "$(ARCH)" "win64"
INCLUDE_NICSLU=0
INCLUDE_CUBA=0
INCLUDE_NET=0
endif
testarch:
$(eval archs := mac win linux)
$(eval archs := mac win32 win64 linux)
$(eval archflag := $(filter $(ARCH), $(archs)))
$(if $(filter $(ARCH), $(archs)), \
@echo "Arch flag found for '$(archflag)'", \
$(error Arch flag must be mac, win or linux))
$(error Arch flag must be mac, win32, win64 or linux))
# library building target
lib: testarch
$(MAKE) --directory=$@ ARCH=$(ARCH)
lib: testarch setup
$(MAKE) --directory=lib ARCH=$(ARCH) INCLUDE_NICSLU=$(INCLUDE_NICSLU) INCLUDE_CUBA=$(INCLUDE_CUBA) INCLUDE_NET=$(INCLUDE_NET)
# finesse building targets
src: lib
$(MAKE) --directory=$@ ARCH=$(ARCH) kat
$(MAKE) --directory=src ARCH=$(ARCH) INCLUDE_NICSLU=$(INCLUDE_NICSLU) INCLUDE_CUBA=$(INCLUDE_CUBA) INCLUDE_NET=$(INCLUDE_NET) kat
debug: lib
$(MAKE) --directory=src ARCH=$(ARCH) $@
$(MAKE) --directory=src ARCH=$(ARCH) INCLUDE_NICSLU=$(INCLUDE_NICSLU) INCLUDE_CUBA=$(INCLUDE_CUBA) INCLUDE_NET=$(INCLUDE_NET) debug
prof: lib
$(MAKE) --directory=src ARCH=$(ARCH) $@
......
@setlocal enableextensions enabledelayedexpansion
@echo OFF
@echo off
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------
CD %~dp0
echo ---------------------------------------
......
......@@ -32,7 +32,6 @@
# #
###########################################################################
### globals ###############################################################
ROOT=`pwd`
......@@ -450,7 +449,7 @@ esac
# here we go...
export OPTIM_CFLAGS="-O3 -ffast-math -Wall -fexpensive-optimizations -fomit-frame-pointer -funroll-loops -DNDEBUG "
export OPTIM_CFLAGS="-mfpmath=sse -O3 -ffast-math -Wall -fexpensive-optimizations -fomit-frame-pointer -funroll-loops -DNDEBUG "
case $TARGET in
$TARGET_LINUX)
......
@echo off
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------
CD %~dp0
setx PATH "%CD%;%PATH%"
......
......@@ -12,9 +12,7 @@ clight 299792458.0 # speed of light
lambda 1.064e-6 # Wavelength of carrier
deriv_h 1e-3 # h for num. derivation
qeff 1.0 # quantum efficency
#epsilon_c 2.6544e-3 # epsilon_0 times clight (in I=.5*epsilon_0*clight*E^2)
epsilon_c 1.0
x_scale 0.5e-9
x_scale 1e-9
# Quantum scaling options. This scales globally the output
# for qnoised, qshot and shot.
......@@ -25,6 +23,14 @@ x_scale 0.5e-9
# 4 = Amplitude spectral density in units of sqrt(hf)
quantum_scaling 3
# Amplitude scaling options. This sets how the
# ad detectors will scale the field amplitude.
# This should not affect any other detector outputs.
#
# 0 : P = 0.5*eps_0*c*|E|^2
# 1 : P = 0.5*|E|^2
# 2 : P = |E|^2
amplitude_scaling 2
### Parameters for the locking algorithm:
......@@ -1275,5 +1281,3 @@ set nokey
set title
END
......@@ -4,10 +4,8 @@
MKDIR = mkdir -p
#.PHONY: clean SuperLU_MT_2.1 NICSLU formulc libkatnet libMNet KLUsparse Cuba-3.2
#default : SuperLU_MT_2.1 NICSLU formulc libkatnet libMNet KLUsparse Cuba-3.2
.PHONY: clean formulc libkatnet libMNet KLUsparse Cuba-3.2
default : formulc libkatnet libMNet KLUsparse Cuba-3.2
.PHONY: clean NICSLU formulc libkatnet libMNet KLUsparse Cuba-3.2
default : NICSLU formulc libkatnet libMNet KLUsparse Cuba-3.2
# build the sparse package
SuperLU_MT_2.1:
......@@ -16,16 +14,22 @@ SuperLU_MT_2.1:
$(MAKE) --directory=$@ ARCH=$(ARCH)
NICSLU:
$(MAKE) --directory=$@/lib ARCH=$(ARCH)
ifeq "$(INCLUDE_NICSLU)" "1"
$(MAKE) --directory=$@/lib
endif
sparse:
$(MAKE) --directory=$@ ARCH=$(ARCH)
libkatnet:
ifeq "$(INCLUDE_NET)" "1"
$(MAKE) --directory=$@ ARCH=$(ARCH)
endif
libMNet:
ifeq "$(INCLUDE_NET)" "1"
$(MAKE) --directory=$@ ARCH=$(ARCH)
endif
# build the formulc package
formulc:
......@@ -37,8 +41,11 @@ KLUsparse:
# build the cuba package
Cuba-3.2:
ifeq "$(INCLUDE_CUBA)" "1"
$(MAKE) lib --directory=$@ ARCH=$(ARCH)
cp ./Cuba-3.2/cuba.h ../src/
endif
# cleanup targets
clean:
for d in formulc libkatnet libMNet KLUsparse SuperLU_MT_2.1 NICSLU; \
......@@ -47,9 +54,11 @@ clean:
done
$(MAKE) --directory=Cuba-3.2 clean dist
rm ./Cuba-3.2/libcuba.a
rm ./KLUsparse/KLU/Lib/lib*.a
rm ./KLUsparse/COLAMD/Lib/lib*.a
rm ./KLUsparse/BTF/Lib/lib*.a
rm ./KLUsparse/AMD/Lib/lib*.a
rm -f ./NICSLU/lib/nicsluc.a
rm -f ./Cuba-3.2/libcuba.a
rm -f ./KLUsparse/KLU/Lib/lib*.a
rm -f ./KLUsparse/COLAMD/Lib/lib*.a
rm -f ./KLUsparse/BTF/Lib/lib*.a
rm -f ./KLUsparse/AMD/Lib/lib*.a
# vim: shiftwidth=4:
all:
(cd lib; make)
lib:
(cd lib; make)
demo:
(cd demo; make)
clean:
(cd lib; make clean)
(cd demo; make clean)
This diff is collapsed.
l l1 1 0 n0
m m1 0.5 0.5 76.544 n0 n1
s s1 1 n1 n2
m m2 0.9 0.1 0.12314 n2 n3
pd tran n3
noxaxis
attr m1 xbeta 1e-8 ybeta 4e-9
attr m2 xbeta 5.5e-8 ybeta -3e-9
maxtem 20
printmatrix
all: demos demop
include ../make.inc
LIBS = -L. ../lib/nicsluc.a -lpthread -lm
INC = -I ../include/
read_file_to_csr.o: read_file_to_csr.c
gcc -O2 -c -o read_file_to_csr.o read_file_to_csr.c
all: demos demop
demos: demos.o read_file_to_csr.o
gcc -O2 -o demos demos.o read_file_to_csr.o -L. ../lib/nicslu.a -lpthread -lm
demos: demos.o
$(CC) $(LFLAGS) -o demos demos.o $(LIBS)
demos.o: demos.c
gcc -O2 -c -o demos.o demos.c
$(CC) $(CFLAGS) -o demos.o $(INC) demos.c
demop: demop.o read_file_to_csr.o
gcc -O2 -o demop demop.o read_file_to_csr.o -L. ../lib/nicslu.a -lpthread -lm
demop: demop.o
$(CC) $(LFLAGS) -o demop demop.o $(LIBS)
demop.o: demop.c
gcc -O2 -c -o demop.o demop.c
$(CC) $(CFLAGS) -o demop.o $(INC) demop.c
clean:
rm -f demos.o demos demop.o demop read_file_to_csr.o
rm -f demos.o demos demop.o demop
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../include/nicslu.h"
#include "nicsluc.h"
int n = 0;
double *ax = NULL;
int *ai = NULL;
int *ap = NULL;
int ReadFileToCSR(const char *file);
main(void)
int main(int argc, char *argv[])
{
int ret, nnz, i;
SNicsLU *nicslu;
double *x, *b, err;
(void)argc;
int ret;
uint__t n, nnz;
SNicsLUc *nicslu;
complex__t *x;
real__t err;
char c;
uint__t ni=0, np=0;
uint__t *ai=NULL, *ap=NULL;
complex__t *rhs=NULL, *ax=NULL;
n = 0;
nnz = 0;
x = NULL;
nicslu = (SNicsLU *)malloc(sizeof(SNicsLU));
NicsLU_Initialize(nicslu);
ret = ReadFileToCSR("ASIC_100k.mtx");
if (ret != 0) goto EXIT;
nnz = ap[n];
x = (double *)malloc(sizeof(double)*(n+n));
b = x + n;
for (i=0; i<n+n; ++i) x[i] = 1.;
NicsLU_CreateMatrix(nicslu, n, nnz, ax, (uint__t *)ai, (uint__t *)ap);
NicsLU_Analyze(nicslu);
const char* file = "klu_full_matrix_car.dat";
printf("Reading file...\n");
FILE *f = fopen(file, "r");
while ( (c=fgetc(f)) != EOF ) {
if ( c == '\n' )
nnz++;
}
ai = (uint__t*) malloc(nnz * sizeof(uint__t));
ap = (uint__t*) malloc(nnz * sizeof(uint__t));
ax = (complex__t*) malloc(nnz * sizeof(complex__t));