Exemple #1
0
def build(source_path, build_path, install_path, targets):
    targets = targets or []
    if "install" not in targets:
        install_path = build_path + "/install"

    # Download the source
    url = "%s/%s" % (url_prefix, filename)
    archive = lib.download(url, filename)

    # Unzip the source
    source_root = lib.open_archive(archive)

    # Build
    with lib.working_dir(build_path + "/_opensubdiv"):
        extra_args = [
            "-DNO_EXAMPLES=ON",
            "-DNO_TUTORIALS=ON",
            "-DNO_REGRESSION=ON",
            "-DNO_DOC=ON",
            "-DNO_OMP=ON",
            "-DNO_CUDA=ON",
            "-DNO_OPENCL=ON",
            "-DNO_DX=ON",
            "-DNO_TESTS=ON",
            "-DNO_GLEW=ON",
            "-DNO_GLFW=ON",
        ]
        lib.run_cmake(source_root, install_path, extra_args=extra_args)
Exemple #2
0
def build(source_path, build_path, install_path, targets):
    targets = targets or []
    if "install" not in targets:
        install_path = build_path + "/install"

    # Download the source
    url = "%s/%s" % (url_prefix, filename)
    archive = lib.download(url, filename)

    # Unzip the source
    source_root = lib.open_archive(archive)

    # Build
    with lib.working_dir(build_path + "/_opencolorio"):
        extra_args = [
            "-DOCIO_BUILD_TRUELIGHT=OFF",
            "-DOCIO_BUILD_APPS=OFF",
            "-DOCIO_BUILD_NUKE=OFF",
            "-DOCIO_BUILD_DOCS=OFF",
            "-DOCIO_BUILD_TESTS=OFF",
            "-DOCIO_BUILD_PYGLUE=OFF",
            "-DOCIO_BUILD_JNIGLUE=OFF",
            "-DOCIO_STATIC_JNIGLUE=OFF",
        ]
        lib.run_cmake(source_root, install_path, extra_args=extra_args)
Exemple #3
0
def build(source_path, build_path, install_path, targets):
    targets = targets or []
    if "install" not in targets:
        install_path = build_path + "/install"

    # Download the source
    url = "%s/%s" % (url_prefix, filename)
    archive = lib.download(url, filename)

    # Unzip the source
    source_root = lib.open_archive(archive)

    # Build
    with lib.working_dir(build_path + "/_hdf5"):
        extra_args = [
            "-DBUILD_TESTING=OFF",
            "-DHDF5_BUILD_TOOLS=OFF",
            "-DHDF5_BUILD_EXAMPLES=OFF",
        ]
        lib.run_cmake(source_root,
                      install_path,
                      extra_args=extra_args,
                      build_type="Debug")
        lib.run_cmake(source_root,
                      install_path,
                      extra_args=extra_args,
                      build_type="Release")
def build(source_path, build_path, install_path, targets):
    targets = targets or []
    if "install" not in targets:
        install_path = build_path + "/install"

    # Download the source
    url = "%s/%s" % (url_prefix, filename)
    archive = lib.download(url, filename)

    # Unzip the source
    source_root = lib.open_archive(archive)

    # libTIFF has a build issue on Windows where tools/tiffgt.c
    # unconditionally includes unistd.h, which does not exist.
    # To avoid this, we patch the CMakeLists.txt to skip building
    # the tools entirely. We do this on Linux and MacOS as well
    # to avoid requiring some GL and X dependencies.
    #
    # We also need to skip building tests, since they rely on
    # the tools we've just elided.
    lib.patch_file(source_root + "/CMakeLists.txt",
                   [("add_subdirectory(tools)", "# add_subdirectory(tools)"),
                    ("add_subdirectory(test)", "# add_subdirectory(test)")])

    # Build
    with lib.working_dir(build_path + "/_libtiff"):
        lib.run_cmake(source_root, install_path, build_type="Debug")
        lib.run_cmake(source_root, install_path, build_type="Release")
