INSTALL.txt 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. ODE has two new build systems, one for *nix systems and another for
  2. just about everything else.
  3. 1. Building with Visual Studio
  4. 2. Building with Autotools (Linux, OS X, MSYS, etc.)
  5. 3. Building with Code::Blocks
  6. 4. Building with Something Else
  7. 5. Building with CMake
  8. 1. BUILDING WITH VISUAL STUDIO (2002 and up)
  9. ============================================
  10. If you downloaded this source code from Subversion you must first use
  11. the Premake build system to generate project files.
  12. Open a command prompt and enter into the build directory. Then run the
  13. premake4.exe program with the appropriate options to generate the
  14. project files. For example, to generate a project for VS2008:
  15. > premake4.exe --with-tests --with-demos vs2008
  16. To see a complete list of options use:
  17. > premake4.exe --help
  18. Note that Visual Studio 6 is not supported and users are advised to upgrade
  19. to at least Visual Studio 2005 Express (it's free!)
  20. Using CMake is another option for generating project files for Visual Studio.
  21. See section 5 below for more details on this.
  22. 2. BUILDING WITH AUTOTOOLS (Linux, OS X, MSYS, etc.)
  23. ====================================================
  24. 2.1 FROM SUBVERSION REPOSITORY
  25. ------------------------------
  26. If you downloaded the source code from Subversion you must bootstrap the
  27. process by running the command:
  28. $ ./bootstrap
  29. For this command to work you need a set of tools typically available
  30. on BSD and Linux distributions with development packages installed. OS X
  31. users may need to manually install libtool, autoconf, automake,
  32. pkg-config, and maybe some more.
  33. If you downloaded a source code package from SourceForge this has
  34. already been done for you. You may see some "underquoted definition"
  35. warnings depending on your platform, these are (for now) harmless
  36. warnings regarding scripts from other m4 installed packages.
  37. 2.2 FROM A RELEASED TARBALL
  38. ---------------------------
  39. First extract the archive (e.g. tar xvfz <filename.tar.gz>) and enter
  40. the created directory (ode-x.y).
  41. Run the configure script to autodetect your build environment:
  42. $ ./configure
  43. By default this will build ODE as a static library with single-precision
  44. math, trimesh support with OPCODE, and debug symbols enabled. You can
  45. modify these defaults by passing additional parameters to
  46. configure. For a full list of available options, type:
  47. $ ./configure --help
  48. Some of the more popular options are
  49. --enable-double-precision enable double-precision math
  50. --with-trimesh=none disables the trimesh support
  51. --with-trimesh=opcode use OPCODE for trimesh code
  52. --with-trimesh=gimpact use GIMPACT for trimesh code
  53. --enabled-shared builds a shared library
  54. To pass specific flags for an optimized build, you must do so
  55. in the CFLAGS and CXXFLAGS enviroment variables, or as arguments
  56. to ./configure. For example if you are building for an athlon xp processor
  57. and you want the compiler to use SSE instructions you can run configure as
  58. follows:
  59. $ ./configure CFLAGS="-msse -march=atlon-xp" CXXFLAGS="-msse -march=atlon-xp"
  60. Note that you must set both CFLAGS and CXXFLAGS as ODE contains a mixture of
  61. C and C++ files.
  62. Once configure has run successfully, build and install ODE:
  63. $ make
  64. $ make install
  65. The latter command will also create a pkg-config script that provides
  66. compilation and linking flags for programs. The old stand-alone
  67. "ode-config" script is also installed for compatibility.
  68. 3. BUILDING WITH Code::Blocks
  69. =============================
  70. Because Code::Blocks supports so many different platforms, we do not
  71. provide workspaces. Instead, use Premake to create a workspace tailored
  72. for your platform and project. Like so:
  73. $ cd build
  74. $ premake4 --with-tests --with-demos codeblocks
  75. To see a complete list of options:
  76. $ cd build
  77. $ premake4 --help
  78. Using CMake is another option for generating project files for Code::Blocks.
  79. See section 5 below for more details on this.
  80. 4. BUILDING WITH SOMETHING ELSE
  81. ===============================
  82. ODE uses the Premake tool to provide support for several different toolsets.
  83. Premake adds support for new toolsets on a regular basis, so yours might be
  84. supported. Check the Premake website at http://premake.sourceforge.net/,
  85. and then follow the directions for Code::Blocks above, substituting your
  86. toolset target in place of `codeblocks`.
  87. Using CMake is another option for generating project files for other
  88. toolsets. See section 5 below for more details on this.
  89. 5. BUILDING WITH CMAKE
  90. ======================
  91. ODE includes support for CMake to generate project files for various platforms
  92. and IDEs including Unix Makefiles, Ninja, Code::Blocks, Visual Studio. A full
  93. overview of all supported generators can be found at the latest version of the
  94. manual at https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html
  95. CMake supports and encourages out-of-source builds. In order to generate build
  96. files for your platform, create a build directory at your preferred location
  97. and then call CMake with the path to ODE's source directory as argument, e.g.,
  98. one level above the source directory:
  99. $ mkdir ../ode-build
  100. $ cd ../ode-build
  101. $ cmake ../ode-src
  102. The existing build directory in the source directory can also be used as a
  103. location for the project files. A different generator than the default one
  104. for the system can be specified as well:
  105. $ cd build
  106. $ cmake -G"Visual Studio 15 2017 Win64" ..
  107. QtCreator, CLion, and Visual Studio 2017 also offer the option to open the
  108. source directory with the CMakeLists.txt file directly in the IDE.