It looks like you're new here. If you want to get involved, click one of these buttons!
I have built both klayout and FreeCAD in MSYS2/ucrt64. You may find:
FreeCAD directory is supposed to be created in c:\users\username\klayout\salt\layoutDD\python\ after having installed the layoutDD package.
I will insert this operation into the install procedure of layoutDD when FreeCAD import will work but at the moment there is a problem that can be detected using the https://github.com/wsteffe/layoutDD_FreeCAD/test.py:
#! /ucrt64/bin/python
import sys,os
#FCpath="../salt/layoutDD/python/FreeCAD/bin"
username = os.getenv("USERNAME")
FCpath="c:/users/"+username+"/klayout/salt/layoutDD/python/FreeCAD/bin"
if not FCpath in sys.path:
sys.path.append(FCpath)
import FreeCAD
import Part
import Import
from BOPTools.ShapeMerge import mergeShapes
from BOPTools.GeneralFuseResult import GeneralFuseResult
Import.readDXF("pippo.dxf")
To check the problem please:
Open a msys shell and do:
cd c:/users/yourusername/klayout/pymacros
touch pippo.dxf
./test.py
Here test.py is using python interpreter from ucrt64 and should run withour error
Launch klayout
Klayout Macro Editor gives me the following error:
Running macro C:/Users/walter/KLayout/pymacros\test1.py
DLL load failed while importing Part: The specified module could not be found.
I am looking for help to understand why FreeCAD modules can be imported in ucrt64/python but not in klayout/python even if both interpreter are built in MSYS2/ucrt64
Comments
Update: test.py gives no error if klayout is executed from a msys shell:
How could I make it work also when klayout is executed from windows GUI ?
Solved.
The problem was due to my personal settiing of the windows path. Klayout was loading dlls built in mingw64 environment which are not compatible with ucrt64 code. The problem has disappeared after cleaning my windows path.
Thanks @wsteffe!
I have merged the PR and I will try to include the ucrt64 build in the deployment. I can't promise a quick integration however.
Best regards,
Matthias
Thanks Matthias,
I made another small pull request to fix wrong messages "NOT found xxx.dll" produced by deploy-win-ucrt64.sh.
@wsteffe Thanks, but I have a branch already (windows-build-ucrt64) which contains some more changes which I think are needed. Maybe you want to take a look at that.
Matthias