bullet-native-build.txt 6.2 KB

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