Skip to content

Commit

Permalink
4.1.3 for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kasemir committed Jun 30, 2010
1 parent 6ba7e59 commit a8353fe
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 12 deletions.
4 changes: 4 additions & 0 deletions MCAError.h
Expand Up @@ -9,6 +9,10 @@
#undef printf
#endif

#ifdef WIN32
#define __attribute__(x) /* nothing */
#endif

class MCAError
{
public:
Expand Down
2 changes: 1 addition & 1 deletion MCAVersion.h
@@ -1,2 +1,2 @@
// Version string
#define MCA_VERSION "4.1.2"
#define MCA_VERSION "4.1.3"
26 changes: 26 additions & 0 deletions README_WIN32
@@ -0,0 +1,26 @@
# Provided by Vladimir Poucki (vladimir@i-tech.si), Hinko Kocevar (hinko.kocevar@i-tech.si), Instrumentation Technologies Slovenia, June 2010


We have compiled the EPICS base on Windows following the instructions: http://www.aps.anl.gov/epics/tech-talk/2010/msg00595.php
We have used "Microsoft Visual C++ 2005 Express Edition" instead of the "Microsoft Visual C++ 2010 Express Edition"; it worked well.

=============================================================================================================
Changes for WIN32 compilation:
- mca.cpp
- MCAError.h
- timereval.cpp
- /alt_compile/mcacompile_win32_mscc.m
(instead of "mcacompile.win32.mscc.m", since Matlab is not recognizinig files with multiple dots in the name)
=============================================================================================================

Matlab release used is "Matlab R2007a (7.4.0)". Operating system is Windows XP with SP3.
Everything was successfully compiled with "Microsoft Visual C++ 2005 Express Edition" installed in "C:\Program Files\Microsoft Visual Studio 8", with Microsoft SDK 6.1 installed in "c:\Program Files\Microsoft SDKs\Windows\v6.1\".

Some 'tweaking' was required for the following:
- Include the proper above mentioned SDK to Matlab 'mex' environment. Also needs to be set as a global environment variable of Windows XP.
Add environment variable to Windows XP: variable name is "MSSdk", variable value is "c:\Program Files\Microsoft SDKs\Windows\v6.1\"
- Compiler options: c:\MATLAB2007a\bin\win32\mexopts\msvc80freeopts.bat
Adding new values to PATH and INCLUDE variables in "General parameters"; proper SDK path and libs.
This consequently changes the: "C:\Documents and Settings\user\Application Data\MathWorks\MATLAB\R2007a\mexopts.bat"


4 changes: 4 additions & 0 deletions RELEASE_NOTES
Expand Up @@ -3,6 +3,10 @@ Matlab Channel Access (MCA)
The version number is available via the "mcaversion" command,
it's defined in MCAVersion.h

* V 4.1.3 - Jun 30 2010
Vladimir Poucki, Hinko Kocevar (Instrumentation Technologies Slovenia):
Update for Windows XP, Matlab R2007a

* V 4.1.2 - Oct 11 2009
Eric Norum: Add #include <errlog.h> to mca.cpp for EPICS R3.14.11.

Expand Down
@@ -1,12 +1,15 @@
%MEXCOMMAND Make mca.dll and timereval.dll
%
cd C:\MATLAB6p5\toolbox\mcanew\mca
mex mca.cpp MCAError.cpp Channel.cpp ChannelAccess.cpp ...

cd C:\Matlab2007a\toolbox\mca\

mex mca.cpp MCAError.cpp Channel.cpp ...
C:\epics\base\lib\win32-x86\Com.lib ...
C:\epics\base\lib\win32-x86\ca.lib ...
-DDB_TEXT_GLBLSOURCE -DMSCC -DEPICS_DLL_NO ...
-DDB_TEXT_GLBLSOURCE -DMSCC -DEPICS_DLL_NO ...
-DWIN32 ...
-IC:\epics\base\include ...
-IC:\epics\base\include\os\WIN32 ...
-v

mex timereval.cpp -v
mex timereval.cpp -v -DWIN32
12 changes: 6 additions & 6 deletions mca.cpp
Expand Up @@ -36,8 +36,8 @@ class MonitorQueue
void clear()
{
mutex.lock();
while(!MonitorQueue.IsEmpty())
MonitorQueue.Dequeue();
while(!MonQueue.IsEmpty())
MonQueue.Dequeue();
mutex.unlock();
}

Expand All @@ -49,25 +49,25 @@ class MonitorQueue
return;
}
mutex.lock();
MonitorQueue.Enqueue(handle);
MonQueue.Enqueue(handle);
mutex.unlock();
}

int remove()
{
int result;
mutex.lock();
if (MonitorQueue.IsEmpty())
if (MonQueue.IsEmpty())
result = 0;
else
result = MonitorQueue.Dequeue();
result = MonQueue.Dequeue();
mutex.unlock();
return result;
}

private:
epicsMutex mutex;
Queue<int> MonitorQueue;
Queue<int> MonQueue;
};

static MonitorQueue MonitorQueue;
Expand Down
3 changes: 2 additions & 1 deletion timereval.cpp
Expand Up @@ -4,7 +4,8 @@

#include <mex.h>
#ifdef WIN32
#include <afxwin.h>
#pragma once
#include <windows.h>
#endif

static bool RUNNING = false;
Expand Down

0 comments on commit a8353fe

Please sign in to comment.