Skip to content

cumesh fails to build from source on windows #3

@boricuapab

Description

@boricuapab

Initially failed but fixed it by making these changes to setup.py

setup(
    name="cumesh",
    packages=[
        'cumesh',
    ],
    ext_modules=[
        CUDAExtension(
            name="cumesh._C",
            sources=[
                # Hashmap functions
                "src/hash/hash.cu",
                
                # CuMesh
                "src/atlas.cu",
                "src/clean_up.cu",
                "src/cumesh.cu",
                "src/connectivity.cu",
                "src/geometry.cu",
                "src/io.cu",
                "src/simplify.cu",
                "src/shared.cu",
                
                # Remeshing
                "src/remesh/simple_dual_contour.cu",
                "src/remesh/svox2vert.cu",
                
                # main
                "src/ext.cpp",
            ],
            extra_compile_args={
                "cxx": ["-O3", "-std=c++20", "-DUSE_CUDA"],
                "nvcc": ["-O3","-std=c++20", "-DUSE_CUDA"] + cc_flag,
            }
        ),
        CUDAExtension(
            name='cumesh._cubvh',
            sources=[
                'third_party/cubvh/src/bvh.cu',
                'third_party/cubvh/src/api_gpu.cu',
                'third_party/cubvh/src/bindings.cpp',
            ],
            include_dirs=[
                os.path.join(ROOT, "third_party/cubvh/include"),
                ROOT,
#                os.path.join(ROOT, "third_party/cubvh/third_party/eigen"),
            ],
            extra_compile_args={
                "cxx": ["-O3", "-std=c++20", "-DUSE_CUDA"],
                "nvcc": ["-O3","-std=c++20"] + cc_flag + [
                    "--extended-lambda",
                    "--expt-relaxed-constexpr",
                    # The following definitions must be undefined
                    # since we need half-precision operation.
                    "-U__CUDA_NO_HALF_OPERATORS__",
                    "-U__CUDA_NO_HALF_CONVERSIONS__",
                    "-U__CUDA_NO_HALF2_OPERATORS__",
                    "-DUSE_CUDA",
                ]
            }
        ),
        CUDAExtension(
            name='cumesh._xatlas',
            sources=[
                'third_party/xatlas/xatlas_mod.cpp',
                'third_party/xatlas/binding.cpp',
            ],
            extra_compile_args={
                "cxx": ["-O3", "-std=c++20", "-DUSE_CUDA"],
            }
        ),
    ],
    cmdclass={
        'build_ext': BuildExtension
    },
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions