# Just Launched: You can now import projects and releases from Google Code onto SourceForge

We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps.

## [621378]: csound-build.tex Maximize Restore History

Parent: [f74c81] (diff)

Child: [bd7cb4] (diff)

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 \documentclass[11pt,letterpaper,onecolumn]{scrartcl} \usepackage{tocloft} \usepackage{stdclsdv} \usepackage{comment} \usepackage{vmargin} \usepackage{t1enc} \usepackage{fancyvrb} \usepackage{url} \usepackage{calc} \usepackage{array} \usepackage{graphicx} \usepackage{color} \usepackage{listings} \usepackage[latin1]{inputenc} \usepackage[english]{babel} \usepackage{supertabular} \usepackage{fancyhdr} \usepackage{multicol} \usepackage{float} \usepackage{textcomp} \usepackage{alltt} \definecolor{LstColor}{cmyk}{0.1,0.1,0,0.025} \setcounter{tocdepth}{1} \ifx\pdfoutput\undefined \usepackage[ps2pdf, pagebackref=true, colorlinks=true, linkcolor=blue ]{hyperref} \usepackage{pspicture} \else \usepackage[pdftex, pagebackref=true, colorlinks=true, linkcolor=blue, pdfpagelabels, pdfstartpage=2 ]{hyperref} \fi \renewcommand{\headheight}{14pt} \begin{document} \begin{sloppypar} \lstset{language=c++,basicstyle=\ttfamily\tiny,commentstyle=\ttfamily\tiny,tabsize=2,breaklines,backgroundcolor=\color{LstColor},fontadjust=true,keepspaces=false,fancyvrb=true,showstringspaces=false,moredelim=[is][\textbf]{\\emph\{}{\}}}. \title{Csound Windows Build \\ 5.10.0} \author{Michael Gogins \\ \texttt{gogins@pipeline.com}} \maketitle \section{Introduction} \label{sec:Introduction} This file should be updated in reasonable detail with each release of the Windows installers for Csound, in order to provide instructions for building Csound on Windows. Csound on Windows is built using MinGW/MSys from (\url{www.mingw.org}). Code is built for release, with full optimizations including intrinsics and vectorization. These optimizations preclude debugging. A separate debug build must be made in order to debug. However, the only differences between the debug build and the release build must be the presence or absence of optimizations and the generation or not of debugging information. Code generation for both builds must be for release versions'' of the runtime libraries and third party libraries. This code generation standard also applies, of course, to actually building the third party libraries. All third party libraries will be updated from the most recent version that seems to be used by a majority of their users --- whatever that is (trunk, most recent tag, stable release, whatever). If pre-built binaries are available, use them. Otherwise, build third party libraries with the same version of the compiler that is used to build Csound itself. If the library does not come with a functional build system for MinGW/MSys, create an SConstruct file for it. \section{Build Steps} \label{sec:BuildSteps} \begin{enumerate} \item (Done) Update the documentation tools. \begin{enumerate} \item (Done) Update the Docbook toolchain with DocBook stylesheets from \url{http://downloads.sourceforge.net/docbook/docbook-xsl-1.74.0.tar.gz} and the current Windows build of \texttt{xsltproc} from \url{http://www.zlatkovic.com/libxml.en.html}. It is necessary also to download the DocBook DTD from \url{http://www.docbook.org/xml/4.5/docbook-xml-4.5.zip} and create a catalog like this, referenced from the \verb|XML_CATALOG_FILES| environment variable. \begin{lstlisting} \end{lstlisting} \item (Done) Update LaTeX to MikTex version 2.7 from \url{http://miktex.org} and TeXniCenter 1 Stable RC1 from \url{http://www.texniccenter.org}. \item (Done) Update Doxygen to the current version (1.5.8) from \url{http://www.stack.nl/~dimitri/doxygen}. \item (Done) Update ATT Graphviz to version 2.8 from \url{http://www.graphviz.org}. Later versions of Graphviz \texttt{dot} do not work with current Doxygen. \end{enumerate} \item (Done) Update the build tools. \begin{enumerate} \item (Done) Update Python from \url{www.python.org} to the most recent standard'' version (currently 2.5.4). \item (Done) Update SCons from \url{www.scons.org} to the most recent standard'' version (currenty 1.2.0). \item (Done) Update MinGW/MSys from \url{www.mingw.org} to gcc version 4.2.1-sjlj (mingw32-2) from \url{http://sourceforge.net/projects/mingw}. Then add the latest MSys base and MSys supplementary tools from \url{http://sourceforge.net/projects/mingw}. Also, add pkg.m4 from \url{http://johnnypops.demon.co.uk/mingw/msys-pkg-config-win32.zip}. The sjlj version of the compiler must be used instead of the dw2 version, even though the dw2 compiler builds somewhat faster code, because the dw2 compiler generates buggy code for DLL relocations. \item (Done) Also install \texttt{dirent.h} from \url{http://www.softagalleria.net/dirent.php} and \texttt{bufferoverflowu.lib} from Microsoft. \item (Done) Update SWIG from \url{www.swig.org} to the most recent standard'' version (currently 1.3.36). \item (Done) Update the Java Development Kit from \url{http://java.sun.com/javase/downloads/index.jsp} to the most recent standard'' version (currently Java SE 6 Update 11). \end{enumerate} \item (Done) Update third-party libraries. \begin{enumerate} \item (Done) Install the VST SDK 2.4 from \url{http://www.steinberg.net/en/company/3rd_party_developer.html}. \item (Done) Update boost from \url{www.boost.org} to the most recent stable version (currently 1.37.0). \item (Done) Update the Synthesis Toolkit in C++ (STK) from \url{http://ccrma.stanford.edu/software/stk} to the most recent version (currently 4.3.1). Apply any patches from the web site and mailing list. Copy all contents of the STK directory into the Csound \texttt{Opcodes} directory. \item (Done) Update libsndfile from \url{http://www.mega-nerd.com/libsndfile}. Try the most recent pre-release version first (currently 1.0.18pre24); if that doesn't work, use the latest stable release (currently 1.0.17). Do not build from sources. \item (Done) Update FLTK from \url{www.fltk.org} to \texttt{branch-1.3 HEAD} from SVN and build it with MinGW using \verb|./configure --enable-threads --enable-shared|. Make sure that \texttt{custom-mingw.py} searches FLTK's \texttt{src} directory for import libraries before it searches FLTK's \texttt{lib} directory for static libraries (both are required). \item (Done) Update liblo tag 0.24 (later versions call \verb|inet_aton| which doesn't exist on Windows) from the tarball at \url{http://liblo.sourceforge.net} (\emph{not} SVN!), and build with this SConstruct: \begin{lstlisting} # S C O N S T R U C T F O R L I B L O . D L L # Michael Gogins # Using hints from: http://clam.iua.upf.edu/wikis/clam/index.php/Devel/Windows_MinGW_cross_compile#liblo environment = Environment(tools = ['mingw']) sources = ''' src/address.c src/blob.c src/bundle.c src/message.c src/method.c src/pattern_match.c src/send.c src/server.c src/server_thread.c src/timetag.c ''' cppath = ''' . D:/utah/opt/liblo D:/utah/opt/liblo/lo D:/utah/opt/pthreads/Pre-built.2/include ''' libpath = ''' D:/utah/mingw/lib D:/utah/opt/pthreads/Pre-built.2/lib ''' environment.Append(CFLAGS = Split('-O2 -g -DHAVE_CONFIG_H -D_WIN32_WINNT=0x0501')) environment.Append(CPPPATH = Split(cppath)) environment.Append(LIBPATH = Split(libpath)) environment.Append(LIBS = Split('pthread kernel32 gdi32 wsock32 ws2_32 ole32 uuid winmm pthread kernel32 gdi32 wsock32 ws2_32 ole32 uuid winmm')) environment.Append(LINKFLAGS = ['-Wl,--enable-stdcall-fixup', '-Wl,-export-dynamic']) liblo = environment.SharedLibrary('lo', Split(sources)) \end{lstlisting} \item (Done) Update FluidSynth from \url{http://fluidsynth.resonance.org/trac} to the most recent stable version (currently 1.0.8). Apply patches from the FluidSynth mailing list on trac. Configure with: \begin{lstlisting} ./configure CPPFLAGS=-Id:/utah/opt/Directx8/Includes LDFLAGS=-Ld:/utah/opt/Directx8/Libs \end{lstlisting} \item (Done) Update the pthread library from \url{http://sources.redhat.com/pthreads-win32} to the most recent stable version (currently 2.8.0). Build in \url{pthread2.2} using \verb|make -f GNUmakefile clean GC|. Copy the DLL and lib into the pre-built directory. Copy those files and rename them \texttt{pthread.dll} and \texttt{libpthread.a}. \item (Done) Update the PortAudio library (\url{http://portmedia.sourceforge.net}) from SVN and build it. Try the trunk version first, if that doesn't work use the most recent tag. Patch PortAudio as follows. Add to \verb|pa_win_wdmks_utils.c| after all \verb|#include| directives these lines: \begin{lstlisting} #if defined(__GNUC__) #define STATIC_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\ DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_IEEE_FLOAT) DEFINE_GUIDSTRUCT("00000003-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_IEEE_FLOAT); #define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) #define CTL_CODE( DeviceType, Function, Method, Access) (((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method)) #endif \end{lstlisting} Build with this SConstruct (includes tell you which DirectX SDKs to use -- two!): \begin{lstlisting} ''' MinGW SConstruct for PortAudio Michael Gogins ''' print __doc__ print import os import string import sys import traceback commonEnvironment = Environment(ENV = os.environ, tools = ['mingw', 'swig', 'javac', 'jar']) commonEnvironment.Append(CFLAGS = Split('-O2 -g')) commonEnvironment.Append(CPPFLAGS = Split(''' -DPAWIN_USE_WDMKS_DEVICE_INFO -DWIN32 -D_WIN32 -DWINDOWS -DKSAUDIO_SPEAKER_DIRECTOUT=0 -DFILE_DEVICE_KS=0x0000002f -DMETHOD_NEITHER=3 -DFILE_ANY_ACCESS=0 ''')) commonEnvironment.Append(CPPPATH = Split(''' . src/common src/hostapi src/os src/os/win include U:/portaudio/src/hostapi/asio/ASIOSDK/host U:/portaudio/src/hostapi/asio/ASIOSDK/host/pc U:/portaudio/src/hostapi/asio/ASIOSDK/common C:/utah/opt/dxsdk_2008_08/Include D:/utah/opt/Directx8/Includes ''')) commonEnvironment.Append(LIBS=Split(''' setupapi kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 oleaut32 uuid odbc32 odbccp32 winmm strmiids ''')) # src/hostapi/asio/ASIOSDK/common/dllentry.cpp portAudioSources = Split(''' src/common/pa_allocation.c src/common/pa_converters.c src/common/pa_cpuload.c src/common/pa_debugprint.c src/common/pa_dither.c src/common/pa_front.c src/common/pa_process.c src/common/pa_ringbuffer.c src/common/pa_skeleton.c src/common/pa_stream.c src/common/pa_trace.c src/hostapi/dsound/pa_win_ds.c src/hostapi/dsound/pa_win_ds_dynlink.c src/hostapi/wdmks/pa_win_wdmks.c src/hostapi/wmme/pa_win_wmme.c src/os/win/pa_win_hostapis.c src/os/win/pa_win_util.c src/os/win/pa_win_waveformat.c src/os/win/pa_win_wdmks_utils.c src/hostapi/asio/ASIOSDK/common/asio.cpp src/hostapi/asio/ASIOSDK/common/combase.cpp src/hostapi/asio/ASIOSDK/common/debugmessage.cpp src/hostapi/asio/ASIOSDK/common/register.cpp src/hostapi/asio/ASIOSDK/host/ASIOConvertSamples.cpp src/hostapi/asio/ASIOSDK/host/asiodrivers.cpp src/hostapi/asio/ASIOSDK/host/pc/asiolist.cpp src/hostapi/asio/iasiothiscallresolver.cpp src/hostapi/asio/pa_asio.cpp src/hostapi/wasapi/pa_win_wasapi.cpp ''') portAudio = commonEnvironment.SharedLibrary('portaudio', portAudioSources) \end{lstlisting} \item (Done) Update the PortMidi library (\url{http://portmedia.sourceforge.net}) from SVN and build it with this SConstruct: \begin{lstlisting} ''' MinGW SConstruct for PortMidi Michael Gogins ''' print __doc__ print import os import string import sys import traceback commonEnvironment = Environment(ENV = os.environ, tools = ['mingw', 'swig', 'javac', 'jar']) commonEnvironment.Append(CFLAGS = Split('-O2 -g ')) commonEnvironment.Append(CPPFLAGS = Split(''' -DWIN32 -D_WIN32 -DWINDOWS ''')) commonEnvironment.Append(CPPPATH = Split(''' . pm_win pm_common porttime ''')) commonEnvironment.Append(LIBS=Split(''' setupapi kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 oleaut32 uuid odbc32 odbccp32 winmm strmiids ''')) commonEnvironment.Append(LIBPATH='.') commonEnvironment.Append(SHLINKFLAGS = Split('-mwindows -mno-cygwin -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc')) portMidiSources = Split(''' pm_common/pmutil.c pm_common/portmidi.c pm_win/pmwin.c pm_win/pmwinmm.c ''') portTimeSources = Split(''' porttime/porttime.c porttime/ptwinmm.c ''') portMidiTestSources = Split(''' pm_test/test.c ''') porttime = commonEnvironment.SharedLibrary('porttime', portTimeSources) portMidiEnvironment = commonEnvironment.Copy() portMidiEnvironment.Append(LIBS='porttime') portmidi = portMidiEnvironment.SharedLibrary('portmidi', portMidiSources) portMidiTestEnvironment = commonEnvironment.Copy() portMidiTestEnvironment.Append(LIBS=Split('portmidi porttime')) test = portMidiTestEnvironment.Program('test', portMidiTestSources) Depends(portmidi, porttime) Depends(test, portmidi) \end{lstlisting} Run the test program to ensure that the build works. \item (Done) Update LuaJIT from \url{http://luajit.org} to the most recent stable version (currently 1.1.4) and build it using the command: \begin{lstlisting} make mingw clean; make mingw all \end{lstlisting} \end{enumerate} \item (Done) Build \begin{enumerate} \item (Done) Double precision sample build. \begin{enumerate} \item (Done) Update \texttt{custom-mingw.py} and \texttt{custom-msvc.py} to reflect the locations of third-party header files and libraries. \item (Done) Update Csound from CVS at \verb|csound.cvs.sourceforge.net:/cvsroot/csound|, module \texttt{csound5}.. \item (Done) Update \emph{The Canonical Csound Reference Manual} from CVS at \verb|csound.cvs.sourceforge.net:/cvsroot/csound|, module \texttt{manual}. \item (Done) Run \texttt{./cleanup.sh} to make everything really clean. \item (Done) Build Csound using \texttt{build-mingw-release-double.bat}. You will have to make some additional patches to the STK sources for the updated MinGW compiler. The patches should be obvious from context. Mostly you need to \verb|#include |. \item (Done) Build again as above, to ensure \texttt{csnd.jar} is built properly. \item (Done) Change to \texttt{examples/java} and execute \texttt{make} to build example jars. \item (Done) Build the manual using a command line such as \verb|make html-dist XSL_BASE_PATH=D:/utah/opt/docbook-xsl-1.74.0| \item (Done) Build the API reference by executing \texttt{doxygen}. \item (Done) Execute \texttt{strip.sh} to strip debugging information out of the binaries. \item (Done) Build the installer using NSIS from \url{http://nsis.sourceforge.net/Main_Page} \emph{with} the \verb|NONFREE| (VST) stuff. \item (Done) Uninstall Csound, and install it again using the installer. Use the Microsoft Dependency Walker and profile \texttt{csound5gui} running to verify that all DLLs required have been installed, or are already part of Windows. \item (Done) Build the installer \texttt{without} the \verb|NONFREE| stuff. \end{enumerate} \item (Done) Single precision sample build. \begin{enumerate} \item (Done) Repeat all procedures above, omitting the \verb|NONFREE| stuff, in a separate directory using \texttt{build-mingw-release-float.bat}. \end{enumerate} \item (Done) Update this document to reflect any changes in procedure or dependencies. \item Upload the installers to SourceForge and update the release package. \end{enumerate} \end{enumerate} \section{Bug Fixes} \label{sec:BugFixes} \begin{enumerate} \item (Done) Move \texttt{spoutlock} and \texttt{spinlock} to dummy slots in CSOUND structure to preserve Csound API compatibility. \item (Done) Change \texttt{SConstruct} to define \verb|FL_DLL| for linking with the FLTK DLL. \item (Done) Change \texttt{SConstruct} to define \verb|_SCL_SECURE_NO_DEPRECATE| for compiling Gmm++. \item (Done) Fix score editing bug in \texttt{csound5gui}. \item (Done) Fix up installers for correct third party DLLs. \item (Done) Fix up installers for correct Csound examples. \item (Done) Make sure installers link to the frames version of the manual and include the quick reference. \item (Done) Fix a bug with real-time notes not ending in CsoundVST, by restoring \texttt{relesing} flag. This needs to be tested for file rendering. \item (Done) Fix up installers for correct third party DLLs. \item (Done) Fix up installers for correct Csound examples. \end{enumerate} \section{Functional Tests} \label{sec:FunctionalTests} \begin{enumerate} \item (Done) Ensure \texttt{csound /examples/trapped.csd} works. \item (Done) Ensure \texttt{csound /examples/trapped.csd -otrapped.wav} works. \item (Done) Ensure \texttt{csound5gui} renders \texttt{trapped.csd} to audio, and can be stopped and restarted. \item (Done) Ensure \texttt{csound5gui} renders \texttt{trapped.csd} to soundfile, and can be stopped and restarted. \item (Done) Ensure FLTK widgets work. \item (Done) Ensure Python works with \texttt{python examples/koch.py}, which uses SoundFonts in FluidSynth opcodes, and \texttt{python examples/Lindenmayer.py}, which uses \texttt{CsoundAC}. \item (Done) Ensure Lua works with \verb|luajit examples/lua_example.lua|. \item (Done) Ensure Lisp works with \verb|clisp interfaces/test.lisp|. \item (Done) Ensure Java works with \verb|java -jar examples/java/CsoundEditor.jar|. \item (Done) Ensure \texttt{CsoundVstShell} can load \texttt{examples/CsoundAC-midi.csd} and perform as a live MIDI instrument using a SoundFont in a FluidSynth instrument, a VST plugin instrument, and an STK instrument. \item (Done) Ensure the Python opcodes work with some of the files in \url{Opcodes/py/examples}. \item (Done) Ensure OSC works using example files. \item (Done) Make sure installers link to the frames version of the manual and include the quick reference. \item (Done) Ensure \texttt{CsoundVST} plugin works with \texttt{CsoundVST.csd} in VSTHost from \url{http://www.hermannseib.com/english/vsthost.htm}. \end{enumerate} \end{sloppypar} \end{document}