File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
src/ITS/ITU/PSeries/P2108 Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 11import platform
2+ import sys
23from ctypes import *
34from enum import IntEnum
45from pathlib import Path
@@ -29,19 +30,24 @@ class ClutterType(IntEnum):
2930
3031
3132# Load the compiled library
33+ lib_name = "P2108"
34+ if sys .maxsize > 2 ** 32 :
35+ lib_name += "x64"
36+ else :
37+ # note: 32-bit python is needed to load 32-bit lib.
38+ lib_name += "x86"
3239if platform .uname ()[0 ] == "Windows" :
33- lib_name = "P2108 .dll"
40+ lib_name + = ".dll"
3441elif platform .uname ()[0 ] == "Linux" :
35- lib_name = "libP2108 .so.1.0 "
36- # elif platform.uname()[0] == "Darwin":
37- # lib_name = "P2108 .dylib" # TODO test and confirm
42+ lib_name + = ".so"
43+ elif platform .uname ()[0 ] == "Darwin" :
44+ lib_name + = ".dylib"
3845else :
3946 raise NotImplementedError ("Your OS is not yet supported" )
4047
4148# Library should be in the same directory as this file
4249lib_path = Path (__file__ ).parent / lib_name
4350lib = CDLL (str (lib_path .resolve ()))
44- # note: 32-bit python is needed to load 32-bit lib.
4551
4652# Define function prototypes
4753lib .AeronauticalStatisticalModel .restype = c_int
You can’t perform that action at this time.
0 commit comments