Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Guix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ogs
inf
Guix
Commits
51a9971c
Unverified
Commit
51a9971c
authored
6 years ago
by
Ricardo Wurmus
Browse files
Options
Downloads
Patches
Plain Diff
gnu: Add python-faiss.
* gnu/packages/graph.scm (python-faiss): New variable.
parent
3e403187
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gnu/packages/graph.scm
+50
-0
50 additions, 0 deletions
gnu/packages/graph.scm
with
50 additions
and
0 deletions
gnu/packages/graph.scm
+
50
−
0
View file @
51a9971c
...
@@ -22,6 +22,7 @@ (define-module (gnu packages graph)
...
@@ -22,6 +22,7 @@ (define-module (gnu packages graph)
#
:use-module
(
guix
download
)
#
:use-module
(
guix
download
)
#
:use-module
(
guix
git-download
)
#
:use-module
(
guix
git-download
)
#
:use-module
(
guix
packages
)
#
:use-module
(
guix
packages
)
#
:use-module
(
guix
utils
)
#
:use-module
(
guix
build-system
cmake
)
#
:use-module
(
guix
build-system
cmake
)
#
:use-module
(
guix
build-system
gnu
)
#
:use-module
(
guix
build-system
gnu
)
#
:use-module
(
guix
build-system
python
)
#
:use-module
(
guix
build-system
python
)
...
@@ -42,6 +43,7 @@ (define-module (gnu packages graph)
...
@@ -42,6 +43,7 @@ (define-module (gnu packages graph)
#
:use-module
(
gnu
packages
python-web
)
#
:use-module
(
gnu
packages
python-web
)
#
:use-module
(
gnu
packages
python-xyz
)
#
:use-module
(
gnu
packages
python-xyz
)
#
:use-module
(
gnu
packages
statistics
)
#
:use-module
(
gnu
packages
statistics
)
#
:use-module
(
gnu
packages
swig
)
#
:use-module
(
gnu
packages
time
)
#
:use-module
(
gnu
packages
time
)
#
:use-module
(
gnu
packages
xml
))
#
:use-module
(
gnu
packages
xml
))
...
@@ -322,3 +324,51 @@ (define-public faiss
...
@@ -322,3 +324,51 @@ (define-public faiss
vectors of any size, up to ones that possibly do not fit in RAM. It also
vectors of any size, up to ones that possibly do not fit in RAM. It also
contains supporting code for evaluation and parameter tuning."
)
contains supporting code for evaluation and parameter tuning."
)
(
license
license:bsd-3
)))
(
license
license:bsd-3
)))
(
define-public
python-faiss
(
package
(
inherit
faiss
)
(
name
"python-faiss"
)
(
build-system
python-build-system
)
(
arguments
`
(
#
:phases
(
modify-phases
%standard-phases
(
add-after
'unpack
'chdir
(
lambda
_
(
chdir
"python"
)
#t
))
(
add-after
'chdir
'build-swig
(
lambda*
(
#
:key
inputs
#
:allow-other-keys
)
(
with-output-to-file
"../makefile.inc"
(
lambda
()
(
let
((
python-version
,
(
version-major+minor
(
package-version
python
))))
(
format
#t
"\
PYTHONCFLAGS =-I~a/include/python~am/ -I~a/lib/python~a/site-packages/numpy/core/include
LIBS = -lpython~am -lfaiss
SHAREDFLAGS = -shared -fopenmp
CXXFLAGS = -fpermissive -std=c++11 -fopenmp -fPIC
CPUFLAGS = ~{~a ~}~%"
(
assoc-ref
inputs
"python*"
)
python-version
(
assoc-ref
inputs
"python-numpy"
)
python-version
python-version
(
cons
"-mpopcnt"
(
list
,@
(
let
((
system
(
or
(
%current-target-system
)
(
%current-system
))))
(
cond
((
string-prefix?
"x86_64"
system
)
'
(
"-mavx"
"-msse2"
))
((
string-prefix?
"i686"
system
)
'
(
"-msse2"
))
(
else
'
())))))))))
(
substitute*
"Makefile"
((
"../libfaiss.a"
)
""
))
(
invoke
"make"
"cpu"
))))))
(
inputs
`
((
"faiss"
,
faiss
)
(
"openblas"
,
openblas
)
(
"python*"
,
python
)
(
"swig"
,
swig
)))
(
propagated-inputs
`
((
"python-matplotlib"
,
python-matplotlib
)
(
"python-numpy"
,
python-numpy
)))
(
description
"Faiss is a library for efficient similarity search and
clustering of dense vectors. This package provides Python bindings to the
Faiss library."
)))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment