Skip to content

Commit

Permalink
* updated README: clang/llvm/libc++ 6.0+ are officially required now…
Browse files Browse the repository at this point in the history
… (can't test older versions any more + preparing for a large toolchain upgrade that will allow for full c++17 support everywhere)

 * removed obsolete macOS/iOS/Xcode version handling
  • Loading branch information
a2flo committed Nov 4, 2018
1 parent 42191f0 commit 5eceff3
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 35 deletions.
17 changes: 9 additions & 8 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
*Requirements:*
* OS:
** Windows: NT 6.0+ (VS: x86/32-bit and x64/64-bit, MinGW/MSYS2: x64/64-bit only)
** OS X: 10.11+ (x64/64-bit only)
** macOS: 10.11+ (x64/64-bit only)
** iOS: 9.0+ (32-bit and 64-bit)
** Linux: any current x64 distribution
** FreeBSD: 10.0+ (x64/64-bit only)
** other Unix: if x64 and other requirements are met
* compiler/toolchain:
** Generic: "Clang":http://clang.llvm.org / "LLVM":http://llvm.org 4.0+ and "libc++":http://libcxx.llvm.org 4.0+
** OS X/iOS: "Xcode":https://developer.apple.com/xcode/downloads 10.0+
** Generic: "Clang":http://clang.llvm.org / "LLVM":http://llvm.org 6.0+ and "libc++":http://libcxx.llvm.org 6.0+
** macOS/iOS: "Xcode":https://developer.apple.com/xcode/downloads 10.0+
** Windows (VS): "VS2017":https://www.visualstudio.com with "Clang / LLVM for Windows":http://llvm.org/builds
** Windows (MinGW): "MSYS2":http://sourceforge.net/projects/msys2 with Clang/LLVM 4.0+ and libc++ 4.0+
** Windows (MinGW): "MSYS2":http://sourceforge.net/projects/msys2 with Clang/LLVM 6.0+ and libc++ 6.0+
* libraries and optional requirements:
** "SDL2":http://www.libsdl.org 2.0.4+
** "OpenGL 4.1+ Core headers":https://www.opengl.org/registry/#headers
** (opt) OpenCL: requires OpenCL 1.2+ SDK and CPU/GPU drivers ("Intel":https://software.intel.com/en-us/intel-opencl, "AMD":http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk)
** (opt) CUDA: requires sm_20+/Fermi+ GPU and CUDA 7.5+ drivers (CUDA SDK not required!)
** (opt) Metal: requires iOS 9.0+ and A7+ CPU/GPU, or OS X 10.11+ and appropriate GPU
** (opt) Metal: requires iOS 9.0+ and A7+ CPU/GPU, or macOS 10.11+ and appropriate GPU
** (opt) Host Compute: requires just the compiler/toolchain that is stated above
** (opt) Vulkan: requires 1.0.24+ "Vulkan headers":https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/tree/master/include/vulkan and "ICD loader / SDK":https://vulkan.lunarg.com
** (opt) networking: requires "asio":http://think-async.com/Asio headers and "OpenSSL":https://www.openssl.org 1.0.1+
Expand All @@ -32,7 +32,7 @@
define "FLOOR_NO_OPENCL" or "./build.sh no-opencl"
** to disable CUDA:
define "FLOOR_NO_CUDA" or "./build.sh no-cuda"
** to disable Metal (only affects iOS/OS X builds):
** to disable Metal (only affects macOS/iOS builds):
define "FLOOR_NO_METAL" or "./build.sh no-metal"
** to disable Host Compute:
define "FLOOR_NO_HOST_COMPUTE" or "./build.sh no-host-compute"
Expand All @@ -47,7 +47,7 @@
** to build with libstdc++ instead of libc++:
"./build.sh libstdc++"

*Build Instructions (Xcode / OS X / iOS):*
*Build Instructions (Xcode / macOS / iOS):*
* open floor.xcodeproj and build
* some notes:
** all optional parts of floor are enabled here and you'll have to install all dependencies or disable them manually
Expand Down Expand Up @@ -86,12 +86,13 @@
* depending on how your Linux distribution handles OpenCL headers and library, you might need to manually install OpenCL 1.2+ compatible ones

*Compute/Graphics Toolchain:*
* automated builds for Linux, OS X and Windows can be found at: https://libfloor.org/builds/toolchain
* automated builds for Linux, macOS and Windows can be found at: https://libfloor.org/builds/toolchain
* NOTE: this requires a Unix environment with all LLVM build dependencies installed - use MSYS2 on Windows
* NOTE: the absolute build path must not contain spaces
* NOTE: when building with GNU Make 4.2, use -j1 (jobserver changes in 4.2 broke *something*)
* compile the toolchain:
** 4.0.0 toolchain: cd floor/etc/llvm40/ && ./build.sh
** 8.0 toolchain: cd floor/etc/llvm80/ && ./build.sh
** if successful, package it (in addition to a .zip file, this also creates a folder with all necessary binaries and include files): ./pkg.sh
* install the toolchain:
** Unix:
Expand Down
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ if expr "${CXX_VERSION}" : ".*clang" >/dev/null; then
eval $(${CXX} -E -dM - < /dev/null 2>&1 | grep -E "clang_major|clang_minor" | tr [:lower:] [:upper:] | sed -E "s/.*DEFINE __(.*)__ [\"]*([^ \"]*)[\"]*/export \1=\2/g")
if expr "${CXX_VERSION}" : "Apple.*" >/dev/null; then
# apple xcode/llvm/clang versioning scheme -> at least 8.1.0 is required (ships with Xcode 8.3)
if [ $CLANG_MAJOR -lt 8 ] || [ $CLANG_MAJOR -eq 8 -a $CLANG_MINOR -lt 1 ]; then
error "at least Xcode 8.3 / clang/LLVM 8.1.0 is required to compile this project!"
if [ $CLANG_MAJOR -lt 10 ] || [ $CLANG_MAJOR -eq 10 -a $CLANG_MINOR -lt 0 ]; then
error "at least Xcode 10.0 / clang/LLVM 10.0.0 is required to compile this project!"
fi
else
# standard clang versioning scheme -> at least 4.0 is required
if [ $CLANG_MAJOR -lt 4 ] || [ $CLANG_MAJOR -eq 4 -a $CLANG_MINOR -lt 0 ]; then
error "at least clang 4.0 is required to compile this project!"
# standard clang versioning scheme -> at least 6.0 is required
if [ $CLANG_MAJOR -lt 6 ] || [ $CLANG_MAJOR -eq 6 -a $CLANG_MINOR -lt 0 ]; then
error "at least clang 6.0 is required to compile this project!"
fi
fi
else
Expand Down
24 changes: 6 additions & 18 deletions compute/device/host_pre.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,13 @@ floor_inline_always static std::locale locale_global(const std::locale& loc) {
#if !defined(__apple_build_version__)
#define FLOOR_TOOLCHAIN_VERSION (__clang_major__ * 10000u + __clang_minor__ * 100u + __clang_patchlevel__)
#else // map apple version scheme ... (*sigh*)
#if (__clang_major__ < 8) || (__clang_major__ == 8 && __clang_minor__ < 1) // Xcode 8.3 with clang 3.9.0/4.0.0-ish is the min req.
#if (__clang_major__ < 10) // Xcode 10.0 with clang 6.0 is the min req.
#error "unsupported toolchain"
#endif

#if (__clang_major__ == 8 && __clang_minor__ >= 1)
#define FLOOR_TOOLCHAIN_VERSION 30900u
#elif (__clang_major__ == 9 && __clang_minor__ == 0) // Xcode 9.0 - 9.2
#define FLOOR_TOOLCHAIN_VERSION 40000u
#elif (__clang_major__ == 9 && __clang_minor__ >= 1) // Xcode 9.3.0+
#define FLOOR_TOOLCHAIN_VERSION 50000u
#else // Xcode 10.0+
#if (__clang_major__ == 10 && __clang_minor__ == 0) // Xcode 10.0 - 10.1
#define FLOOR_TOOLCHAIN_VERSION 60000u
#else // newer/unreleased Xcode, default to 6.0 for now
#define FLOOR_TOOLCHAIN_VERSION 60000u
#endif

Expand Down Expand Up @@ -118,12 +114,8 @@ floor_inline_always static std::locale locale_global(const std::locale& loc) {

#if defined(__APPLE__) && !defined(FLOOR_IOS) // osx
#define FLOOR_COMPUTE_INFO_OS_VERSION MAC_OS_X_VERSION_MAX_ALLOWED
#if FLOOR_COMPUTE_INFO_OS_VERSION < 1090
#if FLOOR_COMPUTE_INFO_OS_VERSION < 101100
#error "invalid os version"
#elif FLOOR_COMPUTE_INFO_OS_VERSION >= 1090 && FLOOR_COMPUTE_INFO_OS_VERSION < 101000
#define FLOOR_COMPUTE_INFO_OS_VERSION_1090
#elif FLOOR_COMPUTE_INFO_OS_VERSION >= 101000 && FLOOR_COMPUTE_INFO_OS_VERSION < 101100
#define FLOOR_COMPUTE_INFO_OS_VERSION_101000
#elif FLOOR_COMPUTE_INFO_OS_VERSION >= 101100 && FLOOR_COMPUTE_INFO_OS_VERSION < 101200
#define FLOOR_COMPUTE_INFO_OS_VERSION_101100
#elif FLOOR_COMPUTE_INFO_OS_VERSION >= 101200 && FLOOR_COMPUTE_INFO_OS_VERSION < 101300
Expand All @@ -136,12 +128,8 @@ floor_inline_always static std::locale locale_global(const std::locale& loc) {

#elif defined(__APPLE__) && defined(FLOOR_IOS) // ios
#define FLOOR_COMPUTE_INFO_OS_VERSION __IPHONE_OS_VERSION_MAX_ALLOWED
#if FLOOR_COMPUTE_INFO_OS_VERSION < 70000
#if FLOOR_COMPUTE_INFO_OS_VERSION < 90000
#error "invalid os version"
#elif FLOOR_COMPUTE_INFO_OS_VERSION >= 70000 && FLOOR_COMPUTE_INFO_OS_VERSION < 80000
#define FLOOR_COMPUTE_INFO_OS_VERSION_70000
#elif FLOOR_COMPUTE_INFO_OS_VERSION >= 80000 && FLOOR_COMPUTE_INFO_OS_VERSION < 90000
#define FLOOR_COMPUTE_INFO_OS_VERSION_80000
#elif FLOOR_COMPUTE_INFO_OS_VERSION >= 90000 && FLOOR_COMPUTE_INFO_OS_VERSION < 100000
#define FLOOR_COMPUTE_INFO_OS_VERSION_90000
#elif FLOOR_COMPUTE_INFO_OS_VERSION >= 100000 && FLOOR_COMPUTE_INFO_OS_VERSION < 110000
Expand Down
2 changes: 1 addition & 1 deletion floor/build_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8450
8452
2 changes: 1 addition & 1 deletion floor/build_version.hpp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define FLOOR_BUILD_VERSION 8450
#define FLOOR_BUILD_VERSION 8452
4 changes: 2 additions & 2 deletions floor/floor_version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
// library checks:
#include <floor/core/platform.hpp>

#if (defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 4000)
#error "You need to install libc++ 4.0+ to compile floor"
#if (defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 6000)
#error "You need to install libc++ 6.0+ to compile floor"
#endif

#if !SDL_VERSION_ATLEAST(2, 0, 2)
Expand Down

0 comments on commit 5eceff3

Please sign in to comment.