Skip to content

Commit cea7bc4

Browse files
authored
Merge pull request #27 from jxngao/master
Windows support
2 parents d356184 + f1a8738 commit cea7bc4

4 files changed

Lines changed: 103 additions & 0 deletions

File tree

pythonlsf/lsf.i

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
%include "cpointer.i"
1313
%include "carrays.i"
1414

15+
#ifdef WIN32
16+
%include <windows.i>
17+
#endif
18+
1519
FILE *fopen(char *filename, char *mode);
1620
int fclose(FILE *f);
1721

@@ -71,6 +75,8 @@ PyObject * string_array_to_pylist(PyObject* ptrobj, int size){
7175
#ifdef WIN32
7276
typedef __int64 LSF_LONG_INT;
7377
typedef unsigned __int64 LSF_UNS_LONG_INT;
78+
typedef __int64 uid_t;
79+
typedef __int64 gid_t;
7480
#define LSF_LONG_FORMAT "%I64d"
7581
#define LSF_UNS_LONG_FORMAT "%I64u"
7682
#elif defined (__alpha)

winbuild/build.bat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
swig -DWIN32 -DWin64 -I%LSF_INCLUDE% -I%LSF_INCLUDE%\lsf -python ..\pythonlsf\lsf.i
2+
msbuild lsf.sln -property:Configuration=Release
3+
cp X64\Release\_lsf.pyd ..\pythonlsf\
4+
cp X64\Release\_lsf.lib ..\pythonlsf\
5+
cp X64\Release\_lsf.exp ..\pythonlsf\
6+
7+

winbuild/lsf.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lsf", "lsf.vcxproj", "{3E2E3CF1-38CA-4C58-AC0F-B4A3D4397667}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Debug|x86 = Debug|x86
12+
Release|x64 = Release|x64
13+
Release|x86 = Release|x86
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{3E2E3CF1-38CA-4C58-AC0F-B4A3D4397667}.Release|x64.ActiveCfg = Release|x64
17+
{3E2E3CF1-38CA-4C58-AC0F-B4A3D4397667}.Release|x64.Build.0 = Release|x64
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

winbuild/lsf.vcxproj

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Release|x64">
5+
<Configuration>Release</Configuration>
6+
<Platform>x64</Platform>
7+
</ProjectConfiguration>
8+
</ItemGroup>
9+
<PropertyGroup Label="Globals">
10+
<ProjectGuid>{3E2E3CF1-38CA-4C58-AC0F-B4A3D4397667}</ProjectGuid>
11+
<Keyword>Win32Proj</Keyword>
12+
<RootNamespace>lsf</RootNamespace>
13+
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
14+
</PropertyGroup>
15+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
16+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
17+
<ConfigurationType>DynamicLibrary</ConfigurationType>
18+
<UseDebugLibraries>false</UseDebugLibraries>
19+
<PlatformToolset>v140</PlatformToolset>
20+
<WholeProgramOptimization>true</WholeProgramOptimization>
21+
<CharacterSet>Unicode</CharacterSet>
22+
</PropertyGroup>
23+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
24+
<ImportGroup Label="ExtensionSettings">
25+
</ImportGroup>
26+
<ImportGroup Label="Shared">
27+
</ImportGroup>
28+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
29+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
30+
</ImportGroup>
31+
<PropertyGroup Label="UserMacros" />
32+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
33+
<LinkIncremental>false</LinkIncremental>
34+
<TargetName>_$(ProjectName)</TargetName>
35+
<TargetExt>.pyd</TargetExt>
36+
</PropertyGroup>
37+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
38+
<ClCompile>
39+
<WarningLevel>Level3</WarningLevel>
40+
<PrecompiledHeader>
41+
</PrecompiledHeader>
42+
<Optimization>MaxSpeed</Optimization>
43+
<FunctionLevelLinking>true</FunctionLevelLinking>
44+
<IntrinsicFunctions>true</IntrinsicFunctions>
45+
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;LSF_EXPORTS;WIN32;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
46+
<SDLCheck>true</SDLCheck>
47+
<AdditionalIncludeDirectories>$(LSF_INCLUDE);$(LSF_INCLUDE)\lsf;$(PYTHON_INCLUDE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
48+
</ClCompile>
49+
<Link>
50+
<SubSystem>Windows</SubSystem>
51+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
52+
<OptimizeReferences>true</OptimizeReferences>
53+
<GenerateDebugInformation>true</GenerateDebugInformation>
54+
<AdditionalDependencies>$(PYTHON_LIB);$(LSF_LIB)\libbat.lib;$(LSF_LIB)\liblsf.lib;$(LSF_LIB)\liblsbstream.lib;ws2_32.lib;wldap32.lib;crypt32.lib;mpr.lib;adsIid.lib;activeds.lib;%(AdditionalDependencies)</AdditionalDependencies>
55+
</Link>
56+
</ItemDefinitionGroup>
57+
<ItemGroup>
58+
<ClCompile Include="..\pythonlsf\lsf_wrap.c" />
59+
</ItemGroup>
60+
<ItemGroup>
61+
<ClInclude Include="..\pythonlsf\lib.table.h" />
62+
<ClInclude Include="$(LSF_INCLUDE)\lsbatch.h" />
63+
<ClInclude Include="$(LSF_INCLUDE)\lsf\lsf.h" />
64+
</ItemGroup>
65+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
66+
<ImportGroup Label="ExtensionTargets">
67+
</ImportGroup>
68+
</Project>

0 commit comments

Comments
 (0)