Forráskód Böngészése

Update README.md (#831)

Co-authored-by: Jorrit Rouwe <[email protected]>
ccn 1 éve
szülő
commit
5e7915d716
1 módosított fájl, 39 hozzáadás és 19 törlés
  1. 39 19
      Build/README.md

+ 39 - 19
Build/README.md

@@ -19,24 +19,34 @@ You can use Jolt/Jolt.h in your precompiled header to speed up compilation.
 ## Defines
 
 There are a number of user configurable defines that turn on/off certain features:
+<details>
+	<summary>General Options (click to see more)</summary>
+	<ul>
+		<li>JPH_PROFILE_ENABLED - Turns on the internal profiler.</li>
+		<li>JPH_EXTERNAL_PROFILE - Turns on the internal profiler but forwards the information to a user defined external system (see Profiler.h).</li>
+		<li>JPH_DEBUG_RENDERER - Adds support to draw lines and triangles, used to be able to debug draw the state of the world.</li>
+		<li>JPH_DISABLE_TEMP_ALLOCATOR - Disables the temporary memory allocator, used mainly to allow ASAN to do its job.</li>
+		<li>JPH_DISABLE_CUSTOM_ALLOCATOR - Disables the ability to override the memory allocator.</li>
+		<li>JPH_FLOATING_POINT_EXCEPTIONS_ENABLED - Turns on division by zero and invalid floating point exception support in order to detect bugs (Windows only).</li>
+		<li>JPH_CROSS_PLATFORM_DETERMINISTIC - Turns on behavior to attempt cross platform determinism. If this is set, JPH_USE_FMADD is ignored.</li>
+		<li>JPH_DOUBLE_PRECISION - Compiles the library so that all positions are stored in doubles instead of floats. This makes larger worlds possible.</li>
+	</ul>
+</details>
 
-- JPH_PROFILE_ENABLED - Turns on the internal profiler.
-- JPH_EXTERNAL_PROFILE - Turns on the internal profiler but forwards the information to a user defined external system (see Profiler.h).
-- JPH_DEBUG_RENDERER - Adds support to draw lines and triangles, used to be able to debug draw the state of the world.
-- JPH_DISABLE_TEMP_ALLOCATOR - Disables the temporary memory allocator, used mainly to allow ASAN to do its job.
-- JPH_DISABLE_CUSTOM_ALLOCATOR - Disables the ability to override the memory allocator.
-- JPH_FLOATING_POINT_EXCEPTIONS_ENABLED - Turns on division by zero and invalid floating point exception support in order to detect bugs (Windows only).
-- JPH_CROSS_PLATFORM_DETERMINISTIC - Turns on behavior to attempt cross platform determinism. If this is set, JPH_USE_FMADD is ignored.
-- JPH_DOUBLE_PRECISION - Compiles the library so that all positions are stored in doubles instead of floats. This makes larger worlds possible.
-- JPH_USE_SSE4_1 - Enable SSE4.1 CPU instructions (x86/x64 only)
-- JPH_USE_SSE4_2 - Enable SSE4.2 CPU instructions (x86/x64 only)
-- JPH_USE_F16C - Enable half float CPU instructions (x86/x64 only)
-- JPH_USE_LZCNT - Enable the lzcnt CPU instruction (x86/x64 only)
-- JPH_USE_TZCNT - Enable the tzcnt CPU instruction (x86/x64 only)
-- JPH_USE_AVX - Enable AVX CPU instructions (x86/x64 only)
-- JPH_USE_AVX2 - Enable AVX2 CPU instructions (x86/x64 only)
-- JPH_USE_AVX512 - Enable AVX512F+AVX512VL CPU instructions (x86/x64 only)
-- JPH_USE_FMADD - Enable fused multiply add CPU instructions (x86/x64 only)
+<details>
+	<summary>CPU Instruction Sets (click to see more)</summary>
+	<ul>
+		<li>JPH_USE_SSE4_1 - Enable SSE4.1 CPU instructions (default: on, x86/x64 only)</li>
+		<li>JPH_USE_SSE4_2 - Enable SSE4.2 CPU instructions (default: on, x86/x64 only)</li>
+		<li>JPH_USE_F16C - Enable half float CPU instructions (default: on, x86/x64 only)</li>
+		<li>JPH_USE_LZCNT - Enable the lzcnt CPU instruction (default: on, x86/x64 only)</li>
+		<li>JPH_USE_TZCNT - Enable the tzcnt CPU instruction (default: on, x86/x64 only)</li>
+		<li>JPH_USE_AVX - Enable AVX CPU instructions (default: on, x86/x64 only)</li>
+		<li>JPH_USE_AVX2 - Enable AVX2 CPU instructions (default: on, x86/x64 only)</li>
+		<li>JPH_USE_AVX512 - Enable AVX512F+AVX512VL CPU instructions (default: off, x86/x64 only)</li>
+		<li>JPH_USE_FMADD - Enable fused multiply add CPU instructions (default: on, x86/x64 only)</li>
+	</ul>
+</details>
 
 ## Logging & Asserting
 
@@ -171,8 +181,6 @@ To implement your custom memory allocator override Allocate, Free, AlignedAlloca
 	</ul>
 </details>
 
-
-
 ## Other Build Tools
 
 * A vcpkg package is available [here](https://github.com/microsoft/vcpkg/tree/master/ports/joltphysics).
@@ -189,6 +197,18 @@ If you receive the following error when linking:
 
 Then you have not enabled interprocedural optimizations (link time optimizations) for your own application. See the INTERPROCEDURAL_OPTIMIZATION option in CMakeLists.txt.
 
+## Illegal Instruction Error
+
+If your CPU doesn't support all of the instructions you'll get an `Illegal instruction` exception.
+
+On Linux to see what instructions your CPU supports run `lscpu` and then look at the flags section, on Windows you can use a program like [`coreinfo`](https://learn.microsoft.com/en-us/sysinternals/downloads/coreinfo). Once you know what instructions your cpu supports you can configure the project through cmake and for example disable all special instructions:
+
+```
+./cmake_linux_clang_gcc.sh Release clang++ -DUSE_SSE4_1=OFF -DUSE_SSE4_2=OFF -DUSE_AVX=OFF -DUSE_AVX2=OFF -DUSE_AVX512=OFF -DUSE_LZCNT=OFF -DUSE_TZCNT=OFF -DUSE_F16C=OFF -DUSE_FMADD=OFF
+```
+
+Note that this example is for Linux but the cmake settings work on Windows too.
+
 ## Doxygen on Windows
 
 Documentation can be generated through doxygen: