Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lammps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
multiscale
lammps
Commits
f181a0bf
Commit
f181a0bf
authored
7 years ago
by
Ryan S. Elliott
Browse files
Options
Downloads
Patches
Plain Diff
Update lib/kim/Install.py for phthon 2.7 conversion
parent
81f342aa
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
lib/kim/Install.py
+35
-26
35 additions, 26 deletions
lib/kim/Install.py
with
35 additions
and
26 deletions
lib/kim/Install.py
+
35
−
26
View file @
f181a0bf
...
...
@@ -200,43 +200,52 @@ if addflag:
print
(
"
Building item ...
"
)
cmd
=
"
cd %s/%s; make; make install
"
%
(
thisdir
,
addmodelname
)
subprocess
.
check_output
(
cmd
,
shell
=
True
)
firstRunOutput
=
txt
[
1
]
if
txt
[
0
]
!=
0
:
try
:
txt
=
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
)
except
subprocess
.
CalledProcessError
as
e
:
# Error: but first, check to see if it needs a driver
firstRunOutput
=
e
.
output
cmd
=
"
cd %s/%s; make kim-item-type
"
%
(
thisdir
,
addmodelname
)
txt
=
subprocess
.
check_output
(
cmd
,
shell
=
True
)
if
txt
[
1
]
==
"
ParameterizedModel
"
:
txt
=
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
)
if
txt
==
"
ParameterizedModel
"
:
# Get and install driver
cmd
=
"
cd %s/%s; make model-driver-name
"
%
(
thisdir
,
addmodelname
)
txt
=
subprocess
.
check_output
(
cmd
,
shell
=
True
)
adddrivername
=
txt
[
1
]
txt
=
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
)
adddrivername
=
txt
print
(
"
First Installing model driver: %s
"
%
adddrivername
)
cmd
=
"
cd %s; python Install.py -a %s
"
%
(
thisdir
,
adddrivername
)
txt
=
subprocess
.
check_output
(
cmd
,
shell
=
True
)
if
txt
[
0
]
!=
0
:
print
(
firstRunOutput
)
print
(
txt
[
1
])
error
()
else
:
print
(
txt
[
1
])
try
:
txt
=
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
)
except
subprocess
.
CalledProcessError
as
e
:
print
(
e
.
output
)
sys
.
exit
()
print
(
txt
)
# now install the model that needed the driver
cmd
=
"
cd %s; python Install.py -a %s
"
%
(
thisdir
,
addmodelname
)
txt
=
subprocess
.
check_output
(
cmd
,
shell
=
True
)
print
(
txt
[
1
])
if
txt
[
0
]
!=
0
:
error
()
try
:
txt
=
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
)
except
subprocess
.
CalledProcessError
as
e
:
print
(
e
.
output
)
sys
.
exit
()
print
(
txt
)
sys
.
exit
()
else
:
print
(
firstRunOutput
)
error
()
else
:
# success
print
(
"
Error, unable to build and install OpenKIM item: %s
"
\
%
addmodelname
)
sys
.
exit
()
print
(
firstRunOutput
)
print
(
"
Removing kim item source and build files ...
"
)
cmd
=
"
cd %s; rm -rf %s; rm -rf %s.tgz
"
%
(
thisdir
,
addmodelname
,
addmodelname
)
subprocess
.
check_output
(
cmd
,
shell
=
True
)
# success the first time
print
(
txt
)
print
(
"
Removing kim item source and build files ...
"
)
cmd
=
"
cd %s; rm -rf %s; rm -rf %s.tgz
"
%
(
thisdir
,
addmodelname
,
addmodelname
)
subprocess
.
check_output
(
cmd
,
shell
=
True
)
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