Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.libsvm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
bob
bob.learn.libsvm
Commits
d79cb4d9
There was a problem fetching the pipeline summary.
Commit
d79cb4d9
authored
6 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
cleaned up setup.py; removed LIBSVM_VERSION from the compiler command line
parent
d8fd7b15
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!9
Resolve "LIBSVM_VERSION is passed as a string to the compiler, but evaluated as uint64_t in the code"
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.py
+7
-44
7 additions, 44 deletions
setup.py
with
7 additions
and
44 deletions
setup.py
+
7
−
44
View file @
d79cb4d9
...
@@ -54,23 +54,12 @@ class libsvm:
...
@@ -54,23 +54,12 @@ class libsvm:
"""
"""
def
__init__
(
self
,
requirement
=
''
,
only_static
=
False
):
def
__init__
(
self
):
"""
"""
Searches for libsvm in stock locations.
Allows user to override.
Searches for libsvm in stock locations.
If the user sets the environment variable BOB_PREFIX_PATH, that prefixes
If the user sets the environment variable BOB_PREFIX_PATH, that prefixes
the standard path locations.
the standard path locations.
Parameters:
requirement, str
A string, indicating a version requirement for libsvm. For example,
``
'
>= 3.12
'
``.
only_static, boolean
A flag, that indicates if we intend to link against the static library
only. This will trigger our library search to disconsider shared
libraries when searching.
"""
"""
candidates
=
find_header
(
'
svm.h
'
,
subpaths
=
[
''
,
'
libsvm
'
,
'
libsvm-*/libsvm
'
])
candidates
=
find_header
(
'
svm.h
'
,
subpaths
=
[
''
,
'
libsvm
'
,
'
libsvm-*/libsvm
'
])
...
@@ -78,34 +67,8 @@ class libsvm:
...
@@ -78,34 +67,8 @@ class libsvm:
if
not
candidates
:
if
not
candidates
:
raise
RuntimeError
(
"
could not find libsvm
'
s `svm.h
'
- have you installed libsvm on this machine?
"
)
raise
RuntimeError
(
"
could not find libsvm
'
s `svm.h
'
- have you installed libsvm on this machine?
"
)
found
=
False
self
.
include_directory
=
os
.
path
.
dirname
(
candidates
[
0
])
self
.
version
=
libsvm_version
(
candidates
[
0
])
if
not
requirement
:
self
.
include_directory
=
os
.
path
.
dirname
(
candidates
[
0
])
self
.
version
=
libsvm_version
(
candidates
[
0
])
found
=
True
else
:
# requirement is 'operator' 'version'
operator
,
required
=
[
k
.
strip
()
for
k
in
requirement
.
split
(
'
'
,
1
)]
# now check for user requirements
for
candidate
in
candidates
:
vv
=
libsvm_version
(
candidate
)
available
=
LooseVersion
(
vv
)
if
(
operator
==
'
<
'
and
available
<
required
)
or
\
(
operator
==
'
<=
'
and
available
<=
required
)
or
\
(
operator
==
'
>
'
and
available
>
required
)
or
\
(
operator
==
'
>=
'
and
available
>=
required
)
or
\
(
operator
==
'
==
'
and
available
==
required
):
self
.
include_directory
=
os
.
path
.
dirname
(
candidate
)
self
.
version
=
vv
found
=
True
break
if
not
found
:
raise
RuntimeError
(
"
could not find the required (%s) version of libsvm on the file system (looked at: %s)
"
%
(
requirement
,
'
,
'
.
join
(
candidates
)))
# normalize
# normalize
self
.
include_directory
=
os
.
path
.
normpath
(
self
.
include_directory
)
self
.
include_directory
=
os
.
path
.
normpath
(
self
.
include_directory
)
...
@@ -114,7 +77,7 @@ class libsvm:
...
@@ -114,7 +77,7 @@ class libsvm:
prefix
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
self
.
include_directory
))
prefix
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
self
.
include_directory
))
module
=
'
svm
'
module
=
'
svm
'
candidates
=
find_library
(
module
,
version
=
self
.
version
,
candidates
=
find_library
(
module
,
version
=
self
.
version
,
prefixes
=
[
prefix
],
only_static
=
only_static
)
prefixes
=
[
prefix
],
only_static
=
False
)
if
not
candidates
:
if
not
candidates
:
raise
RuntimeError
(
"
cannot find required libsvm binary module `%s
'
- make sure libsvm is installed on `%s
'"
%
(
module
,
prefix
))
raise
RuntimeError
(
"
cannot find required libsvm binary module `%s
'
- make sure libsvm is installed on `%s
'"
%
(
module
,
prefix
))
...
@@ -143,10 +106,10 @@ class libsvm:
...
@@ -143,10 +106,10 @@ class libsvm:
>>>
from
bob.learn.libsvm
import
libsvm
>>>
from
bob.learn.libsvm
import
libsvm
>>>
pkg
=
libsvm
()
>>>
pkg
=
libsvm
()
>>>
pkg
.
macros
()
>>>
pkg
.
macros
()
[(
'
HAVE_LIBSVM
'
,
'
1
'
)
,
(
'
LIBSVM_VERSION
'
,
'"
...
"'
)
]
[(
'
HAVE_LIBSVM
'
,
'
1
'
)]
"""
"""
return
[(
'
HAVE_LIBSVM
'
,
'
1
'
)
,
(
'
LIBSVM_VERSION
'
,
'"
%s
"'
%
self
.
version
)
]
return
[(
'
HAVE_LIBSVM
'
,
'
1
'
)]
pkg
=
libsvm
()
pkg
=
libsvm
()
system_include_dirs
=
[
pkg
.
include_directory
]
system_include_dirs
=
[
pkg
.
include_directory
]
...
...
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