Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.io.base
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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.io.base
Commits
dee1b170
There was a problem fetching the pipeline summary.
Commit
dee1b170
authored
6 years ago
by
André Anjos
Browse files
Options
Downloads
Plain Diff
Merge branch '19-blitz_version-is-computed-but-never-used' into 'master'
Resolve "HDF5_VERSION is computed but never used" Closes
#19
See merge request
!25
parents
cff54df2
892ce914
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!25
Resolve "HDF5_VERSION is computed but never used"
Pipeline
#
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.py
+6
-46
6 additions, 46 deletions
setup.py
with
6 additions
and
46 deletions
setup.py
+
6
−
46
View file @
dee1b170
...
...
@@ -20,7 +20,6 @@ version = open("version.txt").read().rstrip()
packages
=
[
'
boost
'
]
boost_modules
=
[
'
system
'
,
'
filesystem
'
]
import
os
def
libhdf5_version
(
header
):
vv
=
egrep
(
header
,
r
"
#\s*define\s+H5_VERSION\s+\"([\d\.]+)\"
"
)
...
...
@@ -29,23 +28,13 @@ def libhdf5_version(header):
class
hdf5
:
def
__init__
(
self
,
requirement
=
''
,
only_static
=
False
):
def
__init__
(
self
):
"""
Searches for libhdf5 in stock locations. Allows user to override.
If the user sets the environment variable BOB_PREFIX_PATH, that prefixes
the standard path locations.
Parameters:
requirement, str
A string, indicating a version requirement for this library. For example,
``
'
>= 8.2
'
``.
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.
"""
import
os
...
...
@@ -61,38 +50,10 @@ class hdf5:
if
not
candidates
:
raise
RuntimeError
(
"
could not find %s
'
s `%s
'
- have you installed %s on this machine?
"
%
(
self
.
name
,
header
,
self
.
name
))
found
=
False
if
not
requirement
:
self
.
include_directories
=
[
os
.
path
.
dirname
(
candidates
[
0
])]
directory
=
os
.
path
.
dirname
(
candidates
[
0
])
version_header
=
os
.
path
.
join
(
directory
,
'
H5pubconf.h
'
)
self
.
version
=
libhdf5_version
(
version_header
)
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
:
directory
=
os
.
path
.
dirname
(
candidate
)
version_header
=
os
.
path
.
join
(
directory
,
'
H5pubconf.h
'
)
vv
=
libhdf5_version
(
version_header
)
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_directories
=
[
os
.
path
.
dirname
(
candidate
)]
self
.
version
=
vv
found
=
True
break
if
not
found
:
raise
RuntimeError
(
"
could not find the required (%s) version of %s on the file system (looked at: %s)
"
%
(
requirement
,
self
.
name
,
'
,
'
.
join
(
candidates
)))
self
.
include_directories
=
[
os
.
path
.
dirname
(
candidates
[
0
])]
directory
=
os
.
path
.
dirname
(
candidates
[
0
])
version_header
=
os
.
path
.
join
(
directory
,
'
H5pubconf.h
'
)
self
.
version
=
libhdf5_version
(
version_header
)
# normalize
self
.
include_directories
=
[
os
.
path
.
normpath
(
i
)
for
i
in
self
.
include_directories
]
...
...
@@ -100,7 +61,7 @@ class hdf5:
# find library
prefix
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
self
.
include_directories
[
0
]))
module
=
'
hdf5
'
candidates
=
find_library
(
module
,
version
=
self
.
version
,
prefixes
=
[
prefix
],
only_static
=
only_static
)
candidates
=
find_library
(
module
,
version
=
self
.
version
,
prefixes
=
[
prefix
],
only_static
=
False
)
if
not
candidates
:
raise
RuntimeError
(
"
cannot find required %s binary module `%s
'
- make sure libhdf5 is installed on `%s
'"
%
(
self
.
name
,
module
,
prefix
))
...
...
@@ -129,7 +90,6 @@ class hdf5:
def
macros
(
self
):
return
[
(
'
HAVE_%s
'
%
self
.
name
.
upper
(),
'
1
'
),
(
'
%s_VERSION
'
%
self
.
name
.
upper
(),
'"
%s
"'
%
self
.
version
),
]
...
...
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