mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20:34 +05:00
pip fixes for loading ngsolve.tcl on MacOS
This commit is contained in:
parent
58af9adb03
commit
715f86b3b5
@ -2,6 +2,9 @@ import netgen
|
||||
|
||||
def StartGUI():
|
||||
from tkinter import Tk
|
||||
from netgen import config
|
||||
import sys, os
|
||||
|
||||
try:
|
||||
# the GUI tries to load ngsolve.tcl (which loads ngsolve shared libraries)
|
||||
# BUT might fail to load dependencies (like mkl), these are handled by the
|
||||
@ -16,6 +19,12 @@ def StartGUI():
|
||||
win.tk.eval('lappend ::auto_path ' + netgen._netgen_bin_dir)
|
||||
# load with absolute path to avoid issues on MacOS
|
||||
win.tk.eval('load "'+netgen._netgen_lib_dir.replace('\\','/')+'/libgui[info sharedlibextension]" gui')
|
||||
|
||||
if config.is_python_package and 'darwin' in sys.platform:
|
||||
# libngsolve and other libraries are installed into netgen python dir to keep relative installation paths, but tcl won't find them there automatically
|
||||
netgen_dir = os.path.abspath(os.path.dirname(netgen.__file__))
|
||||
win.tk.eval(f'set netgen_library_dir {netgen_dir}')
|
||||
|
||||
win.tk.eval( netgen.libngpy._meshing._ngscript)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user