Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions faiss/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ if(WIN32)
target_compile_definitions(faiss_sve PRIVATE FAISS_MAIN_LIB)
endif()

if(WIN32)
set_target_properties(faiss PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols")
endif()

string(FIND "${CMAKE_CXX_FLAGS}" "FINTEGER" finteger_idx)
if (${finteger_idx} EQUAL -1)
target_compile_definitions(faiss PRIVATE FINTEGER=int)
Expand Down
9 changes: 6 additions & 3 deletions faiss/impl/platform_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <cstdint>
#include <cstdio>

#ifdef _MSC_VER
#ifdef _WIN32

/*******************************************************
* Windows specific macros
Expand All @@ -23,11 +23,11 @@
#define FAISS_API __declspec(dllimport)
#endif // FAISS_MAIN_LIB

#ifdef _MSC_VER
#define strtok_r strtok_s
#endif // _MSC_VER

#ifdef _MSC_VER
#define __PRETTY_FUNCTION__ __FUNCSIG__
#endif // _MSC_VER

#define posix_memalign(p, a, s) \
(((*(p)) = _aligned_malloc((s), (a))), *(p) ? 0 : errno)
Expand All @@ -37,6 +37,7 @@
#define ALIGNED(x) __declspec(align(x))

// redefine the GCC intrinsics with Windows equivalents
#ifdef _MSC_VER

#include <intrin.h>
#include <limits.h>
Expand Down Expand Up @@ -101,6 +102,8 @@ inline int __builtin_clzll(uint64_t x) {
#define __F16C__ 1
#endif

#endif // _MSC_VER

#define FAISS_ALWAYS_INLINE __forceinline

#else
Expand Down
6 changes: 3 additions & 3 deletions faiss/invlists/InvertedListsIOHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

#include <faiss/invlists/BlockInvertedLists.h>

#ifndef _MSC_VER
#ifndef _WIN32
#include <faiss/invlists/OnDiskInvertedLists.h>
#endif // !_MSC_VER
#endif // !_WIN32

namespace faiss {

Expand All @@ -33,7 +33,7 @@ namespace {
/// std::vector that deletes its contents
struct IOHookTable : std::vector<InvertedListsIOHook*> {
IOHookTable() {
#ifndef _MSC_VER
#ifndef _WIN32
push_back(new OnDiskInvertedListsIOHook());
#endif
push_back(new BlockInvertedListsIOHook());
Expand Down
Loading