Skip to content

Commit

Permalink
Patch: MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Jun 29, 2019
1 parent 2d4cf85 commit 661d876
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 1 deletion.
91 changes: 91 additions & 0 deletions recipes/adios2/0002-name-clash-msvc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
From 5f9bdb4e42a108ec19c2bf4034a3a2ddb0c5d951 Mon Sep 17 00:00:00 2001
From: Kai Germaschewski <[email protected]>
Date: Sat, 29 Jun 2019 05:35:24 -0400
Subject: [PATCH] fix MSVC/conda build

This simply renames `helper::CopyMemory` to `helper::CopyMemoryBlock` to
avoid a name clash with the `CopyMemory` defined in the MSVC build in #1485.
---
source/adios2/helper/adiosMemory.h | 16 ++++++++--------
source/adios2/helper/adiosMemory.inl | 12 ++++++------
.../adios2/toolkit/format/bp3/BP3Serializer.tcc | 2 +-
.../adios2/toolkit/format/bp4/BP4Serializer.tcc | 2 +-
4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/source/adios2/helper/adiosMemory.h b/source/adios2/helper/adiosMemory.h
index 91d5f1353..44a773c1b 100644
--- a/source/adios2/helper/adiosMemory.h
+++ b/source/adios2/helper/adiosMemory.h
@@ -111,14 +111,14 @@ T ReadValue(const std::vector<char> &buffer, size_t &position,
* @param srcMemCount
*/
template <class T, class U>
-void CopyMemory(T *dest, const Dims &destStart, const Dims &destCount,
- const bool destRowMajor, const U *src, const Dims &srcStart,
- const Dims &srcCount, const bool srcRowMajor,
- const bool endianReverse = false,
- const Dims &destMemStart = Dims(),
- const Dims &destMemCount = Dims(),
- const Dims &srcMemStart = Dims(),
- const Dims &srcMemCount = Dims()) noexcept;
+void CopyMemoryBlock(T *dest, const Dims &destStart, const Dims &destCount,
+ const bool destRowMajor, const U *src,
+ const Dims &srcStart, const Dims &srcCount,
+ const bool srcRowMajor, const bool endianReverse = false,
+ const Dims &destMemStart = Dims(),
+ const Dims &destMemCount = Dims(),
+ const Dims &srcMemStart = Dims(),
+ const Dims &srcMemCount = Dims()) noexcept;

void CopyPayload(char *dest, const Dims &destStart, const Dims &destCount,
const bool destRowMajor, const char *src, const Dims &srcStart,
diff --git a/source/adios2/helper/adiosMemory.inl b/source/adios2/helper/adiosMemory.inl
index e130030e9..7ff9d88de 100644
--- a/source/adios2/helper/adiosMemory.inl
+++ b/source/adios2/helper/adiosMemory.inl
@@ -252,12 +252,12 @@ void ClipVector(std::vector<T> &vec, const size_t start,
}

template <class T, class U>
-void CopyMemory(T *dest, const Dims &destStart, const Dims &destCount,
- const bool destRowMajor, const U *src, const Dims &srcStart,
- const Dims &srcCount, const bool srcRowMajor,
- const bool endianReverse, const Dims &destMemStart,
- const Dims &destMemCount, const Dims &srcMemStart,
- const Dims &srcMemCount) noexcept
+void CopyMemoryBlock(T *dest, const Dims &destStart, const Dims &destCount,
+ const bool destRowMajor, const U *src,
+ const Dims &srcStart, const Dims &srcCount,
+ const bool srcRowMajor, const bool endianReverse,
+ const Dims &destMemStart, const Dims &destMemCount,
+ const Dims &srcMemStart, const Dims &srcMemCount) noexcept
{
// transform everything to payload dims
const Dims destStartPayload = PayloadDims<T>(destStart, destRowMajor);
diff --git a/source/adios2/toolkit/format/bp3/BP3Serializer.tcc b/source/adios2/toolkit/format/bp3/BP3Serializer.tcc
index a66b9dc62..7d54681e6 100644
--- a/source/adios2/toolkit/format/bp3/BP3Serializer.tcc
+++ b/source/adios2/toolkit/format/bp3/BP3Serializer.tcc
@@ -862,7 +862,7 @@ void BP3Serializer::PutPayloadInBuffer(
ProfilerStart("memcpy");
if (!blockInfo.MemoryStart.empty())
{
- helper::CopyMemory(
+ helper::CopyMemoryBlock(
reinterpret_cast<T *>(m_Data.m_Buffer.data() + m_Data.m_Position),
blockInfo.Start, blockInfo.Count, sourceRowMajor, blockInfo.Data,
blockInfo.Start, blockInfo.Count, sourceRowMajor, false, Dims(),
diff --git a/source/adios2/toolkit/format/bp4/BP4Serializer.tcc b/source/adios2/toolkit/format/bp4/BP4Serializer.tcc
index 86b688e0b..3eb210508 100644
--- a/source/adios2/toolkit/format/bp4/BP4Serializer.tcc
+++ b/source/adios2/toolkit/format/bp4/BP4Serializer.tcc
@@ -903,7 +903,7 @@ void BP4Serializer::PutPayloadInBuffer(
if (!blockInfo.MemoryStart.empty())
{
// TODO make it a BP4Serializer function
- helper::CopyMemory(
+ helper::CopyMemoryBlock(
reinterpret_cast<T *>(m_Data.m_Buffer.data() + m_Data.m_Position),
blockInfo.Start, blockInfo.Count, sourceRowMajor, blockInfo.Data,
blockInfo.Start, blockInfo.Count, sourceRowMajor, false, Dims(),

4 changes: 3 additions & 1 deletion recipes/adios2/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ source:
fn: v{{ version_fn }}.tar.gz
url: https://github.com/ornladios/ADIOS2/archive/v{{ version_fn }}.tar.gz
sha256: {{ sha256 }}
#patches:
patches:
# # FIXME: https://github.com/ornladios/ADIOS2/pull/1484
# - 0001-rpath-osx-policy.patch
# FIXME: https://github.com/ornladios/ADIOS2/pull/1575
- 0002-name-clash-msvc.patch

build:
number: {{ build }}
Expand Down

0 comments on commit 661d876

Please sign in to comment.