def build(source_path, build_path, install_path, targets):
    targets = targets or []
    if "install" not in targets:
        install_path = build_path + "/install"

    is_debug = lib.is_debug_build()

    # Download the source
    url = "%s/%s" % (url_prefix, filename)
    archive = lib.download(url, filename)

    # Unzip the source
    source_root = lib.open_archive(archive)

    # Build
    with lib.working_dir(build_path + "/_openimageio"):
        extra_args = [
            "-DOIIO_BUILD_TOOLS=OFF",
            "-DOIIO_BUILD_TESTS=OFF",
            "-DUSE_PYTHON=OFF",
            "-DSTOP_ON_WARNING=OFF",
            # Need to specify TBB use debug or not, or release build will fail
            "-DTBB_USE_DEBUG_BUILD=%s" % ("ON" if is_debug else "OFF"),

            # boost
            "-DBoost_NO_BOOST_CMAKE=On",
            "-DBoost_NO_SYSTEM_PATHS=True",
            "-DHDF5_ROOT=\"%s\"" % os.environ["REZ_HDF5_ROOT"],
            "-DOpenColorIO_ROOT=\"%s\"" % os.environ["REZ_OPENCOLORIO_ROOT"],
        ]
        lib.run_cmake(source_root, install_path, extra_args=extra_args)
def build(source_path, build_path, install_path, targets):
    targets = targets or []
    if "install" not in targets:
        install_path = build_path + "/install"

    # Download the source
    url = "%s/%s" % (url_prefix, filename)
    archive = lib.download(url, filename)

    # Unzip the source
    source_root = lib.open_archive(archive)

    # Build
    with lib.working_dir(build_path + "/_blosc"):
        lib.run_cmake(source_root, install_path)
Exemple #7
0
def build(source_path, build_path, install_path, targets):
    targets = targets or []
    if "install" not in targets:
        install_path = build_path + "/install"

    is_debug = lib.is_debug_build()

    # Download the source
    url = "%s/%s" % (url_prefix, filename)
    archive = lib.download(url, filename)

    # Unzip the source
    source_root = lib.open_archive(archive)

    # Build
    with lib.working_dir(build_path + "/_openimageio"):
        extra_args = [
            "-DOIIO_BUILD_TOOLS=OFF",
            "-DOIIO_BUILD_TESTS=OFF",
            "-DUSE_PYTHON=OFF",
            "-DSTOP_ON_WARNING=OFF",
            # Need to specify TBB use debug or not, or release build will fail
            "-DTBB_USE_DEBUG_BUILD=%s" % ("ON" if is_debug else "OFF"),

            # OIIO's FindOpenEXR module circumvents CMake's normal library
            # search order, which causes versions of OpenEXR installed in
            # /usr/local or other hard-coded locations in the module to
            # take precedence over the version we've built, which would
            # normally be picked up when we specify CMAKE_PREFIX_PATH.
            # This may lead to undefined symbol errors at build or runtime.
            # So, we explicitly specify the OpenEXR we want to use here.
            "-DOPENEXR_HOME=\"%s\"" % os.getenv("OPENEXR_ROOT", install_path),

            # boost
            "-DBoost_NO_BOOST_CMAKE=On",
            "-DBoost_NO_SYSTEM_PATHS=True",
            "-DBOOST_ROOT=\"%s\"" % os.getenv("BOOST_ROOT", install_path),
            "-DHDF5_ROOT=\"%s\"" % os.getenv("REZ_HDF5_ROOT", install_path),
            "-DOpenColorIO_ROOT=\"%s\"" %
            os.getenv("REZ_OPENCOLORIO_ROOT", install_path),
        ]
        lib.run_cmake(source_root, install_path, extra_args=extra_args)
Exemple #8
0
def build(source_path, build_path, install_path, targets):
    targets = targets or []
    if "install" not in targets:
        install_path = build_path + "/install"

    is_debug = lib.is_debug_build()

    # Download the source
    url = "%s/%s" % (url_prefix, filename)
    archive = lib.download(url, filename)

    # Unzip the source
    source_root = lib.open_archive(archive)

    if is_debug:
        lib.patch_file(
            source_root + "/cmake/FindTBB.cmake",
            [("find_library(Tbb_${COMPONENT}_LIBRARY ${COMPONENT}",
              "find_library(Tbb_${COMPONENT}_LIBRARY ${COMPONENT}_debug")])

    # Build
    with lib.working_dir(build_path + "/_openvdb"):
        extra_args = [
            "-DOPENVDB_BUILD_PYTHON_MODULE=OFF",
            "-DOPENVDB_BUILD_BINARIES=OFF",
            "-DOPENVDB_BUILD_UNITTESTS=OFF",

            # boost
            "-DBoost_NO_BOOST_CMAKE=On",
            "-DBoost_NO_SYSTEM_PATHS=True",
            "-DBOOST_ROOT=\"%s\"" % os.getenv("BOOST_ROOT", install_path),
            # blosc
            "-DBLOSC_ROOT=\"%s\"" % os.getenv("BLOSC_ROOT", install_path),
            # tbb
            "-DTBB_ROOT=\"%s\"" % os.getenv("REZ_TBB_ROOT", install_path),
            # OpenVDB needs Half type from IlmBase
            "-DILMBASE_ROOT=\"%s\"" % os.getenv("ILMBASE_ROOT", install_path),
        ]
        lib.run_cmake(source_root, install_path, extra_args=extra_args)
Exemple #9
0
def build(source_path, build_path, install_path, targets):
    targets = targets or []
    if "install" not in targets:
        install_path = build_path + "/install"

    # Download the source
    url = "%s/%s" % (url_prefix, filename)
    archive = lib.download(url, filename)

    # Unzip the source
    source_root = lib.open_archive(archive)

    # Build
    with lib.working_dir(build_path + "/_alembic"):
        extra_args = [
            "-DUSE_BINARIES=OFF",
            "-DUSE_TESTS=OFF",
            # hdf5
            "-DUSE_HDF5=ON",
            "-DHDF5_ROOT=\"%s\"" % os.environ["REZ_HDF5_ROOT"],
            "-DCMAKE_CXX_FLAGS=\"-D H5_BUILT_AS_DYNAMIC_LIB\""
        ]
        lib.run_cmake(source_root, install_path, extra_args=extra_args)
Exemple #10
0
def build(source_path, build_path, install_path, targets):
    targets = targets or []
    if "install" not in targets:
        install_path = build_path + "/install"

    # Download the source
    url = "%s/%s" % (url_prefix, filename)
    archive = lib.download(url, filename)

    # Unzip the source
    source_root = lib.open_archive(archive)

    ilm_source_root = os.path.join(source_root, "IlmBase")
    exr_source_root = os.path.join(source_root, "OpenEXR")

    # Build ilmbase
    with lib.working_dir(build_path + "/_ilmbase"):
        lib.run_cmake(ilm_source_root, install_path)

    # Build openexr
    with lib.working_dir(build_path + "/_openexr"):
        os.environ["PATH"] += ";" + install_path + "/lib"  # find ilmbase
        extra_args = ["-DILMBASE_PACKAGE_PREFIX=\"%s\"" % install_path]
        lib.run_cmake(exr_source_root, install_path, extra_args=extra_args)
