Skip to content

Commit

Permalink
common: set Windows support as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
osalyk committed Mar 28, 2023
1 parent b354e0b commit 79f15dd
Show file tree
Hide file tree
Showing 61 changed files with 1,047 additions and 130 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ Available Utilities:
Currently these libraries only work on 64-bit Linux, Windows<sup>2</sup>, and 64-bit FreeBSD 11+<sup>3</sup>.
For information on how these libraries are licensed, see our [LICENSE](LICENSE) file.

> NOTICE:
Support for Windows is deprecated since PMDK 1.13.0 release
and will be removed in the PMDK 1.14.0 release.

><sup>1</sup> Not supported on Windows.
>
><sup>2</sup> PMDK for Windows is feature complete, but not yet considered production quality.
Expand All @@ -107,6 +111,10 @@ Additionally, we recommend reading [Introduction to Programming with Persistent

## Pre-Built Packages for Windows

> NOTICE:
Support for Windows is deprecated since PMDK 1.13.0 release
and will be removed in the PMDK 1.14.0 release.

The recommended and easiest way to install PMDK on Windows is to use Microsoft vcpkg. Vcpkg is an open source tool and ecosystem created for library management.

To install the latest PMDK release and link it to your Visual Studio solution you first need to clone and set up vcpkg on your machine as described on the [vcpkg github page](https://github.com/Microsoft/vcpkg) in **Quick Start** section.
Expand Down Expand Up @@ -159,6 +167,10 @@ see https://github.com/pmem/pmdk/issues/4207.

### Windows

> NOTICE:
Support for Windows is deprecated since PMDK 1.13.0 release
and will be removed in the PMDK 1.14.0 release.

* **MS Visual Studio 2022**
* [Windows SDK 10.0.22000.0](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/)
* **Windows, version >= 1803**
Expand Down Expand Up @@ -325,6 +337,10 @@ and UndefinedBehaviorSanitizer, run:

## Building PMDK on Windows

> NOTICE:
Support for Windows is deprecated since PMDK 1.13.0 release
and will be removed in the PMDK 1.14.0 release.

Clone the PMDK tree and open the solution:
```
> git clone https://github.com/pmem/pmdk
Expand All @@ -337,6 +353,10 @@ Select the desired configuration (Debug or Release) and build the solution

### Testing Libraries on Windows

> NOTICE:
Support for Windows is deprecated since PMDK 1.13.0 release
and will be removed in the PMDK 1.14.0 release.

Before running the tests, you may need to prepare a test configuration file (src/test/testconfig.ps1). Please see the available configuration settings in the example file [src/test/testconfig.ps1.example](src/test/testconfig.ps1.example).

To **run the unit tests**, open the PowerShell console and type:
Expand Down
3 changes: 3 additions & 0 deletions doc/README
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ libpmempool -- persistent memory pool management library
pmempool -- persistent memory pool management tool
daxio -- perform I/O on Device DAX device

NOTE: Support for Windows and FreeBSD are deprecated since PMDK 1.13.0 release
and will be removed in the PMDK 1.14.0 release.

These man pages provide the API specification for the corresponding libraries
and commands in this source tree, so any updates to one should be tested,
reviewed, and committed with changes to the other.
Expand Down
4 changes: 4 additions & 0 deletions doc/libpmem/libpmem.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ header: "pmem API version 1.1"

**libpmem** - persistent memory support library

>NOTE:
Support for Windows is deprecated since PMDK 1.13.0 release
and will be removed in the PMDK 1.14.0 release.

# SYNOPSIS #

```c
Expand Down
4 changes: 4 additions & 0 deletions doc/libpmem2/libpmem2.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ header: "pmem2 API version 1.0"

**libpmem2** - persistent memory support library

>NOTE:
Support for Windows is deprecated since PMDK 1.13.0 release
and will be removed in the PMDK 1.14.0 release.

# SYNOPSIS #

```c
Expand Down
4 changes: 4 additions & 0 deletions doc/libpmemblk/libpmemblk.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ header: "pmemblk API version 1.1"

**libpmemblk** - persistent memory resident array of blocks (DEPRECATED)

>NOTE:
Support for Windows is deprecated since PMDK 1.13.0 release
and will be removed in the PMDK 1.14.0 release.

# SYNOPSIS #

```c
Expand Down
4 changes: 4 additions & 0 deletions doc/libpmemlog/libpmemlog.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ header: "pmemlog API version 1.1"

**libpmemlog** - persistent memory resident log file (DEPRECATED)

>NOTE:
Support for Windows is deprecated since PMDK 1.13.0 release
and will be removed in the PMDK 1.14.0 release.

# SYNOPSIS #

```c
Expand Down
4 changes: 4 additions & 0 deletions doc/libpmemobj/libpmemobj.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ header: "pmemobj API version 2.3"

**libpmemobj** - persistent memory transactional object store

>NOTE:
Support for Windows is deprecated since PMDK 1.13.0 release
and will be removed in the PMDK 1.14.0 release.

# SYNOPSIS #

```c
Expand Down
4 changes: 4 additions & 0 deletions doc/libpmempool/libpmempool.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ header: "pmempool API version 1.3"

**libpmempool** - persistent memory pool management library

>NOTE:
Support for Windows is deprecated since PMDK 1.13.0 release
and will be removed in the PMDK 1.14.0 release.

# SYNOPSIS #

```c
Expand Down
4 changes: 4 additions & 0 deletions doc/pmempool/pmempool.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ header: "pmem Tools version 1.4"

**pmempool** - Persistent Memory Pool Management Tool

>NOTE:
Support for Windows is deprecated since PMDK 1.13.0 release
and will be removed in the PMDK 1.14.0 release.

# SYNOPSIS #

```
Expand Down
4 changes: 2 additions & 2 deletions src/benchmarks/pmembench.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
</AdditionalIncludeDirectories>
<PreprocessToFile>false</PreprocessToFile>
<PreprocessKeepComments>false</PreprocessKeepComments>
<DisableSpecificWarnings>4200</DisableSpecificWarnings>
<DisableSpecificWarnings>4200;4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -239,7 +239,7 @@
<CompileAs>CompileAsCpp</CompileAs>
<ForcedIncludeFiles>platform.h</ForcedIncludeFiles>
<TreatWarningAsError>true</TreatWarningAsError>
<DisableSpecificWarnings>4200</DisableSpecificWarnings>
<DisableSpecificWarnings>4200;4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
2 changes: 1 addition & 1 deletion src/examples/libpmemobj/tree_map/rtree_map.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<ItemDefinitionGroup>
<ClCompile>
<CompileAs>CompileAsCpp</CompileAs>
<DisableSpecificWarnings>4200</DisableSpecificWarnings>
<DisableSpecificWarnings>4200;4996</DisableSpecificWarnings>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
71 changes: 70 additions & 1 deletion src/include/libpmem.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause */
/* Copyright 2014-2020, Intel Corporation */
/* Copyright 2014-2023, Intel Corporation */

/*
* libpmem.h -- definitions of libpmem entry points
Expand Down Expand Up @@ -27,6 +27,9 @@
#define pmem_map_file pmem_map_fileU
#define pmem_check_version pmem_check_versionU
#define pmem_errormsg pmem_errormsgU

#define WIN_DEPR_STR "Windows support is deprecated."
#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR))
#endif

#endif
Expand All @@ -53,29 +56,82 @@ extern "C" {
void *pmem_map_file(const char *path, size_t len, int flags, mode_t mode,
size_t *mapped_lenp, int *is_pmemp);
#else
WIN_DEPR_ATTR
void *pmem_map_fileU(const char *path, size_t len, int flags, mode_t mode,
size_t *mapped_lenp, int *is_pmemp);
WIN_DEPR_ATTR
void *pmem_map_fileW(const wchar_t *path, size_t len, int flags, mode_t mode,
size_t *mapped_lenp, int *is_pmemp);
#endif

#ifdef _WIN32
WIN_DEPR_ATTR
#endif
int pmem_unmap(void *addr, size_t len);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
int pmem_is_pmem(const void *addr, size_t len);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
void pmem_persist(const void *addr, size_t len);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
int pmem_msync(const void *addr, size_t len);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
int pmem_has_auto_flush(void);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
void pmem_flush(const void *addr, size_t len);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
void pmem_deep_flush(const void *addr, size_t len);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
int pmem_deep_drain(const void *addr, size_t len);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
int pmem_deep_persist(const void *addr, size_t len);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
void pmem_drain(void);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
int pmem_has_hw_drain(void);

#ifdef _WIN32
WIN_DEPR_ATTR
#endif
void *pmem_memmove_persist(void *pmemdest, const void *src, size_t len);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
void *pmem_memcpy_persist(void *pmemdest, const void *src, size_t len);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
void *pmem_memset_persist(void *pmemdest, int c, size_t len);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
void *pmem_memmove_nodrain(void *pmemdest, const void *src, size_t len);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
void *pmem_memcpy_nodrain(void *pmemdest, const void *src, size_t len);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
void *pmem_memset_nodrain(void *pmemdest, int c, size_t len);

#define PMEM_F_MEM_NODRAIN (1U << 0)
Expand All @@ -95,8 +151,17 @@ void *pmem_memset_nodrain(void *pmemdest, int c, size_t len);
PMEM_F_MEM_WB | \
PMEM_F_MEM_NOFLUSH)

#ifdef _WIN32
WIN_DEPR_ATTR
#endif
void *pmem_memmove(void *pmemdest, const void *src, size_t len, unsigned flags);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
void *pmem_memcpy(void *pmemdest, const void *src, size_t len, unsigned flags);
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
void *pmem_memset(void *pmemdest, int c, size_t len, unsigned flags);

/*
Expand All @@ -112,16 +177,20 @@ void *pmem_memset(void *pmemdest, int c, size_t len, unsigned flags);
const char *pmem_check_version(unsigned major_required,
unsigned minor_required);
#else
WIN_DEPR_ATTR
const char *pmem_check_versionU(unsigned major_required,
unsigned minor_required);
WIN_DEPR_ATTR
const wchar_t *pmem_check_versionW(unsigned major_required,
unsigned minor_required);
#endif

#ifndef _WIN32
const char *pmem_errormsg(void);
#else
WIN_DEPR_ATTR
const char *pmem_errormsgU(void);
WIN_DEPR_ATTR
const wchar_t *pmem_errormsgW(void);
#endif

Expand Down
8 changes: 8 additions & 0 deletions src/include/libpmem2/async.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ extern "C" {
#define ASYNC_DEPR_STR "Async support for libpmem2 is deprecated."
#ifdef _WIN32
#define ASYNC_DEPR_ATTR __declspec(deprecated(ASYNC_DEPR_STR))
#define WIN_DEPR_STR "Windows support is deprecated."
#define WIN_DEPR_ATTR __declspec(deprecated(WIN_DEPR_STR))
#else
#define ASYNC_DEPR_ATTR __attribute__((deprecated(ASYNC_DEPR_STR)))
#endif
Expand Down Expand Up @@ -54,6 +56,9 @@ FUTURE(pmem2_persist_future,
/*
* Implementation of persist future, called upon future_poll
*/
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
static inline enum future_state
pmem2_persist_future_impl(struct future_context *ctx,
struct future_notifier *notifier)
Expand All @@ -80,6 +85,9 @@ union pmem2_finalize_future {
/*
* Returns a future for persisting data
*/
#ifdef _WIN32
WIN_DEPR_ATTR
#endif
static inline union pmem2_finalize_future
pmem2_persist_future(struct pmem2_map *map, void *ptr, size_t size)
{
Expand Down
Loading

0 comments on commit 79f15dd

Please sign in to comment.