Commit 29781db2 authored by Daniel Brown's avatar Daniel Brown

Merge branch 'develop'

parents 71575b01 f56bac57
*.err
*.log
kat.exe
kat
src/cuba.h
src/kat_config.h
# Stop extra files
test.*
test_plot.*
.DS_store
test
doc
finesse.project
nbproject*
\ No newline at end of file
Changes between different versions of Finesse
http://www.gwoptics.org/finesse
......@@ -9,6 +10,110 @@ fixed bugs.
This list starts with Version 0.53 since there were just too many
changes before. Not every version number is listed.
2.1 -> 2.2 (June 2017)
main changes:
This release incorporates new features and bug fixes over the last year.
This mainly involves fixes and new features for modelling of quantum systems, like EPR
squeezing, and HOM squeezing. In addition a new feature for displaying all the mode mismatches
in a model can now be displayed to aid in matching files quicker. A new isolator like
component called a directional beamsplitter (dbs) was added. This was because the original 3-port
device couldn't handle the mix of quantum noise easily. The three port isolator component
was removed. Pykat and Finesse now talk to each other via a pipe command, which will be
used more in future and save writing things to disk first before reading it in to Python.
Added ability to set offset via the lock command now, rather than having to define a separate
function.
syntax change:
o tf2: For each pole or zero added the funcion will automatically add the conjugate pole
so you don't need to specify each
o Three port isolator is no longer available
o pitch and yaw can now be used instead of ybeta and xbeta
o Added optional offset parameter: lock name $var gain accuracy [offset]
added features:
o added 'powers' command which prints the light power in all node to the terminal
o added the ability to generate mutli-mode squeezing. This is done by using the `tem'
command to set the mode content of a squeezer, like a normal laser component. The
only difference being the amplitude part inputs the mode squeezing in dB and phase
input sets the squeezing rotation.
o Introduced `--pykat=pipename` flag. This opens a pipe between Finesse and whatever
else (typically Pykat) so that data can be sent and requested between the two.
o mismatches [flag]: displays mismatching present in the model
o dbs: Directional beam splitter component
Usage:
dbs name node1 node2 node3 node4
Connections:
node1 -> node3
node2 -> node1
node3 -> node4
node4 -> node2
This can be used essentially as a perfect isolator component with multiple nodes.
For an input isolator the laser goes in at node1 and node3 goes to the IFO, the reflected
port is then at node4. This also applies for the output isolator for injecting squeezing.
node1 is from the IFO, node3 towards OMC and node2 the squeexing injection.
o Entangled carrier injection for EPR modelling using the sqz* command.
Generates a 0Hz field and another at the frequency specified in the command.
These two fields then have their upper and lower sidebands correllated.
o qNhd detector for combing quantum noise measurements at multiple nodes.
usage example:
func funca = (-1)
func funcb = (1)
q2hd HD_AB funca node1a node1b funcb node2a node2b
Specify how many homodyne measurements you need, and a transfer function to scale the output
of each before combining them.
o Frequency selective R and T at a beamsplitter. You can now set the R and T value for a given
frequency bin. This is set by the frequency name which can be found by running the file with
using the `frequency` command. This will print a list of all frequencies and their names.
With this name you can then set the R and T value as shown below:
Example: Reflecting the lower (minus) sideband
l l1 1.0 0 0.0 n1
bs bs1 1 0 0 0 n1 n2 n3 n4
# conf beamsplitter fRT frequency_name R T
conf bs1 fRT l1_psb 0 1
conf bs1 fRT l1_msb 1 0
fsig sig l1 1 0 1
ad u $fs n3
ad l $mfs n3
o Lock offset: Can set the offset to a lock more easily now instead of having
to define a func and do the math.
Example:
l l1 10 0 0.0 n1
m m1 0 1 0 n1 n2
pd P n2
set P.re P re
lock test $P.re -0.01 1e-4 -2
put l1 P $test
xaxis test offset lin -1 -10 10
bug fixes:
o noxaxis no longer tries to call gnuplot/python plotting
o fixed roundtrip gouy phase sign
o fixed bug with frequency signal/noise, i.e. when applying fsig
to a laser frequency
o Fixed error when using var, which would say that too many variables exist
o Fixed map scattering calculations when storing values for a certain maxtem but then rerunning with a larger one.
o Non-square maps causing segfault is fixed
o Functions names can be longer than 14 characters now
o Phase 1 was being incorrectly applied for surface motion maps, gave wrong sign errors for PI gains
in certain circumstances.
o ASC signals through composite mirrors were fixed. See https://dcc.ligo.org/LIGO-T1700114
2.0 -> 2.1 (22/04/2016)
main changes:
......@@ -148,9 +253,9 @@ added features:
variable in kat.ini.
o Changed quantum noise injection to take advantage of the loss information
in the coupling matrices. We now inject the noise lost due to couplings
such as mode-mismatch, tits, maps, etc. by assuming all the power that
isn't coupled is replaced with vacuum noise. This means a large number
of modes to get quantum noise converging shouldn't be needed. You only
such as mode-mismatch, tilts, maps, etc. by assuming all the power that
is not coupled is replaced with vacuum noise. This means a large number
of modes to get quantum noise converging should not be needed. You only
need enough to get the classical sidebands/carriers converging. This
is assuming the higher order modes not included do not contain any
quantum correllations, if they do your quantum noise values may still
......@@ -170,7 +275,7 @@ bug fixes:
with the cos(alpha) term as stated in the manual section 4.11.
o Fixed bug in beamsplitter pitch tilt signals not coupling correct modes.
o Fixed bug with scaling of qshotS and qnoisedS commands, also fixed
a bug where scale commands didn't affect qshot and qnoised.
a bug where scale commands did not 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
......
Finesse: Frequency domain INterfErometer Simulation SoftwarE
Andreas Freise 17.05.2014 http://www.gwoptics.org/finesse/
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.821363.svg)](https://doi.org/10.5281/zenodo.821363)
Daniel Brown and Andreas Freise 26.06.2017
http://www.gwoptics.org/finesse/
README
------------------------------------------------------------
Finesse [1] is a numeric simulation for laser interferometers
using the frequency domain and Hermite-Gauss modes. This document
gives a short overview of the main features of Finesse. Please
see the file INSTALL for information on installing and running
Finesse.
using the frequency domain and Hermite-Gauss modes. It is open
source software distributed for OSX, Linux, and Windows. You
can download the binaries at:
http://www.gwoptics.org/finesse/
The source code is available at:
https://git.ligo.org/finesse/finesse/
This document gives a short overview of the main features of
Finesse. Please see the file INSTALL for information on
installing and running Finesse.
HOW TO CITE FINESSE
------------------------------------------------------------
For results using Finesse please cite the following DOI:
@misc{finesse,
author = {Brown, Daniel David and
Freise, Andreas},
title = {Finesse},
month = may,
year = 2014,
note = {{You can download the binaries and source code at
\url{http://www.gwoptics.org/finesse}.}},
doi = {10.5281/zenodo.821363},
url = {http://www.gwoptics.org/finesse}
}
1. Interferometer signals
2. Beam geometry and imaging
3. Documentation, testing and examples
4. Examples of the impact of Finesse on commissioning tasks
5. Finesse with Python and MATLAB
6. References
Table of Contents:
------------------------------------------------------------
1. Interferometer signals
2. Beam geometry and imaging
3. Documentation, support and examples
4. Examples of the impact of Finesse on commissioning tasks
5. Finesse with Python and MATLAB
6. References
------------------------------------------------------------
......@@ -54,22 +89,32 @@ and interferometers. Gouy phases and beam waist positions can be
plotted as functions of positions of optical elements.
3. Documentation, testing and examples
3. Documentation, support and examples
------------------------------------------------------------
The simulation code has been developed and improved continuously
over the last ten years. It has been frequently and successfully
tested against experimental data from GEO 600 (and sometimes
using LIGO and Virgo data). The code is under version control
and is executed within a nightly test-suite to maintain stability
during the ongoing development.
The program is easy to use for students: For the basic use, including
graphical output, no commercial software is required. The implemented
physics is well documented in a 180 pages manual. Simple examples are
physics is well documented in a 200 pages manual. Simple examples are
provided as well as detailed input files for all main interferometric
gravitational-wave detectors.
gravitational-wave detectors. The manual and examples can be found on
the main Finesse page at http://www.gwoptics.org/finesse/
In addition we provide resources and self-study material on laser
interferometry in the form of Jupyter notebooks using Finesse
simulations: http://www.gwoptics.org/learn/
For questions and discussions related to Finesse we are hosting
a mailing in Birmingham and LIGO chat channel. Instructions on how
to join these are provided at:
https://git.ligo.org/finesse/finesse/wikis/home
The simulation code has been developed and improved continuously
over the last ten years. It has been frequently and successfully
tested against experimental data from GEO 600, LIGO and Virgo.
The code is under version control and is executed within a nightly
test-suite to maintain stability during the ongoing development.
4. Examples of Finesse usage for commissioning tasks
------------------------------------------------------------
......@@ -157,4 +202,15 @@ with Finesse from Python.
[8] C. Bond, P. Fulda, D. Brown and A. Freise: ‘Investigation of beam
clipping in the Power Recycling Cavity of Advanced LIGO using Finesse’,
LIGO note T1300954, https://dcc.ligo.org/LIGO-T1300954, (2013)
\ No newline at end of file
LIGO note T1300954, https://dcc.ligo.org/LIGO-T1300954, (2013)
[9] D. Brown, R. J. E. Smith, and A. Freise:
Fast simulation of Gaussian-mode scattering for precision interferometry
Journal of Optics, 2016, http://stacks.iop.org/2040-8986/18/i=2/a=025604
[10] Daniel David Brown
Interactions of light and mirrors: advanced techniques for modelling
future gravitational wave detectors
Ph.D. thesis, University of Birmingham, 2016
https://doi.org/10.5281/zenodo.821380
\ No newline at end of file
To clean up run:
conda build purge
Then run:
conda build finesse_binary
To upload a version, something like:
conda build finesse_VERSION
anaconda upload /Users/ddb/miniconda3/conda-bld/osx-64/finesse_binary-2.1-0.tar.bz2
To upload a new dev version, something like:
conda build finesse_develop
anaconda upload /Users/ddb/miniconda3/conda-bld/osx-64/finesse_binary-2.1-0.tar.bz2 --label dev
To make a new version to distribute copy one of the folders and edit the yaml file
If you need to update a package you need to change the build number
\ No newline at end of file
@ECHO ON
SET LookForFile="%SRC_DIR%\kat.exe"
chdir /d %SRC_DIR%
IF "%ARCH%"=="64" (
c:\msys64\mingw64 /bin/bash ./finesse.sh --build-win64
)
IF "%ARCH%"=="32" (
c:\msys64\mingw32 /bin/bash ./finesse.sh --build-win32
)
@ECHO OFF
:CheckForFile
IF EXIST %LookForFile% GOTO FoundIt
TIMEOUT /T 2 >nul
GOTO CheckForFile
:FoundIt
ECHO Found: %LookForFile%
@ECHO ON
xcopy %SRC_DIR%\kat.exe "%PREFIX%\Library\bin\"
xcopy %SRC_DIR%\kat.ini "%PREFIX%\Library\bin\"
mkdir %PREFIX%\etc\conda\activate.d
mkdir %PREFIX%\etc\conda\deactivate.d
type NUL > %PREFIX%\etc\conda\activate.d\finesse_vars.bat
type NUL > %PREFIX%\etc\conda\deactivate.d\finesse_vars.bat
echo @ECHO OFF >> %PREFIX%\etc\conda\activate.d\finesse_vars.bat
echo SET KATINI=%%CONDA_PREFIX%%\Library\bin\kat.ini >> %PREFIX%\etc\conda\activate.d\finesse_vars.bat
echo SET FINESSE_DIR=%%CONDA_PREFIX%%\Library\bin >> %PREFIX%\etc\conda\activate.d\finesse_vars.bat
echo @ECHO OFF >> %PREFIX%\etc\conda\deactivate.d\finesse_vars.bat
echo SET KATINI= >> %PREFIX%\etc\conda\deactivate.d\finesse_vars.bat
echo SET FINESSE_DIR= >> %PREFIX%\etc\conda\deactivate.d\finesse_vars.bat
\ No newline at end of file
#!/bin/bash
platform='unknown'
unamestr=`uname`
unamem=`uname -m`
if [[ "$unamestr" == 'Linux' ]]; then
if [[ "${ARCH}" == '32' ]]; then
./finesse.sh --build-linux32
else
./finesse.sh --build-linux
fi
cp ./kat ${PREFIX}/bin
cp ./kat.ini ${PREFIX}/bin
elif [[ "$unamestr" == 'Darwin' ]]; then
if [[ "${ARCH}" == '32' ]]; then
./finesse.sh --build-mac32
else
./finesse.sh --build-mac
fi
cp ./kat ${PREFIX}/bin
cp ./kat.ini ${PREFIX}/bin
elif [[ "$unamestr" == *CYGWIN* ]]; then
if [[ "$unamem" == 'i686' ]]; then
./finesse.sh --build-win32
else
./finesse.sh --build-win64
fi
cp ./kat.exe ${PREFIX}/bin
cp ./kat.ini ${PREFIX}/bin
elif [[ "$unamestr" == *MINGW32* ]]; then
echo "Platform not supported" | tee -a $LOGFILE
failure
else
echo "Platform could not be determined" | tee -a $LOGFILE
failure
fi
# Setup saved env vars https://conda.io/docs/using/envs.html
mkdir -p ${PREFIX}/etc/conda/activate.d
mkdir -p ${PREFIX}/etc/conda/deactivate.d
touch ${PREFIX}/etc/conda/activate.d/finesse_vars.sh
touch ${PREFIX}/etc/conda/deactivate.d/finesse_vars.sh
echo "#!/bin/bash" >> ${PREFIX}/etc/conda/activate.d/finesse_vars.sh
echo "export KATINI=\${CONDA_PREFIX}/bin/kat.ini" >> ${PREFIX}/etc/conda/activate.d/finesse_vars.sh
echo "export FINESSE_DIR=\${CONDA_PREFIX}/bin/" >> ${PREFIX}/etc/conda/activate.d/finesse_vars.sh
echo "#!/bin/bash" >> ${PREFIX}/etc/conda/deactivate.d/finesse_vars.sh
echo "unset KATINI" >> ${PREFIX}/etc/conda/deactivate.d/finesse_vars.sh
echo "unset FINESSE_DIR" >> ${PREFIX}/etc/conda/deactivate.d/finesse_vars.sh
\ No newline at end of file
package:
name: finesse
version: 2.1
source:
git_rev: 2.1
git_url: https://git.ligo.org/finesse/finesse.git
build:
number: 0
about:
home: www.gwoptics.org/finesse
license: GPL3
license_file: LICENSES
@ECHO ON
SET LookForFile="%SRC_DIR%\kat.exe"
chdir /d %SRC_DIR%
IF "%ARCH%"=="64" (
c:\msys64\mingw64 /bin/bash ./finesse.sh --build-win64
)
IF "%ARCH%"=="32" (
c:\msys64\mingw32 /bin/bash ./finesse.sh --build-win32
)
@ECHO OFF
:CheckForFile
IF EXIST %LookForFile% GOTO FoundIt
TIMEOUT /T 2 >nul
GOTO CheckForFile
:FoundIt
ECHO Found: %LookForFile%
@ECHO ON
xcopy %SRC_DIR%\kat.exe "%PREFIX%\Library\bin\"
xcopy %SRC_DIR%\kat.ini "%PREFIX%\Library\bin\"
mkdir %PREFIX%\etc\conda\activate.d
mkdir %PREFIX%\etc\conda\deactivate.d
type NUL > %PREFIX%\etc\conda\activate.d\finesse_vars.bat
type NUL > %PREFIX%\etc\conda\deactivate.d\finesse_vars.bat
echo @ECHO OFF >> %PREFIX%\etc\conda\activate.d\finesse_vars.bat
echo SET KATINI=%%CONDA_PREFIX%%\Library\bin\kat.ini >> %PREFIX%\etc\conda\activate.d\finesse_vars.bat
echo SET FINESSE_DIR=%%CONDA_PREFIX%%\Library\bin >> %PREFIX%\etc\conda\activate.d\finesse_vars.bat
echo @ECHO OFF >> %PREFIX%\etc\conda\deactivate.d\finesse_vars.bat
echo SET KATINI= >> %PREFIX%\etc\conda\deactivate.d\finesse_vars.bat
echo SET FINESSE_DIR= >> %PREFIX%\etc\conda\deactivate.d\finesse_vars.bat
\ No newline at end of file
#!/bin/bash
platform='unknown'
unamestr=`uname`
unamem=`uname -m`
if [[ "$unamestr" == 'Linux' ]]; then
if [[ "${ARCH}" == '32' ]]; then
./finesse.sh --build-linux32
else
./finesse.sh --build-linux
fi
cp ./kat ${PREFIX}/bin
cp ./kat.ini ${PREFIX}/bin
elif [[ "$unamestr" == 'Darwin' ]]; then
if [[ "${ARCH}" == '32' ]]; then
./finesse.sh --build-mac32
else
./finesse.sh --build-mac
fi
cp ./kat ${PREFIX}/bin
cp ./kat.ini ${PREFIX}/bin
elif [[ "$unamestr" == *CYGWIN* ]]; then
if [[ "$unamem" == 'i686' ]]; then
./finesse.sh --build-win32
else
./finesse.sh --build-win64
fi
cp ./kat.exe ${PREFIX}/bin
cp ./kat.ini ${PREFIX}/bin
elif [[ "$unamestr" == *MINGW32* ]]; then
echo "Platform not supported" | tee -a $LOGFILE
failure
else
echo "Platform could not be determined" | tee -a $LOGFILE
failure
fi
# Setup saved env vars https://conda.io/docs/using/envs.html
mkdir -p ${PREFIX}/etc/conda/activate.d
mkdir -p ${PREFIX}/etc/conda/deactivate.d
touch ${PREFIX}/etc/conda/activate.d/finesse_vars.sh
touch ${PREFIX}/etc/conda/deactivate.d/finesse_vars.sh
echo "#!/bin/bash" >> ${PREFIX}/etc/conda/activate.d/finesse_vars.sh
echo "export KATINI=\${CONDA_PREFIX}/bin/kat.ini" >> ${PREFIX}/etc/conda/activate.d/finesse_vars.sh
echo "export FINESSE_DIR=\${CONDA_PREFIX}/bin/" >> ${PREFIX}/etc/conda/activate.d/finesse_vars.sh
echo "#!/bin/bash" >> ${PREFIX}/etc/conda/deactivate.d/finesse_vars.sh
echo "unset KATINI" >> ${PREFIX}/etc/conda/deactivate.d/finesse_vars.sh
echo "unset FINESSE_DIR" >> ${PREFIX}/etc/conda/deactivate.d/finesse_vars.sh
\ No newline at end of file
package:
name: finesse
version: develop
source:
git_rev: develop
git_url: https://git.ligo.org/finesse/finesse.git
build:
number: 0
about:
home: www.gwoptics.org/finesse
license: GPL3
license_file: LICENSES
......@@ -381,10 +381,14 @@ elif [[ "$unamestr" == *CYGWIN* ]]; then
else
platform='cygwin64'
fi
elif [[ "$unamestr" == *MINGW32* ]]; then
platform='win64'
elif [[ "$unamestr" == *MINGW* ]]; then
if [[ "$unamem" == 'i686' ]]; then
platform='win32'
else
platform='win64'
fi
else
echo "Platform could not be determined" | tee -a $LOGFILE
echo "Platform could not be determined ($unamestr)" | tee -a $LOGFILE
failure
fi
......@@ -512,11 +516,20 @@ case $TARGET in
failure
fi
echo "Building for OSX version: 10.$OSXminor"
# probably should allow custom minor version for build-mac
export MACOSX_DEPLOYMENT_TARGET="10.$OSXminor"
if [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/ ]; then
if [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/ ]; then
echo "Preparing Mac OS X 10.12 SDK build environment..." | tee -a $LOGFILE
export OSX_SDK="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/"
export OSX_CFLAGS=$OPTIM_CFLAGS"-isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=12"
export OSX_LDFLAGS="-isysroot $OSX_SDK -Wl,-syslibroot,$OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OSX_CFLAGS
export CXXFLAGS=$OSX_CFLAGS
export LDFLAGS=$OSX_LDFLAGS
elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/ ]; then
echo "Preparing Mac OS X 10.11 SDK build environment..." | tee -a $LOGFILE
export OSX_SDK="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/"
export OSX_CFLAGS=$OPTIM_CFLAGS"-isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET"
export OSX_CFLAGS=$OPTIM_CFLAGS"-isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=11"
export OSX_LDFLAGS="-isysroot $OSX_SDK -Wl,-syslibroot,$OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OSX_CFLAGS
export CXXFLAGS=$OSX_CFLAGS
......@@ -524,7 +537,7 @@ case $TARGET in
elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/ ]; then
echo "Preparing Mac OS X 10.10 SDK build environment..." | tee -a $LOGFILE
export OSX_SDK="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/"
export OSX_CFLAGS=$OPTIM_CFLAGS"-isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET"
export OSX_CFLAGS=$OPTIM_CFLAGS"-isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=10"
export OSX_LDFLAGS="-isysroot $OSX_SDK -Wl,-syslibroot,$OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OSX_CFLAGS
export CXXFLAGS=$OSX_CFLAGS
......@@ -532,7 +545,7 @@ case $TARGET in
elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/ ]; then
echo "Preparing Mac OS X 10.9 SDK build environment..." | tee -a $LOGFILE
export OSX_SDK="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/"
export OSX_CFLAGS=$OPTIM_CFLAGS"-isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET"
export OSX_CFLAGS=$OPTIM_CFLAGS"-isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=9"
export OSX_LDFLAGS="-isysroot $OSX_SDK -Wl,-syslibroot,$OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OSX_CFLAGS
export CXXFLAGS=$OSX_CFLAGS
......@@ -540,7 +553,7 @@ case $TARGET in
elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/ ]; then
echo "Preparing Mac OS X 10.8 SDK build environment..." | tee -a $LOGFILE
export OSX_SDK="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/"
export OSX_CFLAGS=$OPTIM_CFLAGS" -isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET"
export OSX_CFLAGS=$OPTIM_CFLAGS" -isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=8"
export OSX_LDFLAGS=" -isysroot $OSX_SDK -Wl,-syslibroot,$OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OSX_CFLAGS
export CXXFLAGS=$OSX_CFLAGS
......@@ -548,7 +561,7 @@ case $TARGET in
elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/ ]; then
echo "Preparing Mac OS X 10.7 SDK build environment..." | tee -a $LOGFILE
export OSX_SDK="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/"
export OSX_CFLAGS=$OPTIM_CFLAGS" -isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET"
export OSX_CFLAGS=$OPTIM_CFLAGS" -isysroot $OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=7"
export OSX_LDFLAGS="-isysroot $OSX_SDK -Wl,-syslibroot,$OSX_SDK -arch $CPUARCH -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OSX_CFLAGS
export CXXFLAGS=$OSX_CFLAGS
......@@ -557,25 +570,25 @@ case $TARGET in
echo "Preparing Mac OS X 10.6 x86_64 SDK build environment..." | tee -a $LOGFILE
export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -arch $CPUARCH $LDFLAGS"
export CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch $CPUARCH $CPPFLAGS -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OPTIM_CFLAGS"-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch $CPUARCH $CFLAGS -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OPTIM_CFLAGS"-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch $CPUARCH $CFLAGS -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=6"
export CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch $CPUARCH $CXXFLAGS"
export SDKROOT="/Developer/SDKs/MacOSX10.6.sdk"
elif [ -d /Developer/SDKs/MacOSX10.5u.sdk ]; then
echo "Preparing Mac OS X 10.5 i386 SDK build environment..." | tee -a $LOGFILE
export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch $CPUARCH $LDFLAGS"
export CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch $CPUARCH $CPPFLAGS -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OPTIM_CFLAGS"-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch $CPUARCH $CFLAGS -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OPTIM_CFLAGS"-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch $CPUARCH $CFLAGS -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=5"
export CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch $CPUARCH $CXXFLAGS"
export SDKROOT="/Developer/SDKs/MacOSX10.5.sdk"
elif [ -d /Developer/SDKs/MacOSX10.4u.sdk ]; then
echo "Preparing Mac OS X 10.4 i386 SDK build environment..." | tee -a $LOGFILE
export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch $CPUARCH $LDFLAGS"
export CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch $CPUARCH $CPPFLAGS -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OPTIM_CFLAGS"-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch $CPUARCH $CFLAGS -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET"
export CFLAGS=$OPTIM_CFLAGS"-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch $CPUARCH $CFLAGS -DOSX_BUILD_VER=$MACOSX_DEPLOYMENT_TARGET -DMACOSX_SDK=4"
export CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch $CPUARCH $CXXFLAGS"
export SDKROOT="/Developer/SDKs/MacOSX10.4u.sdk"
else
echo "Mac OS X 10.4 - 10.11 SDK required but missing!" | tee -a $LOGFILE
echo "Mac OS X 10.4 - 10.12 SDK required but missing!" | tee -a $LOGFILE
failure
fi
#prepare_tree || failure
......
......@@ -12,13 +12,28 @@
#include <mach/mach_time.h>
#define TIMER_ABSTIME -1
#define CLOCK_REALTIME CALENDAR_CLOCK
#define CLOCK_MONOTONIC SYSTEM_CLOCK
#ifdef __APPLE__
#include <AvailabilityMacros.h>
#ifndef MAC_OS_X_VERSION_10_12
#define MAC_OS_X_VERSION_10_12 101200
#endif
#endif
//#define APPLE_HAVE_CLOCK_GETTIME (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12))
#define APPLE_HAVE_CLOCK_GETTIME (defined(__APPLE__) && (MACOSX_SDK >= 12))
static double mt_timebase = 0.0;
static uint64_t mt_timestart = 0;
//clock_gettime is not implemented on OSX
//clock_gettime is not implemented on OSX up to 10.12
#if !APPLE_HAVE_CLOCK_GETTIME
#define CLOCK_REALTIME CALENDAR_CLOCK
#define CLOCK_MONOTONIC SYSTEM_CLOCK
int clock_gettime(int clk_id, struct timespec *tp)
{
kern_return_t retval = KERN_SUCCESS;
......@@ -51,6 +66,8 @@ int clock_gettime(int clk_id, struct timespec *tp)
return retval;
}
#endif
#else
#include <time.h>
#endif
......
......@@ -48,6 +48,14 @@ else
endif
endif
# These are required for statically linking mingw libraries for distribution
ifeq "$(ARCH)" "win32"
MINGW_FLAGS = -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic
else ifeq "$(ARCH)" "win64"
MINGW_FLAGS = -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic
else
MINGW_FLAGS =
endif
GIT = git
GREP = grep
......@@ -246,8 +254,8 @@ endif
# make kat
kat: PROG = ../kat
kat: msgs config $(PREREQS)
$(CXX) ${GSL_CFLAGS} $(BASE_CFLAGS) -c $(INCLUDES) $(KAT_SOURCES_CPP)
$(CC) $(FAST_CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
$(CXX) ${GSL_CFLAGS} $(BASE_CFLAGS) -c $(INCLUDES) $(KAT_SOURCES_CPP) ${MINGW_FLAGS}
$(CC) $(FAST_CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS} ${MINGW_FLAGS}
# make fast
fast: kat
......@@ -259,13 +267,13 @@ debug: CFLAGS = $(DEBUG_CFLAGS)
debug: PROG = ../kat
debug: msgs config $(PREREQS)
$(CXX) $(DEBUG_CFLAGS) ${GSL_CFLAGS} $(BASE_CFLAGS) -c $(INCLUDES) $(KAT_SOURCES_CPP)
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
# make nodebug
nodebug: CFLAGS = $(NODEBUG_CFLAGS)
nodebug: PROG = ../kat
nodebug: config $(PREREQS)
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS} ${MINGW_FLAGS}
# make test
$(TEST_OBJECTS): CFLAGS = $(BASE_CFLAGS) -g
......@@ -315,7 +323,7 @@ slow: config $(PREREQS)
# make versionnumber
versionnumber: PROG := ../kat_$(GIT_SHA)
versionnumber: config $(PREREQS)
$(CC) $(FAST_CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
$(CC) $(FAST_CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS} ${MINGW_FLAGS}
### sundry other targets ###
......
......@@ -146,6 +146,7 @@ FILE* pykat_file;
* \param argc The number of input parameters
* \param argv The array of input parameters
*/
int main(int argc, char *argv[]) {
getTime(&clock_start);
......@@ -437,6 +438,7 @@ int main(int argc, char *argv[]) {
} else if (strcasecmp(argv[1 + num_options], "--perl1") == 0) {
warn("Use --pykat option instead of --perl1, it has been depreciated.");
options.perl1 = 1;
sprintf(vglobal.pykat_pipename, "");
++num_options;
--argc;