Skip to content

Commit

Permalink
First stab at adding builds for Ubuntu in Swigged.cuda. Unfortunately…
Browse files Browse the repository at this point in the history
…, there is a problem in compiling--all files, including straight up CUDA Driver programs--must be compiled with NVCC. The file "build.sh" contains the two steps needed to build the .SO file for Ubuntu, but it should be integrated into VS.
  • Loading branch information
kaby76 committed Apr 29, 2018
1 parent 1dd46be commit be1a40a
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -13,3 +13,5 @@ ConsoleApp1/x64/
ConsoleApp1/packages/
ConsoleApp1/.vs/
*.nupkg
swigged.cuda.native/obj/
swigged.cuda.native/bin/
2 changes: 2 additions & 0 deletions build.sh
@@ -0,0 +1,2 @@
nvcc --compiler-options '-fpic' -c CUDA_wrap.cpp
g++ -o "libnew-swigged-cuda-native.so.1.0" -Wl,--verbose -Wl,--no-undefined -Wl,-L"/usr/local/cuda-9.1/lib64" -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -shared "CUDA_wrap.o" -lcuda
99 changes: 99 additions & 0 deletions swigged.cuda.native/new-swigged-cuda-native.vcxproj
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{3816e6b2-fc7b-4846-987c-7f770357ce27}</ProjectGuid>
<Keyword>Linux</Keyword>
<RootNamespace>LinuxConsoleApplication2</RootNamespace>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<ApplicationType>Linux</ApplicationType>
<ApplicationTypeRevision>1.0</ApplicationTypeRevision>
<TargetLinuxPlatform>Generic</TargetLinuxPlatform>
<LinuxProjectType>{D51BCBC9-82E9-4017-911E-C93873C4EA2B}</LinuxProjectType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="Shared" />
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>/usr/local/cuda-9.1/include/;$(IncludePath)</IncludePath>
<LibraryPath>/usr/local/cuda-9.1/lib64</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>/usr/local/cuda-9.1/include/;$(IncludePath)</IncludePath>
<LibraryPath>/usr/local/cuda-9.1/lib64</LibraryPath>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="CUDA_wrap.cpp" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Link>
<LibraryDependencies>cuda;%(LibraryDependencies)</LibraryDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Link>
<LibraryDependencies>cudadevrt;%(LibraryDependencies)</LibraryDependencies>
<AdditionalOptions>
</AdditionalOptions>
<VerboseOutput>true</VerboseOutput>
<AdditionalLibraryDirectories>/usr/local/cuda-9.1/lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<ClCompile>
<AdditionalOptions>
</AdditionalOptions>
<PositionIndependentCode>true</PositionIndependentCode>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
4 changes: 4 additions & 0 deletions swigged.cuda.native/new-swigged-cuda-native.vcxproj.user
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
27 changes: 24 additions & 3 deletions swigged.cuda.native/swigged-cuda-native.sln
@@ -1,28 +1,49 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2043
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "swigged.cuda.native", "swigged-cuda-native.vcxproj", "{28159184-D97E-4A6C-8AD1-253DC15640C4}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "swigged-cuda-native", "swigged-cuda-native.vcxproj", "{28159184-D97E-4A6C-8AD1-253DC15640C4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "new-swigged-cuda-native", "new-swigged-cuda-native.vcxproj", "{3816E6B2-FC7B-4846-987C-7F770357CE27}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{28159184-D97E-4A6C-8AD1-253DC15640C4}.Debug|ARM.ActiveCfg = Debug|Win32
{28159184-D97E-4A6C-8AD1-253DC15640C4}.Debug|x64.ActiveCfg = Debug|x64
{28159184-D97E-4A6C-8AD1-253DC15640C4}.Debug|x64.Build.0 = Debug|x64
{28159184-D97E-4A6C-8AD1-253DC15640C4}.Debug|x86.ActiveCfg = Debug|Win32
{28159184-D97E-4A6C-8AD1-253DC15640C4}.Debug|x86.Build.0 = Debug|Win32
{28159184-D97E-4A6C-8AD1-253DC15640C4}.Release|ARM.ActiveCfg = Release|Win32
{28159184-D97E-4A6C-8AD1-253DC15640C4}.Release|x64.ActiveCfg = Release|x64
{28159184-D97E-4A6C-8AD1-253DC15640C4}.Release|x64.Build.0 = Release|x64
{28159184-D97E-4A6C-8AD1-253DC15640C4}.Release|x86.ActiveCfg = Release|Win32
{28159184-D97E-4A6C-8AD1-253DC15640C4}.Release|x86.Build.0 = Release|Win32
{3816E6B2-FC7B-4846-987C-7F770357CE27}.Debug|ARM.ActiveCfg = Debug|ARM
{3816E6B2-FC7B-4846-987C-7F770357CE27}.Debug|ARM.Build.0 = Debug|ARM
{3816E6B2-FC7B-4846-987C-7F770357CE27}.Debug|x64.ActiveCfg = Debug|x64
{3816E6B2-FC7B-4846-987C-7F770357CE27}.Debug|x64.Build.0 = Debug|x64
{3816E6B2-FC7B-4846-987C-7F770357CE27}.Debug|x86.ActiveCfg = Debug|x86
{3816E6B2-FC7B-4846-987C-7F770357CE27}.Debug|x86.Build.0 = Debug|x86
{3816E6B2-FC7B-4846-987C-7F770357CE27}.Release|ARM.ActiveCfg = Release|ARM
{3816E6B2-FC7B-4846-987C-7F770357CE27}.Release|ARM.Build.0 = Release|ARM
{3816E6B2-FC7B-4846-987C-7F770357CE27}.Release|x64.ActiveCfg = Release|x64
{3816E6B2-FC7B-4846-987C-7F770357CE27}.Release|x64.Build.0 = Release|x64
{3816E6B2-FC7B-4846-987C-7F770357CE27}.Release|x86.ActiveCfg = Release|x86
{3816E6B2-FC7B-4846-987C-7F770357CE27}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F7B3E71F-5EBB-4D56-AB29-D892735A4EBA}
EndGlobalSection
EndGlobal

0 comments on commit be1a40a

Please sign in to comment.