Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes for building on windows + cuda #1614

Closed
wants to merge 4 commits into from

Conversation

h-vetinari
Copy link
Contributor

Upstreaming some work towards #1586 from conda-forge/faiss-split-feedstock#19; complements #1610

Windows is not POSIX-compliant and does not provide clock_gettime()

Also, the timespec type from time.h is C11, compare which MSVC has not
supported for the longest time (only starting from 14.28 / Visual Studio 16.8),
cf. https://en.cppreference.com/w/c/chrono/timespec

Change to an implementation based on C++11 std-lib, see
https://en.cppreference.com/w/cpp/chrono
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wickedfoo has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@wickedfoo
Copy link
Contributor

Thanks for the diff! I've imported it internally and take a look on Monday to make sure it passed our internal build and then will land it.

@h-vetinari
Copy link
Contributor Author

Cool, happy to hear it!

Together with d2c04d0 and the commits here, I managed to get to the linker stage in conda-forge/faiss-split-feedstock#19, but there it fails with

Auto build dll exports
     Creating library D:/bld/faiss-split_1610238297983/work/_build/faiss/Release/faiss.lib and object D:/bld/faiss-split_1610238297983/work/_build/faiss/Release/faiss.exp
GpuIndexIVFFlat.obj : error LNK2019: unresolved external symbol "public: __cdecl faiss::gpu::IVFFlat::IVFFlat(class faiss::gpu::GpuResources *,struct faiss::gpu::FlatIndex *,enum faiss::MetricType,float,bool,struct faiss::ScalarQuantizer *,enum faiss::gpu::IndicesOptions,enum faiss::gpu::MemorySpace)" (??0IVFFlat@gpu@faiss@@QEAA@PEAVGpuResources@12@PEAUFlatIndex@12@W4MetricType@2@M_NPEAUScalarQuantizer@2@W4IndicesOptions@12@W4MemorySpace@12@@Z) referenced in function "public: __cdecl faiss::gpu::GpuIndexIVFFlat::GpuIndexIVFFlat(class faiss::gpu::GpuResourcesProvider *,struct faiss::IndexIVFFlat const *,struct faiss::gpu::GpuIndexIVFFlatConfig)" (??0GpuIndexIVFFlat@gpu@faiss@@QEAA@PEAVGpuResourcesProvider@12@PEBUIndexIVFFlat@2@UGpuIndexIVFFlatConfig@12@@Z) [D:\bld\faiss-split_1610238297983\work\_build\faiss\faiss.vcxproj]
GpuIndexIVFScalarQuantizer.obj : error LNK2001: unresolved external symbol "public: __cdecl faiss::gpu::IVFFlat::IVFFlat(class faiss::gpu::GpuResources *,struct faiss::gpu::FlatIndex *,enum faiss::MetricType,float,bool,struct faiss::ScalarQuantizer *,enum faiss::gpu::IndicesOptions,enum faiss::gpu::MemorySpace)" (??0IVFFlat@gpu@faiss@@QEAA@PEAVGpuResources@12@PEAUFlatIndex@12@W4MetricType@2@M_NPEAUScalarQuantizer@2@W4IndicesOptions@12@W4MemorySpace@12@@Z) [D:\bld\faiss-split_1610238297983\work\_build\faiss\faiss.vcxproj]
GpuIndexIVFPQ.obj : error LNK2019: unresolved external symbol "public: __cdecl faiss::gpu::IVFPQ::IVFPQ(class faiss::gpu::GpuResources *,enum faiss::MetricType,float,struct faiss::gpu::FlatIndex *,int,int,bool,bool,bool,float *,enum faiss::gpu::IndicesOptions,enum faiss::gpu::MemorySpace)" (??0IVFPQ@gpu@faiss@@QEAA@PEAVGpuResources@12@W4MetricType@2@MPEAUFlatIndex@12@HH_N33PEAMW4IndicesOptions@12@W4MemorySpace@12@@Z) referenced in function "public: void __cdecl faiss::gpu::GpuIndexIVFPQ::copyFrom(struct faiss::IndexIVFPQ const *)" (?copyFrom@GpuIndexIVFPQ@gpu@faiss@@QEAAXPEBUIndexIVFPQ@3@@Z) [D:\bld\faiss-split_1610238297983\work\_build\faiss\faiss.vcxproj]
D:\bld\faiss-split_1610238297983\work\_build\faiss\Release\faiss.dll : fatal error LNK1120: 2 unresolved externals [D:\bld\faiss-split_1610238297983\work\_build\faiss\faiss.vcxproj]

which I haven't been able to resolve.

@facebook-github-bot
Copy link
Contributor

@wickedfoo merged this pull request in 3d3d539.

@h-vetinari h-vetinari deleted the win_cuda branch January 11, 2021 09:22
@h-vetinari h-vetinari mentioned this pull request Feb 27, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants