Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[msmpi] build from source #13218

Closed
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ports/msmpi/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Source: msmpi
Version: 10.1
Port-Version: 1
Homepage: https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi
Description: Microsoft MPI
Supports: windows
Build-Depends: networkdirect-sdk
26 changes: 26 additions & 0 deletions ports/msmpi/disable-control-flow-guard.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/src/mpi.props b/src/mpi.props
index 8339a89..ba33015 100644
--- a/src/mpi.props
+++ b/src/mpi.props
@@ -96,7 +96,7 @@
<Optimization>Full</Optimization>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PreprocessorDefinitions>NDEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <ControlFlowGuard>Guard</ControlFlowGuard>
+ <!-- <ControlFlowGuard>Guard</ControlFlowGuard> -->
</ClCompile>
</ItemDefinitionGroup>

diff --git a/src/mpi/msmpi/msmpi.props b/src/mpi/msmpi/msmpi.props
index 878a36a..7e3c4a6 100644
--- a/src/mpi/msmpi/msmpi.props
+++ b/src/mpi/msmpi/msmpi.props
@@ -13,7 +13,7 @@
<Optimization>MaxSpeed</Optimization>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PreprocessorDefinitions>NDEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <ControlFlowGuard>Guard</ControlFlowGuard>
+ <!-- <ControlFlowGuard>Guard</ControlFlowGuard> -->
</ClCompile>
</ItemDefinitionGroup>

12 changes: 12 additions & 0 deletions ports/msmpi/disable-x86-safeseh.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/src/mpi/msmpi/dll/msmpi.vcxproj b/src/mpi/msmpi/dll/msmpi.vcxproj
index 255b9f5..020a0cc 100644
--- a/src/mpi/msmpi/dll/msmpi.vcxproj
+++ b/src/mpi/msmpi/dll/msmpi.vcxproj
@@ -31,6 +31,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EntryPointSymbol Condition="'$(BuildArchitecture)'=='amd64'">_DllMainCRTStartup</EntryPointSymbol>
<EntryPointSymbol Condition="'$(BuildArchitecture)'=='i386'">_DllMainCRTStartup@12</EntryPointSymbol>
+ <ImageHasSafeExceptionHandlers Condition="'$(BuildArchitecture)'=='i386'">false</ImageHasSafeExceptionHandlers>
<AdditionalDependencies>
%(AdditionalDependencies);
$(PUBLIC_SDK_LIB)\kernel32.lib;
20 changes: 20 additions & 0 deletions ports/msmpi/fix-external-symbols.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/src/mpi/common/mpidef.h b/src/mpi/common/mpidef.h
index bb1d146..8535d19 100644
--- a/src/mpi/common/mpidef.h
+++ b/src/mpi/common/mpidef.h
@@ -135,13 +135,13 @@ typedef MPIU_Bsize_t MPIDI_msg_sz_t;
*/

/* PtrToInt converts a pointer to a int type, truncating bits if necessary */
-#define MPIU_PtrToInt PtrToInt
+#define MPIU_PtrToInt(p) ((INT)(INT_PTR) (p) )

/* PtrToAint converts a pointer to an MPI_Aint type, truncating bits if necessary */
#define MPIU_PtrToAint(a) ((MPI_Aint)(INT_PTR) (a) )

/* IntToPtr converts a int to a pointer type, extending bits if necessary */
-#define MPIU_IntToPtr IntToPtr
+#define MPIU_IntToPtr(i) ((VOID *)(INT_PTR)((int)i))


//
190 changes: 190 additions & 0 deletions ports/msmpi/fix-invalid-boz-literals.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
diff --git a/src/include/mpif.h b/src/include/mpif.h
index f531a15..aaac5d1 100644
--- a/src/include/mpif.h
+++ b/src/include/mpif.h
@@ -224,7 +224,7 @@
INTEGER MPI_OP_NULL
PARAMETER (MPI_OP_NULL=402653184)
INTEGER MPI_DATATYPE_NULL
- PARAMETER (MPI_DATATYPE_NULL=z'0c000000')
+ PARAMETER (MPI_DATATYPE_NULL=201326592)
INTEGER MPI_REQUEST_NULL
PARAMETER (MPI_REQUEST_NULL=738197504)
INTEGER MPI_ERRHANDLER_NULL
@@ -300,104 +300,104 @@
INTEGER MPI_LOCK_SHARED
PARAMETER (MPI_LOCK_SHARED=235)
INTEGER MPI_CHAR
- PARAMETER (MPI_CHAR=z'4c000101')
+ PARAMETER (MPI_CHAR=1275068673)
INTEGER MPI_UNSIGNED_CHAR
- PARAMETER (MPI_UNSIGNED_CHAR=z'4c000102')
+ PARAMETER (MPI_UNSIGNED_CHAR=1275068674)
INTEGER MPI_SHORT
- PARAMETER (MPI_SHORT=z'4c000203')
+ PARAMETER (MPI_SHORT=1275068931)
INTEGER MPI_UNSIGNED_SHORT
- PARAMETER (MPI_UNSIGNED_SHORT=z'4c000204')
+ PARAMETER (MPI_UNSIGNED_SHORT=1275068932)
INTEGER MPI_INT
- PARAMETER (MPI_INT=z'4c000405')
+ PARAMETER (MPI_INT=1275069445)
INTEGER MPI_UNSIGNED
- PARAMETER (MPI_UNSIGNED=z'4c000406')
+ PARAMETER (MPI_UNSIGNED=1275069446)
INTEGER MPI_LONG
- PARAMETER (MPI_LONG=z'4c000407')
+ PARAMETER (MPI_LONG=1275069447)
INTEGER MPI_UNSIGNED_LONG
- PARAMETER (MPI_UNSIGNED_LONG=z'4c000408')
+ PARAMETER (MPI_UNSIGNED_LONG=1275069448)
INTEGER MPI_LONG_LONG
- PARAMETER (MPI_LONG_LONG=z'4c000809')
+ PARAMETER (MPI_LONG_LONG=1275070473)
INTEGER MPI_LONG_LONG_INT
- PARAMETER (MPI_LONG_LONG_INT=z'4c000809')
+ PARAMETER (MPI_LONG_LONG_INT=1275070473)
INTEGER MPI_FLOAT
- PARAMETER (MPI_FLOAT=z'4c00040a')
+ PARAMETER (MPI_FLOAT=1275069450)
INTEGER MPI_DOUBLE
- PARAMETER (MPI_DOUBLE=z'4c00080b')
+ PARAMETER (MPI_DOUBLE=1275070475)
INTEGER MPI_LONG_DOUBLE
- PARAMETER (MPI_LONG_DOUBLE=z'4c00080c')
+ PARAMETER (MPI_LONG_DOUBLE=1275070476)
INTEGER MPI_BYTE
- PARAMETER (MPI_BYTE=z'4c00010d')
+ PARAMETER (MPI_BYTE=1275068685)
INTEGER MPI_WCHAR
- PARAMETER (MPI_WCHAR=z'4c00020e')
+ PARAMETER (MPI_WCHAR=1275068942)
INTEGER MPI_PACKED
- PARAMETER (MPI_PACKED=z'4c00010f')
+ PARAMETER (MPI_PACKED=1275068687)
INTEGER MPI_LB
- PARAMETER (MPI_LB=z'4c000010')
+ PARAMETER (MPI_LB=1275068432)
INTEGER MPI_UB
- PARAMETER (MPI_UB=z'4c000011')
+ PARAMETER (MPI_UB=1275068433)
INTEGER MPI_2INT
- PARAMETER (MPI_2INT=z'4c000816')
+ PARAMETER (MPI_2INT=1275070486)
INTEGER MPI_SIGNED_CHAR
- PARAMETER (MPI_SIGNED_CHAR=z'4c000118')
+ PARAMETER (MPI_SIGNED_CHAR=1275068696)
INTEGER MPI_UNSIGNED_LONG_LONG
- PARAMETER (MPI_UNSIGNED_LONG_LONG=z'4c000819')
+ PARAMETER (MPI_UNSIGNED_LONG_LONG=1275070489)
INTEGER MPI_CHARACTER
- PARAMETER (MPI_CHARACTER=z'4c00011a')
+ PARAMETER (MPI_CHARACTER=1275068698)
INTEGER MPI_INTEGER
- PARAMETER (MPI_INTEGER=z'4c00041b')
+ PARAMETER (MPI_INTEGER=1275069467)
INTEGER MPI_REAL
- PARAMETER (MPI_REAL=z'4c00041c')
+ PARAMETER (MPI_REAL=1275069468)
INTEGER MPI_LOGICAL
- PARAMETER (MPI_LOGICAL=z'4c00041d')
+ PARAMETER (MPI_LOGICAL=1275069469)
INTEGER MPI_COMPLEX
- PARAMETER (MPI_COMPLEX=z'4c00081e')
+ PARAMETER (MPI_COMPLEX=1275070494)
INTEGER MPI_DOUBLE_PRECISION
- PARAMETER (MPI_DOUBLE_PRECISION=z'4c00081f')
+ PARAMETER (MPI_DOUBLE_PRECISION=1275070495)
INTEGER MPI_2INTEGER
- PARAMETER (MPI_2INTEGER=z'4c000820')
+ PARAMETER (MPI_2INTEGER=1275070496)
INTEGER MPI_2REAL
- PARAMETER (MPI_2REAL=z'4c000821')
+ PARAMETER (MPI_2REAL=1275070497)
INTEGER MPI_DOUBLE_COMPLEX
- PARAMETER (MPI_DOUBLE_COMPLEX=z'4c001022')
+ PARAMETER (MPI_DOUBLE_COMPLEX=1275072546)
INTEGER MPI_2DOUBLE_PRECISION
- PARAMETER (MPI_2DOUBLE_PRECISION=z'4c001023')
+ PARAMETER (MPI_2DOUBLE_PRECISION=1275072547)
INTEGER MPI_2COMPLEX
- PARAMETER (MPI_2COMPLEX=z'4c001024')
+ PARAMETER (MPI_2COMPLEX=1275072548)
INTEGER MPI_2DOUBLE_COMPLEX
- PARAMETER (MPI_2DOUBLE_COMPLEX=z'4c002025')
+ PARAMETER (MPI_2DOUBLE_COMPLEX=1275076645)
INTEGER MPI_REAL2
- PARAMETER (MPI_REAL2=z'0c000000')
+ PARAMETER (MPI_REAL2=201326592)
INTEGER MPI_REAL4
- PARAMETER (MPI_REAL4=z'4c000427')
+ PARAMETER (MPI_REAL4=1275069479)
INTEGER MPI_COMPLEX8
- PARAMETER (MPI_COMPLEX8=z'4c000828')
+ PARAMETER (MPI_COMPLEX8=1275070504)
INTEGER MPI_REAL8
- PARAMETER (MPI_REAL8=z'4c000829')
+ PARAMETER (MPI_REAL8=1275070505)
INTEGER MPI_COMPLEX16
- PARAMETER (MPI_COMPLEX16=z'4c00102a')
+ PARAMETER (MPI_COMPLEX16=1275072554)
INTEGER MPI_REAL16
- PARAMETER (MPI_REAL16=z'0c000000')
+ PARAMETER (MPI_REAL16=201326592)
INTEGER MPI_COMPLEX32
- PARAMETER (MPI_COMPLEX32=z'0c000000')
+ PARAMETER (MPI_COMPLEX32=201326592)
INTEGER MPI_INTEGER1
- PARAMETER (MPI_INTEGER1=z'4c00012d')
+ PARAMETER (MPI_INTEGER1=1275068717)
INTEGER MPI_COMPLEX4
- PARAMETER (MPI_COMPLEX4=z'0c000000')
+ PARAMETER (MPI_COMPLEX4=201326592)
INTEGER MPI_INTEGER2
- PARAMETER (MPI_INTEGER2=z'4c00022f')
+ PARAMETER (MPI_INTEGER2=1275068975)
INTEGER MPI_INTEGER4
- PARAMETER (MPI_INTEGER4=z'4c000430')
+ PARAMETER (MPI_INTEGER4=1275069488)
INTEGER MPI_INTEGER8
- PARAMETER (MPI_INTEGER8=z'4c000831')
+ PARAMETER (MPI_INTEGER8=1275070513)
INTEGER MPI_INTEGER16
- PARAMETER (MPI_INTEGER16=z'0c000000')
+ PARAMETER (MPI_INTEGER16=201326592)

INCLUDE 'mpifptr.h'

INTEGER MPI_OFFSET
- PARAMETER (MPI_OFFSET=z'4c00083c')
+ PARAMETER (MPI_OFFSET=1275070524)
INTEGER MPI_COUNT
- PARAMETER (MPI_COUNT=z'4c00083d')
+ PARAMETER (MPI_COUNT=1275070525)
INTEGER MPI_FLOAT_INT
PARAMETER (MPI_FLOAT_INT=-1946157056)
INTEGER MPI_DOUBLE_INT
diff --git a/src/include/x64/mpifptr.h b/src/include/x64/mpifptr.h
index 1d4a288..58d9b62 100644
--- a/src/include/x64/mpifptr.h
+++ b/src/include/x64/mpifptr.h
@@ -4,6 +4,6 @@
! Licensed under the MIT License.
!
INTEGER MPI_AINT
- PARAMETER (MPI_AINT=z'4c00083b')
+ PARAMETER (MPI_AINT=1275070523)
INTEGER MPI_ADDRESS_KIND
PARAMETER(MPI_ADDRESS_KIND = 8)
diff --git a/src/include/x86/mpifptr.h b/src/include/x86/mpifptr.h
index 1028a1d..ff28c14 100644
--- a/src/include/x86/mpifptr.h
+++ b/src/include/x86/mpifptr.h
@@ -4,6 +4,6 @@
! Licensed under the MIT License.
!
INTEGER MPI_AINT
- PARAMETER (MPI_AINT=z'4c00043b')
+ PARAMETER (MPI_AINT=1275069499)
INTEGER MPI_ADDRESS_KIND
PARAMETER(MPI_ADDRESS_KIND = 4)
80 changes: 80 additions & 0 deletions ports/msmpi/fix-nuget-restore.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
diff --git a/.build/Local/CBTModules/CBTModules.proj b/.build/Local/CBTModules/CBTModules.proj
deleted file mode 100644
index 8a8d130..0000000
--- a/.build/Local/CBTModules/CBTModules.proj
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <TargetFramework>net46</TargetFramework>
- </PropertyGroup>
-<!--
- *******************************************************************************************************************
- This file contains the CBT modules that you want to use. Modules are standard NuGet packages that apply to the
- whole project tree rather than on a per-project basis. Modules provide extensions to your build in a centralized
- way and act as a replacement of having to check-in all of the build logic.
-
- Modules include build extensions such as:
-
- 1. Analyzing source code and/or build output
- 2. Assembly versioning
- 3. Policy enforcement
- 4. Strong-name signing of build output
-
- To find more modules, use "NuGet.exe list CBT.*" or browse a list at http://commonbuildtoolset.github.io
- *******************************************************************************************************************
- -->
-
- <ItemGroup>
- <!--
- *******************************************************************************************************************
- CBT.Traversal module provides the build logic to have a dirs.proj which defines the projects you want built in a
- hosted build environment. Use this module if you want more control over your official build output and are willing
- to move away from Visual Studio solution files.
- *******************************************************************************************************************
- -->
- <PackageReference Include="CBT.Traversal" Version="2.0.53" />
-
- <!--
- *******************************************************************************************************************
- CBT.NuGet module provides NuGet package restore from the command-line prior to build. This allows users to not
- have to restore before building a project tree. This is mostly useful for hosted builds which run from a command-
- line environment rather than Visual Studio.
- *******************************************************************************************************************
- -->
- <PackageReference Include="CBT.NuGet" Version="2.2.2" />
-
- <!--
- *******************************************************************************************************************
- CBT.DotNetFx provides the .NET Framework reference assemblies so that users do not have to have them installed to
- build your projects. When using this module, be sure to include ALL of the versions of the target frameworks that
- your projects use. For example, if your projects target .NET 4.5 and .NET 4.6, you'll need to include both of the
- corresponding modules.
-
- By default build packages are disabled when added to the cbtmodules project.
- To use any build package globally it must be enabled for the code base.
- Do this by setting Enable#NuGetPackageID# where the . is replaced with _.
- Example add this property to your Directory.Build.props for the CBT.DotNetFx-net46 package.
- <EnableCBT_DotNetFx-net46>true</EnableCBT_DotNetFx-net46>
- *******************************************************************************************************************
- -->
- <PackageReference Include="CBT.DotNetFx-net46" Version="1.0.0-beta01" />
-
-
- </ItemGroup>
-</Project>
\ No newline at end of file
diff --git a/.build/Local/CBTModules/packages.config b/.build/Local/CBTModules/packages.config
new file mode 100644
index 0000000..80dbe71
--- /dev/null
+++ b/.build/Local/CBTModules/packages.config
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="CBT.Traversal" version="2.0.53" targetFramework="net46" />
+ <package id="CBT.NuGet" version="2.2.2" targetFramework="net46" />
+ <package id="CBT.DotNetFx-net46" version="1.0.0-beta01" targetFramework="net46" />
+</packages>
\ No newline at end of file
44 changes: 44 additions & 0 deletions ports/msmpi/networkdirect-no-nuget.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/src/mpi/msmpi/channels/mpichannels.vcxproj b/src/mpi/msmpi/channels/mpichannels.vcxproj
index 2093a96..094500c 100644
--- a/src/mpi/msmpi/channels/mpichannels.vcxproj
+++ b/src/mpi/msmpi/channels/mpichannels.vcxproj
@@ -65,10 +65,6 @@

<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

- <ItemGroup>
- <PackageReference Include="NetworkDirect" Version="2.0.1" />
- </ItemGroup>
-
<ItemGroup>
<ProjectReference Include="$(MPI_SRC_ROOT)\common\traceManifest.vcxproj">
</ProjectReference>
diff --git a/src/mpi/msmpi/dll/msmpi.vcxproj b/src/mpi/msmpi/dll/msmpi.vcxproj
index 255b9f5..e2a6455 100644
--- a/src/mpi/msmpi/dll/msmpi.vcxproj
+++ b/src/mpi/msmpi/dll/msmpi.vcxproj
@@ -119,9 +119,5 @@ if not %rc%==1 exit %rce% else exit 0</Command>
<ClCompile Include=".\main.cpp" />
</ItemGroup>

- <ItemGroup>
- <PackageReference Include="NetworkDirect" Version="2.0.1" />
- </ItemGroup>
-
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
diff --git a/src/mpi/msmpi/mpid/mpid.vcxproj b/src/mpi/msmpi/mpid/mpid.vcxproj
index de9cebf..ac83ff3 100644
--- a/src/mpi/msmpi/mpid/mpid.vcxproj
+++ b/src/mpi/msmpi/mpid/mpid.vcxproj
@@ -95,10 +95,6 @@

<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

- <ItemGroup>
- <PackageReference Include="NetworkDirect" Version="2.0.1" />
- </ItemGroup>
-
<ItemGroup>
<ProjectReference Include="$(MPI_SRC_ROOT)\common\traceManifest.vcxproj">
</ProjectReference>
Loading