~epics-core/epics-base/3.14.11+patches

« back to all changes in this revision

Viewing changes to documentation/README.WIN32

  • Committer: Andrew Johnson
  • Date: 2002-07-16 20:36:07 UTC
  • Revision ID: anj@aps.anl.gov-20020716203607-4xjqxqmln2yej5g3
MovedĀ fromĀ $(TOP)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
Compiling EPICS and Building IOC Applications on win32-x86 (Windows95/NT) 
 
3
---------------------------------------------------------------------
 
4
 
 
5
Original port of EPICS base build system to WIN32 (Windows95/NT)
 
6
was done by Kay-Uwe Kasemir 11/96
 
7
 
 
8
please mail questions, comments, corrections, additional examples, etc 
 
9
        to johill@lanl.gov
 
10
 
 
11
0) what you will get
 
12
--------------------
 
13
 
 
14
Right now this port of EPICS to win32-x86 should allow you to
 
15
 
 
16
* compile all of EPICS base using {Tornado, MS Visual C, perl,
 
17
  GNU make} (only {MS Visual C, perl, GNU make} if you prefer
 
18
  to compile only the host portions of EPICS base).
 
19
* load EPICS on an IOC (486, pentium, 68k, ...),
 
20
  load databases
 
21
  (no drivers/devices for real I/O available, yet.
 
22
   Some Greenspring IP support [Relay, Dig, ADC, DAC] is in progress)
 
23
* build and use ca.dll on NT or Win95 to access all IOCs,
 
24
  as well as the Com-library, gdd-library, cas-library,
 
25
  and all other EPICS base libraries as DLLs.
 
26
* build gdd, cas and a demo of the new portable CA server on win32-x86.
 
27
 
 
28
To build only for win32-x86 and not cross compile for IOC development type 
 
29
"make win32-x86" or in your configure/CONFIG_SITE file set 
 
30
"CROSS_COMPILER_HOST_ARCHS="
 
31
 
 
32
1) see what you have
 
33
--------------------
 
34
 
 
35
To compile EPICS on win32-x86, we need
 
36
 
 
37
        WindRiver System's Tornado (used: 1.0)  (not required if host only build)
 
38
        Microsoft's Visual C/C++   (used: 6.0)  (borland C++ rumored to work also)
 
39
 
 
40
and some tools:
 
41
 
 
42
        gnu make - www.gnu.org (we used 3.76)
 
43
        perl - www.perl.org (we used 5.003)
 
44
 
 
45
The perl interpreter and gnu make are available 'on the net'
 
46
as sources which compile with MS Visual C++.
 
47
If you cannot/don't want to find them, contact me, please!
 
48
 
 
49
2) set environment variables
 
50
 
 
51
(Setting env. vars. is different: for NT, use Settings/System,
 
52
for Win95 use autoexec.bat)
 
53
 
 
54
When setting paths in the EPICS CONFIG files for win32-x86 the following
 
55
are hints in case you have trouble. You should not need to worry about 
 
56
this unless you type a path into one of the EPICS config files that 
 
57
includes a "\". In most situations gnu make, windows NT, the MS compiler,
 
58
and the MS linker will accept "/" and this will result in less trouble.
 
59
 
 
60
        ** Note that that each "\" in any path variables you set
 
