FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lammps/python/setup.py at master · ibrsam/lammps · GitHub
ibrsam
/
lammps
Public
forked from
yury-lysogorskiy/lammps
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
lammps
/
python
/
setup.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (34 loc) · 1.31 KB
Breadcrumbs
lammps
/
python
/
setup.py
Copy path
File metadata and controls
39 lines (34 loc) · 1.31 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# this only installs the LAMMPS python package
# it assumes the LAMMPS shared library is already installed
from
distutils
.
core
import
setup
from
sys
import
version_info
import
os
,
time
LAMMPS_PYTHON_DIR
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
LAMMPS_DIR
=
os
.
path
.
dirname
(
LAMMPS_PYTHON_DIR
)
LAMMPS_SOURCE_DIR
=
os
.
path
.
join
(
LAMMPS_DIR
,
'src'
)
if
not
os
.
path
.
exists
(
LAMMPS_SOURCE_DIR
):
# allows installing and building wheel from current directory
LAMMPS_DIR
=
os
.
path
.
realpath
(
os
.
path
.
join
(
os
.
environ
[
'PWD'
],
'..'
))
LAMMPS_SOURCE_DIR
=
os
.
path
.
join
(
LAMMPS_DIR
,
'src'
)
def
get_lammps_version
():
version_h_file
=
os
.
path
.
join
(
LAMMPS_SOURCE_DIR
,
'version.h'
)
with
open
(
version_h_file
,
'r'
)
as
f
:
line
=
f
.
readline
()
start_pos
=
line
.
find
(
'"'
)
+
1
end_pos
=
line
.
find
(
'"'
,
start_pos
)
t
=
time
.
strptime
(
""
.
join
(
line
[
start_pos
:
end_pos
].
split
()),
"%d%b%Y"
)
return
"{}.{}.{}"
.
format
(
t
.
tm_year
,
t
.
tm_mon
,
t
.
tm_mday
)
if
version_info
.
major
>=
3
:
pkgs
=
[
'lammps'
,
'lammps.mliap'
]
else
:
pkgs
=
[
'lammps'
]
setup
(
name
=
"lammps"
,
version
=
get_lammps_version
(),
author
=
"Steve Plimpton"
,
author_email
=
"sjplimp@sandia.gov"
,
url
=
"https://www.lammps.org"
,
description
=
"LAMMPS Molecular Dynamics Python package"
,
license
=
"GPL"
,
packages
=
pkgs
,
)
Back
|
FazBrowse Home
|
New Git URL