On 1/9/24 06:22, Alessandro DUffizi via Tech-talk wrote:
Good morning to all,
I'm a colleague of Giovanni Franzini.
We finally reached to compile LabCA under Windows.
I'm here to let you know the steps I did for reaching this goal.
The Tech-Talk archive is a great resource, but tends not to be
the first place a new user will look.
Perhaps you could create a Pull Request updating/adding a README?
https://github.com/till-s/epics-labca
Also, could you comment on Freddie's PR? Does it help? Is it
enough? Do you also see the build failure he mentions?
https://github.com/till-s/epics-labca/pull/8
ENVIRONMENT : epics 7.0 - MatlabR2022 - Windows 10 Pro
It would be preferred that those program were installed in a path without blank spaces. Maybe is not necessary, but I did so.
Once downloaded the library, edit the ./configure/RELEASE file
Change the EPICS_BASE value with the installation path of your EPICS, at the base level
I also set EPICS_HOST_ARCH=windows-x64
But this could be not necessary.
Uncomment and set the MATLABDIR variable with the path of you matlab installation
The MAKEFOR variable in CONFIG is MATLAB as DEFAULT so there's no need to change it
Uncomment and change the value of MATLIB_SUBDIR with the RELATIVE path between your ${MATLABDIR}/lib and the directory where is located the library 'libmex.lib'
Use the / into the PATH just like in a LINUX PATH:
c:/mypath/mysubpath
BUILDING THE LIBRARY
As building environment I used:
Microsoft Visual Studio Community Edition 2022
You have to install a make tool, because is not already present in Windows.
For this purpose I used Gnu Make 4.3 installed by Chocolatey
Now, Visual Studio 2022 and Make are not so pretty integrated, for this reason you could have some bad behaviour using the make from the IDE depending on the host architecture of the EPICS library that you have installed.
It could happens (and happened to me) that you have the 64 bit library from EPICS, but your Visual Studio will continue to use a 32 bit cl compiler for building your library even if you try to define the compilation target inside the IDE. This will brought you to fail your build.
So instead of Launching the Visual studio IDE, launch the:
X64 Native Tools Command Prompt For VS 2022 if you're compiling a 64-bit library or
X86 Native Tools Command Prompt For VS 2022 if you're compliling a 32-bit library
You will find both of those tools in Start → Visual Studio 2022 folder in the start menu.
Before you launch the build inside this command prompt, you have to change another point of the code:
Open the glue/mglue.h file and edit the line 91 that was
void lcaMexGblInit();
trasforming it in:
epicsShareFunc void epicsShareAPI lcaMexGblInit();
This is necessary because Windows for default doesn't export functions into library. It must be explicitly declared, differently from Linux.
Now, launching a MAKE command in the Prompt for VS,the command should run correctly and creating a subfolder of the matlab library folder, in which you will have all the .mexw64 that you need to put into your matlab.
You will need also the dll created in the folders ezca (ezcamt.dll) and in the folders glue (mezcaglue.dll)
That was our experience. Hoping could be useful for somebody
Alessandro
- References:
- Re: LabCA for MATLAB Installation error Alessandro DUffizi via Tech-talk
- Navigate by Date:
- Prev:
RE: Behavior of the soft motor's DINP field Pearson, Matthew via Tech-talk
- Next:
Re: Behavior of the soft motor's DINP field Abdalla Ahmad via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
<2024>
- Navigate by Thread:
- Prev:
Re: LabCA for MATLAB Installation error Alessandro DUffizi via Tech-talk
- Next:
Re: Question about cross compile of epics Han Lee via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
<2024>
|