bullet-native-build.txt 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. ***********************************
  2. * Build info for bulletjme *
  3. * (c) 2011 Normen Hansen *
  4. ***********************************
  5. This document outlines the process of building bullet-jme on different platforms.
  6. Since bulletjme is a native java library and bullet gets included statically,
  7. building requires downloading and building the bullet sources.
  8. Note that you do need to have CMake and a GCC compiler installed as well as
  9. the Android NDK in case you want to build for android too.
  10. -----------------------------------
  11. Requirements
  12. -----------------------------------
  13. ALL PLATFORMS
  14. - Java SDK 1.5+: http://java.sun.com
  15. - Apache ANT: http://ant.apache.org (included in most Java IDEs)
  16. - Android NDK (optional): http://developer.android.com/sdk/ndk/index.html
  17. WINDOWS
  18. - Install mingw GNU C++ Compiler: http://www.mingw.org/
  19. - Install CMake: http://www.cmake.org/
  20. Mac OSX
  21. - Install XCode: http://developer.apple.com/ (or via the App Store)
  22. - Install the "Command Line Tools" from inside XCode
  23. - Install http://www.macports.org
  24. - Install cmake via macports, in the Terminal type:
  25. > sudo port install cmake
  26. LINUX
  27. - Install cmake (and gcc if not available) via your package manager of choice, e.g.
  28. > sudo apt-get install cmake
  29. -----------------------------------
  30. Building
  31. -----------------------------------
  32. The build script in this directory does everything needed to download and compile
  33. bullet and the jme-bullet library, you only need to call the appropriate ant target,
  34. via your IDE or command line:
  35. > ant build-bullet-natives
  36. ..and all of the steps below are executed automatically, including the download.
  37. You can alter options in the "nbproject/bullet.properties" file, such as the used
  38. bullet version, native compilation options (see below), path to Android NDK etc.
  39. -----------------------------------
  40. Running
  41. -----------------------------------
  42. The resulting jMonkeyEngine3.jar containing the tests will automatically use the
  43. jME3-jbullet.jar or jME3-bullet.jar, depending on which is available in the libs directory.
  44. A convenience target exists to run the engine tests using the native bullet library:
  45. > ant run-bullet-native
  46. -----------------------------------
  47. Altering the native build process
  48. -----------------------------------
  49. bullet-jme uses cpptasks to compile native code as well as the Android NDK.
  50. If you get compilation errors, try setting "native.java.include" in the build.properties file to your
  51. JDK include directory, e.g. /opt/java/include or "c:\Program Files\Java\jdk1.6.0_20\include".
  52. To change the used compiler, edit the "native.platform.compiler" entry in the
  53. "build.properties" file. The following c++ compilers work with cpptasks:
  54. gcc GCC C++ compiler
  55. g++ GCC C++ compiler
  56. c++ GCC C++ compiler
  57. msvc Microsoft Visual C++
  58. bcc Borland C++ Compiler
  59. icl Intel C++ compiler for Windows (IA-32)
  60. ecl Intel C++ compiler for Windows (IA-64)
  61. icc Intel C++ compiler for Linux (IA-32)
  62. ecc Intel C++ compiler for Linux (IA-64)
  63. CC Sun ONE C++ compiler
  64. aCC HP aC++ C++ Compiler
  65. wcl OpenWatcom C/C++ compiler
  66. In the "nbproject" folder you can find "build-native-platform.xml" files containing the commands
  67. to compile bullet-jme on different platforms. If you want to alter the process,
  68. you can copy and modify one of the files and import it in the "build.xml" file instead
  69. of the old one.
  70. -----------------------------------
  71. Netbeans Project
  72. -----------------------------------
  73. The engine NetBeans project also includes the native sources and a build configuration
  74. entry to build the binary and run the tests with it.
  75. To have correct syntax highlighting in .cpp/.h files:
  76. - in Netbeans Settings -> C/C++ -> Code Assistance -> C++
  77. - add bullet-2.79/src as include directories for C++
  78. - add JAVA_HOME/include as include directories for C
  79. ***********************************
  80. * Building bullet (optional) *
  81. ***********************************
  82. -----------------------------------
  83. General info
  84. -----------------------------------
  85. Note that the compilation of bullet should not produce dll / so / dylib files
  86. but static *.a libraries which can later be compiled into the binary of bullet-jme.
  87. -----------------------------------
  88. Downloading and extracting bullet
  89. -----------------------------------
  90. Requirements:
  91. - Bullet source: http://bullet.googlecode.com/
  92. Extract bullet source and build bullet (see below)
  93. -----------------------------------
  94. Building on Mac OSX
  95. -----------------------------------
  96. Requirements:
  97. - Apple Developer tools: http://developer.apple.com/
  98. - CMake: http://www.cmake.org/ (or via http://www.macports.org)
  99. Commands:
  100. > cd bullet-trunk
  101. > cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON \
  102. -DCMAKE_OSX_ARCHITECTURES='ppc;i386;x86_64' \
  103. -DBUILD_EXTRAS=off -DBUILD_DEMOS=off -DCMAKE_BUILD_TYPE=Release
  104. > make
  105. -----------------------------------
  106. Building on WINDOWS (MinGW/GCC, Recommended)
  107. -----------------------------------
  108. Requirements:
  109. - GNU C++ Compiler: http://www.mingw.org/
  110. http://mingw-w64.sourceforge.net/
  111. - CMake: http://www.cmake.org/
  112. Commands:
  113. > cd bullet-trunk
  114. > cmake . -DBUILD_SHARED_LIBS=OFF -DBUILD_DEMOS:BOOL=OFF -DBUILD_EXTRAS:BOOL=OFF -DCMAKE_BUILD_TYPE=Release . -G "MinGW Makefiles"
  115. > mingw32-make
  116. -----------------------------------
  117. Building on WINDOWS (VisualStudio, untested)
  118. -----------------------------------
  119. Requirements:
  120. - Microsoft Visual Studio http://msdn.microsoft.com/
  121. Bullet comes with autogenerated Project Files for Microsoft Visual Studio 6, 7, 7.1 and 8.
  122. The main Workspace/Solution is located in Bullet/msvc/8/wksbullet.sln (replace 8 with your version).
  123. Build the project to create static libraries.
  124. -----------------------------------
  125. Building bullet on LINUX
  126. -----------------------------------
  127. Requirements:
  128. - Gnu C++ Compiler: http://gcc.gnu.org/
  129. - CMake: http://www.cmake.org/ (or via your package manager of choice)
  130. Commands:
  131. > cd bullet-trunk
  132. > cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC"\
  133. -DBUILD_EXTRAS=off -DBUILD_DEMOS=off -DCMAKE_BUILD_TYPE=Release
  134. > make
  135. -----------------------------------
  136. More info on building bullet
  137. -----------------------------------
  138. http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Installation