Exemple #11
0
def build(source_path, build_path, install_path, targets):

    # We need to shorten build path if DPXR_BUILD_EXAMPLES is ON.
    # This is not perfect, but it is suffice for now.
    build_path = shorten_variant_build_path(source_path)

    rebuild = True

    targets = targets or []
    if "install" not in targets:
        install_path = build_path + "/install"

    is_debug = lib.is_debug_build()
    py_info = lib.python_info()

    # Clean build
    if rebuild:
        lib.clear_build(build_path)

    # Download the source
    archive = os.path.join(build_path, filename)
    if rebuild:
        url = "%s/%s" % (url_prefix, filename)
        lib.download(url, archive)

    # Unzip the source
    source_root = lib.open_archive(archive, cleanup=rebuild)

    # Patch
    # Fix "openvdb\Types.h(36):
    #   fatal error C1083: cannot open file: 'OpenEXR/half.h' ..."
    lib.patch_file(
        source_root + "/pxr/imaging/glf/CMakeLists.txt",
        [("list(APPEND optionalIncludeDirs ${OPENVDB_INCLUDE_DIR})",
          "list(APPEND optionalIncludeDirs ${OPENVDB_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR})")]
    )
    # Fix finding usd tools exec on Windows
    lib.patch_file(
        source_root + "/pxr/usd/bin/usddiff/usddiff.py",
        [(_usddiff_code_a + _win_code, _usdtools_patch)],
        multiline_matches=True
    )
    lib.patch_file(
        source_root + "/pxr/usd/bin/usdedit/usdedit.py",
        [(_usdedit_code_a + _win_code, _usdtools_patch)],
        multiline_matches=True
    )

    # Build
    with lib.working_dir(build_path + "/_usd"):
        extra_args = [
            "-DTBB_USE_DEBUG_BUILD=" + "ON" if is_debug else "OFF",

            "-DPXR_ENABLE_PYTHON_SUPPORT=ON",
            "-DPXR_USE_PYTHON_3=%s" % "ON" if PY3 else "OFF",
            "-DPYTHON_EXECUTABLE=\"%s\"" % py_info[0],
            "-DPYTHON_LIBRARY=\"%s\"" % py_info[1],
            "-DPYTHON_INCLUDE_DIR=\"%s\"" % py_info[2],

            "-DBUILD_SHARED_LIBS=ON",
            "-DPXR_BUILD_DOCUMENTATION=ON",
            "-DPXR_BUILD_EXAMPLES=ON",
            "-DPXR_BUILD_TESTS=ON",
            "-DPXR_BUILD_TUTORIALS=ON",
            "-DPXR_BUILD_USD_TOOLS=ON",
            "-DPXR_BUILD_USDVIEW=ON",

            # boost
            "-DBoost_NO_BOOST_CMAKE=On",
            "-DBoost_NO_SYSTEM_PATHS=True",
            "-DBOOST_ROOT=\"%s\"" % os.getenv("BOOST_ROOT", install_path),

            "-DPXR_BUILD_IMAGING=ON",
            "-DPXR_BUILD_USD_IMAGING=ON",
            "-DPXR_ENABLE_PTEX_SUPPORT=ON",
            "-DPXR_ENABLE_OPENVDB_SUPPORT=ON",
            "-DPXR_BUILD_OPENIMAGEIO_PLUGIN=ON",
            "-DPXR_BUILD_OPENCOLORIO_PLUGIN=ON",
            "-DPXR_BUILD_MATERIALX_PLUGIN=ON",

            "-DPXR_BUILD_ALEMBIC_PLUGIN=ON",
            "-DPXR_ENABLE_HDF5_SUPPORT=ON",
            "-DHDF5_ROOT=\"%s\"" % os.getenv("REZ_HDF5_ROOT", install_path),
            "-DALEMBIC_DIR=\"%s\"" % os.getenv("REZ_ALEMBIC_ROOT", install_path),
            "-DGLEW_LOCATION=\"%s\"" % os.getenv("REZ_GLEW_ROOT", install_path),

            "-DPXR_BUILD_EMBREE_PLUGIN=OFF",
            "-DPXR_BUILD_PRMAN_PLUGIN=OFF",
            "-DPXR_BUILD_DRACO_PLUGIN=OFF",

            # PXR_VALIDATE_GENERATED_CODE
            # hgiMetal
            # PXR_BUILD_GPU_SUPPORT
            # PXR_ENABLE_METAL_SUPPORT
        ]
        if IS_WIN:
            # Increase the precompiled header buffer limit.
            extra_args.append("-DCMAKE_CXX_FLAGS=\"/Zm150\"")

        lib.run_cmake(source_root, install_path, extra_args=extra_args)

        # Copy additional resources
        copy_additionals(source_path, install_path)

        # Run test (Build will pass even test failed.)
        env = os.environ.copy()
        required_path = os.pathsep.join(
            install_path + dirname for dirname in
            ["/bin", "/lib", "/plugin/usd"]
        )  # must be prepended.
        env["PATH"] = os.pathsep.join([required_path, env["PATH"]])
        env["PYTHONPATH"] += ";%s" % install_path + "/lib/python"
        # No need to set PYTHONHOME in production, just for testing
        env["PYTHONHOME"] = os.environ["REZ_PYTHON_ROOT"] + "/payload"
        subprocess.call([
            "ctest",
            "--output-on-failure",
            "--timeout", "300",
            "-C", "Debug" if is_debug else "Release",
            # "-R", "<single_test_name_here>",
        ], env=env)