forked from lballabio/QuantLib-SWIG
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
2,430 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ quantlib_wrap.* | |
*.dll | ||
Makefile | ||
Makefile.in | ||
csharp | ||
QuantLib.ncb | ||
QuantLib.suo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,39 @@ | ||
|
||
CLEANFILES = quantlib_wrap.* libNQuantLibc.so QuantLib.dll | ||
CLEANFILES = cpp/quantlib_wrap.* csharp/*.cs libNQuantLibc.so NQuantLib.dll | ||
|
||
BUILT_SOURCES = quantlib_wrap.cpp | ||
BUILT_SOURCES = cpp/quantlib_wrap.cpp | ||
|
||
if HAVE_MCS | ||
|
||
all-local: libNQuantLibc.so QuantLib.dll | ||
all-local: libNQuantLibc.so NQuantLib.dll | ||
|
||
libNQuantLibc.so: quantlib_wrap.o | ||
g++ -shared quantlib_wrap.o -o libNQuantLibc.so -lQuantLib | ||
libNQuantLibc.so: cpp/quantlib_wrap.o | ||
g++ -shared cpp/quantlib_wrap.o -o libNQuantLibc.so -lQuantLib | ||
|
||
quantlib_wrap.o: quantlib_wrap.cpp | ||
g++ -c -fpic quantlib_wrap.cpp | ||
cpp/quantlib_wrap.o: $(BUILT_SOURCES) | ||
g++ -c -fpic cpp/quantlib_wrap.cpp -o cpp/quantlib_wrap.o | ||
|
||
QuantLib.dll: quantlib_wrap.cpp | ||
$(MCS) -nologo -target:library -out:QuantLib.dll csharp/*.cs | ||
NQuantLib.dll: $(BUILT_SOURCES) | ||
$(MCS) -nologo -target:library -out:NQuantLib.dll csharp/*.cs | ||
|
||
endif | ||
|
||
clean-local: | ||
rm -rf csharp | ||
|
||
quantlib_wrap.cpp: csharp ../SWIG/*.i | ||
cpp/quantlib_wrap.cpp: ../SWIG/*.i | ||
$(SWIG) -csharp -c++ -I../SWIG -outdir csharp \ | ||
-namespace QuantLib -o quantlib_wrap.cpp quantlib.i | ||
|
||
csharp: | ||
mkdir -p csharp | ||
|
||
dist-hook: | ||
-namespace QuantLib -o cpp/quantlib_wrap.cpp quantlib.i | ||
|
||
dist-hook: cpp/quantlib_wrap.cpp | ||
mkdir -p $(distdir)/cpp | ||
cp ./cpp/QuantlibWrapper.vcproj $(distdir)/cpp | ||
cp ./cpp/quantlib_wrap.cpp $(distdir)/cpp | ||
cp ./cpp/QuantlibWrapper.h ./cpp/QuantlibWrapper.cpp $(distdir)/cpp | ||
cp ./cpp/stdafx.h $(distdir)/cpp | ||
mkdir -p $(distdir)/csharp | ||
cp ./csharp/NQuantLib.csproj $(distdir)/csharp | ||
cp ./csharp/*.cs $(distdir)/csharp | ||
mkdir -p $(distdir)/examples | ||
cp ./examples/*.csproj $(distdir)/examples | ||
cp ./examples/*.cs $(distdir)/examples | ||
|
||
EXTRA_DIST = README.txt $(BUILT_SOURCES) | ||
EXTRA_DIST = QuantLib.sln swig.cmd README.txt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Microsoft Visual Studio Solution File, Format Version 8.00 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NQuantLib", "csharp\NQuantLib.csproj", "{928F98EE-7D50-457F-9304-A6818DCF1079}" | ||
ProjectSection(ProjectDependencies) = postProject | ||
EndProjectSection | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BermudanSwaption", "examples\BermudanSwaption.csproj", "{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}" | ||
ProjectSection(ProjectDependencies) = postProject | ||
{21183104-9963-4D4F-B7E8-C8A6169FD053} = {21183104-9963-4D4F-B7E8-C8A6169FD053} | ||
EndProjectSection | ||
EndProject | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NQuantLibc", "cpp\QuantlibWrapper.vcproj", "{21183104-9963-4D4F-B7E8-C8A6169FD053}" | ||
ProjectSection(ProjectDependencies) = postProject | ||
EndProjectSection | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfiguration) = preSolution | ||
Debug = Debug | ||
Release = Release | ||
EndGlobalSection | ||
GlobalSection(ProjectConfiguration) = postSolution | ||
{928F98EE-7D50-457F-9304-A6818DCF1079}.Debug.ActiveCfg = Debug|.NET | ||
{928F98EE-7D50-457F-9304-A6818DCF1079}.Debug.Build.0 = Debug|.NET | ||
{928F98EE-7D50-457F-9304-A6818DCF1079}.Release.ActiveCfg = Release|.NET | ||
{928F98EE-7D50-457F-9304-A6818DCF1079}.Release.Build.0 = Release|.NET | ||
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Debug.ActiveCfg = Debug|.NET | ||
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Debug.Build.0 = Debug|.NET | ||
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Release.ActiveCfg = Release|.NET | ||
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Release.Build.0 = Release|.NET | ||
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Debug.ActiveCfg = Debug|Win32 | ||
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Debug.Build.0 = Debug|Win32 | ||
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Release.ActiveCfg = Release|Win32 | ||
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Release.Build.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityAddIns) = postSolution | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
Visual Studio .NET projects are provided; note that before launching | ||
the IDE, you'll have to define an environment variable QL_DIR whose | ||
value must equal the path to your QuantLib installation. | ||
|
||
The interfaces should also work with Mono on Linux; run 'make' in this | ||
directory. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
quantlib_wrap.* | ||
bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// QuantlibWrapper.cpp : Defines the entry point for the DLL application. | ||
// | ||
|
||
#include "stdafx.h" | ||
#include "QuantlibWrapper.h" | ||
BOOL APIENTRY DllMain( HANDLE hModule, | ||
DWORD ul_reason_for_call, | ||
LPVOID lpReserved | ||
) | ||
{ | ||
switch (ul_reason_for_call) | ||
{ | ||
case DLL_PROCESS_ATTACH: | ||
case DLL_THREAD_ATTACH: | ||
case DLL_THREAD_DETACH: | ||
case DLL_PROCESS_DETACH: | ||
break; | ||
} | ||
return TRUE; | ||
} | ||
|
||
// This is an example of an exported variable | ||
QUANTLIBWRAPPER_API int nQuantlibWrapper=0; | ||
|
||
// This is an example of an exported function. | ||
QUANTLIBWRAPPER_API int fnQuantlibWrapper(void) | ||
{ | ||
return 42; | ||
} | ||
|
||
// This is the constructor of a class that has been exported. | ||
// see QuantlibWrapper.h for the class definition | ||
CQuantlibWrapper::CQuantlibWrapper() | ||
{ | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// The following ifdef block is the standard way of creating macros which make exporting | ||
// from a DLL simpler. All files within this DLL are compiled with the QUANTLIBWRAPPER_EXPORTS | ||
// symbol defined on the command line. this symbol should not be defined on any project | ||
// that uses this DLL. This way any other project whose source files include this file see | ||
// QUANTLIBWRAPPER_API functions as being imported from a DLL, whereas this DLL sees symbols | ||
// defined with this macro as being exported. | ||
#ifdef QUANTLIBWRAPPER_EXPORTS | ||
#define QUANTLIBWRAPPER_API __declspec(dllexport) | ||
#else | ||
#define QUANTLIBWRAPPER_API __declspec(dllimport) | ||
#endif | ||
|
||
// This class is exported from the QuantlibWrapper.dll | ||
class QUANTLIBWRAPPER_API CQuantlibWrapper { | ||
public: | ||
CQuantlibWrapper(void); | ||
// TODO: add your methods here. | ||
}; | ||
|
||
extern QUANTLIBWRAPPER_API int nQuantlibWrapper; | ||
|
||
QUANTLIBWRAPPER_API int fnQuantlibWrapper(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
<?xml version="1.0" encoding="Windows-1252"?> | ||
<VisualStudioProject | ||
ProjectType="Visual C++" | ||
Version="7.10" | ||
Name="NQuantLibc" | ||
ProjectGUID="{21183104-9963-4D4F-B7E8-C8A6169FD053}" | ||
Keyword="Win32Proj"> | ||
<Platforms> | ||
<Platform | ||
Name="Win32"/> | ||
</Platforms> | ||
<Configurations> | ||
<Configuration | ||
Name="Debug|Win32" | ||
OutputDirectory="bin\Debug" | ||
IntermediateDirectory="bin\Debug" | ||
ConfigurationType="2" | ||
CharacterSet="2"> | ||
<Tool | ||
Name="VCCLCompilerTool" | ||
Optimization="0" | ||
AdditionalIncludeDirectories="$(QL_DIR)" | ||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTLIBWRAPPER_EXPORTS;_cplusplus;NOMINMAX" | ||
MinimalRebuild="TRUE" | ||
BasicRuntimeChecks="3" | ||
RuntimeLibrary="1" | ||
RuntimeTypeInfo="TRUE" | ||
UsePrecompiledHeader="0" | ||
WarningLevel="3" | ||
Detect64BitPortabilityProblems="TRUE" | ||
DebugInformationFormat="4"/> | ||
<Tool | ||
Name="VCCustomBuildTool"/> | ||
<Tool | ||
Name="VCLinkerTool" | ||
OutputFile="$(OutDir)/NQuantLibc.dll" | ||
LinkIncremental="2" | ||
AdditionalLibraryDirectories="$(QL_DIR)\lib" | ||
GenerateDebugInformation="TRUE" | ||
ProgramDatabaseFile="$(OutDir)/QuantlibWrapper.pdb" | ||
SubSystem="2" | ||
ImportLibrary="$(OutDir)/NQuantlibc.lib" | ||
TargetMachine="1"/> | ||
<Tool | ||
Name="VCMIDLTool"/> | ||
<Tool | ||
Name="VCPostBuildEventTool"/> | ||
<Tool | ||
Name="VCPreBuildEventTool"/> | ||
<Tool | ||
Name="VCPreLinkEventTool"/> | ||
<Tool | ||
Name="VCResourceCompilerTool"/> | ||
<Tool | ||
Name="VCWebServiceProxyGeneratorTool"/> | ||
<Tool | ||
Name="VCXMLDataGeneratorTool"/> | ||
<Tool | ||
Name="VCWebDeploymentTool"/> | ||
<Tool | ||
Name="VCManagedWrapperGeneratorTool"/> | ||
<Tool | ||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> | ||
</Configuration> | ||
<Configuration | ||
Name="Release|Win32" | ||
OutputDirectory="bin\Release" | ||
IntermediateDirectory="bin\Release" | ||
ConfigurationType="2" | ||
CharacterSet="2"> | ||
<Tool | ||
Name="VCCLCompilerTool" | ||
AdditionalIncludeDirectories="$(QL_DIR)" | ||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTLIBWRAPPER_EXPORTS" | ||
RuntimeLibrary="0" | ||
RuntimeTypeInfo="TRUE" | ||
UsePrecompiledHeader="2" | ||
WarningLevel="3" | ||
Detect64BitPortabilityProblems="TRUE" | ||
DebugInformationFormat="3"/> | ||
<Tool | ||
Name="VCCustomBuildTool"/> | ||
<Tool | ||
Name="VCLinkerTool" | ||
OutputFile="$(OutDir)/NQuantlibc.dll" | ||
LinkIncremental="1" | ||
AdditionalLibraryDirectories="$(QL_DIR)\lib" | ||
GenerateDebugInformation="TRUE" | ||
SubSystem="2" | ||
OptimizeReferences="2" | ||
EnableCOMDATFolding="2" | ||
ImportLibrary="$(OutDir)/NQuantlibc.lib" | ||
TargetMachine="1"/> | ||
<Tool | ||
Name="VCMIDLTool"/> | ||
<Tool | ||
Name="VCPostBuildEventTool"/> | ||
<Tool | ||
Name="VCPreBuildEventTool"/> | ||
<Tool | ||
Name="VCPreLinkEventTool"/> | ||
<Tool | ||
Name="VCResourceCompilerTool"/> | ||
<Tool | ||
Name="VCWebServiceProxyGeneratorTool"/> | ||
<Tool | ||
Name="VCXMLDataGeneratorTool"/> | ||
<Tool | ||
Name="VCWebDeploymentTool"/> | ||
<Tool | ||
Name="VCManagedWrapperGeneratorTool"/> | ||
<Tool | ||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> | ||
</Configuration> | ||
</Configurations> | ||
<References> | ||
</References> | ||
<Files> | ||
<Filter | ||
Name="Source Files" | ||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> | ||
<File | ||
RelativePath=".\quantlib_wrap.cpp"> | ||
</File> | ||
<File | ||
RelativePath=".\QuantlibWrapper.cpp"> | ||
</File> | ||
</Filter> | ||
<Filter | ||
Name="Header Files" | ||
Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> | ||
<File | ||
RelativePath=".\QuantlibWrapper.h"> | ||
</File> | ||
<File | ||
RelativePath=".\stdafx.h"> | ||
</File> | ||
</Filter> | ||
<Filter | ||
Name="Resource Files" | ||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" | ||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> | ||
</Filter> | ||
</Files> | ||
<Globals> | ||
</Globals> | ||
</VisualStudioProject> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// stdafx.h : include file for standard system include files, | ||
// or project specific include files that are used frequently, but | ||
// are changed infrequently | ||
// | ||
|
||
#pragma once | ||
|
||
|
||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers | ||
// Windows Header Files: | ||
#include <windows.h> | ||
|
||
// TODO: reference additional headers your program requires here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.cs | ||
bin | ||
obj | ||
NQuantLib.csproj.user |
Oops, something went wrong.