9
8
Outside users can download self-extracting archive from:
10
9
ftp://ftp.ncbi.nih.gov/toolbox/ncbi_tools/CURRENT/ncbiz.exe
12
Insiders can always retrieve the latest Toolkit sources from CVS using script:
13
$CVSROOT/scripts/makedist_pc
11
Insiders can get the C Toolkit sources from the latest successful build from:
12
/net/sampson/a/coremake/win32/ncbi_c.zip
17
15
Building the NCBI C Toolkit
18
16
-----------------------------
20
1) go to MAKE directory
22
2) here, if necessary, modify path to your BORLAND or MSVC++ toolkit
23
at the very beginning of the "ncbimake.bat" file:
24
set __PATH_MS=c:\msdev
26
NOTE: On Windows-NT, MSVC++ 5.x, 6.x it is often enough to uncomment
27
(and maybe slightly fix the paths) this:
28
set __PATH_MS=D:\Program Files\DevStudio\SharedIDE\bin;D:\Program Files\DevStudio\VC
30
3) then (from the MAKE directory) run:
31
ncbimake.bat XXX YYY ZZZ copy
33
where XXX, YYY and ZZZ specifies(see Usage):
35
ncbimake {M|B|D} {W|C} {O|D} [noexe | copy | user <makefile> <toolkit_path>]
36
(M)icrosoft / (B)orland compiler / (D)LL
37
(W)indows/(C)onsole application
38
(D)ebug/(O)ptimized version
41
(copy) -- deploy all sources(must be run from MAKE directory)
42
() -- build in the current directory(created by 'copy')
43
(noexe) -- same as () but build libraries only(no executables)
44
(user) -- must be followed by(both):
45
<makefile> -- user makefile basename (will be completed by .MAK)
46
<toolkit_path> -- path to the NCBI toolkit
48
E.g., to deploy the NCBI toolkit sources for
49
MSVC++ (M), GUI (W), optimized (O) application, just use:
50
ncbimake.bat M W O copy
52
two new directories will be created and filled with necessary source files:
56
The build directory naming policy is:
57
BUILD[_D].[MS|BOR|DLL]
59
| |>>> Microsoft / Borland compiler
60
|>>> debugging version
62
4) now go to the new "BUILD*.*" directory and run "ncbimake.bat"
63
with the same options but the "copy".
65
E.g., for the case described above, go to "BUILD.MS" and run:
68
Use "noexe" flag if you want to build only toolkit libraries and
69
do not want to build all executables(the latter can occupy, depending of
70
the build mode and the compiler, from 8M to 40M of your disk space):
71
ncbimake.bat M W O noexe
74
Building a separate application
75
--------------------------------
77
1) Build the NCBI toolkit with "ncbimake.bat" (e.g. with options 'M W D'
78
in directory "c:\ncbi")
80
2) Write special makefile. It must have extension ".mak". For example,
81
the special makefile to build "cn3d.exe" can have name "cn3d.mak" and
83
#################################
84
!include "$(LIBPATH)\make_gen.dos"
86
TEST_OBJ = cn3dmain.obj
88
TEST_LIB = $(LIB41) $(LIB31) $(LIB30) $(LIB23) $(LIB22) $(LIB20) $(ENTREZLIBS) $(LIB4) $(LIB2) $(LIB1)
90
#RES_DEP = ncbilogo.ico
91
!include "$(LIBPATH)\make_exe.dos"
92
#################################
94
3) Now, from any directory containing both "cn3d.mak" and "cn3dmain.c"
95
(or already compiled "cn3dmain.obj") just run:
96
c:\ncbi\make\ncbimake M W D user cn3d c:\ncbi
98
*) If specified, the $(TEST_OPT) flags will be added to the C compiler
99
flags when compiling modules from the $(TEST_OBJ) list.
100
**) If $(RES) is defined then "$(TEST_NAME).rc"(=="cn3d.rc" in our case)
101
resource file must present in the working directory(along with the
102
"cn3d.mak" and "cn3dmain.c" files); it will be compiled by the relevant
103
resource compiler and linked in the executable("cn3d.exe").
104
$(RES_DEP) describes hidden resource file dependencies(if any).
105
***) Use $(TEST_STDLIB) to add additional standard libraries.
108
Building a separate library
109
----------------------------
111
1) Build the NCBI toolkit with "ncbimake.bat" (e.g. with options M W D
112
in directory "c:\ncbi")
114
2) Write special makefile. It must have extension ".mak". For example,
115
the special makefile to build "ncbiobj.lib(or .dll)" can have name
116
"ncbiobj.mak" and contain:
117
#################################
119
!include "$(LIBPATH)\make_gen.dos"
122
LIB_OBJ = +naccentr.obj +accutils.obj
126
!include "$(LIBPATH)\make_lib.dos"
127
#################################
129
3) Now, from any directory containing both "ncbiobj.mak" and modules
130
"naccentr.c" and "accutils.c"(or already compiled "naccentr.obj" and
131
"accutils.obj") just run:
132
c:\ncbi\make\ncbimake 32 W D user ncbiobj c:\ncbi
134
*) If specified, the $(LIB_PREOPT) and $(LIB_OPT) flags will be added
135
to the C compiler flags when compiling modules from the $(LIB_OBJ) list;
136
$(LIB_PREOPT) will be added before standard toolkit flags $(CFLAGS), and
137
$(LIB_OPT) will be added after the $(CFLAGS). Thus, $(LIB_PREOPT) can be
138
useful if you e.g. need to add your include dirs to alternate standard
139
toolkit include dirs("-I..."); and $(LIB_OPT) can be used to override
140
standard toolkit C-preprocessor variables("-D.... -U...").
141
The '+' sign before each object module in the $(LIB_OBJ) list is mandatory
142
if you use Borland librarian.
143
**) Should the target library can be built as DLL, just uncomment the line
144
containing "NCBI_DLL = 1". (Otherwise, the $(LIB_LIB) variable does
145
not need to contain the list of underlying libraries.)
146
***) Use $(LIB_STDLIB) to specify additional standard libraries.
149
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
151
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153
*1*) The files like "flag*.*" in your "BUILD*.*" directory(ies) are
154
designed to protect you from running "ncbimake.bat" with
155
wrong options(e.g. mixing optimized and debugging versions
156
of NCBI toolkit, or different compilers, etc.).
157
*2*) Exit from Norton Commander before running "ncbimake.bat" --
158
as NC has not enough space for environment variables used
159
within "ncbimake.bat".
160
*3*) If *2* does not help and the "Out of environment space" problem
161
persists then run new command interpreter with option /e:2000
162
(to increase DOS environment space to 2000 bytes), like
163
c:\dos\command.com /e:2000
165
c:\command.com /e:2000
166
*4*) Before starting with the source deployment make sure that you
167
have not set environment variable NC -- if set, this variable
168
prevents the source copying(use "set NC=" to unset it, if necessary)
169
*5*) Before running most of NCBI applications you should modify(if
170
necessary) and copy NCBI config files(like "ncbi.ini") to your
172
For more details see CONFIG/README and main README file.
173
*6*) If the toolkit build fails due to an occasional error
174
(e.g. "INTERNAL COMPILER ERROR"), the build can be resumed from
175
that state by just rerunning the build command with the same
177
*7*) If you use "vibgif.lib"(LIB28) to dump VIBRANT pictures directly to
178
GIF files: be aware to exclude all GUI-specific code from your
179
application (you can output either to GIF or to the screen, but not
180
to both!). Also, this library must be linked only to console
181
applications (use flag "C" for "ncbimake.bat").
182
*8*) $(LIB4), $(LIB30) and $(LIB31) libraries are actually
183
linked to the applications only when the "W" flag specified
184
(2nd "ncbimake.bat" parameter); thus, there is no reason to
185
remove e.g. $(LIB4) from the application library list if you
186
want to build non-Vibrant(console) version of your application.
187
*9*) If you want to run your build from inside the MSVC++
188
environment, create file "fake.mak" containing something like:
190
c:\ncbi\make\ncbimake.bat 32 W O user cn3d c:\ncbi
191
and open this as a makefile. In "Build"/"Settings..."(Alt-F7)
192
dialog set the output name to "cn3d.exe". Make sure that
193
all involved files ("fake.mak", "cn3d.mak", "cn3dmain.c", etc.)
194
are copied to the MSVC project dir.
195
*10*) If you have an error like "Too many parameters" (and the script
196
usually cannot find "nmake.exe" after this), try to add
197
double-quotes to the "***** Set Environment *****" section of
199
{ set PATH=%BIN%;%PATH% } ---> { set PATH="%BIN%;%PATH%" }
200
and, maybe, analogously:
201
{ set __PATH_MS="c:\program files\devstudio\vc" }).
202
This is a "feature"(bug?) in some versions of "command.com".
203
Another flavor of this bug can require to use only the opening
204
double-quote, and omit the closing one, like: {set PATH="%BIN%;%PATH%}.
205
*11*) All toolkit libs and applications are always built in Multi-Thread mode.
206
*12*) To build applications which use 3D graphics (Cn3D, Sequin, Nentrez)
207
with the OpenGL libraries (in addition to those built with the
208
the NCBI 3D-viewer), you will have to:
210
before running "ncbimake.bat ....". -- or, you can just uncomment
211
the following line in "ncbimake.bat":
214
***** Please send your remarks to: <vakatov@ncbi.nlm.nih.gov> *****
18
(We assume here that the Toolkit sources are deployed in "c:\ncbi".)
21
1) Run Microsoft Visual C++
23
2) Load the NCBI C Toolkit project workspace:
24
"File" / "Open Workspace..."
25
c:\ncbi\make\msvc_prj\ncbi.dsw
27
3) Set the build mode (default is single-threaded Debug):
28
"Build" / "Set Active Configuration" / "Project configurations:"
29
3.1) To build everything, choose one of:
33
"all - Win32 ReleaseMT"
34
"all - Win32 DebugDLL"
35
"all - Win32 ReleaseDLL"
36
3.2) Or, you can choose to build any library(es) or application(s)
37
in any configuration by using either the list of
38
project configuration here or "ClassView" (or "FileView") frame.
40
4) Start the build of the project chosen:
43
5) On success, the libraries and executables can be found under
44
c:\ncbi\make\msvc_prj\*\<build_mode>\
45
where <build_mode> stands for one of (see step 3 above):
46
Debug, Release, DebugMT, ReleaseMT.
48
For example, if you chose to build "Release" configuration, then
49
most of the built executables will be located at:
50
c:\ncbi\make\msvc_prj\demo\Release\*.exe
53
***** Please send your remarks to: <toolkit@ncbi.nlm.nih.gov> *****