Skip to content

Commit 09af1fb

Browse files
committed
Final fix
1 parent cbb66d7 commit 09af1fb

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,19 @@ liboqs' library directory, e.g.,
6565
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
6666
```
6767

68-
On Windows platforms, **you must ensure** that the liboqs shared library
69-
`oqs.dll` is visible system-wide, and that the following environment variable
70-
are being set. Use the "Edit the system environment variables" Control Panel
71-
tool or execute in a Command Prompt, e.g.,
68+
On Windows platforms, **you must ensure** that you add the
69+
`-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE` flag to CMake, and that the liboqs
70+
shared library `oqs.dll` is visible system-wide, i.e., set the `PATH`
71+
environment variable accordingly by using the "Edit the system environment
72+
variables" Control Panel tool or executing in a Command Prompt
7273

7374
```shell
7475
set PATH=%PATH%;C:\Program Files (x86)\liboqs\bin
7576
```
7677

7778
You can change liboqs' installation directory by configuring the build to use
78-
an alternative path, e.g., `C:\liboqs`, by replacing the first CMake line above
79-
by
79+
an alternative path, e.g., `C:\liboqs`, by passing the
80+
`-DCMAKE_INSTALL_PREFIX=/path/to/liboqs` flag to CMake, e.g.,
8081

8182
```shell
8283
cmake -S liboqs -B liboqs/build -DCMAKE_INSTALL_PREFIX="C:\liboqs" -DBUILD_SHARED_LIBS=ON

oqs/oqs.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def _load_shared_obj(name, additional_searching_paths=None):
5151
# https://stackoverflow.com/questions/856116/changing-ld-library-path-at-runtime-for-ctypes
5252
# os.environ["LD_LIBRARY_PATH"] += os.path.abspath(path)
5353
if platform.system() == "Windows":
54+
paths.append(os.path.abspath(path) + os.path.sep + name + ".lib")
55+
paths.append(os.path.abspath(path) + os.path.sep + name + ".dll")
5456
os.environ["PATH"] += os.path.abspath(path) # Windows
5557
# Search typical locations
5658

@@ -110,7 +112,7 @@ def _install_liboqs(directory, oqs_version):
110112
_liboqs = _load_shared_obj(name="oqs", additional_searching_paths=[oqs_lib_dir])
111113
assert _liboqs
112114
except RuntimeError:
113-
# We don't have liboqs, so we try to install it automatically in $HOME/oqs
115+
# We don't have liboqs, so we try to install it automatically
114116
_install_liboqs(directory=oqs_install_dir, oqs_version=OQS_VERSION)
115117
# Try loading it again
116118
try:

0 commit comments

Comments
 (0)