faiss-node
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -95,10 +95,28 @@ cmake_minimum_required(VERSION 3.17 FATAL_ERROR) | ||
foreach(dep ${DEPENDANCES_MKL}) | ||
file(TO_CMAKE_PATH "$ENV{MKLROOT}/lib/intel64/${dep}" MKL_dep) | ||
message("Copy DEPENDANCES_MKL: " ${MKL_dep}) | ||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different | ||
${MKL_dep} | ||
$<TARGET_FILE_DIR:${PROJECT_NAME}>) | ||
endforeach(file_i) | ||
file(TO_CMAKE_PATH "$ENV{MKLROOT}/lib/intel64/${dep}" MKL_dep) | ||
message("Copy DEPENDANCES_MKL: " ${MKL_dep}) | ||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different | ||
${MKL_dep} | ||
$<TARGET_FILE_DIR:${PROJECT_NAME}>) | ||
endforeach() | ||
endif() | ||
if(EXISTS "/etc/alpine-release") | ||
# Alpine | ||
message("Alpine") | ||
# Copy libgomp.so.1, libopenblas.so.3, libgfortran.so.5, libquadmath.so.0 | ||
set(DEPENDANCES_MUSL | ||
libgomp.so.1 | ||
libopenblas.so.3 | ||
libgfortran.so.5 | ||
libquadmath.so.0) | ||
foreach(dep ${DEPENDANCES_MUSL}) | ||
file(TO_CMAKE_PATH "/usr/lib/${dep}" MUSL_dep) | ||
message("Copy DEPENDANCES_MUSL: " ${MUSL_dep}) | ||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different | ||
${MUSL_dep} | ||
$<TARGET_FILE_DIR:${PROJECT_NAME}>) | ||
endforeach() | ||
ENDIF() | ||
endif() | ||
@@ -105,0 +123,0 @@ |
{ | ||
"name": "faiss-node", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Node.js bindings for faiss", | ||
@@ -22,3 +22,4 @@ "main": "lib/index.js", | ||
"build:clean": "cmake-js clean", | ||
"prebuild-package": "prebuild --verbose --runtime napi --include-regex \"^(faiss-node\\.node)|(mkl_sequential\\.2\\.dll)|(faiss\\.lib)|(libfaiss\\.a)|(libmkl_intel_lp64\\.so)|(libmkl_sequential\\.so)|(libmkl_core\\.so)|(libomp\\.dylib)$\" --backend cmake-js", | ||
"build:test": "npm run build && npm run test", | ||
"prebuild-package": "prebuild --verbose --runtime napi --include-regex \"^(faiss-node\\.node)|(mkl_sequential\\.2\\.dll)|(faiss\\.lib)|(libfaiss\\.a)|(libmkl_intel_lp64\\.so)|(libmkl_sequential\\.so)|(libmkl_core\\.so)|(libomp\\.dylib)|(libgomp\\.so\\.1)|(libopenblas\\.so\\.3)|(libgfortran\\.so\\.5)|(libquadmath\\.so\\.0)$\" --backend cmake-js", | ||
"install": "prebuild-install --runtime napi --verbose || npm run build", | ||
@@ -25,0 +26,0 @@ "test": "jest", |
@@ -19,2 +19,22 @@ const { IndexFlatL2 } = require('../lib'); | ||
describe('#read', () => { | ||
it('throws an error if file does not existed', () => { | ||
const fname = 'not_existed_file' | ||
expect(() => { IndexFlatL2.read(fname) }).toThrow(new RegExp(`^Error.*could not open ${fname} for reading: No such file or directory$`)); | ||
}); | ||
it('read saved file.', () => { | ||
const dimension = 2; | ||
const index = new IndexFlatL2(dimension); | ||
index.add([1, 0]); | ||
const fname = '_tmp.test.read.index'; | ||
index.write(fname); | ||
const index_loaded = IndexFlatL2.read(fname); | ||
expect(index_loaded.getDimension()).toBe(2); | ||
expect(index_loaded.ntotal()).toBe(1); | ||
}) | ||
}); | ||
describe('#ntotal', () => { | ||
@@ -21,0 +41,0 @@ const index = new IndexFlatL2(1); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27111
11
186