-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from BBN-Q/fix/python-path
Fixing OS specific path issue.
- Loading branch information
Showing
1 changed file
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,16 +17,25 @@ | |
np_uint16_1D = npct.ndpointer(dtype=np.uint16, ndim=1, flags='CONTIGUOUS') | ||
np_uint8_1D = npct.ndpointer(dtype=np.uint8, ndim=1, flags='CONTIGUOUS') | ||
|
||
# determine OS | ||
if os.name == 'nt': # windows | ||
suffix = '\\Library\\bin' | ||
elif os.name == 'posix': | ||
suffix = '/lib' | ||
else: | ||
suffix = '' | ||
|
||
# load the shared library | ||
# try with and without "lib" prefix | ||
libpath = find_library("aps2") | ||
if libpath is None: | ||
libpath = find_library("libaps2") | ||
# if we still can't find it, then look in python prefix (where conda stores binaries) | ||
if libpath is None: | ||
libpath = sys.prefix + '/lib' | ||
libpath = sys.prefix + suffix | ||
libaps2 = npct.load_library("libaps2", libpath) | ||
else: | ||
libpath = sys.prefix + suffix | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
matthewware
Author
Collaborator
|
||
libaps2 = CDLL(libpath) | ||
|
||
libaps2.get_device_IPs.argtypes = [POINTER(c_char_p)] | ||
|
@matthewware I don't think you want this here. If the library was found (either aps2 or libaps2) it already has the full file name in the path. Or am I missing some case?