From 74dec0508ea49a9a7c52531247ef73561854cbe8 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 1 Sep 2021 16:45:16 -0700 Subject: [PATCH 01/53] OpenVDB: Latest CMake has different find_python semantics. --- OpenVDB/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenVDB/config.py b/OpenVDB/config.py index 057023ed58..f6e1f2f711 100644 --- a/OpenVDB/config.py +++ b/OpenVDB/config.py @@ -31,6 +31,8 @@ " -D OPENVDB_ENABLE_RPATH=OFF" " -D CONCURRENT_MALLOC=None" " -D PYOPENVDB_INSTALL_DIRECTORY={buildDir}/python" + " -D Python_ROOT_DIR={buildDir}" + " -D Python_FIND_STRATEGY=LOCATION" " .." , From 6cdb0fc14b3f3eb2c9005cacd466543aafb92c1e Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 3 Sep 2021 00:48:56 -0700 Subject: [PATCH 02/53] Appleseed: Prevent using the system boost --- Appleseed/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Appleseed/config.py b/Appleseed/config.py index 7c97966f06..0bb4370408 100644 --- a/Appleseed/config.py +++ b/Appleseed/config.py @@ -54,6 +54,8 @@ " -D CMAKE_PREFIX_PATH={buildDir}" " -D CMAKE_INSTALL_PREFIX={buildDir}/appleseed" " -D CMAKE_LIBRARY_PATH={pythonLibDir}" + " -D BOOST_ROOT={buildDir}" + " -D Boost_NO_SYSTEM_PATHS=ON" " ..", "cd build && make install -j {jobs} VERBOSE=1" From b82f391a435cf9a06596e506df44eb053f85a05f Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 2 Sep 2021 18:05:20 -0700 Subject: [PATCH 03/53] Build: Latest CMake find_python has different semantics. --- OpenImageIO/config.py | 2 ++ OpenShadingLanguage/config.py | 2 ++ PyBind11/config.py | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenImageIO/config.py b/OpenImageIO/config.py index 8ac1c2c6d3..311b363ae0 100644 --- a/OpenImageIO/config.py +++ b/OpenImageIO/config.py @@ -33,6 +33,8 @@ " -D USE_EXTERNAL_PUGIXML=YES" " -D OIIO_BUILD_TESTS=NO" " {pythonArguments}" + " -D Python_ROOT_DIR={buildDir}" + " -D Python_FIND_STRATEGY=LOCATION" # These next two disable `iv`. This fails to # build on Mac due to OpenGL deprecations, and # we've never packaged it anyway. diff --git a/OpenShadingLanguage/config.py b/OpenShadingLanguage/config.py index f133f5c60c..83ea18e845 100644 --- a/OpenShadingLanguage/config.py +++ b/OpenShadingLanguage/config.py @@ -35,6 +35,8 @@ " -D LLVM_STATIC=1" " -D OSL_BUILD_MATERIALX=1" " -D OSL_SHADER_INSTALL_DIR={buildDir}/shaders" + " -D Python_ROOT_DIR={buildDir}" + " -D Python_FIND_STRATEGY=LOCATION" " ..", "cd gafferBuild && make install -j {jobs} VERBOSE=1", "cp {buildDir}/share/doc/OSL/osl-languagespec.pdf {buildDir}/doc", diff --git a/PyBind11/config.py b/PyBind11/config.py index a61a9b2d3e..de0ba82da8 100644 --- a/PyBind11/config.py +++ b/PyBind11/config.py @@ -23,7 +23,10 @@ "cmake" " -D CMAKE_INSTALL_PREFIX={buildDir} ." - " -D PYBIND11_TEST=0", + " -D PYBIND11_TEST=0" + " -D PYBIND11_FINDPYTHON=1" + " -D Python_ROOT_DIR={buildDir}" + " -D Python_FIND_STRATEGY=LOCATION", "make install", ], From 534ddc995ea0a0d17de9a4c82e530277dd1eab2a Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 3 Sep 2021 15:18:32 -0700 Subject: [PATCH 04/53] Boost: Specify cxxstd version, on gcc 6.3.1 it probably defaulted to 14, this is more explicit. --- Boost/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Boost/config.py b/Boost/config.py index a8ff743098..0068779611 100644 --- a/Boost/config.py +++ b/Boost/config.py @@ -28,7 +28,7 @@ "commands" : [ "./bootstrap.sh --prefix={buildDir} --with-python={buildDir}/bin/python --with-python-root={buildDir} --without-libraries=log --without-icu", - "./bjam -d+2 -j {jobs} --disable-icu cxxflags='-std=c++{c++Standard}' variant=release link=shared threading=multi install", + "./bjam -d+2 -j {jobs} --disable-icu cxxflags='-std=c++{c++Standard}' cxxstd={c++Standard} variant=release link=shared threading=multi install", ], From 43d470c631275496546202b077ca499d0e2e3f68 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 3 Sep 2021 15:21:43 -0700 Subject: [PATCH 05/53] OpenVDB: Prevent using the system boost --- OpenVDB/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenVDB/config.py b/OpenVDB/config.py index f6e1f2f711..faa37a1e8d 100644 --- a/OpenVDB/config.py +++ b/OpenVDB/config.py @@ -33,6 +33,8 @@ " -D PYOPENVDB_INSTALL_DIRECTORY={buildDir}/python" " -D Python_ROOT_DIR={buildDir}" " -D Python_FIND_STRATEGY=LOCATION" + " -D BOOST_ROOT={buildDir}" + " -D Boost_NO_SYSTEM_PATHS=ON" " .." , From 9222830a483e310870e9604e5de2357b121e8ae5 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 3 Sep 2021 17:37:43 -0700 Subject: [PATCH 06/53] OpenImageIO: Suppress GIF and WEBP so it doesn't pick it from the host machine. --- OpenImageIO/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenImageIO/config.py b/OpenImageIO/config.py index 311b363ae0..e85a8e28c5 100644 --- a/OpenImageIO/config.py +++ b/OpenImageIO/config.py @@ -29,6 +29,8 @@ " -D CMAKE_INSTALL_LIBDIR={buildDir}/lib" " -D CMAKE_PREFIX_PATH={buildDir}" " -D USE_FFMPEG=NO" + " -D USE_GIF=0" + " -D USE_WEBP=0" " -D USE_PYTHON=YES" " -D USE_EXTERNAL_PUGIXML=YES" " -D OIIO_BUILD_TESTS=NO" From befd9488dcc66e87af35581ab885025fca8025ac Mon Sep 17 00:00:00 2001 From: John Haddon Date: Wed, 13 Oct 2021 10:11:01 +0100 Subject: [PATCH 07/53] Bump version to 4.0.0 --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index dcf52018e9..6b751180c3 100755 --- a/build.py +++ b/build.py @@ -14,7 +14,7 @@ import tarfile import zipfile -__version = "3.1.0" +__version = "4.0.0" """ Config file format From 95e9333a7fd1bd3f87845fbd9f82ee0f18be457e Mon Sep 17 00:00:00 2001 From: John Haddon Date: Wed, 13 Oct 2021 10:09:31 +0100 Subject: [PATCH 08/53] OpenVDB : Update to version 8.1.0 --- Changes.md | 5 +++++ OpenVDB/config.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index 9a7af60b15..5a313b9a8b 100644 --- a/Changes.md +++ b/Changes.md @@ -1,3 +1,8 @@ +4.x.x +----- + +- OpenVDB : Updated to version 8.1.0. + 3.1.0 ----- diff --git a/OpenVDB/config.py b/OpenVDB/config.py index faa37a1e8d..ac04190045 100644 --- a/OpenVDB/config.py +++ b/OpenVDB/config.py @@ -2,7 +2,7 @@ "downloads" : [ - "https://github.com/AcademySoftwareFoundation/openvdb/archive/v7.2.2.tar.gz" + "https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v8.1.0.tar.gz" ], From b98e12cac3f08a11d19dee5aaf7782b829d519eb Mon Sep 17 00:00:00 2001 From: John Haddon Date: Wed, 13 Oct 2021 10:10:39 +0100 Subject: [PATCH 09/53] TBB : Update to version 2020.2. --- Changes.md | 1 + TBB/config.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index 5a313b9a8b..67ca4930f4 100644 --- a/Changes.md +++ b/Changes.md @@ -2,6 +2,7 @@ ----- - OpenVDB : Updated to version 8.1.0. +- TBB : Updated to version 2020.2. 3.1.0 ----- diff --git a/TBB/config.py b/TBB/config.py index df3e6eb138..3f3a3ed0cb 100644 --- a/TBB/config.py +++ b/TBB/config.py @@ -2,7 +2,7 @@ "downloads" : [ - "https://github.com/01org/tbb/archive/2018_U5.tar.gz" + "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2020.2.tar.gz" ], From b83829acdcdfee1b487a06f2021ccb18c9944a28 Mon Sep 17 00:00:00 2001 From: John Haddon Date: Wed, 13 Oct 2021 10:12:00 +0100 Subject: [PATCH 10/53] Qt/PySide : Update to version 5.15.2 Building this required the addition of a few additional system packages on my local machine - these might also be required in the Docker container managed by GafferHQ/build : - xcb-util-renderutil-devel - xcb-util-wm-devel - xcb-util-devel - xcb-util-image-devel - xcb-util-keysyms-devel --- Changes.md | 2 ++ PySide/config.py | 4 ++-- PySide/patches/clang10Compatibility.patch | 11 ----------- Qt/config.py | 6 +++--- 4 files changed, 7 insertions(+), 16 deletions(-) delete mode 100644 PySide/patches/clang10Compatibility.patch diff --git a/Changes.md b/Changes.md index 67ca4930f4..980d047746 100644 --- a/Changes.md +++ b/Changes.md @@ -3,6 +3,8 @@ - OpenVDB : Updated to version 8.1.0. - TBB : Updated to version 2020.2. +- Qt : Updated to version 5.15.2. +- PySide : Updated to version 5.15.2. 3.1.0 ----- diff --git a/PySide/config.py b/PySide/config.py index 739949139e..9b0134f8b4 100644 --- a/PySide/config.py +++ b/PySide/config.py @@ -2,7 +2,7 @@ "downloads" : [ - "https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.12.6-src/pyside-setup-everywhere-src-5.12.6.tar.xz" + "https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.2-src/pyside-setup-opensource-src-5.15.2.tar.xz" ], @@ -21,7 +21,7 @@ "commands" : [ - "python setup.py --verbose-build --ignore-git --no-examples --parallel {jobs} install", + "python setup.py --parallel {jobs} install", ], diff --git a/PySide/patches/clang10Compatibility.patch b/PySide/patches/clang10Compatibility.patch deleted file mode 100644 index 25b6a11299..0000000000 --- a/PySide/patches/clang10Compatibility.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp -+++ b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp -@@ -274,7 +274,7 @@ static QString findClangBuiltInIncludesDir() - for (const QFileInfo &fi : versionDirs) { - const QString fileName = fi.fileName(); - if (fileName.at(0).isDigit()) { -- const QVersionNumber versionNumber = QVersionNumber::fromString(fileName.at(0)); -+ const QVersionNumber versionNumber = QVersionNumber::fromString(fileName); - if (!versionNumber.isNull() && versionNumber > lastVersionNumber) { - candidate = fi.absoluteFilePath(); - lastVersionNumber = versionNumber; diff --git a/Qt/config.py b/Qt/config.py index 33089cde99..ba7ecc251e 100644 --- a/Qt/config.py +++ b/Qt/config.py @@ -2,7 +2,7 @@ "downloads" : [ - "http://download.qt.io/official_releases/qt/5.12/5.12.10/single/qt-everywhere-src-5.12.10.tar.xz" + "http://download.qt.io/official_releases/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz" ], @@ -21,7 +21,7 @@ "commands" : [ "./configure" - " -prefix {buildDir}" + " -prefix {buildDir} " " -plugindir {buildDir}/qt/plugins" " -release" " -opensource -confirm-license" @@ -74,7 +74,7 @@ "variables" : { - "extraArgs" : "-qt-xcb", + "extraArgs" : "-xcb -bundled-xcb-xinput", }, From 767de94d715464f674a734b6d55d1c31779ebefc Mon Sep 17 00:00:00 2001 From: John Haddon Date: Wed, 17 Nov 2021 18:00:47 +0000 Subject: [PATCH 11/53] Cortex : Update to version 10.3.0.0 --- Changes.md | 1 + Cortex/config.py | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Changes.md b/Changes.md index 980d047746..bab5dabe79 100644 --- a/Changes.md +++ b/Changes.md @@ -5,6 +5,7 @@ - TBB : Updated to version 2020.2. - Qt : Updated to version 5.15.2. - PySide : Updated to version 5.15.2. +- Cortex : Updated to version 10.3.0.0. 3.1.0 ----- diff --git a/Cortex/config.py b/Cortex/config.py index fd69aaa6a0..dc2cb00249 100644 --- a/Cortex/config.py +++ b/Cortex/config.py @@ -2,7 +2,7 @@ "downloads" : [ - "https://github.com/ImageEngine/cortex/archive/refs/tags/10.2.2.0.tar.gz" + "https://github.com/ImageEngine/cortex/archive/refs/tags/10.3.0.0.tar.gz" ], @@ -21,7 +21,7 @@ }, - "requiredEnvironment" : [ "ARNOLD_ROOT", "RMAN_ROOT" ], + "requiredEnvironment" : [ "RMAN_ROOT" ], "commands" : [ @@ -34,7 +34,6 @@ " INSTALL_RMANPROCEDURAL_NAME={buildDir}/renderMan/procedurals/iePython" " INSTALL_RMANDISPLAY_NAME={buildDir}/renderMan/displayDrivers/ieDisplay" " INSTALL_PYTHON_DIR={buildDir}/python" - " INSTALL_ARNOLDOUTPUTDRIVER_NAME={buildDir}/arnold/plugins/ieOutputDriver.so" " INSTALL_IECORE_OPS=''" " PYTHON_CONFIG={buildDir}/bin/python{pythonMajorVersion}-config" " PYTHON={buildDir}/bin/python" @@ -50,7 +49,6 @@ " GLEW_INCLUDE_PATH={buildDir}/include/GL" " RMAN_ROOT=$RMAN_ROOT" " NUKE_ROOT=" - " ARNOLD_ROOT=$ARNOLD_ROOT" " APPLESEED_ROOT={buildDir}/appleseed" " APPLESEED_INCLUDE_PATH={buildDir}/appleseed/include" " APPLESEED_LIB_PATH={buildDir}/appleseed/lib" @@ -69,7 +67,6 @@ "lib/libIECore*{sharedLibraryExtension}", "python/IECore*", "renderMan", - "arnold", "appleseedDisplays", "glsl/IECoreGL", "glsl/*.frag", From f975251b84c4f02b25c58f01d91d21d1e4621677 Mon Sep 17 00:00:00 2001 From: John Haddon Date: Wed, 17 Nov 2021 18:01:46 +0000 Subject: [PATCH 12/53] Changes.md : Update version to 4.0.0 --- Changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index bab5dabe79..62e1c98213 100644 --- a/Changes.md +++ b/Changes.md @@ -1,4 +1,4 @@ -4.x.x +4.0.0 ----- - OpenVDB : Updated to version 8.1.0. From 2ee0f2bc73151ede61793d2e5ac3d2586c91b7ab Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Thu, 14 May 2020 22:38:58 -0400 Subject: [PATCH 13/53] build.py : add Windows compatibility - use urllib for downloading archives to avoid requiring curl on Windows (curl is not a typical Windows utility and needs to be installed from gnu for Windows) - use cmake to unpack tar archives (tar is not a typical Windows tool) - add Windows config defaults - apply patches from OS specific subdirectories --- build.py | 54 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/build.py b/build.py index 6b751180c3..452e634a2f 100755 --- a/build.py +++ b/build.py @@ -13,6 +13,7 @@ import sys import tarfile import zipfile +from urllib.request import urlretrieve __version = "4.0.0" @@ -99,6 +100,8 @@ def __decompress( archive ) : ## \todo When we eventually move to Python 3, we can use # the `tarfile` module for this too. command = "tar -xvf {archive}".format( archive=archive ) + if sys.platform == "win32": + command = "cmake -E tar xvf {archive}".format( archive=archive ) sys.stderr.write( command + "\n" ) files = subprocess.check_output( command, stderr=subprocess.STDOUT, shell = True, universal_newlines = True ) files = [ f for f in files.split( "\n" ) if f ] @@ -197,11 +200,12 @@ def __loadConfigs( variables, variants ) : configs = {} for project in __projects() : config = __loadJSON( project ) + config[ "platform" ] = variables[ "platform" ] if project in variants : __applyConfigOverrides( config, "variant:{}".format( variants[project] ) ) for variantProject, variant in variants.items() : __applyConfigOverrides( config, "variant:{}:{}".format( variantProject, variant ) ) - __applyConfigOverrides( config, "platform:osx" if sys.platform == "darwin" else "platform:linux" ) + __applyConfigOverrides( config, { "darwin": "platform:osx", "win32": "platform:windows" }.get( sys.platform, "platform:linux" ) ) if config.get( "enabled", True ) : configs[project] = config @@ -272,9 +276,10 @@ def __buildProject( project, config, buildDir ) : if os.path.exists( archivePath ) : continue - downloadCommand = "curl -L {0} > {1}".format( download, archivePath ) - sys.stderr.write( downloadCommand + "\n" ) - subprocess.check_call( downloadCommand, shell = True ) + # downloadCommand = "curl -L {0} > {1}".format( download, archivePath ) + # sys.stderr.write( downloadCommand + "\n" ) + # subprocess.check_call( downloadCommand, shell = True ) + urlretrieve( download, archivePath ) workingDir = project + "/working" if os.path.exists( workingDir ) : @@ -297,13 +302,14 @@ def __buildProject( project, config, buildDir ) : shutil.rmtree( licenseDest ) shutil.copytree( config["license"], licenseDest ) - for patch in glob.glob( "../../patches/*.patch" ) : + for patch in glob.glob( "../../patches/{}/*.patch".format( config["platform"] ) ) : + # subprocess.check_call( "git apply --ignore-space-change --ignore-whitespace --whitespace=nowarn {patch}".format( patch = patch ), shell = True ) subprocess.check_call( "patch -p1 < {patch}".format( patch = patch ), shell = True ) environment = os.environ.copy() for k, v in config.get( "environment", {} ).items() : environment[k] = os.path.expandvars( v ) - + for command in config["commands"] : sys.stderr.write( command + "\n" ) subprocess.check_call( command, shell = True, env = environment ) @@ -400,10 +406,25 @@ def walk( project, configs, buildDir ) : with open( os.path.join( buildDir, "doc", "licenses", "manifest.json" ), "w" ) as file : json.dump( projectManifest, file, indent = 4 ) - rootName = os.path.basename( package ).replace( ".tar.gz", "" ) - with tarfile.open( package, "w:gz" ) as file : - for m in files : - file.add( os.path.join( buildDir, m ), arcname = os.path.join( rootName, m ) ) + if sys.platform == "win32" : + rootName = os.path.basename( package ).replace( ".zip", "" ) + buildDirLength = len( buildDir ) + with zipfile.ZipFile( package, "w", zipfile.ZIP_DEFLATED ) as file: + for m in files : + path = os.path.join( buildDir, m ) + if os.path.isfile( path ) : + file.write( os.path.join( buildDir, m ), arcname = os.path.join( rootName, m ) ) + elif os.path.isdir( path ) : + for root, dirs, files in os.walk( path ): + for f in files: + fullPath = os.path.join( root, f ) + relativePath = fullPath[ buildDirLength : ].lstrip( "\\" ) + file.write( fullPath, arcname = os.path.join( rootName, relativePath ) ) + else : + rootName = os.path.basename( package ).replace( ".tar.gz", "" ) + with tarfile.open( package, "w:gz" ) as file : + for m in files : + file.add( os.path.join( buildDir, m ), arcname = os.path.join( rootName, m ) ) parser = argparse.ArgumentParser() @@ -423,7 +444,7 @@ def walk( project, configs, buildDir ) : parser.add_argument( "--package", - default = "gafferDependencies-{version}{variants}-{platform}.tar.gz", + default = "gafferDependencies-{version}{variants}-{platform}" + ( ".zip" if sys.platform == "win32" else ".tar.gz" ), help = "The filename of the tarball package to create.", ) @@ -458,12 +479,19 @@ def walk( project, configs, buildDir ) : variables = { "buildDir" : os.path.abspath( args.buildDir ), + "buildDirFwd" : args.buildDir.replace("\\", "/"), "jobs" : args.jobs, "path" : os.environ["PATH"], "version" : __version, - "platform" : "osx" if sys.platform == "darwin" else "linux", - "sharedLibraryExtension" : ".dylib" if sys.platform == "darwin" else ".so", + "platform" : { "darwin": "osx", "win32": "windows" }.get( sys.platform, "linux" ), + "sharedLibraryExtension" : { "darwin": ".dylib", "win32": ".dll" }.get( sys.platform, ".so" ), + "staticLibraryExtension" : ".lib" if sys.platform == "win32" else ".a", + "pythonModuleExtension" : ".pyd" if sys.platform == "win32" else ".so", + "executableExtension" : ".exe" if sys.platform == "win32" else "", + "libraryPrefix" : "" if sys.platform == "win32" else "lib", "c++Standard" : "14", + "cmakeGenerator" : "\"NMake Makefiles JOM\"" if sys.platform == "win32" else "\"Unix Makefiles\"", + "cmakeBuildType": "Release", "variants" : "".join( "-{}{}".format( key, variants[key] ) for key in sorted( variants.keys() ) ), } From 5f456a0c9af1919b1a8f7caa572cf47953edd46c Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 18 Dec 2018 11:22:58 -0500 Subject: [PATCH 14/53] Zlib : add Windows configuration --- Zlib/config.py | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Zlib/config.py diff --git a/Zlib/config.py b/Zlib/config.py new file mode 100644 index 0000000000..13d0170f6f --- /dev/null +++ b/Zlib/config.py @@ -0,0 +1,71 @@ +{ + + "downloads" : [ + + "https://github.com/madler/zlib/archive/v1.2.11.tar.gz" + + ], + + "url" : "http://zlib.net/", + + "license" : None, + + "commands" : [ + + "mkdir gafferBuild", + + "cd gafferBuild &&" + " cmake" + " -G {cmakeGenerator}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " ..", + + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}" + + ], + + "manifest" : [ + + "include/zlib.h", + "include/zconf.h", + "lib/{libraryPrefix}zlib*{sharedLibraryExtension}*", + "lib/{libraryPrefix}zlib*.lib", + + ], + + "platform:osx" : { + + "enabled" : False, + + }, + + "platform:linux" : { + + "enabled" : False, + + }, + + "platform:windows" : { + + "commands" : [ + + "mkdir gafferBuild", + + "cd gafferBuild && " + " cmake" + " -G {cmakeGenerator}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " ..", + + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}", + # for some reason Zlib building doesn't put zconf.h in the main source directory alongside zlib.h + # manually copy it there so Boost can find it + "cd gafferBuild && copy zconf.h ..", + "copy {buildDir}\\bin\\{libraryPrefix}zlib*{sharedLibraryExtension}* {buildDir}\\lib\\", + ] + + } + +} From e97beb5f3f5d6ba3ec1ee18ca1bd5bb805781e5d Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 2 May 2018 10:55:02 -0400 Subject: [PATCH 15/53] Python : add Windows configuration --- LibFFI/config.py | 10 +- OpenSSL/config.py | 11 ++ Python/config.py | 407 ++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 417 insertions(+), 11 deletions(-) diff --git a/LibFFI/config.py b/LibFFI/config.py index 055696f442..3e20453815 100644 --- a/LibFFI/config.py +++ b/LibFFI/config.py @@ -19,8 +19,16 @@ "manifest" : [ - "lib/libffi*{sharedLibraryExtension}*", + "lib/{libraryPrefix}ffi*{sharedLibraryExtension}*", + "lib/{libraryPrefix}ffi*{staticLibraryExtension}*", ], + "platform:windows" : { + + "manifest" : [], + "commands" : [], + + }, + } diff --git a/OpenSSL/config.py b/OpenSSL/config.py index 85a0b4afd6..d2a3219581 100644 --- a/OpenSSL/config.py +++ b/OpenSSL/config.py @@ -20,6 +20,8 @@ "manifest" : [ + # The "lib" prefix is correct for all platforms + "lib/libssl*{sharedLibraryExtension}*", "lib/libcrypto*{sharedLibraryExtension}*", @@ -35,4 +37,13 @@ }, + "platform:windows" : { + + # Python builds it's own OpenSSL that we don't want to conflict with + + "manifest" : [], + "commands" : [], + + }, + } diff --git a/Python/config.py b/Python/config.py index f07bdf74b1..c3e3f30118 100644 --- a/Python/config.py +++ b/Python/config.py @@ -33,12 +33,12 @@ "manifest" : [ - "bin/python", - "bin/python*[0-9]", + "bin/python{executableExtension}", + "bin/python*[0-9]{executableExtension}", "include/python*", - "lib/libpython*{sharedLibraryExtension}*", + "lib/{libraryPrefix}python*{sharedLibraryExtension}*", "lib/Python.framework*", "lib/python{pythonVersion}", @@ -80,10 +80,10 @@ "publicVariables" : { "pythonVersion" : "3.7", - # Python 3 unconditionally puts these infuriating "m" ABI suffixes on - # everything. This is intended to allow different types of Python builds - # to exist in the same place, but that's not a problem we have. The problem - # we _do_ have is that a bunch of our projects get tripped up by these + # On POSIX systems, Python 3 unconditionally puts these infuriating "m" ABI + # suffixes on everything. This is intended to allow different types of Python + # builds to exist in the same place, but that's not a problem we have. The + # problem we _do_ have is that a bunch of our projects get tripped up by these # suffixes. See : https://www.python.org/dev/peps/pep-3149. "pythonABIVersion" : "3.7m", "pythonMajorVersion" : "3", @@ -91,11 +91,19 @@ }, - "symbolicLinks" : [ + }, - ( "{buildDir}/bin/python", "python3" ), + "platform:linux" : { - ], + "variant:3" : { + + "symbolicLinks" : [ + + ( "{buildDir}/bin/python", "python3" ), + + ], + + } }, @@ -124,4 +132,383 @@ }, + "platform:windows" : { + + "publicVariables" : { + + "pythonIncludeDir" : "{buildDirFwd}/include", + "pythonLibDir" : "{buildDirFwd}/libs", + + }, + + "manifest" : [ + + "bin/python{executableExtension}", + "bin/{libraryPrefix}python*{sharedLibraryExtension}*", + + "lib/{libraryPrefix}python*.lib", + "lib/python{pythonVersion}", + + "libs", + + "DLLs", + + # Gross. But here's the reasoning for now: we can't put the modules into a directory + # like `lib` as on Linux because it causes havoc with cmake finding the site-packages + # directory for downstream projects that need to install their Python modules. + # If we just do `Lib/*` then the packager will sweep up everything in the `lib` + # folder at the end of the entire dependencies build, not at the time Python is built. + # So for now to come up with this list, do a build of just Python, and then a simple + # Python script or similar to get a list of everything in the `lib` folder. + "Lib/abc.py", + "Lib/aifc.py", + "Lib/antigravity.py", + "Lib/argparse.py", + "Lib/ast.py", + "Lib/asynchat.py", + "Lib/asyncio", + "Lib/asyncore.py", + "Lib/base64.py", + "Lib/bdb.py", + "Lib/binhex.py", + "Lib/bisect.py", + "Lib/bz2.py", + "Lib/calendar.py", + "Lib/cgi.py", + "Lib/cgitb.py", + "Lib/chunk.py", + "Lib/cmd.py", + "Lib/code.py", + "Lib/codecs.py", + "Lib/codeop.py", + "Lib/collections", + "Lib/colorsys.py", + "Lib/compileall.py", + "Lib/concurrent", + "Lib/configparser.py", + "Lib/contextlib.py", + "Lib/contextvars.py", + "Lib/copy.py", + "Lib/copyreg.py", + "Lib/cProfile.py", + "Lib/crypt.py", + "Lib/csv.py", + "Lib/ctypes", + "Lib/curses", + "Lib/dataclasses.py", + "Lib/datetime.py", + "Lib/dbm", + "Lib/decimal.py", + "Lib/difflib.py", + "Lib/dis.py", + "Lib/distutils", + "Lib/doctest.py", + "Lib/dummy_threading.py", + "Lib/email", + "Lib/encodings", + "Lib/enum.py", + "Lib/filecmp.py", + "Lib/fileinput.py", + "Lib/fnmatch.py", + "Lib/formatter.py", + "Lib/fractions.py", + "Lib/ftplib.py", + "Lib/functools.py", + "Lib/genericpath.py", + "Lib/getopt.py", + "Lib/getpass.py", + "Lib/gettext.py", + "Lib/glob.py", + "Lib/gzip.py", + "Lib/hashlib.py", + "Lib/heapq.py", + "Lib/hmac.py", + "Lib/html", + "Lib/http", + "Lib/imaplib.py", + "Lib/imghdr.py", + "Lib/imp.py", + "Lib/importlib", + "Lib/inspect.py", + "Lib/io.py", + "Lib/ipaddress.py", + "Lib/json", + "Lib/keyword.py", + "Lib/lib2to3", + "Lib/linecache.py", + "Lib/locale.py", + "Lib/logging", + "Lib/lzma.py", + "Lib/macpath.py", + "Lib/mailbox.py", + "Lib/mailcap.py", + "Lib/mimetypes.py", + "Lib/modulefinder.py", + "Lib/msilib", + "Lib/multiprocessing", + "Lib/netrc.py", + "Lib/nntplib.py", + "Lib/ntpath.py", + "Lib/nturl2path.py", + "Lib/numbers.py", + "Lib/opcode.py", + "Lib/operator.py", + "Lib/optparse.py", + "Lib/os.py", + "Lib/pathlib.py", + "Lib/pdb.py", + "Lib/pickle.py", + "Lib/pickletools.py", + "Lib/pipes.py", + "Lib/pkgutil.py", + "Lib/platform.py", + "Lib/plistlib.py", + "Lib/poplib.py", + "Lib/posixpath.py", + "Lib/pprint.py", + "Lib/profile.py", + "Lib/pstats.py", + "Lib/pty.py", + "Lib/pyclbr.py", + "Lib/pydoc.py", + "Lib/pydoc_data", + "Lib/py_compile.py", + "Lib/queue.py", + "Lib/quopri.py", + "Lib/random.py", + "Lib/re.py", + "Lib/reprlib.py", + "Lib/rlcompleter.py", + "Lib/runpy.py", + "Lib/sched.py", + "Lib/secrets.py", + "Lib/selectors.py", + "Lib/shelve.py", + "Lib/shlex.py", + "Lib/shutil.py", + "Lib/signal.py", + "Lib/site-packages", + "Lib/site.py", + "Lib/smtpd.py", + "Lib/smtplib.py", + "Lib/sndhdr.py", + "Lib/socket.py", + "Lib/socketserver.py", + "Lib/sqlite3", + "Lib/sre_compile.py", + "Lib/sre_constants.py", + "Lib/sre_parse.py", + "Lib/ssl.py", + "Lib/stat.py", + "Lib/statistics.py", + "Lib/string.py", + "Lib/stringprep.py", + "Lib/struct.py", + "Lib/subprocess.py", + "Lib/sunau.py", + "Lib/symbol.py", + "Lib/symtable.py", + "Lib/sysconfig.py", + "Lib/tabnanny.py", + "Lib/tarfile.py", + "Lib/telnetlib.py", + "Lib/tempfile.py", + "Lib/textwrap.py", + "Lib/this.py", + "Lib/threading.py", + "Lib/timeit.py", + "Lib/token.py", + "Lib/tokenize.py", + "Lib/trace.py", + "Lib/traceback.py", + "Lib/tracemalloc.py", + "Lib/tty.py", + "Lib/types.py", + "Lib/typing.py", + "Lib/unittest", + "Lib/urllib", + "Lib/uu.py", + "Lib/uuid.py", + "Lib/warnings.py", + "Lib/wave.py", + "Lib/weakref.py", + "Lib/webbrowser.py", + "Lib/wsgiref", + "Lib/xdrlib.py", + "Lib/xml", + "Lib/xmlrpc", + "Lib/zipapp.py", + "Lib/zipfile.py", + "Lib/_bootlocale.py", + "Lib/_collections_abc.py", + "Lib/_compat_pickle.py", + "Lib/_compression.py", + "Lib/_dummy_thread.py", + "Lib/_markupbase.py", + "Lib/_osx_support.py", + "Lib/_pydecimal.py", + "Lib/_pyio.py", + "Lib/_py_abc.py", + "Lib/_sitebuiltins.py", + "Lib/_strptime.py", + "Lib/_threading_local.py", + "Lib/_weakrefset.py", + "Lib/__future__.py", + "Lib/__phello__.foo.py", + "Lib/__pycache__", + + # Double gross. Python on Windows seems pretty insistent on having the + # includes in the `include` directory, not a subdirectory. Many of the + # GafferDependencies projects can handle it in a subdirectory, but + # PySide and perhaps others can't. There's also a good change putting + # includes in a subdirectory would break installing things with pip + # or setuptools (the distutils.sysconfig.get_config_var("INCLUDEPY") will + # return the wrong value if the includes are located anywhere except `include`) + "include/abstract.h", + "include/accu.h", + "include/asdl.h", + "include/ast.h", + "include/bitset.h", + "include/bltinmodule.h", + "include/boolobject.h", + "include/bytearrayobject.h", + "include/bytesobject.h", + "include/bytes_methods.h", + "include/cellobject.h", + "include/ceval.h", + "include/classobject.h", + "include/code.h", + "include/codecs.h", + "include/compile.h", + "include/complexobject.h", + "include/context.h", + "include/datetime.h", + "include/descrobject.h", + "include/dictobject.h", + "include/dtoa.h", + "include/dynamic_annotations.h", + "include/enumobject.h", + "include/errcode.h", + "include/eval.h", + "include/fileobject.h", + "include/fileutils.h", + "include/floatobject.h", + "include/frameobject.h", + "include/funcobject.h", + "include/genobject.h", + "include/graminit.h", + "include/grammar.h", + "include/import.h", + "include/intrcheck.h", + "include/iterobject.h", + "include/listobject.h", + "include/longintrepr.h", + "include/longobject.h", + "include/marshal.h", + "include/memoryobject.h", + "include/metagrammar.h", + "include/methodobject.h", + "include/modsupport.h", + "include/moduleobject.h", + "include/namespaceobject.h", + "include/node.h", + "include/object.h", + "include/objimpl.h", + "include/odictobject.h", + "include/opcode.h", + "include/osdefs.h", + "include/osmodule.h", + "include/parsetok.h", + "include/patchlevel.h", + "include/pgen.h", + "include/pgenheaders.h", + "include/pyarena.h", + "include/pyatomic.h", + "include/pycapsule.h", + "include/pyconfig.h", + "include/pyctype.h", + "include/pydebug.h", + "include/pydtrace.h", + "include/pyerrors.h", + "include/pyexpat.h", + "include/pyfpe.h", + "include/pyhash.h", + "include/pylifecycle.h", + "include/pymacconfig.h", + "include/pymacro.h", + "include/pymath.h", + "include/pymem.h", + "include/pyport.h", + "include/pystate.h", + "include/pystrcmp.h", + "include/pystrhex.h", + "include/pystrtod.h", + "include/Python-ast.h", + "include/Python.h", + "include/pythonrun.h", + "include/pythread.h", + "include/pytime.h", + "include/py_curses.h", + "include/rangeobject.h", + "include/setobject.h", + "include/sliceobject.h", + "include/structmember.h", + "include/structseq.h", + "include/symtable.h", + "include/sysmodule.h", + "include/token.h", + "include/traceback.h", + "include/tupleobject.h", + "include/typeslots.h", + "include/ucnhash.h", + "include/unicodeobject.h", + "include/warnings.h", + "include/weakrefobject.h", + + # `lib` prefix is correct for Windows + "DLLs/libssl*{sharedLibraryExtension}*", + "DLLs/libcrypto*{sharedLibraryExtension}*", + ], + + "commands" : [ + + "call PCbuild/build.bat -p x64 --no-tkinter", + + # Recreate the typical Python 3 directory structure + "if not exist {buildDir}\\DLLs mkdir {buildDir}\\DLLs", + "if not exist {buildDir}\\bin mkdir {buildDir}\\bin", + "if not exist {buildDir}\\lib mkdir {buildDir}\\lib", + "if exist {buildDir}\\libs rmdir /Q /S {buildDir}\\libs", + "if not exist {buildDir}\\include mkdir {buildDir}\\include", + "if exist {buildDir}\\include\\openssl rmdir /S /Q {buildDir}\\include\\openssl", + "mkdir {buildDir}\\include\\openssl", + + # Initially copy all components to `DLLs` to avoid needing to copy + # individual DLL files later + "PCbuild\\amd64\\python.exe PC\\layout -s . -b PCbuild\\amd64 -v --precompile --flat-dlls --include-pip --include-dev --copy {buildDir}\\DLLs", + + "xcopy /sehyi {buildDir}\\DLLs\\include {buildDir}\\include", + "xcopy /sehyi {buildDir}\\DLLs\\Lib {buildDir}\\lib", + "move {buildDir}\\DLLs\\libs {buildDir}", + + "rmdir /Q /S {buildDir}\\DLLs\\include", + "rmdir /Q /S {buildDir}\\DLLs\\Lib", + + "move {buildDir}\\DLLs\\python.exe {buildDir}\\bin", + "move {buildDir}\\DLLs\\python{pythonMajorVersion}{pythonMinorVersion}.dll {buildDir}\\bin", + # pythonw runs a script without an accompanying terminal which means we don't get + # stdout, stderr, etc. + "del {buildDir}\\DLLs\\pythonw.exe", + "del {buildDir}\\DLLs\\LICENSE.txt", # build.py puts the license in the right place + + # Grab OpenSSL libs from the Python externals (needed by PySide2) + "copy externals\\openssl-bin-1.1.1d\\amd64\\libcrypto.lib {buildDir}\\lib", + "copy externals\\openssl-bin-1.1.1d\\amd64\\libssl.lib {buildDir}\\lib", + "xcopy /sehyi externals\\openssl-bin-1.1.1d\\amd64\\include\\openssl\\* {buildDir}\\include\\openssl", + + + ], + + } + } From 576c6d1d353c284c77642b2f264aa9e24c38df08 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 18 Dec 2018 12:46:03 -0500 Subject: [PATCH 16/53] CMark : add Windows configuration --- CMark/config.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/CMark/config.py b/CMark/config.py index 6dcaf7f12d..ed04ad64eb 100644 --- a/CMark/config.py +++ b/CMark/config.py @@ -20,8 +20,28 @@ "manifest" : [ - "lib/libcmark*{sharedLibraryExtension}*" + "lib/{libraryPrefix}cmark*{sharedLibraryExtension}*", + "lib/{libraryPrefix}cmark*.lib", ], + "platform:windows" : { + + "commands" : [ + + "mkdir gafferBuild", + "cd gafferBuild && " + " cmake" + " -G {cmakeGenerator}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " ..", + + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}", + "copy {buildDir}\\bin\\{libraryPrefix}cmark*{sharedLibraryExtension}* {buildDir}\\lib\\", + + ], + + } + } From 1a92cdb8c7d2fbceadb6a422ad4558a93d26cfcc Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 2 May 2018 10:48:03 -0400 Subject: [PATCH 17/53] Boost : add Windows configuration --- Boost/config.py | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/Boost/config.py b/Boost/config.py index 0068779611..009b564fbf 100644 --- a/Boost/config.py +++ b/Boost/config.py @@ -12,6 +12,12 @@ "dependencies" : [ "Python" ], + "variables" : { + + "boostVersionSuffix" : "", + + }, + "environment" : { # Without this, boost build will still pick up the system python framework, @@ -34,10 +40,43 @@ "manifest" : [ - "include/boost", - "lib/libboost_*{sharedLibraryExtension}*", - "lib/libboost_test_exec_monitor.a", + "include/boost{boostVersionSuffix}", + "lib/{libraryPrefix}boost_*{sharedLibraryExtension}*", + "lib/{libraryPrefix}boost_*.lib", + "lib/libboost_test_exec_monitor*{staticLibraryExtension}", # Windows and Linux both use the "lib" prefix ], + "platform:windows" : { + + "dependencies" : [ "Python", "Zlib" ], + + "variables" : { + + "boostVersionSuffix" : "-1_68", + + }, + + "publicVariables" : { + + "boostLibSuffix" : "-vc141-mt-x64{boostVersionSuffix}", + + }, + + "environment" : { + + # Boost needs help finding Python + "PATH" : "%PATH%;{buildDir}\\bin", + "PYTHONPATH" : "{buildDir};{buildDir}\\bin;{buildDir}\\lib64;{buildDir}\\lib" + + }, + + "commands" : [ + "echo using python : {pythonVersion} : \"{buildDirFwd}/bin/python\" : {pythonIncludeDir} : {pythonLibDir} ; >> tools\\build\\src\\user-config.jam", # best to use forward slashes in user-config.jam + "bootstrap.bat --prefix={buildDir} --without-libraries=log", + "b2 -d+2 --prefix={buildDir} --toolset=msvc architecture=x86 address-model=64 --build-type=complete variant=release link=shared threading=multi cxxflags=\"/std:c++{c++Standard}\" cxxstd={c++Standard} -s ZLIB_SOURCE=%ROOT_DIR%\\Zlib\\working\\zlib-1.2.11 -s ZLIB_INCLUDE={buildDir}\\include -s ZLIB_LIBPATH={buildDir}\\lib -s ZLIB_BINARY=zlib install" + + ], + + }, } From bfd4e84233a765fc32c290d9891fd4121ae16f2a Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 18 Dec 2018 12:47:13 -0500 Subject: [PATCH 18/53] LibJPEG-Turbo : add Windows configuration --- Boost/config.py | 2 +- .../patches/windows/0000-fix_permissive.patch | 56 +++++++++++++++++++ LibJPEG-Turbo/config.py | 25 ++++++++- 3 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 Boost/patches/windows/0000-fix_permissive.patch diff --git a/Boost/config.py b/Boost/config.py index 009b564fbf..f30714aa65 100644 --- a/Boost/config.py +++ b/Boost/config.py @@ -67,7 +67,7 @@ # Boost needs help finding Python "PATH" : "%PATH%;{buildDir}\\bin", - "PYTHONPATH" : "{buildDir};{buildDir}\\bin;{buildDir}\\lib64;{buildDir}\\lib" + "PYTHONPATH" : "{buildDir};{buildDir}\\bin;{buildDir}\\lib\\python{pythonVersion};{buildDir}\\lib" }, diff --git a/Boost/patches/windows/0000-fix_permissive.patch b/Boost/patches/windows/0000-fix_permissive.patch new file mode 100644 index 0000000000..a6d174bbac --- /dev/null +++ b/Boost/patches/windows/0000-fix_permissive.patch @@ -0,0 +1,56 @@ +From 0d0cd711a764a3b32d2cd19a1049eb9f36b4fd06 Mon Sep 17 00:00:00 2001 +From: Owens +Date: Fri, 17 Aug 2018 06:06:03 +1000 +Subject: [PATCH] Enable forward declaration of unwind_type() in msvc14.15 and + later. + +Name lookup in msvc has changed between 14.14 and 14.15 making it consistent with other compilers. Forward declaration of unwind_type() is now required as it is for other compilers. + +Resolves compilation errors identified in: + +https://github.com/boostorg/python/issues/228 +--- + include/boost/python/detail/unwind_type.hpp | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/include/boost/python/detail/unwind_type.hpp b/include/boost/python/detail/unwind_type.hpp +index f6cdab64f..b81bf7c89 100644 +--- a/boost/python/detail/unwind_type.hpp ++++ b/boost/python/detail/unwind_type.hpp +@@ -11,13 +11,15 @@ + + namespace boost { namespace python { namespace detail { + +-#ifndef _MSC_VER //if forward declared, msvc6.5 does not recognize them as inline +-// forward declaration, required (at least) by Tru64 cxx V6.5-042 ++#if (!defined(_MSC_VER) || _MSC_VER >= 1915) ++// If forward declared, msvc6.5 does not recognize them as inline. ++// However, as of msvc14.15 (_MSC_VER 1915/Visual Studio 15.8.0) name lookup is now consistent with other compilers. ++// forward declaration, required (at least) by Tru64 cxx V6.5-042 and msvc14.15 + template + inline typename Generator::result_type + unwind_type(U const& p, Generator* = 0); + +-// forward declaration, required (at least) by Tru64 cxx V6.5-042 ++// forward declaration, required (at least) by Tru64 cxx V6.5-042 and msvc14.15 + template + inline typename Generator::result_type + unwind_type(boost::type*p = 0, Generator* = 0); +@@ -83,7 +85,7 @@ struct unwind_helper + + template + inline typename Generator::result_type +-#ifndef _MSC_VER ++#if (!defined(_MSC_VER) || _MSC_VER >= 1915) + unwind_type(U const& p, Generator*) + #else + unwind_type(U const& p, Generator* = 0) +@@ -148,7 +150,7 @@ struct unwind_helper2 + // why bother? + template + inline typename Generator::result_type +-#ifndef _MSC_VER ++#if (!defined(_MSC_VER) || _MSC_VER >= 1915) + unwind_type(boost::type*, Generator*) + #else + unwind_type(boost::type*p =0, Generator* =0) diff --git a/LibJPEG-Turbo/config.py b/LibJPEG-Turbo/config.py index 8ae7aab8b6..b9704cd9b6 100644 --- a/LibJPEG-Turbo/config.py +++ b/LibJPEG-Turbo/config.py @@ -24,8 +24,29 @@ "include/jmorecfg.h", "include/jpeglib.h", - "lib/libjpeg*{sharedLibraryExtension}*", - + "lib/libjpeg*{sharedLibraryExtension}*", # Linux / Mac OS + "lib/libjpeg*.lib*", + "lib/jpeg62{sharedLibraryExtension}", # Windows only + "lib/turbojpeg{sharedLibraryExtension}", # Windows only ], + "platform:windows" : { + + "commands" : [ + + "mkdir gafferBuild", + "cd gafferBuild && " + " cmake" + " -G {cmakeGenerator}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D WITH_SIMD=OFF" + " ..", + + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}", + "copy {buildDir}\\bin\\jpeg62{sharedLibraryExtension} {buildDir}\\lib\\", + "copy {buildDir}\\bin\\turbojpeg{sharedLibraryExtension} {buildDir}\\lib\\", + ], + + }, } From 9feef2f23c3eff1ae6f9a9c984ca6afc458442bd Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 18 Dec 2018 12:48:18 -0500 Subject: [PATCH 19/53] LibTIFF : add Windows configuration --- LibTIFF/config.py | 11 +++++++++++ LibTIFF/patches/windows/zip.patch | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 LibTIFF/patches/windows/zip.patch diff --git a/LibTIFF/config.py b/LibTIFF/config.py index acc0d5224c..41dc3e027c 100644 --- a/LibTIFF/config.py +++ b/LibTIFF/config.py @@ -36,5 +36,16 @@ "lib/libtiff*{sharedLibraryExtension}*", ], + "platform:windows" : { + + "commands" : [ + + "nmake /f makefile.vc", + "copy libtiff\\*.h {buildDir}\\include", + "copy libtiff\\libtiff.lib {buildDir}\\lib", + + ], + + }, } diff --git a/LibTIFF/patches/windows/zip.patch b/LibTIFF/patches/windows/zip.patch new file mode 100644 index 0000000000..e889fe2b61 --- /dev/null +++ b/LibTIFF/patches/windows/zip.patch @@ -0,0 +1,16 @@ +--- ./nmake.opt 2018-11-03 14:26:00.959361000 -0400 ++++ ./nmake.opt 2018-12-14 17:48:11.536126800 -0500 +@@ -62,10 +62,9 @@ + # Uncomment and edit following lines to enable ZIP support + # (required for Deflate compression and Pixar log-format) + # +-#ZIP_SUPPORT = 1 +-#ZLIBDIR = d:/projects/zlib-1.2.1 +-#ZLIB_INCLUDE = -I$(ZLIBDIR) +-#ZLIB_LIB = $(ZLIBDIR)/zlib.lib ++ZIP_SUPPORT = 1 ++ZLIB_INCLUDE = -I%BUILD_DIR%/include ++ZLIB_LIB = %BUILD_DIR%/lib/zlib.lib + + # + # Uncomment and edit following lines to enable ISO JBIG support From 8632df3ca8c6d0e24a54bb837b82517cda984db9 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 2 May 2018 10:54:01 -0400 Subject: [PATCH 20/53] LibPNG : add Windows configuration --- LibPNG/config.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/LibPNG/config.py b/LibPNG/config.py index ed1e233181..30c3f5cbfe 100644 --- a/LibPNG/config.py +++ b/LibPNG/config.py @@ -21,8 +21,29 @@ "include/png*", "include/libpng*", - "lib/libpng*{sharedLibraryExtension}*", + "lib/libpng*{sharedLibraryExtension}*", # lib prefix is accurate for all platforms + "lib/libpng*.lib", ], + "platform:windows" : { + + "commands" : [ + + "mkdir gafferBuild", + "cd gafferBuild && " + " cmake" + " -G {cmakeGenerator}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D ZLIB_INCLUDE_DIR={buildDir}\\include" + " -D ZLIB_LIBRARY={buildDir}\\lib\\zlib.lib" + " ..", + + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}", + "copy {buildDir}\\bin\\libpng*{sharedLibraryExtension}* {buildDir}\\lib\\", + + ], + + }, } From 0b2162e66ecba78a11b351e23a17a05f99d35009 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 2 May 2018 10:50:59 -0400 Subject: [PATCH 21/53] FreeType : add Windows configuration --- FreeType/config.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/FreeType/config.py b/FreeType/config.py index 1f454e4f26..469999ef43 100644 --- a/FreeType/config.py +++ b/FreeType/config.py @@ -28,8 +28,29 @@ "manifest" : [ "include/freetype2", - "lib/libfreetype*{sharedLibraryExtension}*", + "lib/{libraryPrefix}freetype*{sharedLibraryExtension}*", + "lib/{libraryPrefix}freetype*.lib*", ], + "platform:windows" : { + + "commands" : [ + + "mkdir gafferBuild", + "cd gafferBuild && cmake" + " -Wno-dev" + " -G {cmakeGenerator}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D CMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE" + " ..", + # FreeType 2.9.1 does not copy the ftconfig.h header + # the binary directory, help it out here + "copy include\\freetype\\config\\ftconfig.h gafferBuild\\include\\freetype\\config\\ftconfig.h", + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}", + + ] + + } } From 8982a45e6fb8611de2ed30b54140b6b3f9f54f09 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 2 May 2018 10:56:12 -0400 Subject: [PATCH 22/53] TBB : add Windows configuration --- TBB/config.py | 25 +- TBB/patches/windows/001-cmake.patch | 578 ++++++++++++++++++ TBB/patches/windows/002-cmake.patch | 10 + TBB/patches/windows/msvc2017_workaround.patch | 23 + 4 files changed, 635 insertions(+), 1 deletion(-) create mode 100644 TBB/patches/windows/001-cmake.patch create mode 100644 TBB/patches/windows/002-cmake.patch create mode 100644 TBB/patches/windows/msvc2017_workaround.patch diff --git a/TBB/config.py b/TBB/config.py index 3f3a3ed0cb..ccc6397eff 100644 --- a/TBB/config.py +++ b/TBB/config.py @@ -21,7 +21,8 @@ "manifest" : [ "include/tbb", - "lib/libtbb*{sharedLibraryExtension}*", + "lib/{libraryPrefix}tbb*{sharedLibraryExtension}*", + "lib/{libraryPrefix}tbb*.lib", ], @@ -57,4 +58,26 @@ }, + "platform:windows" : { + + "commands" : [ + + "mkdir gafferBuild", + "cd gafferBuild && " + " cmake" + " -G {cmakeGenerator}" + " -D CMAKE_CXX_STANDARD={c++Standard}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_PREFIX_PATH={buildDir}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D TBB_BUILD_TESTS=OFF" + " ..", + + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}", + "copy {buildDir}\\bin\\{libraryPrefix}tbb*{sharedLibraryExtension}* {buildDir}\\lib\\", + + ], + + }, + } diff --git a/TBB/patches/windows/001-cmake.patch b/TBB/patches/windows/001-cmake.patch new file mode 100644 index 0000000000..8e2d977187 --- /dev/null +++ b/TBB/patches/windows/001-cmake.patch @@ -0,0 +1,578 @@ +From 53303ec80c78df847cee960f7be8f2fe250d20fa Mon Sep 17 00:00:00 2001 +From: Alex Fuller +Date: Sun, 17 Sep 2017 15:11:22 -0700 +Subject: [PATCH] TBB CMake build scripts from https://github.com/wjakob/tbb + +--- + ./CMakeLists.txt | 524 ++++++++++++++++++++++++++++ + ./build/mingw_cross_toolchain.cmake | 9 + + ./build/version_string.ver.in | 11 + + 3 files changed, 550 insertions(+), 11 deletions(-) + create mode 100644 ./CMakeLists.txt + create mode 100644 ./build/mingw_cross_toolchain.cmake + create mode 100644 ./build/version_string.ver.in + +diff --git a/./CMakeLists.txt b/./CMakeLists.txt +new file mode 100644 +index 0000000000..e020273fc6 +--- /dev/null ++++ b/./CMakeLists.txt +@@ -0,0 +1,524 @@ ++cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR) ++project (tbb CXX) ++ ++include(CheckCXXCompilerFlag) ++include(CheckCXXSourceRuns) ++ ++if(POLICY CMP0058) ++ cmake_policy(SET CMP0058 NEW) ++endif() ++ ++if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) ++ message(STATUS "Setting build type to 'Release' as none was specified.") ++ set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) ++ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" ++ "MinSizeRel" "RelWithDebInfo") ++endif() ++ ++if(NOT TBB_INSTALL_RUNTIME_DIR) ++ set(TBB_INSTALL_RUNTIME_DIR bin) ++endif() ++if(NOT TBB_INSTALL_LIBRARY_DIR) ++ set(TBB_INSTALL_LIBRARY_DIR lib) ++endif() ++if(NOT TBB_INSTALL_ARCHIVE_DIR) ++ set(TBB_INSTALL_ARCHIVE_DIR lib) ++endif() ++if(NOT TBB_INSTALL_INCLUDE_DIR) ++ set(TBB_INSTALL_INCLUDE_DIR include) ++endif() ++ ++include_directories(include src src/rml/include ${CMAKE_CURRENT_BINARY_DIR}) ++ ++option(TBB_BUILD_SHARED "Build TBB shared library" ON) ++option(TBB_BUILD_STATIC "Build TBB static library" ON) ++option(TBB_BUILD_TBBMALLOC "Build TBB malloc library" ON) ++option(TBB_BUILD_TBBMALLOC_PROXY "Build TBB malloc proxy library" ON) ++option(TBB_BUILD_TESTS "Build TBB tests and enable testing infrastructure" ON) ++option(TBB_CI_BUILD "Is this a continuous integration build?" OFF) ++ ++if(APPLE) ++ set(CMAKE_MACOSX_RPATH ON) ++endif() ++ ++file(GLOB tbb_src "${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/old/*.cpp") ++list(APPEND tbb_src ${CMAKE_CURRENT_SOURCE_DIR}/src/rml/client/rml_tbb.cpp) ++file(GLOB to_remove "${CMAKE_CURRENT_SOURCE_DIR}/src/old/test*.cpp") ++list(REMOVE_ITEM tbb_src ${to_remove}) ++ ++set(tbbmalloc_static_src ++ src/tbbmalloc/backend.cpp ++ src/tbbmalloc/large_objects.cpp ++ src/tbbmalloc/backref.cpp ++ src/tbbmalloc/tbbmalloc.cpp ++ src/tbbmalloc/frontend.cpp ++ src/tbb/itt_notify.cpp) ++ ++set(tbbmalloc_src ${tbbmalloc_static_src}) ++ ++set(tbbmalloc_proxy_src ++ src/tbbmalloc/proxy.cpp ++ src/tbbmalloc/tbb_function_replacement.cpp) ++ ++if (CMAKE_SYSTEM_PROCESSOR MATCHES "(i386|x86_64)") ++ if (NOT APPLE AND NOT MINGW) ++ add_definitions(-DDO_ITT_NOTIFY) ++ endif() ++endif() ++ ++if (APPLE) ++ # Disable annoying "has no symbols" warnings ++ set(CMAKE_C_ARCHIVE_CREATE " Scr ") ++ set(CMAKE_CXX_ARCHIVE_CREATE " Scr ") ++ set(CMAKE_C_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") ++ set(CMAKE_CXX_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") ++endif() ++ ++macro(CHECK_CXX_COMPILER_AND_LINKER_FLAGS _RESULT _CXX_FLAGS _LINKER_FLAGS) ++ set(CMAKE_REQUIRED_FLAGS ${_CXX_FLAGS}) ++ set(CMAKE_REQUIRED_LIBRARIES ${_LINKER_FLAGS}) ++ set(CMAKE_REQUIRED_QUIET TRUE) ++ check_cxx_source_runs("#include \nint main(int argc, char **argv) { std::cout << \"test\"; return 0; }" ${_RESULT}) ++ set(CMAKE_REQUIRED_FLAGS "") ++ set(CMAKE_REQUIRED_LIBRARIES "") ++endmacro() ++ ++# Prefer libc++ in conjunction with Clang ++if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") ++ if (CMAKE_CXX_FLAGS MATCHES "-stdlib=libc\\+\\+") ++ message(STATUS "TBB: using libc++.") ++ else() ++ CHECK_CXX_COMPILER_AND_LINKER_FLAGS(HAS_LIBCPP "-stdlib=libc++" "-stdlib=libc++") ++ if (HAS_LIBCPP) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -D_LIBCPP_VERSION") ++ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") ++ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libc++") ++ message(STATUS "TBB: using libc++.") ++ else() ++ message(STATUS "TBB: NOT using libc++.") ++ endif() ++ endif() ++endif() ++ ++if (UNIX) ++ add_definitions (-DUSE_PTHREAD) ++ ++ check_cxx_compiler_flag ("-std=c++11" SUPPORTS_STDCXX11) ++ if (SUPPORTS_STDCXX11) ++ set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") ++ endif () ++ ++ check_cxx_compiler_flag ("-mrtm -Werror" SUPPORTS_MRTM) ++ if (SUPPORTS_MRTM) ++ set (CMAKE_CXX_FLAGS "-mrtm ${CMAKE_CXX_FLAGS}") ++ endif () ++ ++elseif(WIN32) ++ if (MSVC) ++ cmake_minimum_required (VERSION 3.1) ++ enable_language(ASM_MASM) ++ set(CMAKE_CXX_FLAGS "/GS- /Zc:wchar_t /Zc:forScope /DUSE_WINTHREAD ${CMAKE_CXX_FLAGS}") ++ set(CMAKE_CXX_FLAGS "/D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0600 ${CMAKE_CXX_FLAGS}") ++ check_cxx_compiler_flag ("/volatile:iso" SUPPORTS_VOLATILE_FLAG) ++ if (SUPPORTS_VOLATILE_FLAG) ++ set(CMAKE_CXX_FLAGS "/volatile:iso ${CMAKE_CXX_FLAGS}") ++ endif () ++ set(CMAKE_CXX_FLAGS "/wd4267 /wd4800 /wd4146 /wd4244 /wd4577 /wd4018 ${CMAKE_CXX_FLAGS}") ++ if (NOT CMAKE_SIZEOF_VOID_P) ++ message(FATAL_ERROR "'CMAKE_SIZEOF_VOID_P' is undefined. Please delete your build directory and rerun CMake again!") ++ endif() ++ ++ if (CMAKE_SIZEOF_VOID_P EQUAL 8) ++ list(APPEND tbb_src src/tbb/intel64-masm/atomic_support.asm ++ src/tbb/intel64-masm/itsx.asm src/tbb/intel64-masm/intel64_misc.asm) ++ list(APPEND tbbmalloc_src src/tbb/intel64-masm/atomic_support.asm) ++ set(CMAKE_ASM_MASM_FLAGS "/DEM64T=1 ${CMAKE_ASM_MASM_FLAGS}") ++ else() ++ list(APPEND tbb_src src/tbb/ia32-masm/atomic_support.asm ++ src/tbb/ia32-masm/itsx.asm src/tbb/ia32-masm/lock_byte.asm) ++ # Enable SAFESEH feature for assembly (x86 builds only). ++ set(CMAKE_ASM_MASM_FLAGS "/safeseh ${CMAKE_ASM_MASM_FLAGS}") ++ endif() ++ elseif (MINGW) ++ add_definitions(-DUSE_WINTHREAD) ++ add_definitions(-D_WIN32_WINNT=0x0502) ++ set(CMAKE_CXX_FLAGS "-mthreads ${CMAKE_CXX_FLAGS}") ++ endif () ++endif() ++ ++if (MSVC) ++ set(ENABLE_RTTI "/EHsc /GR ") ++ set(DISABLE_RTTI "/EHs- /GR- ") ++elseif (UNIX) ++ set(ENABLE_RTTI "-frtti -fexceptions ") ++ set(DISABLE_RTTI "-fno-rtti -fno-exceptions ") ++endif () ++ ++##-------- ++# - Added TBB_USE_GLIBCXX_VERSION macro to specify the version of GNU ++# libstdc++ when it cannot be properly recognized, e.g. when used ++# with Clang on Linux* OS. Inspired by a contribution from David A. ++if (NOT TBB_USE_GLIBCXX_VERSION AND UNIX AND NOT APPLE) ++ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") ++ # using Clang ++ string(REPLACE "." "0" TBB_USE_GLIBCXX_VERSION ${CMAKE_CXX_COMPILER_VERSION}) ++ endif() ++endif() ++ ++if (TBB_USE_GLIBCXX_VERSION) ++ add_definitions(-DTBB_USE_GLIBCXX_VERSION=${TBB_USE_GLIBCXX_VERSION}) ++endif() ++ ++##------- ++ ++if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") ++ check_cxx_compiler_flag ("-flifetime-dse=1" SUPPORTS_FLIFETIME) ++ if (SUPPORTS_FLIFETIME) ++ add_definitions(-flifetime-dse=1) ++ endif() ++endif() ++ ++# Linker export definitions ++if (APPLE) ++ set (ARCH_PREFIX "mac") ++elseif(WIN32) ++ set (ARCH_PREFIX "win") ++else() ++ set (ARCH_PREFIX "lin") ++endif() ++ ++if (CMAKE_SIZEOF_VOID_P EQUAL 8) ++ set(ARCH_PREFIX "${ARCH_PREFIX}64") ++else() ++ set(ARCH_PREFIX "${ARCH_PREFIX}32") ++endif() ++ ++if (MINGW) ++ set (ARCH_PREFIX "${ARCH_PREFIX}-gcc") ++ # there's no win32-gcc-tbb-export.def, use lin32-tbb-export.def ++ execute_process (COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/lin32-tbb-export.def ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/win32-gcc-tbb-export.def) ++endif() ++ ++if (MSVC) ++ add_custom_command(OUTPUT tbb.def ++ COMMAND ${CMAKE_CXX_COMPILER} /TC /EP ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include > tbb.def ++ MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def ++ COMMENT "Preprocessing tbb.def" ++ ) ++ ++ add_custom_command(OUTPUT tbbmalloc.def ++ COMMAND ${CMAKE_CXX_COMPILER} /TC /EP ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include > tbbmalloc.def ++ MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def ++ COMMENT "Preprocessing tbbmalloc.def" ++ ) ++else() ++ add_custom_command(OUTPUT tbb.def ++ COMMAND ${CMAKE_CXX_COMPILER} -xc++ -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbb.def ++ MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def ++ COMMENT "Preprocessing tbb.def" ++ ) ++ ++ add_custom_command(OUTPUT tbbmalloc.def ++ COMMAND ${CMAKE_CXX_COMPILER} -xc++ -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbbmalloc.def ++ MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def ++ COMMENT "Preprocessing tbbmalloc.def" ++ ) ++endif() ++ ++add_custom_target(tbb_def_files DEPENDS tbb.def tbbmalloc.def) ++ ++# TBB library ++if (TBB_BUILD_STATIC) ++ add_library(tbb_static STATIC ${tbb_src}) ++ set_property(TARGET tbb_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_BUILD=1") ++ set_property(TARGET tbb_static APPEND_STRING PROPERTY COMPILE_FLAGS ${ENABLE_RTTI}) ++ install(TARGETS tbb_static ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR}) ++ if (MSVC) ++ target_compile_definitions(tbb_static PUBLIC __TBB_NO_IMPLICIT_LINKAGE=1) ++ endif() ++ ++ if (UNIX AND NOT APPLE) ++ target_link_libraries(tbb_static PUBLIC pthread dl) ++ endif() ++endif() ++ ++if (TBB_BUILD_SHARED) ++ add_library(tbb SHARED ${tbb_src}) ++ set_property(TARGET tbb APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_BUILD=1") ++ set_property(TARGET tbb APPEND_STRING PROPERTY COMPILE_FLAGS ${ENABLE_RTTI}) ++ add_dependencies(tbb tbb_def_files) ++ ++ if (APPLE) ++ set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/tbb.def") ++ elseif (MSVC) ++ set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/tbb.def") ++ else () ++ set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,${CMAKE_CURRENT_BINARY_DIR}/tbb.def") ++ endif() ++ ++ install(TARGETS tbb ++ LIBRARY DESTINATION ${TBB_INSTALL_LIBRARY_DIR} ++ ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR} ++ RUNTIME DESTINATION ${TBB_INSTALL_RUNTIME_DIR}) ++ if (UNIX AND NOT APPLE) ++ target_link_libraries(tbb PUBLIC pthread dl) ++ endif() ++ if (MSVC) ++ target_compile_definitions(tbb PUBLIC __TBB_NO_IMPLICIT_LINKAGE=1) ++ endif() ++endif() ++ ++ ++if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") ++ # Quench a warning on GCC ++ set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/governor.cpp COMPILE_FLAGS "-Wno-missing-field-initializers ") ++elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") ++ # Quench a warning on Clang ++ set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/itt_notify.cpp COMPILE_FLAGS "-Wno-varargs ") ++elseif(MSVC) ++ # Quench a warning on MSVC ++ set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/scheduler.cpp COMPILE_FLAGS "/wd4458 ") ++endif() ++ ++if(TBB_BUILD_TBBMALLOC) ++ # TBB malloc library ++ if (TBB_BUILD_STATIC) ++ add_library(tbbmalloc_static STATIC ${tbbmalloc_static_src}) ++ set_property(TARGET tbbmalloc_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1") ++ set_property(TARGET tbbmalloc_static APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI}) ++ if (MSVC) ++ target_compile_definitions(tbbmalloc_static PUBLIC __TBB_NO_IMPLICIT_LINKAGE=1 __TBBMALLOC_NO_IMPLICIT_LINKAGE=1) ++ endif() ++ install(TARGETS tbbmalloc_static ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR}) ++ endif() ++ ++ if (TBB_BUILD_SHARED) ++ add_library(tbbmalloc SHARED ${tbbmalloc_src}) ++ set_property(TARGET tbbmalloc APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1") ++ set_property(TARGET tbbmalloc APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI}) ++ add_dependencies(tbbmalloc tbb_def_files) ++ if (APPLE) ++ set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "-Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def") ++ elseif (MSVC) ++ set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def") ++ else () ++ set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def") ++ endif() ++ if (MSVC) ++ target_compile_definitions(tbbmalloc PUBLIC __TBB_NO_IMPLICIT_LINKAGE=1 __TBBMALLOC_NO_IMPLICIT_LINKAGE=1) ++ endif() ++ install(TARGETS tbbmalloc ++ LIBRARY DESTINATION ${TBB_INSTALL_LIBRARY_DIR} ++ ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR} ++ RUNTIME DESTINATION ${TBB_INSTALL_RUNTIME_DIR}) ++ if (UNIX AND NOT APPLE) ++ target_link_libraries(tbbmalloc PUBLIC pthread dl) ++ endif() ++ endif() ++endif() ++ ++if(TBB_BUILD_TBBMALLOC_PROXY) ++ # TBB malloc proxy library ++ if (TBB_BUILD_STATIC) ++ add_library(tbbmalloc_proxy_static STATIC ${tbbmalloc_proxy_src}) ++ set_property(TARGET tbbmalloc_proxy_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1") ++ set_property(TARGET tbbmalloc_proxy_static APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI}) ++ install(TARGETS tbbmalloc_proxy_static ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR}) ++ endif() ++ ++ if (TBB_BUILD_SHARED) ++ add_library(tbbmalloc_proxy SHARED ${tbbmalloc_proxy_src}) ++ set_property(TARGET tbbmalloc_proxy APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1") ++ set_property(TARGET tbbmalloc_proxy APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI}) ++ target_link_libraries(tbbmalloc_proxy PUBLIC tbbmalloc) ++ install(TARGETS tbbmalloc_proxy ++ LIBRARY DESTINATION ${TBB_INSTALL_LIBRARY_DIR} ++ ARCHIVE DESTINATION ${TBB_INSTALL_ARCHIVE_DIR} ++ RUNTIME DESTINATION ${TBB_INSTALL_RUNTIME_DIR}) ++ if (UNIX AND NOT APPLE) ++ target_link_libraries(tbbmalloc_proxy PUBLIC pthread dl) ++ endif() ++ endif() ++endif() ++ ++install(DIRECTORY include/tbb DESTINATION ${TBB_INSTALL_INCLUDE_DIR}) ++ ++# version_string.ver ++if (UNIX) ++ execute_process (COMMAND date "+%a, %d %b %Y %H:%M:%S %z" ++ OUTPUT_VARIABLE _configure_date ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++elseif (WIN32) ++ execute_process (COMMAND cmd " /C date /T" ++ OUTPUT_VARIABLE _configure_date ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++else () ++ set (_configure_date "Unknown") ++endif() ++include_directories (${CMAKE_BINARY_DIR}) ++configure_file (build/version_string.ver.in version_string.ver @ONLY) ++ ++if (TBB_BUILD_TESTS) ++ enable_language (C) ++ enable_testing () ++ ++ find_library (LIBRT_LIBRARIES rt) ++ find_library (LIDL_LIBRARIES dl) ++ find_package (Threads) ++ if (NOT APPLE) ++ find_package (OpenMP) ++ endif() ++ ++ macro (tbb_add_test testname) ++ set (full_testname tbb_test_${testname}) ++ add_executable (${full_testname} src/test/test_${testname}.cpp) ++ if (TBB_BUILD_SHARED) ++ target_link_libraries (${full_testname} PRIVATE tbb tbbmalloc) ++ target_compile_definitions (${full_testname} PRIVATE __TBB_LIB_NAME=tbb) ++ else () ++ target_link_libraries (${full_testname} PRIVATE tbb_static tbbmalloc_static) ++ target_compile_definitions (${full_testname} PRIVATE __TBB_LIB_NAME=tbb_static) ++ endif () ++ if (LIBRT_LIBRARIES) ++ target_link_libraries (${full_testname} PRIVATE ${LIBRT_LIBRARIES}) ++ endif () ++ if (LIDL_LIBRARIES) ++ target_link_libraries (${full_testname} PRIVATE ${LIDL_LIBRARIES}) ++ endif () ++ if (Threads_FOUND) ++ target_link_libraries (${full_testname} PRIVATE ${CMAKE_THREAD_LIBS_INIT}) ++ endif () ++ if (OPENMP_FOUND AND "${testname}" MATCHES "openmp") ++ set_target_properties (${full_testname} PROPERTIES COMPILE_FLAGS "${OpenMP_CXX_FLAGS}") ++ set_target_properties (${full_testname} PROPERTIES LINK_FLAGS "${OpenMP_CXX_FLAGS}") ++ endif() ++ if (MINGW) ++ target_link_libraries (${full_testname} PRIVATE psapi) ++ endif () ++ add_test (NAME ${full_testname} COMMAND ${full_testname}) ++ endmacro () ++ ++ tbb_add_test (aggregator) ++ tbb_add_test (aligned_space) ++ tbb_add_test (assembly) ++ tbb_add_test (async_msg) ++ tbb_add_test (async_node) ++ # tbb_add_test (atomic) # msvc64/debug timeouts: Compile-time initialization fails for static tbb::atomic variables ++ tbb_add_test (blocked_range2d) ++ tbb_add_test (blocked_range3d) ++ tbb_add_test (blocked_range) ++ tbb_add_test (broadcast_node) ++ tbb_add_test (buffer_node) ++ tbb_add_test (cache_aligned_allocator) ++ if (NOT WIN32) ++ tbb_add_test (cache_aligned_allocator_STL) ++ endif() ++ tbb_add_test (cilk_dynamic_load) ++ tbb_add_test (cilk_interop) ++ tbb_add_test (combinable) ++ tbb_add_test (composite_node) ++ tbb_add_test (concurrent_hash_map) ++ tbb_add_test (concurrent_lru_cache) ++ # tbb_add_test (concurrent_monitor) # too long ++ # tbb_add_test (concurrent_priority_queue) ++ tbb_add_test (concurrent_queue) ++ # tbb_add_test (concurrent_queue_whitebox) ++ tbb_add_test (concurrent_unordered_map) ++ # tbb_add_test (concurrent_unordered_set) ++ tbb_add_test (concurrent_vector) ++ tbb_add_test (continue_node) ++ tbb_add_test (critical_section) ++ tbb_add_test (dynamic_link) ++ # tbb_add_test (eh_algorithms) ++ tbb_add_test (eh_flow_graph) ++ # tbb_add_test (eh_tasks) ++ tbb_add_test (enumerable_thread_specific) ++ tbb_add_test (examples_common_utility) ++ # tbb_add_test (fast_random) ++ tbb_add_test (flow_graph) ++ tbb_add_test (flow_graph_whitebox) ++ # tbb_add_test (fp) # mingw: harness_fp.h:66, assertion !checkConsistency || (ctl.mxcsr & SSE_RND_MODE_MASK) >> 3 == (ctl.x87cw & FE_RND_MODE_MASK): failed ++ # tbb_add_test (function_node) # mingw:random timeout ++ # tbb_add_test (global_control) ++ # tbb_add_test (global_control_whitebox) ++ tbb_add_test (halt) ++ tbb_add_test (handle_perror) ++ # tbb_add_test (hw_concurrency) ++ tbb_add_test (indexer_node) ++ tbb_add_test (inits_loop) ++ tbb_add_test (intrusive_list) ++ tbb_add_test (ittnotify) ++ # tbb_add_test (join_node) #msvc/64: fatal error C1128: number of sections exceeded object file format limit: compile with /bigob ++ tbb_add_test (lambda) ++ tbb_add_test (limiter_node) ++ # tbb_add_test (malloc_atexit) ++ tbb_add_test (malloc_compliance) ++ tbb_add_test (malloc_init_shutdown) ++ # tbb_add_test (malloc_lib_unload) ++ # tbb_add_test (malloc_overload) ++ tbb_add_test (malloc_pools) ++ tbb_add_test (malloc_regression) ++ # tbb_add_test (malloc_used_by_lib) ++ # tbb_add_test (malloc_whitebox) ++ tbb_add_test (model_plugin) ++ # tbb_add_test (multifunction_node) # too long ++ tbb_add_test (mutex) ++ tbb_add_test (mutex_native_threads) ++ # tbb_add_test (opencl_node) ++ if (OPENMP_FOUND) ++ tbb_add_test (openmp) ++ endif () ++ tbb_add_test (overwrite_node) ++ # tbb_add_test (parallel_do) ++ if (NOT TBB_CI_BUILD) ++ # This seems to fail on CI platforms (AppVeyor/Travis), perhaps because the VM exposes just 1 core? ++ tbb_add_test (parallel_for) ++ endif() ++ tbb_add_test (parallel_for_each) ++ tbb_add_test (parallel_for_vectorization) ++ tbb_add_test (parallel_invoke) ++ tbb_add_test (parallel_pipeline) ++ tbb_add_test (parallel_reduce) ++ tbb_add_test (parallel_scan) ++ tbb_add_test (parallel_sort) ++ tbb_add_test (parallel_while) ++ # tbb_add_test (partitioner_whitebox) # too long ++ tbb_add_test (pipeline) ++ # tbb_add_test (pipeline_with_tbf) # takes forever on appveyor ++ tbb_add_test (priority_queue_node) ++ tbb_add_test (queue_node) ++ tbb_add_test (reader_writer_lock) ++ # tbb_add_test (runtime_loader) # LINK : fatal error LNK1104: cannot open file 'tbbproxy.lib' [C:\projects\tbb\test_runtime_loader.vcxproj] ++ tbb_add_test (rwm_upgrade_downgrade) ++ # tbb_add_test (ScalableAllocator) ++ if (NOT WIN32) ++ tbb_add_test (ScalableAllocator_STL) ++ endif() ++ tbb_add_test (semaphore) ++ # tbb_add_test (sequencer_node) # msvc: timeout ++ tbb_add_test (source_node) ++ tbb_add_test (split_node) ++ tbb_add_test (static_assert) ++ tbb_add_test (std_thread) ++ tbb_add_test (tagged_msg) ++ # tbb_add_test (task_arena) # LINK : fatal error LNK1104: cannot open file '__TBB_LIB_NAME.lib' [C:\projects\tbb\test_task_arena.vcxproj] ++ # tbb_add_test (task_assertions) ++ tbb_add_test (task_auto_init) ++ tbb_add_test (task) ++ # tbb_add_test (task_enqueue) # too long ++ tbb_add_test (task_group) ++ # tbb_add_test (task_leaks) ++ # tbb_add_test (task_priority) ++ # tbb_add_test (task_scheduler_init) # msvc: test_task_scheduler_init.cpp:68, assertion !test_mandatory_parallelism || Harness::CanReachConcurrencyLevel(threads): failed ++ tbb_add_test (task_scheduler_observer) ++ tbb_add_test (task_steal_limit) ++ tbb_add_test (tbb_condition_variable) ++ tbb_add_test (tbb_fork) ++ # tbb_add_test (tbb_header) ++ tbb_add_test (tbb_thread) ++ # tbb_add_test (tbb_version) ++ tbb_add_test (tick_count) ++ tbb_add_test (tuple) ++ tbb_add_test (write_once_node) ++ tbb_add_test (yield) ++endif () +\ No newline at end of file +diff --git a/./build/mingw_cross_toolchain.cmake b/./build/mingw_cross_toolchain.cmake +new file mode 100644 +index 0000000000..f0671b513c +--- /dev/null ++++ b/./build/mingw_cross_toolchain.cmake +@@ -0,0 +1,9 @@ ++# CMake toolchain file, cf. README.mingw_cross ++SET(CMAKE_SYSTEM_NAME Windows) ++include(CMakeForceCompiler) ++IF("${GNU_HOST}" STREQUAL "") ++ SET(GNU_HOST i586-mingw32msvc) ++ENDIF() ++# Prefix detection only works with compiler id "GNU" ++CMAKE_FORCE_C_COMPILER(${GNU_HOST}-gcc GNU) ++SET(CMAKE_RC_COMPILER ${GNU_HOST}-windres) +diff --git a/./build/version_string.ver.in b/./build/version_string.ver.in +new file mode 100644 +index 0000000000..bb9f96e8f2 +--- /dev/null ++++ b/./build/version_string.ver.in +@@ -0,0 +1,11 @@ ++#define __TBB_VERSION_STRINGS(N) \ ++#N": BUILD_HOST @CMAKE_SYSTEM_NAME@" ENDL \ ++#N": BUILD_OS @CMAKE_SYSTEM@" ENDL \ ++#N": BUILD_KERNEL @CMAKE_SYSTEM_VERSION@" ENDL \ ++#N": BUILD_GCC @CMAKE_CXX_COMPILER_ID@" ENDL \ ++#N": BUILD_LIBC Unknown" ENDL \ ++#N": BUILD_LD Unknown" ENDL \ ++#N": BUILD_TARGET Unknown" ENDL \ ++#N": BUILD_COMMAND Unknown" ENDL ++ ++#define __TBB_DATETIME "@_configure_date@" + diff --git a/TBB/patches/windows/002-cmake.patch b/TBB/patches/windows/002-cmake.patch new file mode 100644 index 0000000000..f0267b1543 --- /dev/null +++ b/TBB/patches/windows/002-cmake.patch @@ -0,0 +1,10 @@ +--- ./CMakeLists.txt 2021-12-22 12:35:01.012377400 -0500 ++++ ./CMakeLists.txt 2021-12-22 12:37:57.055092500 -0500 +@@ -45,6 +45,7 @@ + list(APPEND tbb_src ${CMAKE_CURRENT_SOURCE_DIR}/src/rml/client/rml_tbb.cpp) + file(GLOB to_remove "${CMAKE_CURRENT_SOURCE_DIR}/src/old/test*.cpp") + list(REMOVE_ITEM tbb_src ${to_remove}) ++list(REMOVE_ITEM tbb_src "${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/tbb_bind.cpp") + + set(tbbmalloc_static_src + src/tbbmalloc/backend.cpp diff --git a/TBB/patches/windows/msvc2017_workaround.patch b/TBB/patches/windows/msvc2017_workaround.patch new file mode 100644 index 0000000000..8aefdb506b --- /dev/null +++ b/TBB/patches/windows/msvc2017_workaround.patch @@ -0,0 +1,23 @@ +From acac892ffc3759bf9b0fd9bf0500f1cc7feb3c39 Mon Sep 17 00:00:00 2001 +From: alanb-sony <62992435+alanb-sony@users.noreply.github.com> +Date: Sat, 24 Oct 2020 10:31:15 +0100 +Subject: [PATCH] Workaround bug in visual studio 2017 + +Fixes #274 +--- + include/tbb/tbb_config.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/tbb/tbb_config.h b/include/tbb/tbb_config.h +index 7a8d06a03..886699d87 100644 +--- a/include/tbb/tbb_config.h ++++ b/include/tbb/tbb_config.h +@@ -620,7 +620,7 @@ There are four cases that are supported: + // instantiation site, which is too late for suppression of the corresponding messages for internal + // stuff. + #if !defined(__INTEL_COMPILER) && (!defined(TBB_SUPPRESS_DEPRECATED_MESSAGES) || (TBB_SUPPRESS_DEPRECATED_MESSAGES == 0)) +- #if (__cplusplus >= 201402L) ++ #if (__cplusplus >= 201402L && (!defined(_MSC_VER) || _MSC_VER >= 1920)) + #define __TBB_DEPRECATED [[deprecated]] + #define __TBB_DEPRECATED_MSG(msg) [[deprecated(msg)]] + #elif _MSC_VER From 03e2b08c0e4f639ac761734f68dd4d6992ea5710 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 2 May 2018 10:50:26 -0400 Subject: [PATCH 23/53] BitstreamVera : add Windows configuration --- BitstreamVera/config.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BitstreamVera/config.py b/BitstreamVera/config.py index 0e1e4391dc..3ba67f9a5d 100644 --- a/BitstreamVera/config.py +++ b/BitstreamVera/config.py @@ -21,5 +21,15 @@ "fonts", ], + "platform:windows" : { + + "commands" : [ + + "if not exist \"{buildDir}\\fonts\" mkdir {buildDir}\\fonts", + "copy *.ttf {buildDir}\\fonts" + + ] + + } } From fa703cde0efa050715bd07b21dec15e3bbed8a5f Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Mon, 9 Jul 2018 17:50:25 -0400 Subject: [PATCH 24/53] GLEW : add Windows configuration --- GLEW/config.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/GLEW/config.py b/GLEW/config.py index 5c6e376761..22a734f476 100644 --- a/GLEW/config.py +++ b/GLEW/config.py @@ -19,8 +19,25 @@ "manifest" : [ "include/GL", - "lib/libGLEW*{sharedLibraryExtension}*", + "lib/{libraryPrefix}GLEW*{sharedLibraryExtension}*", + "lib/{libraryPrefix}GLEW*.lib", ], + "platform:windows" : { + + "commands" : [ + + "if not exist \"build\" mkdir build", + "cd build &&" + " cmake" + " -Wno-dev" + " -G {cmakeGenerator}" + " -DCMAKE_INSTALL_PREFIX={buildDir}" + " ..\\build\\cmake", + "cd build && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}", + "copy {buildDir}\\bin\\{libraryPrefix}GLEW*{sharedLibraryExtension}* {buildDir}\\lib\\", + ] + + } } From 8a0a4a79af8c0ce264db402cd27d5396a0ce9ea0 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 2 May 2018 10:52:55 -0400 Subject: [PATCH 25/53] OpenColorIO : add Windows configuration --- OpenColorIO/config.py | 48 ++++++++++++++++++- .../patches/windows/cmake_backslash_fix.patch | 12 +++++ .../patches/windows/pyglue_cmakelists.patch | 14 ++++++ 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 OpenColorIO/patches/windows/cmake_backslash_fix.patch create mode 100644 OpenColorIO/patches/windows/pyglue_cmakelists.patch diff --git a/OpenColorIO/config.py b/OpenColorIO/config.py index 9e41737275..c4e110fcde 100644 --- a/OpenColorIO/config.py +++ b/OpenColorIO/config.py @@ -50,10 +50,56 @@ "manifest" : [ "include/OpenColorIO", - "lib/libOpenColorIO*{sharedLibraryExtension}*", + "lib/{libraryPrefix}OpenColorIO*{sharedLibraryExtension}*", + "lib/{libraryPrefix}OpenColorIO*.lib", "openColorIO", "python/PyOpenColorIO*", ], + "platform:windows" : { + + "variables" : { + + "cmakeBuildType" : "Release", + "cmakeGenerator": "\"Visual Studio 15 2017 Win64\"", + + }, + + "environment" : { + + "PATH" : "%PATH%;%ROOT_DIR%\\winbuild\\patch\\bin", + + }, + + "commands" : [ + + #OCIO is particular about needing all slashes to be forward slashes + "cmake" + " -Wno-dev -G {cmakeGenerator}" + " -DCMAKE_BUILD_TYPE={cmakeBuildType}" + " -DCMAKE_INSTALL_PREFIX={buildDir}" + " -DPYTHON={buildDir}\\bin\\python.exe" + " -DOCIO_USE_BOOST_PTR=1" + " -DOCIO_BUILD_TRUELIGHT=OFF" + " -DOCIO_BUILD_APPS=OFF" + " -DOCIO_BUILD_NUKE=OFF" + " -DOCIO_BUILD_STATIC=OFF" + " -DOCIO_BUILD_SHARED=ON" + " -DOCIO_BUILD_PYGLUE=ON" + " -DPYTHON_VERSION={pythonVersion}" + " -DPYTHON_INCLUDE={pythonIncludeDir}" + " -DPYTHON_LIB={pythonLibDir}" + " -DOCIO_PYGLUE_LINK=ON" + " .", + "cmake --build . --config {cmakeBuildType} --target install", + "if not exist \"{buildDir}\\python\" mkdir {buildDir}\\python", + "copy {buildDir}\\PyOpenColorIO.dll {buildDir}\\python\\PyOpenColorIO.pyd", + "if not exist \"{buildDir}\\openColorIO\" mkdir {buildDir}\\openColorIO", + "if not exist \"{buildDir}\\openColorIO\\luts\" mkdir {buildDir}\\openColorIO\\luts", + "copy ..\\OpenColorIO-Configs-1.0_r2\\nuke-default\\config.ocio {buildDir}\\openColorIO", + "xcopy /s /e /h /y /i ..\\OpenColorIO-Configs-1.0_r2\\nuke-default\\luts {buildDir}\\openColorIO\\luts", + ], + + }, } diff --git a/OpenColorIO/patches/windows/cmake_backslash_fix.patch b/OpenColorIO/patches/windows/cmake_backslash_fix.patch new file mode 100644 index 0000000000..b1c4364def --- /dev/null +++ b/OpenColorIO/patches/windows/cmake_backslash_fix.patch @@ -0,0 +1,12 @@ +diff --git a/./CMakeLists.txt b/./CMakeLists.txt +--- ./CMakeLists.txt ++++ ./CMakeLists.txt +@@ -125,6 +125,8 @@ + + if(WIN32) + if(PYTHON_VERSION AND PYTHON_INCLUDE AND PYTHON_LIB) ++ file(TO_CMAKE_PATH ${PYTHON_INCLUDE} PYTHON_INCLUDE) ++ file(TO_CMAKE_PATH ${PYTHON_LIB} PYTHON_LIB) + set(EXTDIST_PYTHONPATH ${PYTHON_LIB}/python${PYTHON_VARIANT_PATH}/site-packages) + set(PYTHONPATH ${EXTDIST_PYTHONPATH};$ENV{PYTHONPATH}) + set(PYTHON_OK YES) diff --git a/OpenColorIO/patches/windows/pyglue_cmakelists.patch b/OpenColorIO/patches/windows/pyglue_cmakelists.patch new file mode 100644 index 0000000000..505fd835d9 --- /dev/null +++ b/OpenColorIO/patches/windows/pyglue_cmakelists.patch @@ -0,0 +1,14 @@ +diff --git a/src/pyglue/CMakeLists.txt b/src/pyglue/CMakeLists.txt +--- ./src/pyglue/CMakeLists.txt ++++ ./src/pyglue/CMakeLists.txt +@@ -56,8 +56,8 @@ + if(WIN32) + if(OCIO_PYGLUE_LINK) + target_link_libraries(PyOpenColorIO OpenColorIO +- debug ${PYTHON_LIB}/python26_d.lib +- optimized ${PYTHON_LIB}/python26.lib) ++ debug ${PYTHON_LIB}/python37_d.lib ++ optimized ${PYTHON_LIB}/python37.lib) + else() + target_link_libraries(PyOpenColorIO OpenColorIO) + endif(OCIO_PYGLUE_LINK) From e2c97dca62f75535ec6ae8d88770dc5bd0e74a13 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 10 Jul 2018 10:25:42 -0400 Subject: [PATCH 26/53] OpenImageIO : add Windows configuration --- OpenImageIO/config.py | 52 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/OpenImageIO/config.py b/OpenImageIO/config.py index e85a8e28c5..82226f3e61 100644 --- a/OpenImageIO/config.py +++ b/OpenImageIO/config.py @@ -69,14 +69,60 @@ "manifest" : [ - "bin/maketx", - "bin/oiiotool", + "bin/maketx{executableExtension}", + "bin/oiiotool{executableExtension}", "include/OpenImageIO", - "lib/libOpenImageIO*{sharedLibraryExtension}*", + "lib/{libraryPrefix}OpenImageIO*{sharedLibraryExtension}*", + "lib/{libraryPrefix}OpenImageIO*.lib", "doc/openimageio.pdf", ], + "platform:windows" : { + + "environment" : { + + "PATH" : "{buildDir}/bin;{buildDir}/lib;%PATH%", + + }, + + "commands" : [ + + "mkdir gafferBuild", + "cd gafferBuild &&" + " cmake" + " -G {cmakeGenerator}" + " -D CMAKE_CXX_STANDARD={c++Standard}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDirFwd}" + " -D CMAKE_PREFIX_PATH={buildDirFwd}" + " -D USE_FFMPEG=OFF" + " -D USE_QT=OFF" + " -D USE_PYTHON=OFF" + " -D BUILDSTATIC=OFF" + " -D BOOST_ROOT={buildDirFwd}" + " -D OPENEXR_INCLUDE_PATH={buildDirFwd}/include" + " -D OPENEXR_IMATH_LIBRARY={buildDirFwd}/lib/Imath.lib" + " -D OPENEXR_ILMIMF_LIBRARY={buildDirFwd}/lib/IlmImf.lib" + " -D OPENEXR_IEX_LIBRARY={buildDirFwd}/lib/Iex.lib" + " -D OPENEXR_ILMTHREAD_LIBRARY={buildDirFwd}/lib/IlmThread.lib" + " -D ZLIB_INCLUDE_DIR={buildDirFwd}/include" + " -D ZLIB_LIBRARY={buildDirFwd}/lib/zlib.lib" + " -D PNG_PNG_INCLUDE_DIR={buildDirFwd}/include" + " -D PNG_LIBRARY={buildDirFwd}/lib/libpng16.lib" + " -D JPEG_INCLUDE_DIR={buildDirFwd}/include" + " -D JPEG_LIBRARY={buildDirFwd}/lib/jpeg.lib" + " -D TIFF_INCLUDE_DIR={buildDirFwd}/include" + " -D TIFF_LIBRARY={buildDirFwd}/lib/libtiff.lib" + " -D PYTHON_INCLUDE_DIR={pythonIncludeDir}" + " -D PYTHON_LIBRARY={pythonLibDir}/python{pythonMajorVersion}{pythonMinorVersion}.lib" + " -D OCIO_LIBRARY_PATH={buildDirFwd}/lib/OpenColorIO.lib" + " ..", + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}", + "copy {buildDir}\\bin\\{libraryPrefix}OpenImageIO*{sharedLibraryExtension}* {buildDir}\\lib\\", + ] + + } } From eec9740d499962bca9c97e9cb0bb8d1e201db7cd Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 2 May 2018 10:49:25 -0400 Subject: [PATCH 27/53] Blosc : add Windows configuration --- Blosc/config.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Blosc/config.py b/Blosc/config.py index d0abeadc3b..3dcae98ae7 100644 --- a/Blosc/config.py +++ b/Blosc/config.py @@ -22,8 +22,30 @@ "manifest" : [ "include/blosc*.h", - "lib/libblosc*{sharedLibraryExtension}*", + "lib/{libraryPrefix}blosc*{sharedLibraryExtension}*", + "lib/{libraryPrefix}blosc*.lib", ], + "platform:windows" : { + + "commands" : [ + + "mkdir gafferBuild", + "cd gafferBuild && " + " cmake" + " -Wno-dev" + " -G {cmakeGenerator}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D BUILD_TESTS=OFF" + " -D BUILD_BENCHMARKS=OFF" + " -D BUILD_STATIC=OFF" + " ..", + + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}", + + ], + + }, } From e5115336aa003464d08289b752a134230ef43aa7 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 2 May 2018 10:52:36 -0400 Subject: [PATCH 28/53] LLVM : add Windows configuration --- LLVM/config.py | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/LLVM/config.py b/LLVM/config.py index 3f15318bd9..b7147e3c42 100644 --- a/LLVM/config.py +++ b/LLVM/config.py @@ -17,12 +17,34 @@ "mkdir build", "cd build &&" " cmake" - " -DCMAKE_INSTALL_PREFIX={buildDir}" - " -DCMAKE_BUILD_TYPE=Release" - " -DLLVM_ENABLE_RTTI=ON" + " -G {cmakeGenerator}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D LLVM_ENABLE_RTTI=ON" " ..", - "cd build && make install -j {jobs}" + "cd build && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}" ], + "platform:windows" : { + + "commands" : [ + + "move ..\\clang* tools\\clang", + "mkdir build", + "cd build &&" + " cmake" + " -G {cmakeGenerator}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D BUILD_SHARED_LIBS=OFF" + " -D LLVM_REQUIRES_RTTI=ON" + " -D LLVM_TARGETS_TO_BUILD=\"X86\"" + " ..", + "cd build && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}", + + ], + + } + } From 8b9b66a89a134eff39ceb08e1e430cbef680b752 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 2 May 2018 10:53:46 -0400 Subject: [PATCH 29/53] OpenShadingLanguage : add Windows configuration --- OpenShadingLanguage/config.py | 57 ++++++++++++++++++- .../{ => osx}/llvmCompileFlagsMac.patch | 0 .../patches/windows/testsDisabled.patch | 28 +++++++++ 3 files changed, 82 insertions(+), 3 deletions(-) rename OpenShadingLanguage/patches/{ => osx}/llvmCompileFlagsMac.patch (100%) create mode 100644 OpenShadingLanguage/patches/windows/testsDisabled.patch diff --git a/OpenShadingLanguage/config.py b/OpenShadingLanguage/config.py index 83ea18e845..ec8e420eed 100644 --- a/OpenShadingLanguage/config.py +++ b/OpenShadingLanguage/config.py @@ -45,14 +45,65 @@ "manifest" : [ - "bin/oslc", - "bin/oslinfo", + "bin/oslc{executableExtension}", + "bin/oslinfo{executableExtension}", "include/OSL", - "lib/libosl*", + "lib/{libraryPrefix}osl*", "lib/osl.imageio.*", "doc/osl*", "shaders", ], + "platform:windows" : { + + "variables" : { + + "version" : "1.11.11.0", + + }, + + "environment" : { + "PATH" : "{buildDir}\\lib;{buildDir}\\bin;%ROOT_DIR%\\OpenShadingLanguage\\working\\OpenShadingLanguage-Release-{version}\\gafferBuild\\src\\liboslcomp;%ROOT_DIR%\\OpenShadingLanguage\\working\\OpenShadingLanguage-Release-{version}\\gafferBuild\\src\\oslc;%PATH%", + + }, + + "commands" : [ + "mkdir gafferBuild", + "cd gafferBuild &&" + " cmake" + " -Wno-dev -G {cmakeGenerator}" + " -D CMAKE_CXX_STANDARD={c++Standard}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D BUILDSTATIC=OFF" + " -D USE_OIIO_STATIC=OFF" + " -D OSL_BUILD_PLUGINS=OFF" + " -D ENABLERTTI=1" + " -D CMAKE_PREFIX_PATH={buildDir}" + " -D STOP_ON_WARNING=0" + " -D LLVM_DIRECTORY={buildDir}" + " -D USE_LLVM_BITCODE=OFF" + " -D OSL_BUILD_TESTS=OFF" + " -D BOOST_ROOT={buildDir}" + " -D Boost_USE_STATIC_LIBS=OFF" + " -D LLVM_STATIC=ON" + " -D OPENEXR_INCLUDE_PATH={buildDir}\\include" + " -D OPENEXR_IMATH_LIBRARY={buildDir}\\lib\\Imath.lib" + " -D OPENEXR_ILMIMF_LIBRARY={buildDir}\\lib\\IlmImf.lib" + " -D OPENEXR_IEX_LIBRARY={buildDir}\\lib\\Iex.lib" + " -D OPENEXR_ILMTHREAD_LIBRARY={buildDir}\\lib\\IlmThread.lib" + " -D OPENIMAGEIOHOME={buildDir}" + " -D ZLIB_INCLUDE_DIR={buildDir}\\include" + " -D ZLIB_LIBRARY={buildDir}\\lib\\zlib.lib" + " -D EXTRA_CPP_ARGS=\" /D TINYFORMAT_ALLOW_WCHAR_STRINGS\"" + " -D OSL_BUILD_MATERIALX=1" + " -D OSL_SHADER_INSTALL_DIR={buildDir}\\shaders" + " ..", + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}", + "copy {buildDir}\\bin\\{libraryPrefix}osl* {buildDir}\\lib\\", + + ], + + } } diff --git a/OpenShadingLanguage/patches/llvmCompileFlagsMac.patch b/OpenShadingLanguage/patches/osx/llvmCompileFlagsMac.patch similarity index 100% rename from OpenShadingLanguage/patches/llvmCompileFlagsMac.patch rename to OpenShadingLanguage/patches/osx/llvmCompileFlagsMac.patch diff --git a/OpenShadingLanguage/patches/windows/testsDisabled.patch b/OpenShadingLanguage/patches/windows/testsDisabled.patch new file mode 100644 index 0000000000..518fb91297 --- /dev/null +++ b/OpenShadingLanguage/patches/windows/testsDisabled.patch @@ -0,0 +1,28 @@ +From 14bd942f1bbb621c729f01c982925acd6d263d58 Mon Sep 17 00:00:00 2001 +From: debaetsd +Date: Tue, 29 Dec 2020 22:01:21 +0100 +Subject: [PATCH] fixed cmake setup when tests are disabled (#1319) + +--- + CMakeLists.txt | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 990f50d69..46ef7351d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -252,11 +252,9 @@ install (EXPORT OSL_EXPORTED_TARGETS + FILE ${OSL_TARGETS_EXPORT_NAME} + NAMESPACE ${PROJECT_NAME}::) + +- +- +- +-osl_add_all_tests() +- ++if (${PROJECT_NAME}_BUILD_TESTS AND NOT ${PROJECT_NAME}_IS_SUBPROJECT) ++ osl_add_all_tests() ++endif () + + if (NOT ${PROJECT_NAME}_IS_SUBPROJECT) + include (packaging) From 45c448b2fbbf7ab313ad25fb3a9c1ce819f2f02e Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 2 May 2018 10:51:44 -0400 Subject: [PATCH 30/53] HDF5 : add Windows configuration --- HDF5/config.py | 45 +- HDF5/patches/windows/h50mtime.patch | 575 ++++++ HDF5/patches/windows/long_long_test_fix.patch | 1695 +++++++++++++++++ 3 files changed, 2314 insertions(+), 1 deletion(-) create mode 100644 HDF5/patches/windows/h50mtime.patch create mode 100644 HDF5/patches/windows/long_long_test_fix.patch diff --git a/HDF5/config.py b/HDF5/config.py index 80e7fb6dc1..df4e5f9b95 100644 --- a/HDF5/config.py +++ b/HDF5/config.py @@ -21,8 +21,51 @@ "manifest" : [ - "lib/libhdf5*{sharedLibraryExtension}*", + "lib/{libraryPrefix}hdf5*{sharedLibraryExtension}*", + "lib/{libraryPrefix}hdf5*.lib", ], + + # Note that JOM can't be used due to it generating the following errors: + # [ 1%] Generating ../H5Tinit.c + # The process cannot access the file because it is being used by another process. + # [ 1%] Generating ../H5lib_settings.c + # jom: M:\gafferDependencies\HDF5\working\hdf5-1.8.20\build\src\CMakeFiles\hdf5-shared.dir\build.make [H5Tinit.c] Error 1 + # The process cannot access the file because it is being used by another process. + # jom: M:\gafferDependencies\HDF5\working\hdf5-1.8.20\build\src\CMakeFiles\hdf5-shared.dir\build.make [H5lib_settings.c] Error 1 + # Scanning dependencies of target hdf5-static + # jom: M:\gafferDependencies\HDF5\working\hdf5-1.8.20\build\CMakeFiles\Makefile2 [src\CMakeFiles\hdf5-shared.dir\all] Error 2 + # jom: M:\gafferDependencies\HDF5\working\hdf5-1.8.20\build\Makefile [all] Error 2 + + "platform:windows" : { + + "variables" : { + + "cmakeGenerator" : "\"Visual Studio 15 2017 Win64\"", + + }, + + "commands" : [ + "if not exist \"build\" mkdir build", + "cd build &&" + " cmake" + " -C ..\\config\\cmake\\cacheinit.cmake" + " -Wno-dev" + " -G {cmakeGenerator}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D HDF5_ENABLE_THREADSAFE=ON" + " -D BUILD_SHARED_LIBS=ON" + " -D BUILD_TESTING=OFF" + " -D HDF5_BUILD_EXAMPLES=OFF" + " -D HDF5_BUILD_FORTRAN=OFF" + " -D HDF5_ENABLE_SZIP_SUPPORT=OFF" + " -D ZLIB_ROOT={buildDir}" + " ..", + "cd build && cmake --build . --config {cmakeBuildType} --target install", + "copy {buildDir}\\bin\\{libraryPrefix}hdf5*{sharedLibraryExtension}* {buildDir}\\lib\\", + ], + + } } diff --git a/HDF5/patches/windows/h50mtime.patch b/HDF5/patches/windows/h50mtime.patch new file mode 100644 index 0000000000..30cb3f58f1 --- /dev/null +++ b/HDF5/patches/windows/h50mtime.patch @@ -0,0 +1,575 @@ +From 4078bf8d5c36212d63684284277bf4f9d114d6eb Mon Sep 17 00:00:00 2001 +From: Alex Fuller +Date: Sun, 17 Sep 2017 18:58:41 -0700 +Subject: [PATCH] Small MSVC 2015 fix for HDF5 + +--- + hdf5-1.8.20/src/H5Omtime.c | 556 +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 556 insertions(+) + create mode 100644 hdf5-1.8.20/src/H5Omtime.c + +diff --git a/hdf5-1.8.20/src/H5Omtime.c b/hdf5-1.8.20/src/H5Omtime.c +new file mode 100644 +index 0000000000..71fca5f222 +--- /dev/null ++++ b/hdf5-1.8.20/src/H5Omtime.c +@@ -0,0 +1,556 @@ ++/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ++ * Copyright by The HDF Group. * ++ * Copyright by the Board of Trustees of the University of Illinois. * ++ * All rights reserved. * ++ * * ++ * This file is part of HDF5. The full HDF5 copyright notice, including * ++ * terms governing use, modification, and redistribution, is contained in * ++ * the files COPYING and Copyright.html. COPYING can be found at the root * ++ * of the source code distribution tree; Copyright.html can be found at the * ++ * root level of an installed copy of the electronic HDF5 document set and * ++ * is linked from the top-level documents page. It can also be found at * ++ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * ++ * access to either file, you may request a copy from help@hdfgroup.org. * ++ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ ++ ++/* Programmer: Robb Matzke ++ * Friday, July 24, 1998 ++ * ++ * Purpose: The object modification time message. ++ */ ++ ++#define H5O_PACKAGE /*suppress error about including H5Opkg */ ++ ++#include "H5private.h" /* Generic Functions */ ++#include "H5Eprivate.h" /* Error handling */ ++#include "H5FLprivate.h" /* Free lists */ ++#include "H5MMprivate.h" /* Memory management */ ++#include "H5Opkg.h" /* Object headers */ ++ ++ ++static void *H5O_mtime_new_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, ++ unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); ++static herr_t H5O_mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); ++static size_t H5O_mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); ++ ++static void *H5O_mtime_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, ++ unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); ++static herr_t H5O_mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); ++static void *H5O_mtime_copy(const void *_mesg, void *_dest); ++static size_t H5O_mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); ++static herr_t H5O_mtime_reset(void *_mesg); ++static herr_t H5O_mtime_free(void *_mesg); ++static herr_t H5O_mtime_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, ++ int indent, int fwidth); ++ ++/* This message derives from H5O message class */ ++const H5O_msg_class_t H5O_MSG_MTIME[1] = {{ ++ H5O_MTIME_ID, /*message id number */ ++ "mtime", /*message name for debugging */ ++ sizeof(time_t), /*native message size */ ++ 0, /* messages are sharable? */ ++ H5O_mtime_decode, /*decode message */ ++ H5O_mtime_encode, /*encode message */ ++ H5O_mtime_copy, /*copy the native value */ ++ H5O_mtime_size, /*raw message size */ ++ H5O_mtime_reset, /* reset method */ ++ H5O_mtime_free, /* free method */ ++ NULL, /* file delete method */ ++ NULL, /* link method */ ++ NULL, /*set share method */ ++ NULL, /*can share method */ ++ NULL, /* pre copy native value to file */ ++ NULL, /* copy native value to file */ ++ NULL, /* post copy native value to file */ ++ NULL, /* get creation index */ ++ NULL, /* set creation index */ ++ H5O_mtime_debug /*debug the message */ ++}}; ++ ++/* This message derives from H5O message class */ ++/* (Only encode, decode & size routines are different from old mtime routines) */ ++const H5O_msg_class_t H5O_MSG_MTIME_NEW[1] = {{ ++ H5O_MTIME_NEW_ID, /*message id number */ ++ "mtime_new", /*message name for debugging */ ++ sizeof(time_t), /*native message size */ ++ 0, /* messages are sharable? */ ++ H5O_mtime_new_decode, /*decode message */ ++ H5O_mtime_new_encode, /*encode message */ ++ H5O_mtime_copy, /*copy the native value */ ++ H5O_mtime_new_size, /*raw message size */ ++ H5O_mtime_reset, /* reset method */ ++ H5O_mtime_free, /* free method */ ++ NULL, /* file delete method */ ++ NULL, /* link method */ ++ NULL, /*set share method */ ++ NULL, /*can share method */ ++ NULL, /* pre copy native value to file */ ++ NULL, /* copy native value to file */ ++ NULL, /* post copy native value to file */ ++ NULL, /* get creation index */ ++ NULL, /* set creation index */ ++ H5O_mtime_debug /*debug the message */ ++}}; ++ ++/* Current version of new mtime information */ ++#define H5O_MTIME_VERSION 1 ++ ++/* Track whether tzset routine was called */ ++static hbool_t ntzset = FALSE; ++ ++/* Declare a free list to manage the time_t struct */ ++H5FL_DEFINE(time_t); ++ ++ ++/*------------------------------------------------------------------------- ++ * Function: H5O_mtime_new_decode ++ * ++ * Purpose: Decode a new modification time message and return a pointer to a ++ * new time_t value. ++ * ++ * Return: Success: Ptr to new message in native struct. ++ * ++ * Failure: NULL ++ * ++ * Programmer: Quincey Koziol ++ * koziol@ncsa.uiuc.edu ++ * Jan 3 2002 ++ * ++ *------------------------------------------------------------------------- ++ */ ++static void * ++H5O_mtime_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, ++ unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) ++{ ++ time_t *mesg; ++ uint32_t tmp_time; /* Temporary copy of the time */ ++ void *ret_value; /* Return value */ ++ ++ FUNC_ENTER_NOAPI_NOINIT ++ ++ /* check args */ ++ assert(f); ++ assert(p); ++ ++ /* decode */ ++ if(*p++ != H5O_MTIME_VERSION) ++ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for mtime message"); ++ ++ /* Skip reserved bytes */ ++ p+=3; ++ ++ /* Get the time_t from the file */ ++ UINT32DECODE(p, tmp_time); ++ ++ /* The return value */ ++ if (NULL==(mesg = H5FL_MALLOC(time_t))) ++ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); ++ *mesg = (time_t)tmp_time; ++ ++ /* Set return value */ ++ ret_value=mesg; ++ ++done: ++ FUNC_LEAVE_NOAPI(ret_value) ++} /* end H5O_mtime_new_decode() */ ++ ++ ++/*------------------------------------------------------------------------- ++ * Function: H5O_mtime_decode ++ * ++ * Purpose: Decode a modification time message and return a pointer to a ++ * new time_t value. ++ * ++ * Return: Success: Ptr to new message in native struct. ++ * ++ * Failure: NULL ++ * ++ * Programmer: Robb Matzke ++ * matzke@llnl.gov ++ * Jul 24 1998 ++ * ++ *------------------------------------------------------------------------- ++ */ ++static void * ++H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, ++ unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) ++{ ++ time_t *mesg, the_time; ++ int i; ++ struct tm tm; ++ void *ret_value; /* Return value */ ++ ++ FUNC_ENTER_NOAPI_NOINIT ++ ++ /* check args */ ++ HDassert(f); ++ HDassert(p); ++ ++ /* Initialize time zone information */ ++ if(!ntzset) { ++ HDtzset(); ++ ntzset = TRUE; ++ } /* end if */ ++ ++ /* decode */ ++ for(i = 0; i < 14; i++) ++ if(!HDisdigit(p[i])) ++ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message") ++ ++ /* ++ * Convert YYYYMMDDhhmmss UTC to a time_t. This is a little problematic ++ * because mktime() operates on local times. We convert to local time ++ * and then figure out the adjustment based on the local time zone and ++ * daylight savings setting. ++ */ ++ HDmemset(&tm, 0, sizeof tm); ++ tm.tm_year = (p[0]-'0')*1000 + (p[1]-'0')*100 + ++ (p[2]-'0')*10 + (p[3]-'0') - 1900; ++ tm.tm_mon = (p[4]-'0')*10 + (p[5]-'0') - 1; ++ tm.tm_mday = (p[6]-'0')*10 + (p[7]-'0'); ++ tm.tm_hour = (p[8]-'0')*10 + (p[9]-'0'); ++ tm.tm_min = (p[10]-'0')*10 + (p[11]-'0'); ++ tm.tm_sec = (p[12]-'0')*10 + (p[13]-'0'); ++ tm.tm_isdst = -1; /*figure it out*/ ++ if((time_t)-1 == (the_time = HDmktime(&tm))) ++ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message") ++ ++#if defined(H5_HAVE_TM_GMTOFF) ++ /* FreeBSD, OSF 4.0 */ ++ the_time += tm.tm_gmtoff; ++#elif defined(H5_HAVE___TM_GMTOFF) ++ /* Linux libc-4 */ ++ the_time += tm.__tm_gmtoff; ++#elif defined(H5_HAVE_TIMEZONE) ++ /* Linux libc-5 */ ++ /* Fix for MSVC >= 1900 */ ++#ifdef _MSC_VER >= 1900 ++ the_time -= _timezone - (tm.tm_isdst?3600:0); ++#else ++ the_time -= timezone - (tm.tm_isdst?3600:0); ++#endif ++#elif defined(H5_HAVE_BSDGETTIMEOFDAY) && defined(H5_HAVE_STRUCT_TIMEZONE) ++ /* Irix5.3 */ ++ { ++ struct timezone tz; ++ ++ if(HDBSDgettimeofday(NULL, &tz) < 0) ++ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information") ++ the_time -= tz.tz_minuteswest * 60 - (tm.tm_isdst ? 3600 : 0); ++ } ++#elif defined(H5_HAVE_GETTIMEOFDAY) && defined(H5_HAVE_STRUCT_TIMEZONE) && defined(H5_GETTIMEOFDAY_GIVES_TZ) ++ { ++ struct timezone tz; ++ struct timeval tv; /* Used as a placebo; some systems don't like NULL */ ++ ++ if(HDgettimeofday(&tv, &tz) < 0) ++ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information") ++ ++ the_time -= tz.tz_minuteswest * 60 - (tm.tm_isdst ? 3600 : 0); ++ } ++#else ++ /* ++ * The catch-all. If we can't convert a character string universal ++ * coordinated time to a time_t value reliably then we can't decode the ++ * modification time message. This really isn't as bad as it sounds -- the ++ * only way a user can get the modification time is from our internal ++ * query routines, which can gracefully recover. ++ */ ++ ++ /* Irix64 */ ++ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information") ++#endif ++ ++ /* The return value */ ++ if(NULL == (mesg = H5FL_MALLOC(time_t))) ++ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") ++ *mesg = the_time; ++ ++ /* Set return value */ ++ ret_value = mesg; ++ ++done: ++ FUNC_LEAVE_NOAPI(ret_value) ++} /* end H5O_mtime_decode() */ ++ ++ ++/*------------------------------------------------------------------------- ++ * Function: H5O_mtime_new_encode ++ * ++ * Purpose: Encodes a new modification time message. ++ * ++ * Return: Non-negative on success/Negative on failure ++ * ++ * Programmer: Quincey Koziol ++ * koziol@ncsa.uiuc.edu ++ * Jan 3 2002 ++ * ++ *------------------------------------------------------------------------- ++ */ ++static herr_t ++H5O_mtime_new_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) ++{ ++ const time_t *mesg = (const time_t *) _mesg; ++ ++ FUNC_ENTER_NOAPI_NOINIT_NOERR ++ ++ /* check args */ ++ assert(f); ++ assert(p); ++ assert(mesg); ++ ++ /* Version */ ++ *p++ = H5O_MTIME_VERSION; ++ ++ /* Reserved bytes */ ++ *p++ = 0; ++ *p++ = 0; ++ *p++ = 0; ++ ++ /* Encode time */ ++ UINT32ENCODE(p, *mesg); ++ ++ FUNC_LEAVE_NOAPI(SUCCEED) ++} /* end H5O_mtime_new_encode() */ ++ ++ ++/*------------------------------------------------------------------------- ++ * Function: H5O_mtime_encode ++ * ++ * Purpose: Encodes a modification time message. ++ * ++ * Return: Non-negative on success/Negative on failure ++ * ++ * Programmer: Robb Matzke ++ * matzke@llnl.gov ++ * Jul 24 1998 ++ * ++ * Modifications: ++ * ++ *------------------------------------------------------------------------- ++ */ ++static herr_t ++H5O_mtime_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, const void *_mesg) ++{ ++ const time_t *mesg = (const time_t *) _mesg; ++ struct tm *tm; ++ ++ FUNC_ENTER_NOAPI_NOINIT_NOERR ++ ++ /* check args */ ++ assert(f); ++ assert(p); ++ assert(mesg); ++ ++ /* encode */ ++ tm = HDgmtime(mesg); ++ sprintf((char*)p, "%04d%02d%02d%02d%02d%02d", ++ 1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday, ++ tm->tm_hour, tm->tm_min, tm->tm_sec); ++ ++ FUNC_LEAVE_NOAPI(SUCCEED) ++} ++ ++ ++/*------------------------------------------------------------------------- ++ * Function: H5O_mtime_copy ++ * ++ * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if ++ * necessary. ++ * ++ * Return: Success: Ptr to _DEST ++ * ++ * Failure: NULL ++ * ++ * Programmer: Robb Matzke ++ * matzke@llnl.gov ++ * Jul 24 1998 ++ * ++ * Modifications: ++ * ++ *------------------------------------------------------------------------- ++ */ ++static void * ++H5O_mtime_copy(const void *_mesg, void *_dest) ++{ ++ const time_t *mesg = (const time_t *) _mesg; ++ time_t *dest = (time_t *) _dest; ++ void *ret_value; /* Return value */ ++ ++ FUNC_ENTER_NOAPI_NOINIT ++ ++ /* check args */ ++ assert(mesg); ++ if (!dest && NULL==(dest = H5FL_MALLOC(time_t))) ++ HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); ++ ++ /* copy */ ++ *dest = *mesg; ++ ++ /* Set return value */ ++ ret_value=dest; ++ ++done: ++ FUNC_LEAVE_NOAPI(ret_value) ++} ++ ++ ++/*------------------------------------------------------------------------- ++ * Function: H5O_mtime_new_size ++ * ++ * Purpose: Returns the size of the raw message in bytes not ++ * counting the message type or size fields, but only the data ++ * fields. This function doesn't take into account ++ * alignment. ++ * ++ * Return: Success: Message data size in bytes w/o alignment. ++ * ++ * Failure: 0 ++ * ++ * Programmer: Quincey Koziol ++ * koziol@ncsa.uiuc.edu ++ * Jan 3 2002 ++ * ++ * Modifications: ++ * ++ *------------------------------------------------------------------------- ++ */ ++static size_t ++H5O_mtime_new_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const void UNUSED * mesg) ++{ ++ FUNC_ENTER_NOAPI_NOINIT_NOERR ++ ++ /* check args */ ++ assert(f); ++ assert(mesg); ++ ++ FUNC_LEAVE_NOAPI(8) ++} /* end H5O_mtime_new_size() */ ++ ++ ++/*------------------------------------------------------------------------- ++ * Function: H5O_mtime_size ++ * ++ * Purpose: Returns the size of the raw message in bytes not ++ * counting the message type or size fields, but only the data ++ * fields. This function doesn't take into account ++ * alignment. ++ * ++ * Return: Success: Message data size in bytes w/o alignment. ++ * ++ * Failure: 0 ++ * ++ * Programmer: Robb Matzke ++ * matzke@llnl.gov ++ * Jul 14 1998 ++ * ++ * Modifications: ++ * ++ *------------------------------------------------------------------------- ++ */ ++static size_t ++H5O_mtime_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const void UNUSED * mesg) ++{ ++ FUNC_ENTER_NOAPI_NOINIT_NOERR ++ ++ /* check args */ ++ assert(f); ++ assert(mesg); ++ ++ FUNC_LEAVE_NOAPI(16) ++} ++ ++ ++/*------------------------------------------------------------------------- ++ * Function: H5O_mtime_reset ++ * ++ * Purpose: Frees resources within a modification time message, but doesn't free ++ * the message itself. ++ * ++ * Return: Non-negative on success/Negative on failure ++ * ++ * Programmer: Quincey Koziol ++ * Mondey, December 23, 2002 ++ * ++ * Modifications: ++ * ++ *------------------------------------------------------------------------- ++ */ ++static herr_t ++H5O_mtime_reset(void UNUSED *_mesg) ++{ ++ FUNC_ENTER_NOAPI_NOINIT_NOERR ++ ++ FUNC_LEAVE_NOAPI(SUCCEED) ++} ++ ++ ++/*------------------------------------------------------------------------- ++ * Function: H5O_mtime_free ++ * ++ * Purpose: Free's the message ++ * ++ * Return: Non-negative on success/Negative on failure ++ * ++ * Programmer: Quincey Koziol ++ * Thursday, March 30, 2000 ++ * ++ * Modifications: ++ * ++ *------------------------------------------------------------------------- ++ */ ++static herr_t ++H5O_mtime_free(void *mesg) ++{ ++ FUNC_ENTER_NOAPI_NOINIT_NOERR ++ ++ HDassert(mesg); ++ ++ mesg = H5FL_FREE(time_t, mesg); ++ ++ FUNC_LEAVE_NOAPI(SUCCEED) ++} /* end H5O_mtime_free() */ ++ ++ ++/*------------------------------------------------------------------------- ++ * Function: H5O_mtime_debug ++ * ++ * Purpose: Prints debugging info for the message. ++ * ++ * Return: Non-negative on success/Negative on failure ++ * ++ * Programmer: Robb Matzke ++ * matzke@llnl.gov ++ * Jul 24 1998 ++ * ++ * Modifications: ++ * ++ *------------------------------------------------------------------------- ++ */ ++static herr_t ++H5O_mtime_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *stream, ++ int indent, int fwidth) ++{ ++ const time_t *mesg = (const time_t *)_mesg; ++ struct tm *tm; ++ char buf[128]; ++ ++ FUNC_ENTER_NOAPI_NOINIT_NOERR ++ ++ /* check args */ ++ assert(f); ++ assert(mesg); ++ assert(stream); ++ assert(indent >= 0); ++ assert(fwidth >= 0); ++ ++ /* debug */ ++ tm = HDlocaltime(mesg); ++ ++ HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); ++ fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, ++ "Time:", buf); ++ ++ FUNC_LEAVE_NOAPI(SUCCEED) ++} ++ +-- +2.15.1.windows.2 + diff --git a/HDF5/patches/windows/long_long_test_fix.patch b/HDF5/patches/windows/long_long_test_fix.patch new file mode 100644 index 0000000000..286c279e84 --- /dev/null +++ b/HDF5/patches/windows/long_long_test_fix.patch @@ -0,0 +1,1695 @@ +From eea38538c65f52abceb4edbb22527779a150cc4e Mon Sep 17 00:00:00 2001 +From: Eric Mehl +Date: Thu, 15 Mar 2018 20:37:56 -0400 +Subject: [PATCH] change long_long tests to allow windows to build without + popups + +--- + hdf5-1.8.20/config/cmake/ConfigureChecks.cmake | 1176 ++++++++++++++++++++++++ + hdf5-1.8.20/config/cmake/HDF5Tests.c | 491 ++++++++++ + 2 files changed, 1667 insertions(+) + create mode 100644 hdf5-1.8.20/config/cmake/ConfigureChecks.cmake + create mode 100644 hdf5-1.8.20/config/cmake/HDF5Tests.c + +diff --git a/hdf5-1.8.20/config/cmake/ConfigureChecks.cmake b/hdf5-1.8.20/config/cmake/ConfigureChecks.cmake +new file mode 100644 +index 0000000000..4227157a2a +--- /dev/null ++++ b/hdf5-1.8.20/config/cmake/ConfigureChecks.cmake +@@ -0,0 +1,1176 @@ ++#----------------------------------------------------------------------------- ++# Include all the necessary files for macros ++#----------------------------------------------------------------------------- ++INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) ++INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) ++INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake) ++INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake) ++INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) ++INCLUDE (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) ++INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) ++INCLUDE (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) ++INCLUDE (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) ++INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) ++INCLUDE (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake) ++ ++#----------------------------------------------------------------------------- ++# APPLE/Darwin setup ++#----------------------------------------------------------------------------- ++IF (APPLE) ++ LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) ++ IF(ARCH_LENGTH GREATER 1) ++ set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE) ++ message(FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is" ++ "due to technical reasons. The best approach would be build each architecture in separate directories" ++ "and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'" ++ "variable has been set to a blank value which will build the default architecture for this system.") ++ ENDIF() ++ SET (H5_AC_APPLE_UNIVERSAL_BUILD 0) ++ENDIF (APPLE) ++ ++# Check for Darwin (not just Apple - we also want to catch OpenDarwin) ++IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ++ SET (H5_HAVE_DARWIN 1) ++ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ++ ++#----------------------------------------------------------------------------- ++# Option to Clear File Buffers before write --enable-clear-file-buffers ++#----------------------------------------------------------------------------- ++OPTION (HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON) ++IF (HDF5_Enable_Clear_File_Buffers) ++ SET (H5_CLEAR_MEMORY 1) ++ENDIF (HDF5_Enable_Clear_File_Buffers) ++MARK_AS_ADVANCED (HDF5_Enable_Clear_File_Buffers) ++ ++#----------------------------------------------------------------------------- ++# Option for --enable-strict-format-checks ++#----------------------------------------------------------------------------- ++OPTION (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) ++IF (HDF5_STRICT_FORMAT_CHECKS) ++ SET (H5_STRICT_FORMAT_CHECKS 1) ++ENDIF (HDF5_STRICT_FORMAT_CHECKS) ++MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS) ++ ++#----------------------------------------------------------------------------- ++# Option for --enable-metadata-trace-file ++#----------------------------------------------------------------------------- ++OPTION (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF) ++IF (HDF5_METADATA_TRACE_FILE) ++ SET (H5_METADATA_TRACE_FILE 1) ++ENDIF (HDF5_METADATA_TRACE_FILE) ++MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE) ++ ++# ---------------------------------------------------------------------- ++# Decide whether the data accuracy has higher priority during data ++# conversions. If not, some hard conversions will still be prefered even ++# though the data may be wrong (for example, some compilers don't ++# support denormalized floating values) to maximize speed. ++# ++OPTION (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON) ++IF (HDF5_WANT_DATA_ACCURACY) ++ SET (H5_WANT_DATA_ACCURACY 1) ++ENDIF(HDF5_WANT_DATA_ACCURACY) ++MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) ++ ++# ---------------------------------------------------------------------- ++# Decide whether the presence of user's exception handling functions is ++# checked and data conversion exceptions are returned. This is mainly ++# for the speed optimization of hard conversions. Soft conversions can ++# actually benefit little. ++# ++OPTION (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON) ++IF (HDF5_WANT_DCONV_EXCEPTION) ++ SET (H5_WANT_DCONV_EXCEPTION 1) ++ENDIF (HDF5_WANT_DCONV_EXCEPTION) ++MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION) ++ ++# ---------------------------------------------------------------------- ++# Check if they would like the function stack support compiled in ++# ++OPTION (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF) ++IF (HDF5_ENABLE_CODESTACK) ++ SET (H5_HAVE_CODESTACK 1) ++ENDIF (HDF5_ENABLE_CODESTACK) ++MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK) ++ ++OPTION (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON) ++ ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine can handle converting ++# floating-point to long long values. ++# (This flag should be _unset_ for all machines) ++# ++# SET (H5_HW_FP_TO_LLONG_NOT_WORKS 0) ++ ++# so far we have no check for this ++SET(H5_HAVE_TMPFILE 1) ++ ++#----------------------------------------------------------------------------- ++# This MACRO checks IF the symbol exists in the library and IF it ++# does, it appends library to the list. ++#----------------------------------------------------------------------------- ++SET (LINK_LIBS "") ++MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) ++ CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE}) ++ IF (${VARIABLE}) ++ SET (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) ++ ENDIF (${VARIABLE}) ++ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) ++ ++# ---------------------------------------------------------------------- ++# WINDOWS Hard code Values ++# ---------------------------------------------------------------------- ++ ++SET (WINDOWS) ++IF (WIN32) ++ IF (MINGW) ++ SET (H5_HAVE_MINGW 1) ++ SET (WINDOWS 1) # MinGW tries to imitate Windows ++ SET (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") ++ ENDIF (MINGW) ++ SET (H5_HAVE_WIN32_API 1) ++ SET (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") ++ IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) ++ SET (WINDOWS 1) ++ SET (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") ++ IF (MSVC) ++ SET (H5_HAVE_VISUAL_STUDIO 1) ++ ENDIF (MSVC) ++ ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) ++ENDIF (WIN32) ++ ++#IF (WIN32) ++# SET (DEFAULT_STREAM_VFD OFF) ++#ELSE (WIN32) ++# SET (DEFAULT_STREAM_VFD ON) ++#ENDIF (WIN32) ++#OPTION (HDF5_STREAM_VFD "Compile Stream Virtual File Driver support" ${DEFAULT_STREAM_VFD}) ++ ++# TODO -------------------------------------------------------------------------- ++# Should the Default Virtual File Driver be compiled? ++# This is hard-coded now but option should added to match configure ++# ++SET (H5_DEFAULT_VFD H5FD_SEC2) ++ ++IF (WINDOWS) ++ SET (H5_HAVE_WINDOWS 1) ++ # ---------------------------------------------------------------------- ++ # Set the flag to indicate that the machine has window style pathname, ++ # that is, "drive-letter:\" (e.g. "C:") or "drive-letter:/" (e.g. "C:/"). ++ # (This flag should be _unset_ for all machines, except for Windows) ++ SET (H5_HAVE_WINDOW_PATH 1) ++ENDIF (WINDOWS) ++ ++IF (WINDOWS) ++ SET (H5_HAVE_STDDEF_H 1) ++ SET (H5_HAVE_SYS_STAT_H 1) ++ SET (H5_HAVE_SYS_TYPES_H 1) ++ SET (H5_HAVE_LIBM 1) ++ SET (H5_HAVE_STRDUP 1) ++ SET (H5_HAVE_SYSTEM 1) ++ SET (H5_HAVE_LONGJMP 1) ++ IF (NOT MINGW) ++ SET (H5_HAVE_GETHOSTNAME 1) ++ ENDIF (NOT MINGW) ++ SET (H5_HAVE_GETCONSOLESCREENBUFFERINFO 1) ++ SET (H5_HAVE_FUNCTION 1) ++ SET (H5_GETTIMEOFDAY_GIVES_TZ 1) ++ SET (H5_HAVE_TIMEZONE 1) ++ SET (H5_HAVE_GETTIMEOFDAY 1) ++ SET (H5_LONE_COLON 0) ++ IF (MINGW) ++ SET (H5_HAVE_WINSOCK2_H 1) ++ ENDIF (MINGW) ++ SET (H5_HAVE_LIBWS2_32 1) ++ SET (H5_HAVE_LIBWSOCK32 1) ++ENDIF (WINDOWS) ++ ++#----------------------------------------------------------------------------- ++# These tests need to be manually SET for windows since there is currently ++# something not quite correct with the actual test implementation. This affects ++# the 'dt_arith' test and most likely lots of other code ++# ---------------------------------------------------------------------------- ++SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") ++ ++# ---------------------------------------------------------------------- ++# END of WINDOWS Hard code Values ++# ---------------------------------------------------------------------- ++ ++IF (CYGWIN) ++ SET (H5_HAVE_LSEEK64 0) ++ENDIF (CYGWIN) ++ ++#----------------------------------------------------------------------------- ++# Check for the math library "m" ++#----------------------------------------------------------------------------- ++IF (NOT WINDOWS) ++ CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil H5_HAVE_LIBM) ++ CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen H5_HAVE_LIBDL) ++ CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup H5_HAVE_LIBWS2_32) ++ CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname H5_HAVE_LIBWSOCK32) ++ENDIF (NOT WINDOWS) ++ ++CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname H5_HAVE_LIBUCB) ++CHECK_LIBRARY_EXISTS_CONCAT ("socket" connect H5_HAVE_LIBSOCKET) ++CHECK_LIBRARY_EXISTS ("c" gethostbyname "" NOT_NEED_LIBNSL) ++ ++IF (NOT NOT_NEED_LIBNSL) ++ CHECK_LIBRARY_EXISTS_CONCAT ("nsl" gethostbyname H5_HAVE_LIBNSL) ++ENDIF (NOT NOT_NEED_LIBNSL) ++ ++# For other tests to use the same libraries ++SET (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) ++ ++SET (USE_INCLUDES "") ++IF (WINDOWS) ++ SET (USE_INCLUDES ${USE_INCLUDES} "windows.h") ++ENDIF (WINDOWS) ++ ++IF (NOT WINDOWS) ++ TEST_BIG_ENDIAN(H5_WORDS_BIGENDIAN) ++ENDIF (NOT WINDOWS) ++ ++# For other specific tests, use this MACRO. ++MACRO (HDF5_FUNCTION_TEST OTHER_TEST) ++ IF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") ++ SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") ++ SET (OTHER_TEST_ADD_LIBRARIES) ++ IF (CMAKE_REQUIRED_LIBRARIES) ++ SET (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") ++ ENDIF (CMAKE_REQUIRED_LIBRARIES) ++ ++ FOREACH (def ${HDF5_EXTRA_TEST_DEFINITIONS}) ++ SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") ++ ENDFOREACH (def) ++ ++ FOREACH (def ++ HAVE_SYS_TIME_H ++ HAVE_UNISTD_H ++ HAVE_SYS_TYPES_H ++ HAVE_SYS_SOCKET_H ++ ) ++ IF ("${H5_${def}}") ++ SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") ++ ENDIF ("${H5_${def}}") ++ ENDFOREACH (def) ++ ++ IF (LARGEFILE) ++ SET (MACRO_CHECK_FUNCTION_DEFINITIONS ++ "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ++ ) ++ ENDIF (LARGEFILE) ++ ++ #MESSAGE (STATUS "Performing ${OTHER_TEST}") ++ TRY_COMPILE (${OTHER_TEST} ++ ${CMAKE_BINARY_DIR} ++ ${HDF5_RESOURCES_DIR}/HDF5Tests.c ++ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} ++ "${OTHER_TEST_ADD_LIBRARIES}" ++ OUTPUT_VARIABLE OUTPUT ++ ) ++ IF (${OTHER_TEST}) ++ SET (H5_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") ++ MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Success") ++ ELSE (${OTHER_TEST}) ++ MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Failed") ++ SET (H5_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") ++ FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log ++ "Performing Other Test ${OTHER_TEST} failed with the following output:\n" ++ "${OUTPUT}\n" ++ ) ++ ENDIF (${OTHER_TEST}) ++ ENDIF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") ++ENDMACRO (HDF5_FUNCTION_TEST) ++ ++#----------------------------------------------------------------------------- ++# Check for these functions before the time headers are checked ++#----------------------------------------------------------------------------- ++HDF5_FUNCTION_TEST (STDC_HEADERS) ++ ++CHECK_FUNCTION_EXISTS (difftime H5_HAVE_DIFFTIME) ++#CHECK_FUNCTION_EXISTS (gettimeofday H5_HAVE_GETTIMEOFDAY) ++# Since gettimeofday is not defined any where standard, lets look in all the ++# usual places. On MSVC we are just going to use ::clock() ++IF (NOT MSVC) ++ IF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") ++ TRY_COMPILE (HAVE_TIME_GETTIMEOFDAY ++ ${CMAKE_BINARY_DIR} ++ ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp ++ COMPILE_DEFINITIONS -DTRY_TIME_H ++ OUTPUT_VARIABLE OUTPUT ++ ) ++ IF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") ++ SET (H5_HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_TIME_GETTIMEOFDAY") ++ SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") ++ ENDIF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") ++ ENDIF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") ++ ++ IF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") ++ TRY_COMPILE (HAVE_SYS_TIME_GETTIMEOFDAY ++ ${CMAKE_BINARY_DIR} ++ ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp ++ COMPILE_DEFINITIONS -DTRY_SYS_TIME_H ++ OUTPUT_VARIABLE OUTPUT ++ ) ++ IF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") ++ SET (H5_HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_SYS_TIME_GETTIMEOFDAY") ++ SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") ++ ENDIF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") ++ ENDIF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") ++ ++ IF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) ++ MESSAGE (STATUS "---------------------------------------------------------------") ++ MESSAGE (STATUS "Function 'gettimeofday()' was not found. HDF5 will use its") ++ MESSAGE (STATUS " own implementation.. This can happen on older versions of") ++ MESSAGE (STATUS " MinGW on Windows. Consider upgrading your MinGW installation") ++ MESSAGE (STATUS " to a newer version such as MinGW 3.12") ++ MESSAGE (STATUS "---------------------------------------------------------------") ++ ENDIF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) ++ENDIF (NOT MSVC) ++ ++# Find the library containing clock_gettime() ++IF (NOT WINDOWS) ++ CHECK_FUNCTION_EXISTS(clock_gettime CLOCK_GETTIME_IN_LIBC) ++ CHECK_LIBRARY_EXISTS(rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT) ++ CHECK_LIBRARY_EXISTS(posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4) ++ IF(CLOCK_GETTIME_IN_LIBC) ++ SET(H5_HAVE_CLOCK_GETTIME 1) ++ ELSEIF(CLOCK_GETTIME_IN_LIBRT) ++ SET(H5_HAVE_CLOCK_GETTIME 1) ++ LIST(APPEND LINK_LIBS rt) ++ ELSEIF(CLOCK_GETTIME_IN_LIBPOSIX4) ++ SET(H5_HAVE_CLOCK_GETTIME 1) ++ LIST(APPEND LINK_LIBS posix4) ++ ENDIF(CLOCK_GETTIME_IN_LIBC) ++ENDIF (NOT WINDOWS) ++#----------------------------------------------------------------------------- ++ ++#----------------------------------------------------------------------------- ++# Check IF header file exists and add it to the list. ++#----------------------------------------------------------------------------- ++MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) ++ CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE}) ++ IF (${VARIABLE}) ++ SET (USE_INCLUDES ${USE_INCLUDES} ${FILE}) ++ ENDIF (${VARIABLE}) ++ENDMACRO (CHECK_INCLUDE_FILE_CONCAT) ++ ++#----------------------------------------------------------------------------- ++# Check for the existence of certain header files ++#----------------------------------------------------------------------------- ++CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" H5_HAVE_SYS_RESOURCE_H) ++CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" H5_HAVE_SYS_TIME_H) ++CHECK_INCLUDE_FILE_CONCAT ("unistd.h" H5_HAVE_UNISTD_H) ++CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" H5_HAVE_SYS_IOCTL_H) ++CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" H5_HAVE_SYS_STAT_H) ++CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" H5_HAVE_SYS_SOCKET_H) ++CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" H5_HAVE_SYS_TYPES_H) ++CHECK_INCLUDE_FILE_CONCAT ("stddef.h" H5_HAVE_STDDEF_H) ++CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" H5_HAVE_SETJMP_H) ++CHECK_INCLUDE_FILE_CONCAT ("features.h" H5_HAVE_FEATURES_H) ++CHECK_INCLUDE_FILE_CONCAT ("dirent.h" H5_HAVE_DIRENT_H) ++CHECK_INCLUDE_FILE_CONCAT ("stdint.h" H5_HAVE_STDINT_H) ++ ++# IF the c compiler found stdint, check the C++ as well. On some systems this ++# file will be found by C but not C++, only do this test IF the C++ compiler ++# has been initialized (e.g. the project also includes some c++) ++IF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) ++ CHECK_INCLUDE_FILE_CXX ("stdint.h" H5_HAVE_STDINT_H_CXX) ++ IF (NOT H5_HAVE_STDINT_H_CXX) ++ SET (H5_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") ++ SET (USE_INCLUDES ${USE_INCLUDES} "stdint.h") ++ ENDIF (NOT H5_HAVE_STDINT_H_CXX) ++ENDIF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) ++ ++# Darwin ++CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" H5_HAVE_MACH_MACH_TIME_H) ++ ++# Windows ++CHECK_INCLUDE_FILE_CONCAT ("io.h" H5_HAVE_IO_H) ++IF (NOT CYGWIN) ++ CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H5_HAVE_WINSOCK2_H) ++ENDIF (NOT CYGWIN) ++CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" H5_HAVE_SYS_TIMEB_H) ++ ++IF (CMAKE_SYSTEM_NAME MATCHES "OSF") ++ CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" H5_HAVE_SYS_SYSINFO_H) ++ CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" H5_HAVE_SYS_PROC_H) ++ELSE (CMAKE_SYSTEM_NAME MATCHES "OSF") ++ SET (H5_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) ++ SET (H5_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) ++ENDIF (CMAKE_SYSTEM_NAME MATCHES "OSF") ++ ++CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" H5_HAVE_GLOBUS_COMMON_H) ++CHECK_INCLUDE_FILE_CONCAT ("pdb.h" H5_HAVE_PDB_H) ++CHECK_INCLUDE_FILE_CONCAT ("pthread.h" H5_HAVE_PTHREAD_H) ++CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" H5_HAVE_SRBCLIENT_H) ++CHECK_INCLUDE_FILE_CONCAT ("string.h" H5_HAVE_STRING_H) ++CHECK_INCLUDE_FILE_CONCAT ("strings.h" H5_HAVE_STRINGS_H) ++CHECK_INCLUDE_FILE_CONCAT ("time.h" H5_HAVE_TIME_H) ++CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" H5_HAVE_STDLIB_H) ++CHECK_INCLUDE_FILE_CONCAT ("memory.h" H5_HAVE_MEMORY_H) ++CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" H5_HAVE_DLFCN_H) ++CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" H5_HAVE_INTTYPES_H) ++CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" H5_HAVE_NETINET_IN_H) ++ ++#----------------------------------------------------------------------------- ++# Check for large file support ++#----------------------------------------------------------------------------- ++ ++# The linux-lfs option is deprecated. ++SET (LINUX_LFS 0) ++ ++SET (HDF5_EXTRA_C_FLAGS) ++SET (HDF5_EXTRA_FLAGS) ++IF (NOT WINDOWS) ++ # Linux Specific flags ++ # This was originally defined as _POSIX_SOURCE which was updated to ++ # _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX ++ # functionality so clock_gettime and CLOCK_MONOTONIC are defined ++ # correctly. ++ # POSIX feature information can be found in the gcc manual at: ++ # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html ++ SET (HDF5_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=199506L) ++ SET (HDF5_EXTRA_FLAGS -D_BSD_SOURCE) ++ ++ OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) ++ IF (HDF5_ENABLE_LARGE_FILE) ++ SET (msg "Performing TEST_LFS_WORKS") ++ TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE ++ ${HDF5_BINARY_DIR}/CMake ++ ${HDF5_RESOURCES_DIR}/HDF5Tests.c ++ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS ++ OUTPUT_VARIABLE OUTPUT ++ ) ++ IF (TEST_LFS_WORKS_COMPILE) ++ IF (TEST_LFS_WORKS_RUN MATCHES 0) ++ SET (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) ++ SET (LARGEFILE 1) ++ SET (HDF5_EXTRA_FLAGS ${HDF5_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) ++ MESSAGE (STATUS "${msg}... yes") ++ ELSE (TEST_LFS_WORKS_RUN MATCHES 0) ++ SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) ++ MESSAGE (STATUS "${msg}... no") ++ FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log ++ "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ++ ) ++ ENDIF (TEST_LFS_WORKS_RUN MATCHES 0) ++ ELSE (TEST_LFS_WORKS_COMPILE ) ++ SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) ++ MESSAGE (STATUS "${msg}... no") ++ FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log ++ "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ++ ) ++ ENDIF (TEST_LFS_WORKS_COMPILE) ++ ENDIF (HDF5_ENABLE_LARGE_FILE) ++ SET (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF5_EXTRA_FLAGS}) ++ENDIF (NOT WINDOWS) ++ ++ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS}) ++ ++#----------------------------------------------------------------------------- ++# Check for HAVE_OFF64_T functionality ++#----------------------------------------------------------------------------- ++IF (NOT WINDOWS OR MINGW) ++ HDF5_FUNCTION_TEST (HAVE_OFF64_T) ++ IF (H5_HAVE_OFF64_T) ++ CHECK_FUNCTION_EXISTS (lseek64 H5_HAVE_LSEEK64) ++ CHECK_FUNCTION_EXISTS (fseeko64 H5_HAVE_FSEEKO64) ++ CHECK_FUNCTION_EXISTS (ftello64 H5_HAVE_FTELLO64) ++ CHECK_FUNCTION_EXISTS (ftruncate64 H5_HAVE_FTRUNCATE64) ++ ENDIF (H5_HAVE_OFF64_T) ++ ++ CHECK_FUNCTION_EXISTS (fseeko H5_HAVE_FSEEKO) ++ CHECK_FUNCTION_EXISTS (ftello H5_HAVE_FTELLO) ++ ++ HDF5_FUNCTION_TEST (HAVE_STAT64_STRUCT) ++ IF (HAVE_STAT64_STRUCT) ++ CHECK_FUNCTION_EXISTS (fstat64 H5_HAVE_FSTAT64) ++ CHECK_FUNCTION_EXISTS (stat64 H5_HAVE_STAT64) ++ ENDIF (HAVE_STAT64_STRUCT) ++ENDIF (NOT WINDOWS OR MINGW) ++ ++#----------------------------------------------------------------------------- ++# Check the size in bytes of all the int and float types ++#----------------------------------------------------------------------------- ++MACRO (H5_CHECK_TYPE_SIZE type var) ++ SET (aType ${type}) ++ SET (aVar ${var}) ++# MESSAGE (STATUS "Checking size of ${aType} and storing into ${aVar}") ++ CHECK_TYPE_SIZE (${aType} ${aVar}) ++ IF (NOT ${aVar}) ++ SET (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") ++# MESSAGE (STATUS "Size of ${aType} was NOT Found") ++ ENDIF (NOT ${aVar}) ++ENDMACRO (H5_CHECK_TYPE_SIZE) ++ ++H5_CHECK_TYPE_SIZE (char H5_SIZEOF_CHAR) ++H5_CHECK_TYPE_SIZE (short H5_SIZEOF_SHORT) ++H5_CHECK_TYPE_SIZE (int H5_SIZEOF_INT) ++H5_CHECK_TYPE_SIZE (unsigned H5_SIZEOF_UNSIGNED) ++IF (NOT APPLE) ++ H5_CHECK_TYPE_SIZE (long H5_SIZEOF_LONG) ++ENDIF (NOT APPLE) ++H5_CHECK_TYPE_SIZE ("long long" H5_SIZEOF_LONG_LONG) ++H5_CHECK_TYPE_SIZE (__int64 H5_SIZEOF___INT64) ++IF (NOT H5_SIZEOF___INT64) ++ SET (H5_SIZEOF___INT64 0) ++ENDIF (NOT H5_SIZEOF___INT64) ++ ++H5_CHECK_TYPE_SIZE (float H5_SIZEOF_FLOAT) ++H5_CHECK_TYPE_SIZE (double H5_SIZEOF_DOUBLE) ++H5_CHECK_TYPE_SIZE ("long double" H5_SIZEOF_LONG_DOUBLE) ++ ++H5_CHECK_TYPE_SIZE (int8_t H5_SIZEOF_INT8_T) ++H5_CHECK_TYPE_SIZE (uint8_t H5_SIZEOF_UINT8_T) ++H5_CHECK_TYPE_SIZE (int_least8_t H5_SIZEOF_INT_LEAST8_T) ++H5_CHECK_TYPE_SIZE (uint_least8_t H5_SIZEOF_UINT_LEAST8_T) ++H5_CHECK_TYPE_SIZE (int_fast8_t H5_SIZEOF_INT_FAST8_T) ++H5_CHECK_TYPE_SIZE (uint_fast8_t H5_SIZEOF_UINT_FAST8_T) ++ ++H5_CHECK_TYPE_SIZE (int16_t H5_SIZEOF_INT16_T) ++H5_CHECK_TYPE_SIZE (uint16_t H5_SIZEOF_UINT16_T) ++H5_CHECK_TYPE_SIZE (int_least16_t H5_SIZEOF_INT_LEAST16_T) ++H5_CHECK_TYPE_SIZE (uint_least16_t H5_SIZEOF_UINT_LEAST16_T) ++H5_CHECK_TYPE_SIZE (int_fast16_t H5_SIZEOF_INT_FAST16_T) ++H5_CHECK_TYPE_SIZE (uint_fast16_t H5_SIZEOF_UINT_FAST16_T) ++ ++H5_CHECK_TYPE_SIZE (int32_t H5_SIZEOF_INT32_T) ++H5_CHECK_TYPE_SIZE (uint32_t H5_SIZEOF_UINT32_T) ++H5_CHECK_TYPE_SIZE (int_least32_t H5_SIZEOF_INT_LEAST32_T) ++H5_CHECK_TYPE_SIZE (uint_least32_t H5_SIZEOF_UINT_LEAST32_T) ++H5_CHECK_TYPE_SIZE (int_fast32_t H5_SIZEOF_INT_FAST32_T) ++H5_CHECK_TYPE_SIZE (uint_fast32_t H5_SIZEOF_UINT_FAST32_T) ++ ++H5_CHECK_TYPE_SIZE (int64_t H5_SIZEOF_INT64_T) ++H5_CHECK_TYPE_SIZE (uint64_t H5_SIZEOF_UINT64_T) ++H5_CHECK_TYPE_SIZE (int_least64_t H5_SIZEOF_INT_LEAST64_T) ++H5_CHECK_TYPE_SIZE (uint_least64_t H5_SIZEOF_UINT_LEAST64_T) ++H5_CHECK_TYPE_SIZE (int_fast64_t H5_SIZEOF_INT_FAST64_T) ++H5_CHECK_TYPE_SIZE (uint_fast64_t H5_SIZEOF_UINT_FAST64_T) ++ ++IF (NOT APPLE) ++ H5_CHECK_TYPE_SIZE (size_t H5_SIZEOF_SIZE_T) ++ H5_CHECK_TYPE_SIZE (ssize_t H5_SIZEOF_SSIZE_T) ++ IF (NOT H5_SIZEOF_SSIZE_T) ++ SET (H5_SIZEOF_SSIZE_T 0) ++ ENDIF (NOT H5_SIZEOF_SSIZE_T) ++ H5_CHECK_TYPE_SIZE (ptrdiff_t H5_SIZEOF_PTRDIFF_T) ++ENDIF (NOT APPLE) ++ ++H5_CHECK_TYPE_SIZE (off_t H5_SIZEOF_OFF_T) ++H5_CHECK_TYPE_SIZE (off64_t H5_SIZEOF_OFF64_T) ++IF (NOT H5_SIZEOF_OFF64_T) ++ SET (H5_SIZEOF_OFF64_T 0) ++ENDIF (NOT H5_SIZEOF_OFF64_T) ++ ++IF (NOT WINDOWS) ++ #----------------------------------------------------------------------------- ++ # Check if the dev_t type is a scalar type ++ #----------------------------------------------------------------------------- ++ HDF5_FUNCTION_TEST (DEV_T_IS_SCALAR) ++ ++ # ---------------------------------------------------------------------- ++ # Check for MONOTONIC_TIMER support (used in clock_gettime). This has ++ # to be done after any POSIX/BSD defines to ensure that the test gets ++ # the correct POSIX level on linux. ++ CHECK_VARIABLE_EXISTS (CLOCK_MONOTONIC HAVE_CLOCK_MONOTONIC) ++ ++ #----------------------------------------------------------------------------- ++ # Check a bunch of time functions ++ #----------------------------------------------------------------------------- ++ FOREACH (test ++ HAVE_TM_GMTOFF ++ HAVE___TM_GMTOFF ++# HAVE_TIMEZONE ++ HAVE_STRUCT_TIMEZONE ++ GETTIMEOFDAY_GIVES_TZ ++ TIME_WITH_SYS_TIME ++ HAVE_TM_ZONE ++ HAVE_STRUCT_TM_TM_ZONE ++ ) ++ HDF5_FUNCTION_TEST (${test}) ++ ENDFOREACH (test) ++ IF (NOT CYGWIN AND NOT MINGW) ++ HDF5_FUNCTION_TEST (HAVE_TIMEZONE) ++# HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) ++ ENDIF (NOT CYGWIN AND NOT MINGW) ++ ++ # ---------------------------------------------------------------------- ++ # Does the struct stat have the st_blocks field? This field is not Posix. ++ # ++ HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) ++ ++ # ---------------------------------------------------------------------- ++ # How do we figure out the width of a tty in characters? ++ # ++ CHECK_FUNCTION_EXISTS (ioctl H5_HAVE_IOCTL) ++ HDF5_FUNCTION_TEST (HAVE_STRUCT_VIDEOCONFIG) ++ HDF5_FUNCTION_TEST (HAVE_STRUCT_TEXT_INFO) ++ CHECK_FUNCTION_EXISTS (_getvideoconfig H5_HAVE__GETVIDEOCONFIG) ++ CHECK_FUNCTION_EXISTS (gettextinfo H5_HAVE_GETTEXTINFO) ++ CHECK_FUNCTION_EXISTS (_scrsize H5_HAVE__SCRSIZE) ++ CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo H5_HAVE_GETCONSOLESCREENBUFFERINFO) ++ CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" H5_HAVE_TIOCGWINSZ) ++ CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" H5_HAVE_TIOCGETD) ++ENDIF (NOT WINDOWS) ++ ++#----------------------------------------------------------------------------- ++# Check for some functions that are used ++# ++CHECK_FUNCTION_EXISTS (alarm H5_HAVE_ALARM) ++#CHECK_FUNCTION_EXISTS (BSDgettimeofday H5_HAVE_BSDGETTIMEOFDAY) ++CHECK_FUNCTION_EXISTS (fork H5_HAVE_FORK) ++CHECK_FUNCTION_EXISTS (frexpf H5_HAVE_FREXPF) ++CHECK_FUNCTION_EXISTS (frexpl H5_HAVE_FREXPL) ++ ++CHECK_FUNCTION_EXISTS (gethostname H5_HAVE_GETHOSTNAME) ++CHECK_FUNCTION_EXISTS (getpwuid H5_HAVE_GETPWUID) ++CHECK_FUNCTION_EXISTS (getrusage H5_HAVE_GETRUSAGE) ++CHECK_FUNCTION_EXISTS (lstat H5_HAVE_LSTAT) ++ ++CHECK_FUNCTION_EXISTS (rand_r H5_HAVE_RAND_R) ++CHECK_FUNCTION_EXISTS (random H5_HAVE_RANDOM) ++CHECK_FUNCTION_EXISTS (setsysinfo H5_HAVE_SETSYSINFO) ++ ++CHECK_FUNCTION_EXISTS (signal H5_HAVE_SIGNAL) ++CHECK_FUNCTION_EXISTS (longjmp H5_HAVE_LONGJMP) ++CHECK_FUNCTION_EXISTS (setjmp H5_HAVE_SETJMP) ++CHECK_FUNCTION_EXISTS (siglongjmp H5_HAVE_SIGLONGJMP) ++CHECK_FUNCTION_EXISTS (sigsetjmp H5_HAVE_SIGSETJMP) ++CHECK_FUNCTION_EXISTS (sigaction H5_HAVE_SIGACTION) ++CHECK_FUNCTION_EXISTS (sigprocmask H5_HAVE_SIGPROCMASK) ++ ++CHECK_FUNCTION_EXISTS (snprintf H5_HAVE_SNPRINTF) ++CHECK_FUNCTION_EXISTS (srandom H5_HAVE_SRANDOM) ++CHECK_FUNCTION_EXISTS (strdup H5_HAVE_STRDUP) ++CHECK_FUNCTION_EXISTS (symlink H5_HAVE_SYMLINK) ++CHECK_FUNCTION_EXISTS (system H5_HAVE_SYSTEM) ++ ++CHECK_FUNCTION_EXISTS (tmpfile H5_HAVE_TMPFILE) ++CHECK_FUNCTION_EXISTS (vasprintf H5_HAVE_VASPRINTF) ++CHECK_FUNCTION_EXISTS (waitpid H5_HAVE_WAITPID) ++ ++CHECK_FUNCTION_EXISTS (vsnprintf H5_HAVE_VSNPRINTF) ++IF (NOT WINDOWS) ++ IF (H5_HAVE_VSNPRINTF) ++ HDF5_FUNCTION_TEST (VSNPRINTF_WORKS) ++ ENDIF (H5_HAVE_VSNPRINTF) ++ENDIF (NOT WINDOWS) ++ ++#----------------------------------------------------------------------------- ++# sigsetjmp is special; may actually be a macro ++#----------------------------------------------------------------------------- ++IF (NOT H5_HAVE_SIGSETJMP) ++ IF (H5_HAVE_SETJMP_H) ++ CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" H5_HAVE_MACRO_SIGSETJMP) ++ IF (H5_HAVE_MACRO_SIGSETJMP) ++ SET (H5_HAVE_SIGSETJMP 1) ++ ENDIF (H5_HAVE_MACRO_SIGSETJMP) ++ ENDIF (H5_HAVE_SETJMP_H) ++ENDIF (NOT H5_HAVE_SIGSETJMP) ++ ++#----------------------------------------------------------------------------- ++# Check for Symbols ++CHECK_SYMBOL_EXISTS (tzname "time.h" H5_HAVE_DECL_TZNAME) ++ ++#----------------------------------------------------------------------------- ++# Check a bunch of other functions ++#----------------------------------------------------------------------------- ++IF (NOT WINDOWS) ++ FOREACH (test ++ LONE_COLON ++ HAVE_ATTRIBUTE ++ HAVE_C99_FUNC ++ HAVE_FUNCTION ++ HAVE_C99_DESIGNATED_INITIALIZER ++ SYSTEM_SCOPE_THREADS ++ HAVE_SOCKLEN_T ++ CXX_HAVE_OFFSETOF ++ ) ++ HDF5_FUNCTION_TEST (${test}) ++ ENDFOREACH (test) ++ENDIF (NOT WINDOWS) ++ ++# For other CXX specific tests, use this MACRO. ++MACRO (HDF5_CXX_FUNCTION_TEST OTHER_TEST) ++ IF ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") ++ SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") ++ SET (OTHER_TEST_ADD_LIBRARIES) ++ IF (CMAKE_REQUIRED_LIBRARIES) ++ SET (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") ++ ENDIF (CMAKE_REQUIRED_LIBRARIES) ++ ++ FOREACH (def ${HDF5_EXTRA_TEST_DEFINITIONS}) ++ SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") ++ ENDFOREACH (def) ++ ++ FOREACH (def ++ HAVE_SYS_TIME_H ++ HAVE_UNISTD_H ++ HAVE_SYS_TYPES_H ++ HAVE_SYS_SOCKET_H ++ ) ++ IF ("${H5_${def}}") ++ SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") ++ ENDIF ("${H5_${def}}") ++ ENDFOREACH (def) ++ ++ IF (LARGEFILE) ++ SET (MACRO_CHECK_FUNCTION_DEFINITIONS ++ "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ++ ) ++ ENDIF (LARGEFILE) ++ ++ #MESSAGE (STATUS "Performing ${OTHER_TEST}") ++ TRY_COMPILE (${OTHER_TEST} ++ ${CMAKE_BINARY_DIR} ++ ${HDF5_RESOURCES_DIR}/HDF5CXXTests.cpp ++ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} ++ "${OTHER_TEST_ADD_LIBRARIES}" ++ OUTPUT_VARIABLE OUTPUT ++ ) ++ IF ("${OTHER_TEST}" EQUAL 0) ++ SET (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") ++ MESSAGE (STATUS "Performing CXX Test ${OTHER_TEST} - Success") ++ ELSE ("${OTHER_TEST}" EQUAL 0) ++ MESSAGE (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") ++ SET (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") ++ FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log ++ "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" ++ "${OUTPUT}\n" ++ ) ++ ENDIF ("${OTHER_TEST}" EQUAL 0) ++ ENDIF ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") ++ENDMACRO (HDF5_CXX_FUNCTION_TEST) ++ ++#----------------------------------------------------------------------------- ++# Check a bunch of cxx functions ++#----------------------------------------------------------------------------- ++IF (CMAKE_CXX_COMPILER_LOADED) ++ FOREACH (test ++ OLD_HEADER_FILENAME ++ H5_NO_NAMESPACE ++ H5_NO_STD ++ BOOL_NOTDEFINED ++ NO_STATIC_CAST ++ ) ++ HDF5_CXX_FUNCTION_TEST (${test}) ++ ENDFOREACH (test) ++ENDIF (CMAKE_CXX_COMPILER_LOADED) ++ ++#----------------------------------------------------------------------------- ++# Check if Direct I/O driver works ++#----------------------------------------------------------------------------- ++IF (NOT WINDOWS) ++ OPTION (HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" ON) ++ IF (HDF5_ENABLE_DIRECT_VFD) ++ SET (msg "Performing TEST_DIRECT_VFD_WORKS") ++ SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-DTEST_DIRECT_VFD_WORKS -D_GNU_SOURCE ${CMAKE_REQUIRED_FLAGS}") ++ TRY_RUN (TEST_DIRECT_VFD_WORKS_RUN TEST_DIRECT_VFD_WORKS_COMPILE ++ ${HDF5_BINARY_DIR}/CMake ++ ${HDF5_RESOURCES_DIR}/HDF5Tests.c ++ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} ++ OUTPUT_VARIABLE OUTPUT ++ ) ++ IF (TEST_DIRECT_VFD_WORKS_COMPILE) ++ IF (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) ++ HDF5_FUNCTION_TEST (HAVE_DIRECT) ++ SET (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE") ++ ADD_DEFINITIONS ("-D_GNU_SOURCE") ++ ELSE (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) ++ SET (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) ++ MESSAGE (STATUS "${msg}... no") ++ FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log ++ "Test TEST_DIRECT_VFD_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ++ ) ++ ENDIF (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) ++ ELSE (TEST_DIRECT_VFD_WORKS_COMPILE ) ++ SET (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) ++ MESSAGE (STATUS "${msg}... no") ++ FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log ++ "Test TEST_DIRECT_VFD_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ++ ) ++ ENDIF (TEST_DIRECT_VFD_WORKS_COMPILE) ++ ENDIF (HDF5_ENABLE_DIRECT_VFD) ++ENDIF (NOT WINDOWS) ++ ++#----------------------------------------------------------------------------- ++# Check for the Stream VFD driver ++#----------------------------------------------------------------------------- ++IF (HDF5_STREAM_VFD) ++ CHECK_INCLUDE_FILE_CONCAT ("netdb.h" H5_HAVE_NETDB_H) ++ CHECK_INCLUDE_FILE_CONCAT ("netinet/tcp.h" H5_HAVE_NETINET_TCP_H) ++ CHECK_INCLUDE_FILE_CONCAT ("sys/filio.h" H5_HAVE_SYS_FILIO_H) ++ SET (H5_HAVE_STREAM 1) ++ENDIF (HDF5_STREAM_VFD) ++ ++#----------------------------------------------------------------------------- ++# Check if InitOnceExecuteOnce is available ++#----------------------------------------------------------------------------- ++IF (WINDOWS) ++ IF (NOT HDF5_NO_IOEO_TEST) ++ MESSAGE (STATUS "Checking for InitOnceExecuteOnce:") ++ IF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") ++ IF (LARGEFILE) ++ SET (CMAKE_REQUIRED_DEFINITIONS ++ "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ++ ) ++ ENDIF (LARGEFILE) ++ SET(MACRO_CHECK_FUNCTION_DEFINITIONS ++ "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}") ++ IF(CMAKE_REQUIRED_LIBRARIES) ++ SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES ++ "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") ++ ELSE(CMAKE_REQUIRED_LIBRARIES) ++ SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) ++ ENDIF(CMAKE_REQUIRED_LIBRARIES) ++ IF(CMAKE_REQUIRED_INCLUDES) ++ SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES ++ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") ++ ELSE(CMAKE_REQUIRED_INCLUDES) ++ SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) ++ ENDIF(CMAKE_REQUIRED_INCLUDES) ++ ++ TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED ++ ${CMAKE_BINARY_DIR} ++ ${HDF5_RESOURCES_DIR}/HDF5Tests.c ++ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ++ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} ++ -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH} ++ "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}" ++ "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" ++ COMPILE_OUTPUT_VARIABLE OUTPUT) ++ # if it did not compile make the return value fail code of 1 ++ IF(NOT HAVE_IOEO_COMPILED) ++ SET(HAVE_IOEO_EXITCODE 1) ++ ENDIF(NOT HAVE_IOEO_COMPILED) ++ # if the return value was 0 then it worked ++ IF("${HAVE_IOEO_EXITCODE}" EQUAL 0) ++ SET(H5_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") ++ MESSAGE(STATUS "Performing Test InitOnceExecuteOnce - Success") ++ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log ++ "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" ++ "${OUTPUT}\n" ++ "Return value: ${HAVE_IOEO}\n") ++ ELSE("${HAVE_IOEO_EXITCODE}" EQUAL 0) ++ IF(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") ++ SET(H5_HAVE_IOEO "${HAVE_IOEO_EXITCODE}") ++ ELSE(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") ++ SET(H5_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") ++ ENDIF(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") ++ ++ MESSAGE(STATUS "Performing Test InitOnceExecuteOnce - Failed") ++ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log ++ "Performing InitOnceExecuteOnce Test failed with the following output:\n" ++ "${OUTPUT}\n" ++ "Return value: ${HAVE_IOEO_EXITCODE}\n") ++ ENDIF("${HAVE_IOEO_EXITCODE}" EQUAL 0) ++ ENDIF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") ++ ENDIF (NOT HDF5_NO_IOEO_TEST) ++ENDIF (WINDOWS) ++ ++#----------------------------------------------------------------------------- ++# Option to see if GPFS is available on this filesystem --enable-gpfs ++#----------------------------------------------------------------------------- ++OPTION (HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF) ++IF (HDF5_ENABLE_GPFS) ++ CHECK_INCLUDE_FILE_CONCAT ("gpfs.h" HAVE_GPFS) ++ IF (HAVE_GPFS) ++ HDF5_FUNCTION_TEST (HAVE_GPFS) ++ ENDIF (HAVE_GPFS) ++ENDIF (HDF5_ENABLE_GPFS) ++MARK_AS_ADVANCED (HDF5_ENABLE_GPFS) ++ ++#----------------------------------------------------------------------------- ++# Determine how 'inline' is used ++#----------------------------------------------------------------------------- ++SET (HDF5_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) ++FOREACH (inline_test inline __inline__ __inline) ++ SET (INLINE_TEST_INLINE ${inline_test}) ++ HDF5_FUNCTION_TEST (INLINE_TEST_${inline_test}) ++ENDFOREACH (inline_test) ++ ++SET (HDF5_EXTRA_TEST_DEFINITIONS) ++IF (INLINE_TEST___inline__) ++ SET (H5_inline __inline__) ++ELSE (INLINE_TEST___inline__) ++ IF (INLINE_TEST___inline) ++ SET (H5_inline __inline) ++ ELSE (INLINE_TEST___inline) ++ IF (INLINE_TEST_inline) ++ SET (H5_inline inline) ++ ENDIF (INLINE_TEST_inline) ++ ENDIF (INLINE_TEST___inline) ++ENDIF (INLINE_TEST___inline__) ++ ++#----------------------------------------------------------------------------- ++# Check how to print a Long Long integer ++#----------------------------------------------------------------------------- ++IF (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") ++ SET (PRINT_LL_FOUND 0) ++ MESSAGE (STATUS "Checking for appropriate format for 64 bit long:") ++ set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH") ++ if (H5_SIZEOF_LONG_LONG) ++ set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") ++ endif (H5_SIZEOF_LONG_LONG) ++ TRY_RUN (HDF5_PRINTF_LL_TEST_RUN HDF5_PRINTF_LL_TEST_COMPILE ++ ${HDF5_BINARY_DIR}/CMake ++ ${HDF5_RESOURCES_DIR}/HDF5Tests.c ++ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS} ++ OUTPUT_VARIABLE OUTPUT ++ ) ++ if (HDF5_PRINTF_LL_TEST_COMPILE) ++ if (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) ++ string(REGEX REPLACE ".*PRINTF_LL_WIDTH=\\[(.*)\\].*" "\\1" HDF5_PRINTF_LL "${OUTPUT}") ++ set (H5_PRINTF_LL_WIDTH "\"${HDF5_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") ++ set (PRINT_LL_FOUND 1) ++ else (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) ++ message ("HDF5: Width test failed with result: ${HDF5_PRINTF_LL_TEST_RUN}") ++ endif (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) ++ else (HDF5_PRINTF_LL_TEST_COMPILE) ++ file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log ++ "Test H5_PRINTF_LL_WIDTH failed with the following output:\n ${OUTPUT}\n" ++ ) ++ endif (HDF5_PRINTF_LL_TEST_COMPILE) ++ ++ IF (PRINT_LL_FOUND) ++ MESSAGE (STATUS "Checking for appropriate format for 64 bit long: found ${H5_PRINTF_LL_WIDTH}") ++ ELSE (PRINT_LL_FOUND) ++ MESSAGE (STATUS "Checking for appropriate format for 64 bit long: not found") ++ SET (H5_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL ++ "Width for printf for type `long long' or `__int64', us. `ll" ++ ) ++ ENDIF (PRINT_LL_FOUND) ++ENDIF (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") ++ ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine can handle converting ++# denormalized floating-point values. ++# (This flag should be set for all machines, except for the Crays, where ++# the cache value is set in it's config file) ++# ++SET (H5_CONVERT_DENORMAL_FLOAT 1) ++ ++#----------------------------------------------------------------------------- ++# Are we going to use HSIZE_T ++#----------------------------------------------------------------------------- ++IF (HDF5_ENABLE_HSIZET) ++ SET (H5_HAVE_LARGE_HSIZET 1) ++ENDIF (HDF5_ENABLE_HSIZET) ++ ++#----------------------------------------------------------------------------- ++# Macro to determine the various conversion capabilities ++#----------------------------------------------------------------------------- ++MACRO (H5ConversionTests TEST msg) ++ IF ("${TEST}" MATCHES "^${TEST}$") ++ # MESSAGE (STATUS "===> ${TEST}") ++ TRY_RUN (${TEST}_RUN ${TEST}_COMPILE ++ ${HDF5_BINARY_DIR}/CMake ++ ${HDF5_RESOURCES_DIR}/ConversionTests.c ++ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-D${TEST}_TEST ++ OUTPUT_VARIABLE OUTPUT ++ ) ++ IF (${TEST}_COMPILE) ++ IF (${TEST}_RUN MATCHES 0) ++ SET (${TEST} 1 CACHE INTERNAL ${msg}) ++ MESSAGE (STATUS "${msg}... yes") ++ ELSE (${TEST}_RUN MATCHES 0) ++ SET (${TEST} "" CACHE INTERNAL ${msg}) ++ MESSAGE (STATUS "${msg}... no") ++ FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log ++ "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" ++ ) ++ ENDIF (${TEST}_RUN MATCHES 0) ++ ELSE (${TEST}_COMPILE ) ++ SET (${TEST} "" CACHE INTERNAL ${msg}) ++ MESSAGE (STATUS "${msg}... no") ++ FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log ++ "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" ++ ) ++ ENDIF (${TEST}_COMPILE) ++ ++ ENDIF("${TEST}" MATCHES "^${TEST}$") ++ENDMACRO (H5ConversionTests) ++ ++#----------------------------------------------------------------------------- ++# Macro to make some of the conversion tests easier to write/read ++#----------------------------------------------------------------------------- ++MACRO (H5MiscConversionTest VAR TEST msg) ++ IF ("${TEST}" MATCHES "^${TEST}$") ++ IF (${VAR}) ++ SET (${TEST} 1 CACHE INTERNAL ${msg}) ++ MESSAGE (STATUS "${msg}... yes") ++ ELSE (${VAR}) ++ SET (${TEST} "" CACHE INTERNAL ${msg}) ++ MESSAGE (STATUS "${msg}... no") ++ ENDIF (${VAR}) ++ ENDIF ("${TEST}" MATCHES "^${TEST}$") ++ENDMACRO (H5MiscConversionTest) ++ ++#----------------------------------------------------------------------------- ++# Check various conversion capabilities ++#----------------------------------------------------------------------------- ++ ++# ----------------------------------------------------------------------- ++# Set flag to indicate that the machine can handle conversion from ++# long double to integers accurately. This flag should be set "yes" for ++# all machines except all SGIs. For SGIs, some conversions are ++# incorrect and its cache value is set "no" in its config/irix6.x and ++# irix5.x. ++# ++H5MiscConversionTest (H5_SIZEOF_LONG_DOUBLE H5_LDOUBLE_TO_INTEGER_ACCURATE "checking IF converting from long double to integers is accurate") ++# ----------------------------------------------------------------------- ++# Set flag to indicate that the machine can do conversion from ++# long double to integers regardless of accuracy. This flag should be ++# set "yes" for all machines except HP-UX 11.00. For HP-UX 11.00, the ++# compiler has 'floating exception' when converting 'long double' to all ++# integers except 'unsigned long long'. Other HP-UX systems are unknown ++# yet. (1/8/05 - SLU) ++# ++H5ConversionTests (H5_LDOUBLE_TO_INTEGER_WORKS "Checking IF converting from long double to integers works") ++# ----------------------------------------------------------------------- ++# Set flag to indicate that the machine can handle conversion from ++# integers to long double. (This flag should be set "yes" for all ++# machines except all SGIs, where some conversions are ++# incorrect and its cache value is set "no" in its config/irix6.x and ++# irix5.x) ++# ++H5MiscConversionTest (H5_SIZEOF_LONG_DOUBLE H5_INTEGER_TO_LDOUBLE_ACCURATE "checking IF accurately converting from integers to long double") ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine can accurately convert ++# 'unsigned long' to 'float' values. ++# (This flag should be set for all machines, except for Pathscale compiler ++# on Sandia's Linux machine where the compiler interprets 'unsigned long' ++# values as negative when the first bit of 'unsigned long' is on during ++# the conversion to float.) ++# ++H5ConversionTests (H5_ULONG_TO_FLOAT_ACCURATE "Checking IF accurately converting unsigned long to float values") ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine can accurately convert ++# 'unsigned (long) long' values to 'float' and 'double' values. ++# (This flag should be set for all machines, except for the SGIs, where ++# the cache value is set in the config/irix6.x config file) and Solaris ++# 64-bit machines, where the short program below tests if round-up is ++# correctly handled. ++# ++H5ConversionTests (H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE "Checking IF accurately converting unsigned long long to floating-point values") ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine can accurately convert ++# 'float' or 'double' to 'unsigned long long' values. ++# (This flag should be set for all machines, except for PGI compiler ++# where round-up happens when the fraction of float-point value is greater ++# than 0.5. ++# ++H5ConversionTests (H5_FP_TO_ULLONG_ACCURATE "Checking IF accurately roundup converting floating-point to unsigned long long values" ) ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine can accurately convert ++# 'float', 'double' or 'long double' to 'unsigned long long' values. ++# (This flag should be set for all machines, except for HP-UX machines ++# where the maximal number for unsigned long long is 0x7fffffffffffffff ++# during conversion. ++# ++H5ConversionTests (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "Checking IF right maximum converting floating-point to unsigned long long values" ) ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine can accurately convert ++# 'long double' to 'unsigned int' values. (This flag should be set for ++# all machines, except for some Intel compilers on some Linux.) ++# ++H5ConversionTests (H5_LDOUBLE_TO_UINT_ACCURATE "Checking IF correctly converting long double to unsigned int values") ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine can _compile_ ++# 'unsigned long long' to 'float' and 'double' typecasts. ++# (This flag should be set for all machines.) ++# ++IF (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) ++ SET (H5_ULLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling unsigned long long to floating-point typecasts work") ++ MESSAGE (STATUS "Checking IF compiling unsigned long long to floating-point typecasts work... yes") ++ENDIF (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine can _compile_ ++# 'long long' to 'float' and 'double' typecasts. ++# (This flag should be set for all machines.) ++# ++IF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) ++ SET (H5_LLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling long long to floating-point typecasts work") ++ MESSAGE (STATUS "Checking IF compiling long long to floating-point typecasts work... yes") ++ENDIF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine can convert from ++# 'unsigned long long' to 'long double' without precision loss. ++# (This flag should be set for all machines, except for FreeBSD(sleipnir) ++# where the last 2 bytes of mantissa are lost when compiler tries to do ++# the conversion, and Cygwin where compiler doesn't do rounding correctly.) ++# ++H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsigned long long to long double with precision") ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine can handle overflow converting ++# all floating-point to all integer types. ++# (This flag should be set for all machines, except for Cray X1 where ++# floating exception is generated when the floating-point value is greater ++# than the maximal integer value). ++# ++H5ConversionTests (H5_FP_TO_INTEGER_OVERFLOW_WORKS "Checking IF overflows normally converting floating-point to integer values") ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine is using a special algorithm to convert ++# 'long double' to '(unsigned) long' values. (This flag should only be set for ++# the IBM Power6 Linux. When the bit sequence of long double is ++# 0x4351ccf385ebc8a0bfcc2a3c3d855620, the converted value of (unsigned)long ++# is 0x004733ce17af227f, not the same as the library's conversion to 0x004733ce17af2282. ++# The machine's conversion gets the correct value. We define the macro and disable ++# this kind of test until we figure out what algorithm they use. ++# ++IF (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) ++ SET (H5_LDOUBLE_TO_LONG_SPECIAL 0 CACHE INTERNAL "Define if your system converts long double to (unsigned) long values with special algorithm") ++ MESSAGE (STATUS "Checking IF your system converts long double to (unsigned) long values with special algorithm... no") ++ENDIF (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine is using a special algorithm ++# to convert some values of '(unsigned) long' to 'long double' values. ++# (This flag should be off for all machines, except for IBM Power6 Linux, ++# when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff..., ++# ..., 7fffff..., the compiler uses a unknown algorithm. We define a ++# macro and skip the test for now until we know about the algorithm. ++# ++IF (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) ++ SET (H5_LONG_TO_LDOUBLE_SPECIAL 0 CACHE INTERNAL "Define if your system can convert (unsigned) long to long double values with special algorithm") ++ MESSAGE (STATUS "Checking IF your system can convert (unsigned) long to long double values with special algorithm... no") ++ENDIF (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine can accurately convert ++# 'long double' to '(unsigned) long long' values. (This flag should be set for ++# all machines, except for Mac OS 10.4 and SGI IRIX64 6.5. When the bit sequence ++# of long double is 0x4351ccf385ebc8a0bfcc2a3c..., the values of (unsigned)long long ++# start to go wrong on these two machines. Adjusting it higher to ++# 0x4351ccf385ebc8a0dfcc... or 0x4351ccf385ebc8a0ffcc... will make the converted ++# values wildly wrong. This test detects this wrong behavior and disable the test. ++# ++H5ConversionTests (H5_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctly converting long double to (unsigned) long long values") ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine can accurately convert ++# '(unsigned) long long' to 'long double' values. (This flag should be set for ++# all machines, except for Mac OS 10.4, when the bit sequences are 003fff..., ++# 007fff..., 00ffff..., 01ffff..., ..., 7fffff..., the converted values are twice ++# as big as they should be. ++# ++H5ConversionTests (H5_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting (unsigned) long long to long double values") ++# ---------------------------------------------------------------------- ++# Set the flag to indicate that the machine generates bad code ++# for the H5V_log2_gen() routine in src/H5Vprivate.h ++# (This flag should be set to no for all machines, except for SGI IRIX64, ++# where the cache value is set to yes in it's config file) ++# ++IF (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) ++ SET (H5_BAD_LOG2_CODE_GENERATED 0 CACHE INTERNAL "Define if your system generates wrong code for log2 routine") ++ MESSAGE (STATUS "Checking IF your system generates wrong code for log2 routine... no") ++ENDIF (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) ++# ---------------------------------------------------------------------- ++# Check if pointer alignments are enforced ++# ++H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced") ++ ++# Define a macro for Cygwin (on XP only) where the compiler has rounding ++# problem converting from unsigned long long to long double */ ++IF (CYGWIN) ++ SET (H5_CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM 1) ++ENDIF (CYGWIN) +diff --git a/hdf5-1.8.20/config/cmake/HDF5Tests.c b/hdf5-1.8.20/config/cmake/HDF5Tests.c +new file mode 100644 +index 0000000000..b4523e4b60 +--- /dev/null ++++ b/hdf5-1.8.20/config/cmake/HDF5Tests.c +@@ -0,0 +1,491 @@ ++#define SIMPLE_TEST(x) int main(){ x; return 0; } ++ ++#ifdef HAVE_C99_DESIGNATED_INITIALIZER ++ ++#ifdef FC_DUMMY_MAIN ++#ifndef FC_DUMMY_MAIN_EQ_F77 ++# ifdef __cplusplus ++extern "C" ++# endif ++int FC_DUMMY_MAIN() ++{ return 1;} ++#endif ++#endif ++int ++main () ++{ ++ ++ typedef struct ++ { ++ int x; ++ union ++ { ++ int i; ++ double d; ++ }u; ++ }di_struct_t; ++ di_struct_t x = ++ { 0, ++ { .d = 0.0}}; ++ ; ++ return 0; ++} ++ ++#endif ++ ++#ifdef HAVE_C99_FUNC ++ ++#ifdef FC_DUMMY_MAIN ++#ifndef FC_DUMMY_MAIN_EQ_F77 ++# ifdef __cplusplus ++ extern "C" ++# endif ++ int FC_DUMMY_MAIN() { return 1; } ++#endif ++#endif ++int ++main () ++{ ++ const char *fname = __func__; ++ ; ++ return 0; ++} ++ ++#endif ++ ++#ifdef VSNPRINTF_WORKS ++#include ++#include ++#include ++ ++int test_vsnprintf(const char *fmt,...) ++{ ++ va_list ap; ++ char *s = malloc(16); ++ int ret; ++ ++ va_start(ap, fmt); ++ ret=vsnprintf(s,16,"%s",ap); ++ va_end(ap); ++ ++ return(ret!=42 ? 1 : 0); ++} ++ ++int main(void) ++{ ++ return(test_vsnprintf("%s","A string that is longer than 16 characters")); ++} ++#endif ++ ++ ++#ifdef TIME_WITH_SYS_TIME ++/* Time with sys/time test */ ++ ++#include ++#include ++#include ++ ++int ++main () ++{ ++if ((struct tm *) 0) ++return 0; ++ ; ++ return 0; ++} ++ ++#endif ++ ++#ifdef STDC_HEADERS ++#include ++#include ++#include ++#include ++int main() { return 0; } ++#endif /* STDC_HEADERS */ ++ ++#ifdef HAVE_TM_ZONE ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++SIMPLE_TEST(struct tm tm; tm.tm_zone); ++ ++#endif /* HAVE_TM_ZONE */ ++ ++#ifdef HAVE_STRUCT_TM_TM_ZONE ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++SIMPLE_TEST(struct tm tm; tm.tm_zone); ++ ++#endif /* HAVE_STRUCT_TM_TM_ZONE */ ++ ++#ifdef HAVE_ATTRIBUTE ++ ++#if 0 ++static void test int __attribute((unused)) var) ++{ ++ int __attribute__((unused)) x = var; ++} ++ ++int main(void) ++{ ++ test(19); ++} ++ ++#else ++int ++main () ++{ ++int __attribute__((unused)) x ++ ; ++ return 0; ++} ++#endif ++ ++ ++#endif /* HAVE_ATTRIBUTE */ ++ ++#ifdef HAVE_FUNCTION ++ ++#ifdef FC_DUMMY_MAIN ++#ifndef FC_DUMMY_MAIN_EQ_F77 ++# ifdef __cplusplus ++ extern "C" ++# endif ++ int FC_DUMMY_MAIN() { return 1; } ++#endif ++#endif ++int ++main () ++{ ++(void)__FUNCTION__ ++ ; ++ return 0; ++} ++ ++#endif /* HAVE_FUNCTION */ ++ ++#ifdef HAVE_TM_GMTOFF ++ ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++SIMPLE_TEST(struct tm tm; tm.tm_gmtoff=0); ++ ++#endif /* HAVE_TM_GMTOFF */ ++ ++#ifdef HAVE___TM_GMTOFF ++ ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++SIMPLE_TEST(struct tm tm; tm.__tm_gmtoff=0); ++ ++#endif /* HAVE_TM_GMTOFF */ ++ ++#ifdef HAVE_TIMEZONE ++ ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++SIMPLE_TEST(timezone=0); ++ ++#endif /* HAVE_TIMEZONE */ ++ ++#ifdef HAVE_STRUCT_TIMEZONE ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++SIMPLE_TEST(struct timezone tz; tz.tz_minuteswest=0); ++ ++#endif /* HAVE_STRUCT_TIMEZONE */ ++ ++#ifdef HAVE_STAT_ST_BLOCKS ++ ++#include ++SIMPLE_TEST(struct stat sb; sb.st_blocks=0); ++ ++#endif /* HAVE_STAT_ST_BLOCKS */ ++ ++#ifdef PRINTF_LL_WIDTH ++ ++#ifdef HAVE_LONG_LONG ++# define LL_TYPE long long ++#else /* HAVE_LONG_LONG */ ++# define LL_TYPE __int64 ++#endif /* HAVE_LONG_LONG */ ++ ++#include ++#include ++#include ++ ++int main(void) ++{ ++ char *llwidthArgs[] = { "I64", "l64", "l", "L", "q", "ll", NULL }; ++ ++ char *s = malloc(128); ++ char **currentArg = NULL; ++ LL_TYPE x = (LL_TYPE)1048576 * (LL_TYPE)1048576; ++ for (currentArg = llwidthArgs; *currentArg != NULL; currentArg++) ++ { ++ char formatString[64]; ++ sprintf(formatString, "%%%sd", *currentArg); ++ sprintf(s, formatString, x); ++ if (strcmp(s, "1099511627776") == 0) ++ { ++ printf("PRINTF_LL_WIDTH=[%s]\n", *currentArg); ++ return 0; ++ } ++ } ++ return 1; ++} ++ ++#endif /* PRINTF_LL_WIDTH */ ++ ++#ifdef SYSTEM_SCOPE_THREADS ++#include ++#include ++ ++int main(void) ++{ ++ pthread_attr_t attribute; ++ int ret; ++ ++ pthread_attr_init(&attribute); ++ ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); ++ if (ret==0) ++ return 0; ++ return 1; ++} ++ ++#endif /* SYSTEM_SCOPE_THREADS */ ++ ++#ifdef HAVE_SOCKLEN_T ++ ++#include ++#include ++#ifdef HAVE_UNISTD_H ++#include ++#endif ++#ifdef HAVE_SYS_TYPES_H ++#include ++#endif ++#ifdef HAVE_SYS_SOCKET_H ++#include ++#endif ++ ++SIMPLE_TEST(socklen_t foo); ++ ++#endif /* HAVE_SOCKLEN_T */ ++ ++#ifdef DEV_T_IS_SCALAR ++ ++#ifdef HAVE_SYS_TYPES_H ++#include ++#endif ++ ++int main () ++{ ++ dev_t d1, d2; ++ if(d1==d2) ++ return 0; ++ return 1; ++} ++ ++#endif /* DEV_T_IS_SCALAR */ ++ ++#ifdef HAVE_OFF64_T ++#include ++int main() ++{ ++ off64_t n = 0; ++ return (int)n; ++} ++#endif ++ ++#ifdef HAVE_STAT64_STRUCT ++#include ++#include ], ++struct stat64 sb; ++int main() ++{ ++ return 0; ++} ++#endif ++ ++#ifdef TEST_DIRECT_VFD_WORKS ++#include ++#include ++#include ++int main(void) ++{ ++ int fid; ++ if((fid=open("tst_file", O_CREAT | O_TRUNC | O_DIRECT, 0755))<0) ++ return 1; ++ close(fid); ++ remove("tst_file"); ++ return 0; ++} ++#endif ++ ++#ifdef HAVE_DIRECT ++ SIMPLE_TEST(posix_memalign()); ++#endif ++ ++#ifdef TEST_LFS_WORKS ++/* Return 0 when LFS is available and 1 otherwise. */ ++#define _LARGEFILE_SOURCE ++#define _LARGEFILE64_SOURCE ++#define _LARGE_FILES ++#define _FILE_OFFSET_BITS 64 ++#include ++#include ++#include ++#include ++ ++int main(int argc, char **argv) ++{ ++ /* check that off_t can hold 2^63 - 1 and perform basic operations... */ ++#define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ if (OFF_T_64 % 2147483647 != 1) ++ return 1; ++ ++ /* stat breaks on SCO OpenServer */ ++ struct stat buf; ++ stat( argv[0], &buf ); ++ if (!S_ISREG(buf.st_mode)) ++ return 2; ++ ++ FILE *file = fopen( argv[0], "r" ); ++ off_t offset = ftello( file ); ++ fseek( file, offset, SEEK_CUR ); ++ fclose( file ); ++ return 0; ++} ++#endif ++ ++#ifdef GETTIMEOFDAY_GIVES_TZ ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int main(void) ++{ ++ struct timeval tv; ++ struct timezone tz; ++ tz.tz_minuteswest = 7777; /* Initialize to an unreasonable number */ ++ tz.tz_dsttime = 7; ++ gettimeofday(&tv, &tz); ++ /* Check whether the function returned any value at all */ ++ if(tz.tz_minuteswest == 7777 && tz.tz_dsttime == 7) ++ return 1; ++ else return 0; ++} ++#endif ++ ++#ifdef LONE_COLON ++int main(int argc, char * argv) ++{ ++ return 0; ++} ++#endif ++ ++#ifdef CXX_HAVE_OFFSETOF ++ ++#include ++#include ++ ++#ifdef FC_DUMMY_MAIN ++#ifndef FC_DUMMY_MAIN_EQ_F77 ++# ifdef __cplusplus ++extern "C" ++# endif ++int FC_DUMMY_MAIN() ++{ return 1;} ++#endif ++#endif ++int ++main () ++{ ++ ++ struct index_st ++ { ++ unsigned char type; ++ unsigned char num; ++ unsigned int len; ++ }; ++ typedef struct index_st index_t; ++ int x,y; ++ x = offsetof(struct index_st, len); ++ y = offsetof(index_t, num) ++ ++ ; ++ return 0; ++} ++ ++#endif ++ ++#ifdef HAVE_GPFS ++ ++#include ++int main () ++{ ++ int fd = 0; ++ gpfs_fcntl(fd, (void *)0); ++} ++ ++#endif /* HAVE_GPFS */ ++ ++#ifdef HAVE_IOEO ++ ++#include ++typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); ++int main () ++{ ++ PGNSI pGNSI; ++ pGNSI = (PGNSI) GetProcAddress( ++ GetModuleHandle(TEXT("kernel32.dll")), ++ "InitOnceExecuteOnce"); ++ if(NULL == pGNSI) ++ return 1; ++ else ++ return 0; ++} ++ ++#endif /* HAVE_IOEO */ ++ ++#ifdef HAVE_STRUCT_VIDEOCONFIG ++ ++SIMPLE_TEST(struct videoconfig w; w.numtextcols=0); ++ ++#endif /* HAVE_TM_GMTOFF */ ++ ++#ifdef HAVE_STRUCT_TEXT_INFO ++ ++SIMPLE_TEST(struct text_info w; w.screenwidth=0); ++ ++#endif /* HAVE_TM_GMTOFF */ ++ ++ ++#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline ) ++#ifndef __cplusplus ++typedef int foo_t; ++static INLINE_TEST_INLINE foo_t static_foo () { return 0; } ++INLINE_TEST_INLINE foo_t foo () {return 0; } ++int main() { return 0; } ++#endif ++ ++#endif /* INLINE_TEST */ +-- +2.15.1.windows.2 + From 5315e305dcd1c75d1fa8fca4a0d7534136dffb70 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 18 Dec 2018 13:20:28 -0500 Subject: [PATCH 31/53] Alembic : add Windows configuration --- Alembic/config.py | 51 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/Alembic/config.py b/Alembic/config.py index 627e1a06ec..4e6dd42f4b 100644 --- a/Alembic/config.py +++ b/Alembic/config.py @@ -37,19 +37,56 @@ "manifest" : [ - "bin/abcconvert", - "bin/abcecho", - "bin/abcechobounds", - "bin/abcls", - "bin/abcstitcher", - "bin/abctree", + "bin/abcconvert{executableExtension}", + "bin/abcecho{executableExtension}", + "bin/abcechobounds{executableExtension}", + "bin/abcls{executableExtension}", + "bin/abcstitcher{executableExtension}", + "bin/abctree{executableExtension}", "include/Alembic", - "lib/libAlembic*", + "lib/{libraryPrefix}Alembic*", + "lib/{libraryPrefix}Alembic*.lib", "python/alembic*", ], + "platform:windows" : { + + "commands" : [ + + "cmake" + " -G {cmakeGenerator}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D CMAKE_PREFIX_PATH={buildDir}" + " -D ALEMBIC_NO_TESTS=ON" + " -D ALEMBIC_NO_OPENGL=ON" + " -D Boost_NO_SYSTEM_PATHS=ON" + " -D Boost_NO_BOOST_CMAKE=ON" + " -D BOOST_ROOT={buildDir}" + " -D HDF5_ROOT={buildDir}" + " -D ILMBASE_ROOT={buildDir}" + " -D USE_TESTS=OFF" + " -D USE_HDF5=ON" + " -D USE_PYILMBASE=OFF" + " -D USE_PYALEMBIC=OFF" + " -D USE_ARNOLD=OFF" + " -D USE_PRMAN=OFF" + " -D USE_MAYA=OFF" + " -D ALEMBIC_LIB_USES_BOOST=TRUE" + " -D ALEMBIC_ILMBASE_HALF_LIB={buildDir}\\lib\\half.lib" + " -D ALEMBIC_ILMBASE_IEX_LIB={buildDir}\\lib\\Iex.lib" + " -D ALEMBIC_ILMBASE_IEXMATH_LIB={buildDir}\\lib\\IexMath.lib" + " -D ALEMBIC_ILMBASE_ILMTHREAD_LIB={buildDir}\\lib\\IlmThread.lib" + " -D ALEMBIC_ILMBASE_IMATH_LIB={buildDir}\\lib\\Imath.lib" + " .", + "cmake --build . --config {cmakeBuildType} --target install" + + ], + + }, + } From 7f5d49aecf7534ea8cb591e3061b8f44bfb53cb6 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 18 Dec 2018 11:22:35 -0500 Subject: [PATCH 32/53] Xerces : add Windows configuration --- Xerces/config.py | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/Xerces/config.py b/Xerces/config.py index cf10d62081..5ffdb11737 100644 --- a/Xerces/config.py +++ b/Xerces/config.py @@ -2,7 +2,7 @@ "downloads" : [ - "https://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.2.2.tar.gz", + "http://apache.mirror.anlx.net//xerces/c/3/sources/xerces-c-3.2.3.tar.gz" ], @@ -12,16 +12,38 @@ "commands" : [ - "./configure --prefix={buildDir} --without-icu", - "make -j {jobs}", - "make install", - + "mkdir gafferBuild", + "cd gafferBuild &&" + " cmake" + " -G {cmakeGenerator}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " ..", + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}" ], "manifest" : [ - "lib/libxerces-c*{sharedLibraryExtension}*", + "lib/{libraryPrefix}xerces-c*{sharedLibraryExtension}*", + "lib/{libraryPrefix}xerces-c*.lib", ], + "platform:windows" : { + + "commands" : [ + + "mkdir gafferBuild", + "cd gafferBuild &&" + " cmake" + " -G {cmakeGenerator}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D BUILD_SHARED_LIBS=OFF" + " ..", + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}", + + ] + + } } From 6bd7164e073b6b97bd275ce86a7746da702a3e51 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 18 Dec 2018 13:23:34 -0500 Subject: [PATCH 33/53] Appleseed : add Windows configuration --- Appleseed/config.py | 74 ++++++++++++++++++- .../windows/0001-remove_boost_namespace.patch | 10 +++ Appleseed/patches/windows/0002-win-vs.patch | 17 +++++ Appleseed/patches/windows/unique_ptr_1.patch | 11 +++ Appleseed/patches/windows/unique_ptr_2.patch | 11 +++ Appleseed/patches/windows/unique_ptr_3.patch | 22 ++++++ 6 files changed, 143 insertions(+), 2 deletions(-) create mode 100644 Appleseed/patches/windows/0001-remove_boost_namespace.patch create mode 100644 Appleseed/patches/windows/0002-win-vs.patch create mode 100644 Appleseed/patches/windows/unique_ptr_1.patch create mode 100644 Appleseed/patches/windows/unique_ptr_2.patch create mode 100644 Appleseed/patches/windows/unique_ptr_3.patch diff --git a/Appleseed/config.py b/Appleseed/config.py index 0bb4370408..c2889d9a54 100644 --- a/Appleseed/config.py +++ b/Appleseed/config.py @@ -2,7 +2,7 @@ "downloads" : [ - "https://github.com/appleseedhq/appleseed/archive/2.1.0-beta.tar.gz" + "https://github.com/appleseedhq/appleseed/archive/2.0.5-beta.tar.gz" ], @@ -57,7 +57,7 @@ " -D BOOST_ROOT={buildDir}" " -D Boost_NO_SYSTEM_PATHS=ON" " ..", - + "cd build && make install -j {jobs} VERBOSE=1" ], @@ -105,5 +105,75 @@ "appleseed/shaders", ], + "platform:windows" : { + + "enabled" : False, + + "variables" : { + "cmakeGenerator" : "\"Visual Studio 15 2017 Win64\"", + }, + + "environment" : { + + "PATH" : "%PATH%;{buildDir}\\lib;{buildDir}\\bin", + + }, + + "commands" : [ + "if not exist \"build\" mkdir build", + "cd build &&" + " cmake" + " -G {cmakeGenerator}" + " -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D PYTHON_LIBRARY={pythonLibDir}\\python{pythonMajorVersion}{pythonMinorVersion}.lib" + " -D PYTHON_INCLUDE_DIR={pythonIncludeDir}" + " -D WITH_OSL=ON" + " -D WITH_CLI=ON" + " -D WITH_STUDIO=OFF" + " -D WITH_TOOLS=OFF" + " -D WITH_PYTHON=ON" + " -D WITH_PYTHON2_BINDINGS=OFF" + " -D WITH_PYTHON3_BINDINGS=ON" + " -D PYTHON3_INCLUDE_DIR={pythonIncludeDir}" + " -D PYTHON_MAJOR_VERSION={pythonMajorVersion}" + " -D PYTHON_MINOR_VERSION={pythonMinorVersion}" + " -D Boost_PYTHON3_LIBRARY={buildDir}/lib/boost_python{pythonMajorVersion}{pythonMinorVersion}{sharedLibraryExtension}" + " -D WITH_OSL=ON" + " -D WITH_TESTS=OFF" + " -D USE_STATIC_BOOST=OFF" + " -D USE_STATIC_OIIO=OFF" + " -D USE_STATIC_EXR=OFF" + " -D USE_STATIC_OSL=OFF" + " -D USE_EXTERNAL_ZLIB=ON" + " -D USE_EXTERNAL_EXR=ON" + " -D USE_EXTERNAL_PNG=ON" + " -D USE_EXTERNAL_XERCES=ON" + " -D USE_EXTERNAL_OSL=ON" + " -D USE_EXTERNAL_OIIO=ON" + " -D USE_EXTERNAL_ALEMBIC=ON" + " -D WARNINGS_AS_ERRORS=OFF" + " -D USE_SSE=ON" + " -D CMAKE_PREFIX_PATH={buildDir}" + " -D CMAKE_INSTALL_PREFIX={buildDir}\\appleseed" + " -D BOOST_ROOT={buildDir}" + " -D IMATH_INCLUDE_DIRS={buildDir}\\include" + " -D IMATH_HALF_LIBRARY={buildDir}\\lib\\Half.lib" + " -D IMATH_IEX_LIBRARY={buildDir}\\lib\\Iex.lib" + " -D IMATH_MATH_LIBRARY={buildDir}\\lib\\Imath.lib" + " -D OPENEXR_INCLUDE_DIRS={buildDir}\\include" + " -D OPENEXR_IMF_LIBRARY={buildDir}\\lib\\IlmImf.lib" + " -D OPENEXR_THREADS_LIBRARY={buildDir}\\lib\\IlmThread.lib" + " -D XERCES_LIBRARY={buildDir}\\lib\\xerces-c_3.lib" + " -D OSL_INCLUDE_DIR={buildDir}\\include" + " -D LLVM_LIBS_DIR={buildDir}\\lib" + " OSL_EXEC_LIBRARY={buildDir}\\lib\\oslexec.lib" + " OSL_COMP_LIBRARY={buildDir}\\lib\\oslcomp.lib" + " OSL_QUERY_LIBRARY={buildDir}\\lib\\oslquery.lib" + " ..", + "cd build && cmake --build . --config {cmakeBuildType} --target install", + ] + + } } diff --git a/Appleseed/patches/windows/0001-remove_boost_namespace.patch b/Appleseed/patches/windows/0001-remove_boost_namespace.patch new file mode 100644 index 0000000000..9119ff1a7d --- /dev/null +++ b/Appleseed/patches/windows/0001-remove_boost_namespace.patch @@ -0,0 +1,10 @@ +--- a/src/appleseed/renderer/meta/tests/test_tracer.cpp 2020-05-14 18:34:13.413540600 -0400 ++++ b/src/appleseed/renderer/meta/tests/test_tracer.cpp 2020-05-14 18:32:10.040808300 -0400 +@@ -83,7 +83,6 @@ + + using namespace foundation; + using namespace renderer; +-using namespace boost; + using namespace std; + + TEST_SUITE(Renderer_Kernel_Lighting_Tracer) diff --git a/Appleseed/patches/windows/0002-win-vs.patch b/Appleseed/patches/windows/0002-win-vs.patch new file mode 100644 index 0000000000..18c80ab9da --- /dev/null +++ b/Appleseed/patches/windows/0002-win-vs.patch @@ -0,0 +1,17 @@ +--- a/cmake/config/win-vs.txt 2020-05-14 19:22:32.135735200 -0400 ++++ b/cmake/config/win-vs.txt 2020-05-14 19:24:49.460860100 -0400 +@@ -312,10 +312,10 @@ + + macro (link_against_osl target) + set (LLVM_LIBS +- LLVMLTO LLVMLinker LLVMipo LLVMVectorize LLVMBitWriter LLVMTableGen LLVMDebugInfo LLVMOption LLVMX86Disassembler LLVMX86AsmParser ++ LLVMLTO LLVMLinker LLVMipo LLVMVectorize LLVMBitWriter LLVMTableGen LLVMOption LLVMX86Disassembler LLVMX86AsmParser +- LLVMX86CodeGen LLVMSelectionDAG LLVMAsmPrinter LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter LLVMX86Utils LLVMIRReader LLVMBitReader ++ LLVMX86CodeGen LLVMSelectionDAG LLVMAsmPrinter LLVMX86Desc LLVMX86Info LLVMX86Utils LLVMIRReader LLVMBitReader +- LLVMAsmParser LLVMMCDisassembler LLVMMCParser LLVMInstrumentation LLVMInterpreter LLVMMCJIT LLVMJIT LLVMCodeGen LLVMObjCARCOpts +- LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMRuntimeDyld LLVMExecutionEngine LLVMTarget LLVMMC ++ LLVMAsmParser LLVMMCDisassembler LLVMMCParser LLVMInstrumentation LLVMInterpreter LLVMMCJIT LLVMCodeGen LLVMObjCARCOpts ++ LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMAnalysis LLVMRuntimeDyld LLVMExecutionEngine LLVMTarget LLVMMC + LLVMObject LLVMCore LLVMSupport + ) + diff --git a/Appleseed/patches/windows/unique_ptr_1.patch b/Appleseed/patches/windows/unique_ptr_1.patch new file mode 100644 index 0000000000..2b270b9e1f --- /dev/null +++ b/Appleseed/patches/windows/unique_ptr_1.patch @@ -0,0 +1,11 @@ +--- ./src/appleseed/foundation/image/genericimagefilewriter.cpp ++++ ./src/appleseed/foundation/image/genericimagefilewriter.cpp +@@ -79,7 +79,7 @@ + { + // Destroy the ImageOutput stucture. + if (m_writer != nullptr) +- OIIO::ImageOutput::destroy(m_writer); ++ OIIO::ImageOutput::destroy(m_writer.release()); + + delete impl; + } diff --git a/Appleseed/patches/windows/unique_ptr_2.patch b/Appleseed/patches/windows/unique_ptr_2.patch new file mode 100644 index 0000000000..3c9809a0b0 --- /dev/null +++ b/Appleseed/patches/windows/unique_ptr_2.patch @@ -0,0 +1,11 @@ +--- ./src/appleseed/foundation/image/genericimagefilewriter.h ++++ ./src/appleseed/foundation/image/genericimagefilewriter.h +@@ -92,7 +92,7 @@ + struct Impl; + Impl* impl; + +- OIIO::ImageOutput* m_writer; ++ std::unique_ptr m_writer; + const char* m_filename; + }; + diff --git a/Appleseed/patches/windows/unique_ptr_3.patch b/Appleseed/patches/windows/unique_ptr_3.patch new file mode 100644 index 0000000000..d8c1222bd7 --- /dev/null +++ b/Appleseed/patches/windows/unique_ptr_3.patch @@ -0,0 +1,22 @@ +--- ./src/appleseed/foundation/image/genericprogressiveimagefilereader.cpp ++++ ./src/appleseed/foundation/image/genericprogressiveimagefilereader.cpp +@@ -65,7 +65,7 @@ + { + Logger* m_logger; + string m_filename; +- OIIO::ImageInput* m_input; ++ std::unique_ptr m_input; + bool m_supports_random_access; + bool m_is_tiled; + CanvasProperties m_props; +@@ -177,9 +177,7 @@ + // but OpenImageIO 1.5.20 (the version included in appleseed-deps at the time + // of writing) is too old to have this method. Since on Windows we link to + // OpenImageIO statically, this should be safe anyway. +- delete impl->m_input; +- +- impl->m_input = nullptr; ++ OIIO::ImageInput::destroy(impl->m_input.release()); + } + + bool GenericProgressiveImageFileReader::is_open() const From 4ee5633a9c48684bcbf4198cb3b17e6576796c08 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 18 Dec 2018 14:19:55 -0500 Subject: [PATCH 34/53] GafferResources : add Windows configuration --- GafferResources/config.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/GafferResources/config.py b/GafferResources/config.py index a66ed41b71..89b7532fd1 100644 --- a/GafferResources/config.py +++ b/GafferResources/config.py @@ -21,5 +21,14 @@ "resources", ], + "platform:windows" : { + + "commands" : [ + + "xcopy /s /e /h /y /i resources {buildDir}\\resources", + + ], + + } } From e78561409c0b9465b444e94b1cd01ac8e1a72752 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 18 Dec 2018 13:11:06 -0500 Subject: [PATCH 35/53] USD : add Windows configuration --- USD/config.py | 115 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 87 insertions(+), 28 deletions(-) diff --git a/USD/config.py b/USD/config.py index 62e8a817d3..0999f96536 100644 --- a/USD/config.py +++ b/USD/config.py @@ -57,37 +57,67 @@ "manifest" : [ "bin/usd*", - "bin/sdfdump", + "bin/sdfdump{executableExtension}", "include/pxr", - "lib/libtrace{sharedLibraryExtension}", - "lib/libarch{sharedLibraryExtension}", - "lib/libtf{sharedLibraryExtension}", - "lib/libjs{sharedLibraryExtension}", - "lib/libwork{sharedLibraryExtension}", - "lib/libplug{sharedLibraryExtension}", - "lib/libkind{sharedLibraryExtension}", - "lib/libgf{sharedLibraryExtension}", - "lib/libvt{sharedLibraryExtension}", - "lib/libar{sharedLibraryExtension}", - "lib/libsdf{sharedLibraryExtension}", - "lib/libpcp{sharedLibraryExtension}", - "lib/libusd*{sharedLibraryExtension}", - "lib/libndr{sharedLibraryExtension}", - "lib/libsdr{sharedLibraryExtension}", - "lib/libhd{sharedLibraryExtension}", - "lib/libhdx{sharedLibraryExtension}", - "lib/libhdSt{sharedLibraryExtension}", - "lib/libhio{sharedLibraryExtension}", - "lib/libglf{sharedLibraryExtension}", - "lib/libgarch{sharedLibraryExtension}", - "lib/libhgi{sharedLibraryExtension}", - "lib/libhgiInterop{sharedLibraryExtension}", - "lib/libhgiGL{sharedLibraryExtension}", - "lib/libhf{sharedLibraryExtension}", - "lib/libcameraUtil{sharedLibraryExtension}", - "lib/libpxOsd{sharedLibraryExtension}", + # lib prefix is accurate for all platforms + "lib/{libraryPrefix}trace{sharedLibraryExtension}", + "lib/{libraryPrefix}arch{sharedLibraryExtension}", + "lib/{libraryPrefix}tf{sharedLibraryExtension}", + "lib/{libraryPrefix}js{sharedLibraryExtension}", + "lib/{libraryPrefix}work{sharedLibraryExtension}", + "lib/{libraryPrefix}plug{sharedLibraryExtension}", + "lib/{libraryPrefix}kind{sharedLibraryExtension}", + "lib/{libraryPrefix}gf{sharedLibraryExtension}", + "lib/{libraryPrefix}vt{sharedLibraryExtension}", + "lib/{libraryPrefix}ar{sharedLibraryExtension}", + "lib/{libraryPrefix}sdf{sharedLibraryExtension}", + "lib/{libraryPrefix}pcp{sharedLibraryExtension}", + "lib/{libraryPrefix}usd*{sharedLibraryExtension}", + "lib/{libraryPrefix}ndr{sharedLibraryExtension}", + "lib/{libraryPrefix}sdr{sharedLibraryExtension}", + "lib/{libraryPrefix}hd{sharedLibraryExtension}", + "lib/{libraryPrefix}hdx{sharedLibraryExtension}", + "lib/{libraryPrefix}hdSt{sharedLibraryExtension}", + "lib/{libraryPrefix}hio{sharedLibraryExtension}", + "lib/{libraryPrefix}glf{sharedLibraryExtension}", + "lib/{libraryPrefix}garch{sharedLibraryExtension}", + "lib/{libraryPrefix}hgi{sharedLibraryExtension}", + "lib/{libraryPrefix}hgiInterop{sharedLibraryExtension}", + "lib/{libraryPrefix}hgiGL{sharedLibraryExtension}", + "lib/{libraryPrefix}hf{sharedLibraryExtension}", + "lib/{libraryPrefix}cameraUtil{sharedLibraryExtension}", + "lib/{libraryPrefix}pxOsd{sharedLibraryExtension}", + + "lib/{libraryPrefix}trace{staticLibraryExtension}", + "lib/{libraryPrefix}arch{staticLibraryExtension}", + "lib/{libraryPrefix}tf{staticLibraryExtension}", + "lib/{libraryPrefix}js{staticLibraryExtension}", + "lib/{libraryPrefix}work{staticLibraryExtension}", + "lib/{libraryPrefix}plug{staticLibraryExtension}", + "lib/{libraryPrefix}kind{staticLibraryExtension}", + "lib/{libraryPrefix}gf{staticLibraryExtension}", + "lib/{libraryPrefix}vt{staticLibraryExtension}", + "lib/{libraryPrefix}ar{staticLibraryExtension}", + "lib/{libraryPrefix}sdf{staticLibraryExtension}", + "lib/{libraryPrefix}pcp{staticLibraryExtension}", + "lib/{libraryPrefix}usd*{staticLibraryExtension}", + "lib/{libraryPrefix}ndr{staticLibraryExtension}", + "lib/{libraryPrefix}sdr{staticLibraryExtension}", + "lib/{libraryPrefix}hd{staticLibraryExtension}", + "lib/{libraryPrefix}hdx{staticLibraryExtension}", + "lib/{libraryPrefix}hdSt{staticLibraryExtension}", + "lib/{libraryPrefix}hio{staticLibraryExtension}", + "lib/{libraryPrefix}glf{staticLibraryExtension}", + "lib/{libraryPrefix}garch{staticLibraryExtension}", + "lib/{libraryPrefix}hgi{staticLibraryExtension}", + "lib/{libraryPrefix}hgiInterop{staticLibraryExtension}", + "lib/{libraryPrefix}hgiGL{staticLibraryExtension}", + "lib/{libraryPrefix}hf{staticLibraryExtension}", + "lib/{libraryPrefix}cameraUtil{staticLibraryExtension}", + "lib/{libraryPrefix}pxOsd{staticLibraryExtension}", + "lib/usd", "python/pxr", @@ -104,6 +134,35 @@ "extraArguments" : "-D PXR_USE_PYTHON_3=TRUE", }, + + }, + + "platform:windows" : { + + "commands" : [ + + "mkdir gafferBuild", + "cd gafferBuild && " + " cmake" + " -G {cmakeGenerator}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D CMAKE_PREFIX_PATH={buildDir}" + " -D Boost_NO_BOOST_CMAKE=TRUE" + " -D PXR_BUILD_IMAGING=FALSE" + " -D PXR_BUILD_TESTS=FALSE" + " -D Boost_NO_SYSTEM_PATHS=TRUE" + " -D PXR_BUILD_ALEMBIC_PLUGIN=TRUE" + " -D PXR_ENABLE_HDF5_SUPPORT=FALSE" + " -D ALEMBIC_DIR={buildDir}\\lib" + " -D OPENEXR_LOCATION={buildDir}\\lib" + " ..", + + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -- -j {jobs}", + + "xcopy /s /e /h /y /i {buildDir}\\lib\\python\\pxr {buildDir}\\python\\pxr", + + ], }, From 40b89c7662a7dcbda102d7169f6ea8ce61c64a9c Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 18 Dec 2018 13:24:34 -0500 Subject: [PATCH 36/53] PyOpenGL : add Windows configuration --- PyOpenGL/config.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PyOpenGL/config.py b/PyOpenGL/config.py index a246193ef3..0248e3a6f2 100644 --- a/PyOpenGL/config.py +++ b/PyOpenGL/config.py @@ -31,6 +31,16 @@ "python/OpenGL", ], + + "platform:windows" : { + + "commands" : [ + + "{buildDir}\\bin\\python setup.py install {extraArgs} --root / --prefix {buildDir} --install-lib {buildDir}\\python", + + ] + + }, "variables" : { From 811e4311b251dd03355dd0412cdca1a357371d6c Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Sun, 8 Apr 2018 15:09:30 -0400 Subject: [PATCH 37/53] PySide : add Windows configuration --- PySide/config.py | 44 +++++++++++++++++++ .../windows/0001-ez_setup_quotes.patch | 11 +++++ 2 files changed, 55 insertions(+) create mode 100644 PySide/patches/windows/0001-ez_setup_quotes.patch diff --git a/PySide/config.py b/PySide/config.py index 9b0134f8b4..23f2d1292d 100644 --- a/PySide/config.py +++ b/PySide/config.py @@ -25,6 +25,14 @@ ], + "manifest" : [ + + "include/PySide2", + "lib/python{pythonVersion}/site-packages/PySide2", + "lib/python{pythonVersion}/site-packages/pyside2uic", + + ], + "platform:linux" : { "environment" : { @@ -51,4 +59,40 @@ }, + "platform:windows" : { + + "manifest" : [ + + "include/PySide2", + "python/PySide2", + "python/pyside2uic", + "python/shiboken2", + "python/shiboken2_generator", + + ], + + "environment" : { + + "PATH" : "{buildDir}\\bin;{buildDir}\\lib;%PATH%", + "VERSION" : "", # PySide will pull in VERSION from the environment if it exists and cause a failure because the --ignore-git conflicts with VERSION + + }, + + "commands" : [ + "xcopy /s /e /h /y /i %ROOT_DIR%\\PySide\\working\\pyside-setup-opensource-src-5.15.2 %ROOT_DIR%\\PySide\\working\\p", # Shorten overall paths to avoid Windows command character limit + "cd ..\\p && python setup.py install" + " --ignore-git" + " --qmake=%BUILD_DIR%\\bin\\qmake.exe" + " --openssl={buildDir}\\lib" + " --cmake=\"C:\\Program Files\\CMake\\bin\\cmake.exe\"" + " --parallel {jobs}" + " --no-examples", + + "xcopy /s /e /h /y /i {buildDir}\\lib\\site-packages\\PySide2 {buildDir}\\python\\PySide2", + "xcopy /s /e /h /y /i {buildDir}\\lib\\site-packages\\shiboken2 {buildDir}\\python\\shiboken2", + "xcopy /s /e /h /y /i {buildDir}\\lib\\site-packages\\shiboken2_generator {buildDir}\\python\\shiboken2_generator", + + ] + }, + } diff --git a/PySide/patches/windows/0001-ez_setup_quotes.patch b/PySide/patches/windows/0001-ez_setup_quotes.patch new file mode 100644 index 0000000000..aeb0eedfd5 --- /dev/null +++ b/PySide/patches/windows/0001-ez_setup_quotes.patch @@ -0,0 +1,11 @@ +--- a/./ez_setup.py 2020-05-14 15:33:24.322077700 -0400 ++++ b/./ez_setup.py 2020-05-14 15:32:37.667455100 -0400 +@@ -222,7 +222,7 @@ + ps_cmd = ( + "[System.Net.WebRequest]::DefaultWebProxy.Credentials = " + "[System.Net.CredentialCache]::DefaultCredentials; " +- "(new-object System.Net.WebClient).DownloadFile({}, {})".format( ++ "(new-object System.Net.WebClient).DownloadFile(\"{}\", \"{}\")".format( + url, target)) + # ) + cmd = [ From 095ce397ea47f6e57ffbbbbacf0b90e7f3690dd0 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 2 May 2018 10:55:37 -0400 Subject: [PATCH 38/53] Qt.py : add Windows configuration --- Qt.py/config.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Qt.py/config.py b/Qt.py/config.py index 610702fa85..a822638578 100644 --- a/Qt.py/config.py +++ b/Qt.py/config.py @@ -23,4 +23,14 @@ ], -} + "platform:windows" : { + + "commands" : [ + + "copy Qt.py {buildDir}\\python", + + ] + + } + +} \ No newline at end of file From cd5aa40247e29ea30cf1b9335e4b8572dd1299ce Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 20 May 2020 10:57:10 -0400 Subject: [PATCH 39/53] Qt : add Windows configuration --- Qt/config.py | 60 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/Qt/config.py b/Qt/config.py index ba7ecc251e..b816fc927d 100644 --- a/Qt/config.py +++ b/Qt/config.py @@ -48,14 +48,14 @@ "manifest" : [ - "bin/moc", - "bin/qmake", - "bin/rcc", - "bin/uic", + "bin/moc{executableExtension}", + "bin/qmake{executableExtension}", + "bin/rcc{executableExtension}", + "bin/uic{executableExtension}", "include/Qt*", - "lib/libQt*", + "lib/{libraryPrefix}Qt*", "lib/Qt*.framework", "mkspecs", @@ -90,4 +90,54 @@ }, + "platform:windows" : { + + "environment" : { + + "PATH" : "%ROOT_DIR%\\Qt\\working\\qt-everywhere-src-5.15.2\\qtbase\\lib;{buildDir}\\lib;{buildDir}\\bin;%PATH%", + + }, + + "commands" : [ + + "copy {buildDir}\\lib\\zlib.lib {buildDir}\\lib\\zdll.lib", + "copy {buildDir}\\lib\\libpng16.lib {buildDir}\\lib\\libpng.lib", + "copy {buildDir}\\lib\\jpeg.lib {buildDir}\\lib\\libjpeg.lib", + # help Qt find the right zlib.dll + "copy {buildDir}\\bin\\zlib.dll %ROOT_DIR%\\Qt\\working\\qt-everywhere-src-5.15.2\\qtbase\\bin\\zlib.dll", + "call configure.bat" + " -prefix {buildDir}" + " -plugindir {buildDir}\\qt\\plugins" + " -release" + " -opensource" + " -confirm-license" + " -opengl desktop" + " -no-angle" + " -no-rpath" + " -no-dbus" + " -skip qtconnectivity" + " -skip qtwebengine" + " -skip qt3d" + " -skip qtdeclarative" + " -skip qtwebchannel" + " -skip qtpurchasing" + " -skip qtgamepad" + " -skip qtspeech" + " -skip qtdatavis3d" + " -skip qtcharts" + " -no-libudev" + " -no-icu" + " -qt-pcre" + " -nomake examples" + " -nomake tests" + " -system-zlib" + " -I {buildDir}\\include" + " -L {buildDir}\\lib", + "jom.exe", + "jom.exe install", + "copy {buildDir}\\bin\\{libraryPrefix}Qt* {buildDir}\\lib\\", + + ] + } + } From e2418fd133d2354772e6a03ae3940fd58a148473 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 24 Jul 2019 12:01:42 -0400 Subject: [PATCH 40/53] OpenEXR : add Windows configuration --- OpenEXR/config.py | 79 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 69 insertions(+), 10 deletions(-) diff --git a/OpenEXR/config.py b/OpenEXR/config.py index 93208943dd..fdd7a3e61d 100644 --- a/OpenEXR/config.py +++ b/OpenEXR/config.py @@ -50,17 +50,76 @@ "bin/exrheader", "include/OpenEXR", - "lib/libIlmImf*{sharedLibraryExtension}*", - "lib/libIex*{sharedLibraryExtension}*", - "lib/libHalf*{sharedLibraryExtension}*", - "lib/libIlmThread*{sharedLibraryExtension}*", - "lib/libImath*{sharedLibraryExtension}*", - "lib/libPyIex*{sharedLibraryExtension}*", - "lib/libPyImath*{sharedLibraryExtension}*", - - "python/iex.so", - "python/imath.so", + "lib/{libraryPrefix}IlmImf*{sharedLibraryExtension}*", + "lib/{libraryPrefix}Iex*{sharedLibraryExtension}*", + "lib/{libraryPrefix}Half*{sharedLibraryExtension}*", + "lib/{libraryPrefix}IlmThread*{sharedLibraryExtension}*", + "lib/{libraryPrefix}Imath*{sharedLibraryExtension}*", + "lib/{libraryPrefix}PyIex*{sharedLibraryExtension}*", + "lib/{libraryPrefix}PyImath*{sharedLibraryExtension}*", + + "lib/{libraryPrefix}IlmImf*.lib", + "lib/{libraryPrefix}Iex*.lib", + "lib/{libraryPrefix}Half*.lib", + "lib/{libraryPrefix}IlmThread*.lib", + "lib/{libraryPrefix}Imath*.lib", + "lib/{libraryPrefix}PyIex*.lib", + "lib/{libraryPrefix}PyImath*.lib", + + "python/iex{pythonModuleExtension}", + "python/imath{pythonModuleExtension}", ], + "platform:windows" : { + + "variables" : { + + "cmakeGenerator" : "\"Visual Studio 15 2017 Win64\"", + + }, + + "downloads" : [ + + "https://github.com/openexr/openexr/archive/v2.4.1.zip" + + ], + + "dependencies" : [ "Python", "Boost", "Zlib" ], + + "commands" : [ + "mkdir gafferBuild", + "cd gafferBuild && cmake" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -G {cmakeGenerator}" + " -D CMAKE_PREFIX_PATH={buildDir}" + " -D OPENEXR_LIB_SUFFIX=" + " -D ILMBASE_LIB_SUFFIX=" + " -D PYILMBASE_LIB_SUFFIX=" + " -D Boost_NO_SYSTEM_PATHS=TRUE" + " -D Boost_NO_BOOST_CMAKE=TRUE" + " -D BOOST_ROOT={buildDir}" + " -D Python_ROOT_DIR={buildDir}" + " -D Python2_ROOT_DIR={buildDir}" + " -D Python3_ROOT_DIR={buildDir}" + " -D Python_NO_SYSTEM_PATHS=TRUE" + " -D Python3_FIND_STRATEGY=LOCATION" + " -D Python2_FIND_STRATEGY=LOCATION" + " -D ZLIB_ROOT={buildDir}" + " ..", + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install", + "if not exist {buildDir}\\python mkdir {buildDir}\\python", + "copy {buildDir}\\lib\\site-packages\\iex.pyd {buildDir}\\python\\iex.pyd", + "copy {buildDir}\\lib\\site-packages\\imath.pyd {buildDir}\\python\\imath.pyd", + "copy {buildDir}\\bin\\{libraryPrefix}IlmImf*{sharedLibraryExtension}* {buildDir}\\lib\\", + "copy {buildDir}\\bin\\{libraryPrefix}Iex*{sharedLibraryExtension}* {buildDir}\\lib\\", + "copy {buildDir}\\bin\\{libraryPrefix}Half*{sharedLibraryExtension}* {buildDir}\\lib\\", + "copy {buildDir}\\bin\\{libraryPrefix}IlmThread*{sharedLibraryExtension}* {buildDir}\\lib\\", + "copy {buildDir}\\bin\\{libraryPrefix}Imath*{sharedLibraryExtension}* {buildDir}\\lib\\", + "copy {buildDir}\\bin\\{libraryPrefix}PyIex*{sharedLibraryExtension}* {buildDir}\\lib\\", + "copy {buildDir}\\bin\\{libraryPrefix}PyImath*{sharedLibraryExtension}* {buildDir}\\lib\\", + ] + }, + } From 8212ca6dcd54ebdb746e580a0b13fd87d8c1adee Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Wed, 24 Jul 2019 17:56:33 -0400 Subject: [PATCH 41/53] OpenVDB : add Windows configuration --- OpenVDB/config.py | 40 ++++++++++++++++++- .../windows/0001-fix_duplicate_exports.patch | 13 ++++++ Qt/config.py | 17 +++++--- 3 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 OpenVDB/patches/windows/0001-fix_duplicate_exports.patch diff --git a/OpenVDB/config.py b/OpenVDB/config.py index ac04190045..8118bd77f3 100644 --- a/OpenVDB/config.py +++ b/OpenVDB/config.py @@ -46,9 +46,47 @@ "include/openvdb", "include/pyopenvdb.h", - "lib/libopenvdb*{sharedLibraryExtension}*", + "lib/{libraryPrefix}openvdb*{sharedLibraryExtension}*", + "lib/{libraryPrefix}openvdb*.lib", "python/pyopenvdb*", ], + "platform:windows" : { + + "variables" : { + + "cmakeGenerator" : "\"Visual Studio 15 2017 Win64\"", + }, + + "commands" : [ + # OpenVDB requests Python 2.7 specifically but Boost doesn't add version numbers until v1.67 + "mkdir gafferBuild", + "cd gafferBuild && " + " cmake" + " -Wno-dev" + " -G {cmakeGenerator}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D OPENVDB_BUILD_UNITTESTS=OFF" + " -D OPENVDB_BUILD_DOCS=OFF" + " -D OPENVDB_BUILD_PYTHON_MODULE=ON" + " -D USE_GLFW3=OFF" + " -D TBB_LOCATION={buildDir}" + " -D BOOST_ROOT={buildDir}" + " -D GLEW_LOCATION={buildDir}" + " -D ILMBASE_LOCATION={buildDir}" + " -D OPENEXR_LOCATION={buildDir}" + " -D BLOSC_LOCATION={buildDir}" + " -D OPENVDB_ENABLE_3_ABI_COMPATIBLE=OFF" + " ..", + + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install", + "move {buildDir}\\bin\\{libraryPrefix}openvdb*{sharedLibraryExtension}* {buildDir}\\lib\\", + "move {buildDir}\\lib\\python{pythonVersion}\\pyopenvdb.pyd {buildDir}\\python\\pyopenvdb.pyd", + "move {buildDir}\\lib\\python{pythonVersion}\\pyopenvdb*.lib {buildDir}\\lib\\" + ], + + }, + } diff --git a/OpenVDB/patches/windows/0001-fix_duplicate_exports.patch b/OpenVDB/patches/windows/0001-fix_duplicate_exports.patch new file mode 100644 index 0000000000..958b8c74ff --- /dev/null +++ b/OpenVDB/patches/windows/0001-fix_duplicate_exports.patch @@ -0,0 +1,13 @@ +--- a/./openvdb/openvdb/python/pyOpenVDBModule.cc ++++ b/./openvdb/openvdb/python/pyOpenVDBModule.cc +@@ -804,10 +804,8 @@ struct VecTypeDescr + + #ifdef DWA_OPENVDB + #define PY_OPENVDB_MODULE_NAME _openvdb +-extern "C" { void init_openvdb(); } + #else + #define PY_OPENVDB_MODULE_NAME pyopenvdb +-extern "C" { void initpyopenvdb(); } + #endif + + BOOST_PYTHON_MODULE(PY_OPENVDB_MODULE_NAME) diff --git a/Qt/config.py b/Qt/config.py index b816fc927d..39a9df1087 100644 --- a/Qt/config.py +++ b/Qt/config.py @@ -115,16 +115,21 @@ " -no-angle" " -no-rpath" " -no-dbus" - " -skip qtconnectivity" - " -skip qtwebengine" " -skip qt3d" + " -skip qtcharts" + " -skip qtconnectivity" + " -skip qtdatavis3d" " -skip qtdeclarative" - " -skip qtwebchannel" - " -skip qtpurchasing" " -skip qtgamepad" + " -skip qtnetworkauth" + " -skip qtpurchasing" + " -skip qtremoteobjects" + " -skip qtsensors" + " -skip qtserialbus" + " -skip qtserialport" " -skip qtspeech" - " -skip qtdatavis3d" - " -skip qtcharts" + " -skip qtwebchannel" + " -skip qtwebengine" " -no-libudev" " -no-icu" " -qt-pcre" From ebf7f1e9fdd187ad9a2fba9e20a8dcfc52673317 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Thu, 14 May 2020 22:37:56 -0400 Subject: [PATCH 42/53] Six : add Windows configuration --- Six/config.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Six/config.py b/Six/config.py index d6845d4d04..d98cde304b 100644 --- a/Six/config.py +++ b/Six/config.py @@ -24,4 +24,15 @@ ], + "platform:windows" : { + + "commands" : [ + + "if not exist {buildDir}\\python mkdir {buildDir}\\python", + "copy six.py {buildDir}\\python", + + ], + + }, + } From 997f8383f3faf8d16dee663d64b3c00bded8188e Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Thu, 14 May 2020 22:38:05 -0400 Subject: [PATCH 43/53] SubProcess32 : disable on Windows --- Subprocess32/config.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Subprocess32/config.py b/Subprocess32/config.py index 22ccfef867..421423e4ff 100644 --- a/Subprocess32/config.py +++ b/Subprocess32/config.py @@ -25,4 +25,17 @@ ], + "manifest" : [ + + "lib/python{pythonVersion}/site-packages/subprocess32.py", + "lib/python{pythonVersion}/site-packages/_posixsubprocess.so", + + ], + + "platform:windows" : { + + "enabled" : False, + + }, + } From 4581f992e391c835078ca84621b0371602f1830c Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Thu, 25 Mar 2021 13:18:01 -0400 Subject: [PATCH 44/53] Cortex : add Windows configuration --- Cortex/config.py | 54 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/Cortex/config.py b/Cortex/config.py index dc2cb00249..0a6c1afc7c 100644 --- a/Cortex/config.py +++ b/Cortex/config.py @@ -64,7 +64,8 @@ "manifest" : [ "include/IECore*", - "lib/libIECore*{sharedLibraryExtension}", + "lib/{libraryPrefix}IECore*{sharedLibraryExtension}", + "lib/{libraryPrefix}IECore*.lib", "python/IECore*", "renderMan", "appleseedDisplays", @@ -75,4 +76,55 @@ ], + "platform:windows" : { + + "dependencies" : [ + "Python", "OpenImageIO", "OpenEXR", "Boost", "OpenShadingLanguage", + "Blosc", "FreeType", "GLEW", "TBB", "OpenVDB", "USD", "Six" + ], + + "commands" : [ + + "scons install installDoc --debug=findlibs" + " -j 8" + " CXXSTD=c++{c++Standard}" + " ENV_VARS_TO_IMPORT='PATH'" + " INSTALL_PREFIX={buildDir}" + " INSTALL_DOC_DIR={buildDir}\\doc\\cortex" + " INSTALL_RMANPROCEDURAL_NAME={buildDir}\\renderMan\\procedurals\\iePython" + " INSTALL_RMANDISPLAY_NAME={buildDir}\\renderMan\\displayDrivers\\ieDisplay" + " INSTALL_PYTHON_DIR={buildDir}\\python" + " INSTALL_ARNOLDOUTPUTDRIVER_NAME={buildDir}\\arnold\\plugins\\ieOutputDriver.dll" + " BUILD_TYPE=RELEASE" + " PYTHON={buildDir}\\bin\\python.exe" + " PYTHON_INCLUDE_PATH={buildDir}\\include" + " PYTHON_LIB_PATH={buildDir}\\libs" + " PYTHON_LINK_FLAGS=" + " BOOST_INCLUDE_PATH={buildDir}\\include\\boost-1_68" + " BOOST_LIB_PATH={buildDir}\\lib" + " BOOST_LIB_SUFFIX={boostLibSuffix}" + " OPENEXR_INCLUDE_PATH={buildDir}\\include" + " OPENEXR_LIB_SUFFIX=" + " OIIO_INCLUDE_PATH={buildDir}\\include\\OpenImageIO" + " OIIO_LIB_PATH={buildDir}\\lib" + " OSL_INCLUDE_PATH={buildDir}\\include" + " BLOSC_INCLUDE_PATH={buildDir}\\include" + " FREETYPE_INCLUDE_PATH={buildDir}\\include\\freetype2" + " FREETYPE_LIB_PATH={buildDir}\\lib" + " WITH_GL=1" + " GLEW_INCLUDE_PATH={buildDir}\\include" + " GLEW_LIB_SUFFIX=32" + " TBB_INCLUDE_PATH={buildDir}\\include" + " ARNOLD_ROOT=%ARNOLD_ROOT%" + " RMAN_ROOT=%RMAN_ROOT" + " USD_INCLUDE_PATH={buildDir}\\include" + " USD_LIB_PATH={buildDir}\\lib" + " PYTHONPATH={buildDir}\\python" + " OPTIONS=" + " WARNINGS_AS_ERRORS=0" + + ] + + }, + } From 41296ecb2e3aad55fd86d5d345a078e66bf13a5e Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 22 Jun 2021 16:13:50 -0400 Subject: [PATCH 45/53] Cortex : temporary patch until 10.2.x is released --- Cortex/config.py | 2 +- Cortex/patches/windows/0001-template_instantiation.patch | 0 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 Cortex/patches/windows/0001-template_instantiation.patch diff --git a/Cortex/config.py b/Cortex/config.py index 0a6c1afc7c..a52d7a5b0f 100644 --- a/Cortex/config.py +++ b/Cortex/config.py @@ -116,7 +116,7 @@ " GLEW_LIB_SUFFIX=32" " TBB_INCLUDE_PATH={buildDir}\\include" " ARNOLD_ROOT=%ARNOLD_ROOT%" - " RMAN_ROOT=%RMAN_ROOT" + " RMAN_ROOT=%RMAN_ROOT%" " USD_INCLUDE_PATH={buildDir}\\include" " USD_LIB_PATH={buildDir}\\lib" " PYTHONPATH={buildDir}\\python" diff --git a/Cortex/patches/windows/0001-template_instantiation.patch b/Cortex/patches/windows/0001-template_instantiation.patch new file mode 100644 index 0000000000..e69de29bb2 From 970ea37b57c37e375296894b83abaf4b25799dff Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Sat, 23 May 2020 15:33:05 -0400 Subject: [PATCH 46/53] LZ4 : add Windows configuration --- LZ4/config.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/LZ4/config.py b/LZ4/config.py index b852ca0c89..a2a0e5ebc0 100644 --- a/LZ4/config.py +++ b/LZ4/config.py @@ -21,4 +21,24 @@ ], + "platform:windows" : { + + "manifest" : [ + + "lib\\liblz4.dll", + "lib\\liblz4.lib", + + ], + + "commands" : [ + + # From the LZ4 appveyor script + "msbuild visual\\VS2017\\lz4.sln /m /verbosity:minimal /property:PlatformToolset=v141 /property:WindowsTargetPlatformVersion=10.0.17763.0 /t:Clean,Build /p:Platform=x64 /p:Configuration=Release", + "copy visual\\VS2017\\bin\\x64_Release\\liblz4.dll {buildDir}\\lib", + "copy visual\\VS2017\\bin\\x64_Release\\liblz4.lib {buildDir}\\lib", + + ], + + }, + } From a98e04841d084febac4f603e6c6e3b4992d2b0b0 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Thu, 15 Oct 2020 16:41:46 -0400 Subject: [PATCH 47/53] LibRAW : add Windows configuration --- LibRaw/config.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/LibRaw/config.py b/LibRaw/config.py index 4ba530e4bd..2e0f39c340 100644 --- a/LibRaw/config.py +++ b/LibRaw/config.py @@ -18,11 +18,27 @@ ], + # The "lib" prefix is correct for all platforms including Windows "manifest" : [ "include/libraw", "lib/libraw*{sharedLibraryExtension}*", + "lib/libraw.{staticLibraryExtension}", ], + "platform:windows" : { + + "commands" : [ + + "nmake -f Makefile.msvc", + "xcopy /s /e /h /y /i libraw include\\libraw", + "copy bin\\libraw.dll lib\\libraw.dll" + + ], + + }, + + + } From 49618806df813f6571e1e5ec7d5b60bdb56eb872 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Fri, 16 Oct 2020 14:17:31 -0400 Subject: [PATCH 48/53] OpenSubdiv : add Windows configuration --- OpenSubdiv/config.py | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/OpenSubdiv/config.py b/OpenSubdiv/config.py index d34a6368bf..69df5db251 100644 --- a/OpenSubdiv/config.py +++ b/OpenSubdiv/config.py @@ -13,6 +13,7 @@ "commands" : [ "cmake" + " -G {cmakeGenerator}" " -D CMAKE_INSTALL_PREFIX={buildDir}" " -D CMAKE_PREFIX_PATH={buildDir}" " -D NO_DOC=1" @@ -28,8 +29,7 @@ " ." , - "make VERBOSE=1 -j {jobs}", - "make install", + "cmake --build . --config {cmakeBuildType} --target install -- VERBOSE=1 -j {jobs}", ], @@ -40,4 +40,35 @@ ], + "platform:windows" : { + + "variables" : { + "cmakeGenerator" : "\"Visual Studio 15 2017 Win64\"", + }, + + "commands" : [ + + "cmake" + " -G {cmakeGenerator}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " -D CMAKE_PREFIX_PATH={buildDir}" + " -D NO_DOC=1" + " -D NO_OMP=1" + " -D NO_CUDA=1" + " -D NO_OPENCL=1" + " -D NO_GLEW=1" + " -D NO_GLFW=1" + " -D NO_DX=1" + " -D NO_TESTS=1" + " -D NO_TBB=1" + " -D OPENEXR_LOCATION={buildDir}/lib" + " ." + , + + "cmake --build . --config {cmakeBuildType} --target install", + + ], + + }, + } From 6fc4716a4c53258ee3a71bd1a95eeac48fbc9cbd Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Fri, 4 Dec 2020 17:16:38 -0500 Subject: [PATCH 49/53] Jemalloc : add Windows configuration --- Jemalloc/config.py | 18 +- .../windows/0001-Backport-MSVC-build.patch | 655 ++++++++++++++++++ 2 files changed, 672 insertions(+), 1 deletion(-) create mode 100644 Jemalloc/patches/windows/0001-Backport-MSVC-build.patch diff --git a/Jemalloc/config.py b/Jemalloc/config.py index 5041bf7416..25822536df 100644 --- a/Jemalloc/config.py +++ b/Jemalloc/config.py @@ -21,7 +21,23 @@ "manifest" : [ "include/jemalloc", - "lib/libjemalloc*{sharedLibraryExtension}*", + "lib/{libraryPrefix}jemalloc*{sharedLibraryExtension}*", + "lib/{libraryPrefix}jemalloc*.obj", ], + + "platform:windows" : { + + "commands" : [ + + "sh -c \"CC=cl ./autogen.sh\" --prefix={buildDir}", + "msbuild msvc\jemalloc_vc2017.sln -target:jemalloc /property:Configuration=\"Release\" /property:WindowsTargetPlatformVersion=10.0.17763.0" , + "copy msvc\\x64\\Release\\jemalloc.dll {buildDir}\\lib", + "copy msvc\\x64\\Release\\jemalloc.lib {buildDir}\\lib", + "xcopy /s /e /h /y /i include\\jemalloc {buildDir}\\include\\jemalloc", + "xcopy /s /e /h /y /i include\\msvc_compat {buildDir}\\include\\msvc_compat", + + ], + + }, } diff --git a/Jemalloc/patches/windows/0001-Backport-MSVC-build.patch b/Jemalloc/patches/windows/0001-Backport-MSVC-build.patch new file mode 100644 index 0000000000..35e0e1c255 --- /dev/null +++ b/Jemalloc/patches/windows/0001-Backport-MSVC-build.patch @@ -0,0 +1,655 @@ +From 22d0450e0f8b3c82f104ac879f3e4274af105d46 Mon Sep 17 00:00:00 2001 +From: ericmehl +Date: Fri, 4 Dec 2020 17:05:58 -0500 +Subject: [PATCH] Backport MSVC build + +--- + configure.ac | 16 +- + include/msvc_compat/stdbool.h | 16 - + msvc/jemalloc_vc2017.sln | 61 ++++ + .../projects/vc2017/jemalloc/jemalloc.vcxproj | 339 ++++++++++++++++++ + .../vc2017/jemalloc/jemalloc.vcxproj.filters | 161 +++++++++ + 5 files changed, 570 insertions(+), 23 deletions(-) + delete mode 100644 include/msvc_compat/stdbool.h + create mode 100644 msvc/jemalloc_vc2017.sln + create mode 100644 msvc/projects/vc2017/jemalloc/jemalloc.vcxproj + create mode 100644 msvc/projects/vc2017/jemalloc/jemalloc.vcxproj.filters + +diff --git a/configure.ac b/configure.ac +index 4de81dc1..df389999 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -141,7 +141,7 @@ if test "x$CFLAGS" = "x" ; then + JE_CFLAGS_APPEND([-Zi]) + JE_CFLAGS_APPEND([-MT]) + JE_CFLAGS_APPEND([-W3]) +- CPPFLAGS="$CPPFLAGS -I${srcroot}/include/msvc_compat" ++ CPPFLAGS="$CPPFLAGS -I${srcroot}include/msvc_compat" + fi + fi + dnl Append EXTRA_CFLAGS to CFLAGS, if defined. +@@ -1045,12 +1045,14 @@ dnl ============================================================================ + dnl Configure pthreads. + + if test "x$abi" != "xpecoff" ; then +- AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])]) +- dnl Some systems may embed pthreads functionality in libc; check for libpthread +- dnl first, but try libc too before failing. +- AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"], +- [AC_SEARCH_LIBS([pthread_create], , , +- AC_MSG_ERROR([libpthread is missing]))]) ++ if test "x$je_cv_msvc" != "xyes" ; then ++ AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])]) ++ dnl Some systems may embed pthreads functionality in libc; check for libpthread ++ dnl first, but try libc too before failing. ++ AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"], ++ [AC_SEARCH_LIBS([pthread_create], , , ++ AC_MSG_ERROR([libpthread is missing]))]) ++ fi + fi + + CPPFLAGS="$CPPFLAGS -D_REENTRANT" +diff --git a/include/msvc_compat/stdbool.h b/include/msvc_compat/stdbool.h +deleted file mode 100644 +index da9ee8b8..00000000 +--- a/include/msvc_compat/stdbool.h ++++ /dev/null +@@ -1,16 +0,0 @@ +-#ifndef stdbool_h +-#define stdbool_h +- +-#include +- +-/* MSVC doesn't define _Bool or bool in C, but does have BOOL */ +-/* Note this doesn't pass autoconf's test because (bool) 0.5 != true */ +-typedef BOOL _Bool; +- +-#define bool _Bool +-#define true 1 +-#define false 0 +- +-#define __bool_true_false_are_defined 1 +- +-#endif /* stdbool_h */ +diff --git a/msvc/jemalloc_vc2017.sln b/msvc/jemalloc_vc2017.sln +new file mode 100644 +index 00000000..47d3d26c +--- /dev/null ++++ b/msvc/jemalloc_vc2017.sln +@@ -0,0 +1,61 @@ ++ ++Microsoft Visual Studio Solution File, Format Version 12.00 ++# Visual Studio 14 ++VisualStudioVersion = 14.0.24720.0 ++MinimumVisualStudioVersion = 10.0.40219.1 ++Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{70A99006-6DE9-472B-8F83-4CEE6C616DF3}" ++ ProjectSection(SolutionItems) = preProject ++ ReadMe.txt = ReadMe.txt ++ EndProjectSection ++EndProject ++Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jemalloc", "projects\vc2017\jemalloc\jemalloc.vcxproj", "{8D6BB292-9E1C-413D-9F98-4864BDC1514A}" ++EndProject ++Global ++ GlobalSection(SolutionConfigurationPlatforms) = preSolution ++ Debug|x64 = Debug|x64 ++ Debug|x86 = Debug|x86 ++ Debug-static|x64 = Debug-static|x64 ++ Debug-static|x86 = Debug-static|x86 ++ Release|x64 = Release|x64 ++ Release|x86 = Release|x86 ++ Release-static|x64 = Release-static|x64 ++ Release-static|x86 = Release-static|x86 ++ EndGlobalSection ++ GlobalSection(ProjectConfigurationPlatforms) = postSolution ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Debug|x64.ActiveCfg = Debug|x64 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Debug|x64.Build.0 = Debug|x64 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Debug|x86.ActiveCfg = Debug|Win32 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Debug|x86.Build.0 = Debug|Win32 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Debug-static|x64.ActiveCfg = Debug-static|x64 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Debug-static|x64.Build.0 = Debug-static|x64 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Debug-static|x86.ActiveCfg = Debug-static|Win32 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Debug-static|x86.Build.0 = Debug-static|Win32 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Release|x64.ActiveCfg = Release|x64 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Release|x64.Build.0 = Release|x64 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Release|x86.ActiveCfg = Release|Win32 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Release|x86.Build.0 = Release|Win32 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Release-static|x64.ActiveCfg = Release-static|x64 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Release-static|x64.Build.0 = Release-static|x64 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Release-static|x86.ActiveCfg = Release-static|Win32 ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A}.Release-static|x86.Build.0 = Release-static|Win32 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Debug|x64.ActiveCfg = Debug|x64 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Debug|x64.Build.0 = Debug|x64 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Debug|x86.ActiveCfg = Debug|Win32 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Debug|x86.Build.0 = Debug|Win32 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Debug-static|x64.ActiveCfg = Debug-static|x64 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Debug-static|x64.Build.0 = Debug-static|x64 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Debug-static|x86.ActiveCfg = Debug-static|Win32 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Debug-static|x86.Build.0 = Debug-static|Win32 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Release|x64.ActiveCfg = Release|x64 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Release|x64.Build.0 = Release|x64 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Release|x86.ActiveCfg = Release|Win32 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Release|x86.Build.0 = Release|Win32 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Release-static|x64.ActiveCfg = Release-static|x64 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Release-static|x64.Build.0 = Release-static|x64 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Release-static|x86.ActiveCfg = Release-static|Win32 ++ {09028CFD-4EB7-491D-869C-0708DB97ED44}.Release-static|x86.Build.0 = Release-static|Win32 ++ EndGlobalSection ++ GlobalSection(SolutionProperties) = preSolution ++ HideSolutionNode = FALSE ++ EndGlobalSection ++EndGlobal +diff --git a/msvc/projects/vc2017/jemalloc/jemalloc.vcxproj b/msvc/projects/vc2017/jemalloc/jemalloc.vcxproj +new file mode 100644 +index 00000000..7a3a4df8 +--- /dev/null ++++ b/msvc/projects/vc2017/jemalloc/jemalloc.vcxproj +@@ -0,0 +1,339 @@ ++ ++ ++ ++ ++ Debug-static ++ Win32 ++ ++ ++ Debug-static ++ x64 ++ ++ ++ Debug ++ Win32 ++ ++ ++ Release-static ++ Win32 ++ ++ ++ Release-static ++ x64 ++ ++ ++ Release ++ Win32 ++ ++ ++ Debug ++ x64 ++ ++ ++ Release ++ x64 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ {8D6BB292-9E1C-413D-9F98-4864BDC1514A} ++ Win32Proj ++ jemalloc ++ ++ ++ ++ DynamicLibrary ++ true ++ v141 ++ MultiByte ++ ++ ++ StaticLibrary ++ true ++ v141 ++ MultiByte ++ ++ ++ DynamicLibrary ++ false ++ v141 ++ true ++ MultiByte ++ ++ ++ StaticLibrary ++ false ++ v141 ++ true ++ MultiByte ++ ++ ++ DynamicLibrary ++ true ++ v141 ++ MultiByte ++ ++ ++ StaticLibrary ++ true ++ v141 ++ MultiByte ++ ++ ++ DynamicLibrary ++ false ++ v141 ++ true ++ MultiByte ++ ++ ++ StaticLibrary ++ false ++ v141 ++ true ++ MultiByte ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ $(SolutionDir)$(Platform)\$(Configuration)\ ++ $(Platform)\$(Configuration)\ ++ $(ProjectName)d ++ ++ ++ $(SolutionDir)$(Platform)\$(Configuration)\ ++ $(Platform)\$(Configuration)\ ++ $(ProjectName)-$(PlatformToolset)-$(Configuration) ++ ++ ++ $(SolutionDir)$(Platform)\$(Configuration)\ ++ $(Platform)\$(Configuration)\ ++ ++ ++ $(SolutionDir)$(Platform)\$(Configuration)\ ++ $(Platform)\$(Configuration)\ ++ $(ProjectName)-$(PlatformToolset)-$(Configuration) ++ ++ ++ $(SolutionDir)$(Platform)\$(Configuration)\ ++ $(Platform)\$(Configuration)\ ++ $(ProjectName)d ++ ++ ++ $(SolutionDir)$(Platform)\$(Configuration)\ ++ $(Platform)\$(Configuration)\ ++ $(ProjectName)-vc$(PlatformToolsetVersion)-$(Configuration) ++ ++ ++ $(SolutionDir)$(Platform)\$(Configuration)\ ++ $(Platform)\$(Configuration)\ ++ ++ ++ $(SolutionDir)$(Platform)\$(Configuration)\ ++ $(Platform)\$(Configuration)\ ++ $(ProjectName)-vc$(PlatformToolsetVersion)-$(Configuration) ++ ++ ++ ++ ++ ++ Level3 ++ Disabled ++ _REENTRANT;_WINDLL;DLLEXPORT;JEMALLOC_DEBUG;_DEBUG;__STDC_LIMIT_MACROS;%(PreprocessorDefinitions) ++ ..\..\..\..\include;..\..\..\..\include\msvc_compat;%(AdditionalIncludeDirectories) ++ 4090;4146;4267;4334 ++ $(OutputPath)$(TargetName).pdb ++ ++ ++ Windows ++ true ++ ++ ++ ++ ++ ++ ++ Level3 ++ Disabled ++ JEMALLOC_DEBUG;_REENTRANT;JEMALLOC_EXPORT=;_DEBUG;_LIB;__STDC_LIMIT_MACROS;%(PreprocessorDefinitions) ++ ..\..\..\..\include;..\..\..\..\include\msvc_compat;%(AdditionalIncludeDirectories) ++ MultiThreadedDebug ++ 4090;4146;4267;4334 ++ $(OutputPath)$(TargetName).pdb ++ ++ ++ Windows ++ true ++ ++ ++ ++ ++ ++ ++ Level3 ++ Disabled ++ JEMALLOC_NO_PRIVATE_NAMESPACE;_REENTRANT;_WINDLL;DLLEXPORT;JEMALLOC_DEBUG;_DEBUG;__STDC_LIMIT_MACROS;%(PreprocessorDefinitions) ++ ..\..\..\..\include;..\..\..\..\include\msvc_compat;%(AdditionalIncludeDirectories) ++ 4090;4146;4267;4334 ++ $(OutputPath)$(TargetName).pdb ++ ++ ++ Windows ++ true ++ ++ ++ ++ ++ ++ ++ Level3 ++ Disabled ++ JEMALLOC_NO_PRIVATE_NAMESPACE;JEMALLOC_DEBUG;_REENTRANT;JEMALLOC_EXPORT=;_DEBUG;_LIB;__STDC_LIMIT_MACROS;%(PreprocessorDefinitions) ++ ..\..\..\..\include;..\..\..\..\include\msvc_compat;%(AdditionalIncludeDirectories) ++ MultiThreadedDebug ++ 4090;4146;4267;4334 ++ OldStyle ++ false ++ ++ ++ Windows ++ true ++ ++ ++ ++ ++ Level3 ++ ++ ++ MaxSpeed ++ true ++ true ++ _REENTRANT;_WINDLL;DLLEXPORT;NDEBUG;__STDC_LIMIT_MACROS;%(PreprocessorDefinitions) ++ ..\..\..\..\include;..\..\..\..\include\msvc_compat;%(AdditionalIncludeDirectories) ++ 4090;4146;4267;4334 ++ $(OutputPath)$(TargetName).pdb ++ ++ ++ Windows ++ true ++ true ++ true ++ ++ ++ ++ ++ Level3 ++ ++ ++ MaxSpeed ++ true ++ true ++ _REENTRANT;JEMALLOC_EXPORT=;NDEBUG;_LIB;__STDC_LIMIT_MACROS;%(PreprocessorDefinitions) ++ ..\..\..\..\include;..\..\..\..\include\msvc_compat;%(AdditionalIncludeDirectories) ++ MultiThreaded ++ 4090;4146;4267;4334 ++ $(OutputPath)$(TargetName).pdb ++ ++ ++ Windows ++ true ++ true ++ true ++ ++ ++ ++ ++ Level3 ++ ++ ++ MaxSpeed ++ true ++ true ++ ..\..\..\..\include;..\..\..\..\include\msvc_compat;__STDC_LIMIT_MACROS;%(AdditionalIncludeDirectories) ++ JEMALLOC_NO_PRIVATE_NAMESPACE;_REENTRANT;_WINDLL;DLLEXPORT;NDEBUG;%(PreprocessorDefinitions) ++ 4090;4146;4267;4334 ++ $(OutputPath)$(TargetName).pdb ++ ++ ++ Windows ++ true ++ true ++ true ++ ++ ++ ++ ++ Level3 ++ ++ ++ MaxSpeed ++ true ++ true ++ JEMALLOC_NO_PRIVATE_NAMESPACE;_REENTRANT;JEMALLOC_EXPORT=;NDEBUG;_LIB;__STDC_LIMIT_MACROS;%(PreprocessorDefinitions) ++ ..\..\..\..\include;..\..\..\..\include\msvc_compat;%(AdditionalIncludeDirectories) ++ MultiThreaded ++ 4090;4146;4267;4334 ++ OldStyle ++ ++ ++ Windows ++ true ++ true ++ true ++ ++ ++ ++ ++ ++ +diff --git a/msvc/projects/vc2017/jemalloc/jemalloc.vcxproj.filters b/msvc/projects/vc2017/jemalloc/jemalloc.vcxproj.filters +new file mode 100644 +index 00000000..e3b7e0c5 +--- /dev/null ++++ b/msvc/projects/vc2017/jemalloc/jemalloc.vcxproj.filters +@@ -0,0 +1,161 @@ ++ ++ ++ ++ ++ {4FC737F1-C7A5-4376-A066-2A32D752A2FF} ++ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx ++ ++ ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ Source Files ++ ++ ++ +-- +2.29.2.windows.2 + From 516c11e1b20283f3f7f6c53edb810ee1d25cf53d Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 2 Mar 2021 18:06:14 -0500 Subject: [PATCH 50/53] PugiXML : add Windows configuration --- PugiXML/config.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/PugiXML/config.py b/PugiXML/config.py index 6a253bfa39..12bf9b2a2d 100644 --- a/PugiXML/config.py +++ b/PugiXML/config.py @@ -21,4 +21,29 @@ ], + "platform:windows" : { + + "environment" : { + + "PATH" : "{buildDir}\\bin;%PATH%" + + }, + + # using nmake instead of make causes an error "Makefile:35 missing separator. Stop." + "commands" : [ + + "mkdir gafferBuild", + "cd gafferBuild &&" + " cmake" + " -Wno-dev -G {cmakeGenerator}" + " -D CMAKE_CXX_STANDARD={c++Standard}" + " -D CMAKE_BUILD_TYPE={cmakeBuildType}" + " -D CMAKE_INSTALL_PREFIX={buildDir}" + " ..", + "cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install -j {jobs}", + + ], + + }, + } From 2e7cff5e997a2181ddaeae7a3100fc68409b44cd Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 2 Mar 2021 18:06:31 -0500 Subject: [PATCH 51/53] PyBind11 : add Windows configuration --- PyBind11/config.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/PyBind11/config.py b/PyBind11/config.py index de0ba82da8..f96e11ec6d 100644 --- a/PyBind11/config.py +++ b/PyBind11/config.py @@ -22,6 +22,7 @@ "commands" : [ "cmake" + " -G {cmakeGenerator}" " -D CMAKE_INSTALL_PREFIX={buildDir} ." " -D PYBIND11_TEST=0" " -D PYBIND11_FINDPYTHON=1" @@ -37,4 +38,25 @@ ], + "platform:windows" : { + + "environment" : { + + "PATH" : "{buildDir}\\bin;%PATH%" + + }, + + # using make instead of nmake causes an error "Makefile:35 missing separator. Stop." + "commands" : [ + + "cmake" + " -G {cmakeGenerator}" + " -D CMAKE_INSTALL_PREFIX={buildDir} ." + " -D PYBIND11_TEST=0", + "nmake install", + + ], + + }, + } From 9d52aa654a35339fbbca3207a63ee8c24e3a6057 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Sun, 22 Jul 2018 14:19:15 -0400 Subject: [PATCH 52/53] readme : Add Windows build instructions --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4032fa3775..3827acbcf4 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,35 @@ We strongly recommend using the precompiled binaries as described above, but if Since the build covers so many different projects, it requires the installation of several common software development tools, most of which should be installed by default on a typical developer machine. They include (but are probably not limited to) : +#### Linux and OS X - Make - CMake - SCons - libbz2 (and headers) See https://github.com/GafferHQ/build for a Docker container which contains all necessary prerequisites. +#### Windows +- It is recommended to enable long path support on Windows. Some packages like Boost have heavily nested directory structures that may exceed the default 260 character limit. Python 3 installers offer a convenient option to enable long paths after installation, or you can follow Microsoft's recommendations: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation. +- Microsoft Visual Studio 2017 (Community edition is a free version that is known to work) +- CMake (test with version 3.15.7) +- Python 3.6.xx +- Git +- Jom + - Available from Qt: https://wiki.qt.io/Jom + - Ensure the installation directory is included in your PATH +- Cygwin packages + - Bison + - Flex + - NASM + - autoconf + - gawk + - grep + - sed + - patch + - __Flex and Bison should not be installed in a path that contains spaces.__ This includes the installer default (C:\\Program Files (x86)\\) Doing so will prevent Open Shading Language from building. +- Perl with Windows-compatible slash directions + - Strawberry Perl (strawberryperl.com) is an open-source option. + - __The Perl installed by Cygwin is not suitable.__ It will fail to build OpenSSL correctly, but it is required for autoconf. __You must have Strawberry Perl (or a compatible alternative) in your PATH environment variable before your Cygwin binaries path.__ Otherwise the OpenSSL build will fail when attempting configuration. ### Invoking the build @@ -31,20 +54,35 @@ The build is controlled by several environment variables, which must be set up b - ARNOLD_ROOT : Path to the root of an Arnold installation - RMAN_ROOT : Path to the root of a 3delight installation -The build is then initiated with `build.py`, which should be run from the root directory of the project : +#### Linux and OS X +The build is then initiated using a Python script, which should be run from the root directory of the project : ``` -./build.py --buildDir /path/to/build +./build.py --buildDir /path/to/build --projects TBB ``` -Subsets of the dependencies can be built using the `--projects` command line argument : +Variants are specified using the `--variant:` command line arguments : ``` -./build.py --buildDir /path/to/build --projects TBB +./build.py --buildDir /path/to/build --variants:Python 3 ``` +#### Windows +The build is then initiated using the "x64 Native Tools Command Prompt" for Visual Studio 2017. This is a special command prompt that sets up all of the environment variables for Visual Studio to find the various tools needed for building. It is installed with Visual Studio and is accessible from the start menu under Visual Studio 2017. -Variants are specified using the `--variant:` command line arguments : +Individual packages and variants are built using the build.py script in the manner as Linux and OS X dependencies. +#### Universal Python Builder +Some packages are built using a common Python script and configuration settings for each package. These are built by calling the build.py script in the "build" directory (for all of Linux, OS X and Windows) and specifying the package to build and the build directory. + +For example, to build Boost on Linux and OS X and you would run: ``` -./build.py --buildDir /path/to/build --variants:Python 3 +./build/build.py --project Boost --buildDir $BUILD_DIR +``` +and on Windows : +``` +python build/build.py --project Boost --buildDir %BUILD_DIR% +``` +A list of projects that have are built using this script is shown if you run ``` +./build/build.py +``` \ No newline at end of file From fd0cb9bdc5791166cc623ba6967ede454b041980 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Sat, 7 Apr 2018 15:44:01 -0400 Subject: [PATCH 53/53] gitignore : add files that Windows generates as part of the build --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 94456cd86c..969056ac58 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ working */archives +**/gafferBuild +llvm*/build-release +qt*/**/*.qm +c-blosc*/** +qt-adsk-*/** \ No newline at end of file