Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not start IOC on Windows 10, MSYS2 MINGW64, EPICS 7.0.4.1 #20

Open
keale opened this issue May 30, 2023 · 9 comments
Open

Can not start IOC on Windows 10, MSYS2 MINGW64, EPICS 7.0.4.1 #20

keale opened this issue May 30, 2023 · 9 comments

Comments

@keale
Copy link

keale commented May 30, 2023

Dear Kevin,
I would like to play around with motorVMC on Windows 10. I have modules:

ASYN=c:/Users/AlexK/work/epics/Modules/asyn
SNCSEQ=c:/user/AlexK/work/epics/Module/seq-2.2.9
MOTORVMC=c:/Users/AlexK/work/epics/Module/motorVMC
MOTOR=c:/user/AlexK/work/epics/Module/Motor
EPICS_BASE=c:/Users/AlexK/work/epics/base-R7.0.4.1

Modules without version were cloned from the current github repos.
The make finished without error, but I can't find the vmc.exe. Could you check the make on Windows?

With kind regards,
Alexander

P.S. thanks to @tboegi for giving starting help!

@tboegi
Copy link
Contributor

tboegi commented May 31, 2023

As a first step, I added the creation of a binary:
#21

However, more improvements are needed, either in the README and/or with more
example files.

@kmpeters
Copy link
Contributor

Adding dllPath.bat to the Makefile, which I suggested here isn't enough to solve the problem. The dllPath.bat that is created is intended to be run in cmd.exe, not the Msys2 bash shell:

$ more dllPath.bat
@ECHO OFF
SET "PATH=/d/epics/motor-devel/testing/motorVMC/iocs/vmcIOC/bin/windows-x64-mingw;/d/epics/motor-devel/testing/motor/bin/windows-x64-mingw;D:/epics/motor-devel/support/asyn-R4-42/bin/windows-x64-mingw;D:/epics/mot
or-devel/support/seq-2-2-9/bin/windows-x64-mingw;D:/epics/motor-devel/support/busy-R1-7-3/bin/windows-x64-mingw;D:/epics/motor-devel/support/lua-R3-0-2/bin/windows-x64-mingw;D:/epics/motor-devel/support/modbus-R3-
2/bin/windows-x64-mingw;D:/epics/base-7.0.6.1/bin/windows-x64-mingw;/d/epics/motor-devel/testing/motorVMC/bin/windows-x64-mingw;%PATH%"

But there is definitely a need for a dllPath.bat-like-solution for bash:

$ ldd ../../bin/windows-x64-mingw/vmc.exe
        ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ff825e50000)
        KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ff824950000)
        KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ff823530000)
        msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ff825720000)
        Com.dll => not found
        dbCore.dll => not found
        dbRecStd.dll => not found
        asyn.dll => not found
        motor.dll => not found
        vmc.dll => not found

@kmpeters
Copy link
Contributor

The Makefile in the startup directory can create a relPaths.sh file instead of dllPath.bat:

$ cat relPaths.sh
export PATH="/d/epics/motor-devel/testing/motorVMC/iocs/vmcIOC/bin/windows-x64-mingw:/d/epics/motor-devel/testing/motor/bin/windows-x64-mingw:D:/epics/motor-devel/support/asyn-R4-42/bin/windows-x64-mingw:D:/epics/motor-devel/support/seq-2-2-9/bin/windows-x64-mingw:D:/epics/motor-devel/support/busy-R1-7-3/bin/windows-x64-mingw:D:/epics/motor-devel/support/lua-R3-0-2/bin/windows-x64-mingw:D:/epics/motor-devel/support/modbus-R3-2/bin/windows-x64-mingw:D:/epics/base-7.0.6.1/bin/windows-x64-mingw:/d/epics/motor-devel/testing/motorVMC/bin/windows-x64-mingw:$PATH"

The one it created for my IOC has some incorrect paths in it (D:/ vs /d/). The envPaths file has the same problem, so I'll need to look into that.

@kmpeters
Copy link
Contributor

I don't see a way to make this work without having to edit files manually. The EPICS build system is happy to use Windows-style paths (C:/), but paths that get automatically created by the build system default to MSYS2-style paths (/c/).

The envPaths file is broken because it contains MSYS2-style paths, which the running IOC doesn't understand:

epicsEnvSet("IOC","iocvmc")
epicsEnvSet("TOP","/d/epics/motor-devel/testing/motorVMC/iocs/vmcIOC")
epicsEnvSet("MOTOR","/d/epics/motor-devel/testing/motor")
epicsEnvSet("ASYN","D:/epics/motor-devel/support/asyn-R4-42")
epicsEnvSet("SNCSEQ","D:/epics/motor-devel/support/seq-2-2-9")
epicsEnvSet("BUSY","D:/epics/motor-devel/support/busy-R1-7-3")
epicsEnvSet("LUA","D:/epics/motor-devel/support/lua-R3-0-2")
epicsEnvSet("MODBUS","D:/epics/motor-devel/support/modbus-R3-2")
epicsEnvSet("EPICS_BASE","D:/epics/base-7.0.6.1")
epicsEnvSet("SUPPORT","D:/epics/motor-devel/support")
epicsEnvSet("MOTOR_VMC","D:/epics/motor-devel/testing/motorVMC")

The relPaths.sh file is also broken. The Windows-style paths don't work on the MSYS2 bash shell and the MSYS2-style paths don't work on cmd.exe

export PATH="/d/epics/motor-devel/testing/motorVMC/iocs/vmcIOC/bin/windows-x64-mingw:/d/epics/motor-devel/testing/motor/bin/windows-x64-mingw:D:/epics/motor-devel/support/asyn-R4-42/bin/windows-x64-mingw:D:/epics/motor-devel/support/seq-2-2-9/bin/windows-x64-mingw:D:/epics/motor-devel/support/busy-R1-7-3/bin/windows-x64-mingw:D:/epics/motor-devel/support/lua-R3-0-2/bin/windows-x64-mingw:D:/epics/motor-devel/support/modbus-R3-2/bin/windows-x64-mingw:D:/epics/base-7.0.6.1/bin/windows-x64-mingw:D:/epics/motor-devel/testing/motorVMC/bin/windows-x64-mingw:$PATH"

@keale
Copy link
Author

keale commented Jun 16, 2023

What are correct paths? C:/ or /c/... ?
The gettings started testIoc runs in my case only with C:/

@tboegi
Copy link
Contributor

tboegi commented Jun 16, 2023 via email

@keale
Copy link
Author

keale commented Jun 16, 2023

But it seems /c/... is also used...

Warning: IOC is booting with TOP = "c:/Users/AlexK/work/epics/Modules/motorVMC"
          but was built with TOP = "/c/Users/AlexK/work/epics/Modules/motorVMC"

@tboegi
Copy link
Contributor

tboegi commented Jun 16, 2023

That warning can be ignored, kind of.

If you want to get rid of it, replace /c/ with C:/ in all the files under the
configure/ directories
(or should we agree on c:/ (lowercase) ? I dunno

@kmpeters
Copy link
Contributor

I don't see a way to make this work without having to edit files manually. The EPICS build system is happy to use Windows-style paths (C:/), but paths that get automatically created by the build system default to MSYS2-style paths (/c/).

The install documentation includes instructions for manually correcting paths in the envPaths files:

"Open the envPaths file and change the MSYS2 relative paths to full Windows paths"

So that is not something I need to solve to resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants