Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions deepmd/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging
import os
import distutils.ccompiler
import platform
from configparser import ConfigParser
from imp import reload
from pathlib import Path
Expand Down Expand Up @@ -157,8 +157,12 @@ def get_module(module_name: str) -> "ModuleType":
FileNotFoundError
if module is not found in directory
"""
# https://discuss.python.org/t/how-to-get-the-file-extension-of-dynamic-libraries-for-current-os/3916/5
ext = distutils.ccompiler.new_compiler().shared_lib_extension
if platform.system() == "Windows":
ext = ".dll"
elif platform.system() == "Darwin":
ext = ".dylib"
else:
ext = ".so"

module_file = (
(Path(__file__).parent / SHARED_LIB_MODULE / module_name)
Expand Down