bullet-native-build.txt 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 bullet-jme is a native java library and bullet gets included statically,
  7. building requires you to download and build the bullet source first.
  8. ***********************************
  9. * Building bullet *
  10. ***********************************
  11. -----------------------------------
  12. General info
  13. -----------------------------------
  14. Note that the compilation of bullet should not produce dll / so / dylib files
  15. but static *.a libraries which can later be compiled into the binary of bullet-jme.
  16. -----------------------------------
  17. Downloading and extracting bullet
  18. -----------------------------------
  19. Requirements:
  20. - Bullet source: http://bullet.googlecode.com/
  21. Extract bullet source and build bullet (see below)
  22. -----------------------------------
  23. Building on Mac OSX
  24. -----------------------------------
  25. Requirements:
  26. - Apple Developer tools: http://developer.apple.com/
  27. - CMake: http://www.cmake.org/ (or via http://www.macports.org)
  28. Commands:
  29. > cd bullet-trunk
  30. > cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON \
  31. -DCMAKE_OSX_ARCHITECTURES='ppc;i386;x86_64' \
  32. -DBUILD_EXTRAS=off -DBUILD_DEMOS=off -DCMAKE_BUILD_TYPE=Release
  33. > make
  34. -----------------------------------
  35. Building on WINDOWS (MinGW/GCC, Recommended)
  36. -----------------------------------
  37. Requirements:
  38. - GNU C++ Compiler: http://www.mingw.org/
  39. http://mingw-w64.sourceforge.net/
  40. - CMake: http://www.cmake.org/
  41. Commands:
  42. > cd bullet-trunk
  43. > cmake . -DBUILD_SHARED_LIBS=OFF -DBUILD_DEMOS:BOOL=OFF -DBUILD_EXTRAS:BOOL=OFF -DCMAKE_BUILD_TYPE=Release . -G "MinGW Makefiles"
  44. > mingw32-make
  45. -----------------------------------
  46. Building on WINDOWS (VisualStudio, untested)
  47. -----------------------------------
  48. Requirements:
  49. - Microsoft Visual Studio http://msdn.microsoft.com/
  50. Bullet comes with autogenerated Project Files for Microsoft Visual Studio 6, 7, 7.1 and 8.
  51. The main Workspace/Solution is located in Bullet/msvc/8/wksbullet.sln (replace 8 with your version).
  52. Build the project to create static libraries.
  53. -----------------------------------
  54. Building bullet on LINUX
  55. -----------------------------------
  56. Requirements:
  57. - Gnu C++ Compiler: http://gcc.gnu.org/
  58. - CMake: http://www.cmake.org/ (or via your package manager of choice)
  59. Commands:
  60. > cd bullet-trunk
  61. > cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC"\
  62. -DBUILD_EXTRAS=off -DBUILD_DEMOS=off -DCMAKE_BUILD_TYPE=Release
  63. > make
  64. -----------------------------------
  65. More info on building bullet
  66. -----------------------------------
  67. http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Installation
  68. ***********************************
  69. * Building bulletjme *
  70. ***********************************
  71. -----------------------------------
  72. Requirements
  73. -----------------------------------
  74. - Java SDK 1.5+: http://java.sun.com
  75. - Apache ANT: http://ant.apache.org
  76. - C++ Compiler: (see below)
  77. - jme3 Source: http://jmonkeyengine.googlecode.com/
  78. - Statically compiled bullet source (see above)
  79. -----------------------------------
  80. Preparation
  81. -----------------------------------
  82. - copy/link bullet-trunk folder into the same folder where the bullet-jme folder is:
  83. disk
  84. |
  85. +-root folder
  86. |
  87. +-engine
  88. |
  89. +-sdk
  90. |
  91. +-bullet-trunk
  92. - You can alter options in the "src/bullet/native/bullet.properties" file, such as the used bullet
  93. version, native compilation options etc. (see below)
  94. -----------------------------------
  95. Building bulletjme native
  96. -----------------------------------
  97. Commands:
  98. > cd engine
  99. > ant jar
  100. > ant build-bullet-natives
  101. Thats all. ANT takes care building native binaries and copies them to th elib directory.
  102. If you get compilation errors, try setting "native.java.include" in the build.properties file to your
  103. JDK include directory, e.g. /opt/java/include or "c:\Program Files\Java\jdk1.6.0_20\include".
  104. -----------------------------------
  105. Altering the native build process
  106. -----------------------------------
  107. bullet-jme uses cpptasks to compile native code.
  108. To change the used compiler, edit the "native.platform.compiler" entry in the
  109. "build.properties" file. The following c++ compilers work with cpptasks:
  110. gcc GCC C++ compiler
  111. g++ GCC C++ compiler
  112. c++ GCC C++ compiler
  113. msvc Microsoft Visual C++
  114. bcc Borland C++ Compiler
  115. icl Intel C++ compiler for Windows (IA-32)
  116. ecl Intel C++ compiler for Windows (IA-64)
  117. icc Intel C++ compiler for Linux (IA-32)
  118. ecc Intel C++ compiler for Linux (IA-64)
  119. CC Sun ONE C++ compiler
  120. aCC HP aC++ C++ Compiler
  121. wcl OpenWatcom C/C++ compiler
  122. In the "nbproject" folder you can find "build-native-platform.xml" files containing the commands
  123. to compile bullet-jme on different platforms. If you want to alter the process,
  124. you can copy and modify one of the files and import it in the "build.xml" file instead
  125. of the old one.
  126. -----------------------------------
  127. Netbeans Project
  128. -----------------------------------
  129. The project also includes a Netbeans project to edit and build
  130. the source in the Netbeans IDE in the /src/bullet/ subfolder.
  131. To have correct syntax highlighting in .cpp/.h files:
  132. - in Netbeans Settings -> C/C++ -> Code Assistance -> C++
  133. - add bullet-2.77/src as include directories for c++
  134. - add JAVA_HOME/include as include directories for c++