61
                must be replaced with a "\\" (this is because GNU make treats
 
62
                all "\" characters as line continuation)
 
63
 
 
64
        ** Note that that each space in any file name or 
 
65
        path name variable you set must be replaced with 
 
66
        a "\ " (this is because GNU make treats all " " separated
 
67
        input as independent tokens in the input stream.
 
68
 
 
69
        ** win32-x86 will generally allow "/" and "\" interchangeably in file paths,
 
70
                but the DOS shell only accepts "\".
 
71
 
 
72
    ** Certain command line utilities such as the MS linker are known to in rare
 
73
        situations confuse "/" in a path with command line options, and it may
 
74
        be necessary to replace a "/" in a path that configured with "\\", but
 
75
        the bulk of our experience indicates that this is not the necessary.
 
76
 
 
77
Your path should include:
 
78
- The EPICS-binaries that we are about to build in <EPICS>base/bin/win32-x86
 
79
- The System (for me it's in NT40...)
 
80
- The MS Visual C compiler binaries
 
81
 
 
82
Check with e.g.:
 
83
 
 
84
>echo %Path%
 
85
C:\WINNT35.0\system32;
 
86
C:\WINNT35.0;
 
87
c:\msdev\bin;
 
88
c:\perl5\bin;
 
89
c:\make-3.75\WinRel;
 
90
c:\epics\base\bin\win32 (really where INSTALL_LOCATION specifies)
 
91
 
 
92
On NT, "Path" is defined by the operating system, on Win95, it's "PATH" instead.
 
93
 
 
94
MS Visual C and Tornado should be installed properly with
 
95
these env. variables set:
 
96
 
 
97
WIND_BASE=c:\Tornado            (required for cross development only)
 
98
WIND_HOST_TYPE=x86-win32        (required for cross development only)
 
99
 
 
100
This way the EPICS makesystem can locate Tornado 
 
101
without any changes to the files in base/config.
 
102
So for pc486 the settings in CONFIG_SITE where
 
103
you specify the location of VxWorks are ignored,
 
104
this information is taken from WIND_BASE and _HOST_TYPE!!
 
105
 
 
106
MSDevDir=C:\MSDEV
 
107
include=c:\msdev\include;c:\msdev\mfc\include
 
108
lib=c:\msdev\lib;c:\msdev\mfc\lib
 
109
 
 
110
Select host arch to build:
 
111
EPICS_HOST_ARCH=win32-x86                       (used by the make system)
 
112
 
 
113
Set the "TMP" environment variable if you need to specify where 
 
114
temporary files are created.
 
115
 
 
116
Directory Used For Temporary Files   Conditions
 
117
----------------------------------   ----------
 
118
Directory specified by TMP           TMP environment variable is set, 
 
119
                                     and directory specified by TMP exists.     
 
120
dir argument to _tempnam             TMP environment variable is not set, or 
 
121
                                     directory specified by TMP does not exist. 
 
122
P_tmpdir in STDIO.H                  dir argument is NULL, or dir is name of 
 
123
                                     nonexistent directory.     
 
124
Current working directory            P_tmpdir does not exist.   
 
125
 
 
126
On my system I see in stdio.h that _P_tmpdir is "/". Here is a common
 
127
setting for "TMP" (the C:\TEMP directory must exist).
 
128
 
 
129
TMP=C:\TEMP
 
130
 
 
131
3) building EPICS
 
132
-----------------
 
133
 
 
134
Prepare apx. 2 ltr. Tee and type:
 
135
 
 
136
        cd <epics>/base
 
137
        make                    (use gnu make)
 
138
 
 
139
Watch for errors and send them to me.
 
140
 
 
141
Known problems:
 
142
* gnumake seems to be faster than win32-x86 sometimes
 
143
  which results in warnings/errors like
 
144
  "file has modification date in the future"
 
145
  for newly created things.
 
146
  Very seldom this is fatal, so you have to
 
147
  stop gnumake and restart it.
 
148
* This is strange because Windows95/NT doesn't care
 
149
  about upper/lower case:
 
150
  WIN32 is WIN32, not win32. Gnumake fails
 
151
  if e.g. base/src/include/os/WIN32 is ...win32.
 
152
 
 
153
4) Creating EPICS IOC applications under win32-x86
 
154
 
 
155
o create application development folder
 
156
        
 
157
o start a DOS window and change your working directory to the folder
 
158
        created above (with the DOS "cd" command)
 
159
 
 
160
o to create an example application type:
 
161
        "perl c:\epics\bin\win32\makeBaseApp.pl -b c:\\epics -e
 
162
 
 
163
        ** Note that that each "\" above in any path arguments to makeBaseApp.pl
 
164
                must be replaced with a "\\" (this is because GNU make treats
 
165
                all "\" characters as line continuation)
 
166
 
 
167
        ** Note that that each space in any file name or 
 
168
        path name argument to makeBaseApp.pl must be replaced with 
 
169
        a "\ " (this is because GNU make treats all " " separated
 
170
        input as independent tokens in the input stream.
 
171
 
 
172
        ** Note that c:\epics above must be replaced by the path
 
173
                to your epics source installation (or where INSTALL_LOCATION 
 
174
                specifies)
 
175
 
 
176
o General information on EPICS IOC application development can be found in
 
177
        the "EPICS IOC Application Developers Guide". To see all of the options 
 
178
        supported by makeBaseApp.pl type "perl c:\epics\bin\win32\makeBaseApp.pl"
 
179
 
 
180
5) EPICS GNU make makefiles can be executed from within a Visual C++ "makefile"
 
181
style project. This allows EPICS programs to be developed directly inside of
 
182
the visual C++ environment. To do this create a "makefile" project and place your 
 
183
gnu make command in the build configuration (accessed from the project/settings menu). 
 
184
You will also need to add GNU make and <EPICS>/bin/win32 into the Visual C++ 
 
185
executable search path (from the tools/options menu). 
 
186
In visual C++ it is possible to double click on the compiler 
 
187
error messages generated within an EPICS "makefile" style project and have visual 
 
188
C++ immediately position the cursor on the corresponding line in the source. I
 
189
have found that this works correctly with Makefile projects if the project is in a 
 
190
directory just below the source code. The following build command works well
 
191
in a visual C++ make file project: "kill caRepeater.exe&make -C ..". Be careful 
 
192
not to introduce additional spaces around the &. The kill.exe command is in the
 
193
NT resource kit.
 
194
 
 
195
6) Issues that you should be aware of if you are building code that 
 
196
calls EPICS, but you are not using the EPICS build system.
 
197
 
 
198
6a) You will need to include header files from the following paths.
 
199
    <epics>\base\include
 
200
    <epics>\base\include\os\win32
 
201
6b) You will need to link with the following path in effect.
 
202
    <epics>\base\lib\win32-x86. 
 
203
6c) If the visual C++ /Za option is not used then you will also need to define 
 
204
    __STDC__ to be zero on the command line so that EPICS headers will know that
 
205
    a ANSI standard C compiler is in use. 
 
206
6d) If you link with EPICS object libraries then specify /MT or /MTd
 
207
    depending on whether EPICS base and your code are built for debugging. 
 
208
    This specifies the multithreaded operating environment required by EPICS.
 
209
    This will also not define _DLL and therefore the EPICS header files will
 
210
    not specify that sharable libraries are being called. EPICS object library 
 
211
    names follow the convention "xxxObj.lib".
 
212
6e) If you link with EPICS shareable libraries (with DLLs) then you must 
 
213
    use /MDd or /MD depending on whether EPICS base and your code are 
 
214
    built for debugging. This specifies the multithreaded operating environment 
 
215
    required by EPICS. This will also define _DLL and therefore the EPICS header 
 
216
    files will specify an optimized calling convention for shareable libraries. 
 
217
    EPICS shareable libraries (DLL) names follow the convention "xxx.lib"
 
218
    and "xxx.dll".