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
acf6d54e
Commit
acf6d54e
authored
7 years ago
by
Axel Kohlmeyer
Browse files
Options
Downloads
Patches
Plain Diff
python3 port, yet untested
parent
0427f620
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/Install.py
+16
-15
16 additions, 15 deletions
lib/Install.py
with
16 additions
and
15 deletions
lib/Install.py
+
16
−
15
View file @
acf6d54e
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
# soft linked to by many of the lib/Install.py files
# soft linked to by many of the lib/Install.py files
# used to automate the steps described in the corresponding lib/README
# used to automate the steps described in the corresponding lib/README
import
sys
,
commands
,
os
from
__future__
import
print_function
import
sys
,
os
,
subprocess
# help message
# help message
...
@@ -12,7 +13,7 @@ help = """
...
@@ -12,7 +13,7 @@ help = """
Syntax from src dir: make lib-libname args=
"
-m machine -e suffix
"
Syntax from src dir: make lib-libname args=
"
-m machine -e suffix
"
Syntax from lib dir: python Install.py -m machine -e suffix
Syntax from lib dir: python Install.py -m machine -e suffix
libname = name of lib dir (e.g. atc,
colvars,
h5md, meam, poems, etc)
libname = name of lib dir (e.g. atc, h5md, meam, poems, etc)
specify -m and optionally -e, order does not matter
specify -m and optionally -e, order does not matter
-m = peform a clean followed by
"
make -f Makefile.machine
"
-m = peform a clean followed by
"
make -f Makefile.machine
"
...
@@ -20,17 +21,17 @@ specify -m and optionally -e, order does not matter
...
@@ -20,17 +21,17 @@ specify -m and optionally -e, order does not matter
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
does not alter existing Makefile.machine
does not alter existing Makefile.machine
Examples
x
:
Examples:
make lib-
colvar
s args=
"
-m g++
"
# build COLVARS lib with GNU g++ compiler
make lib-
poem
s args=
"
-m g++
"
# build COLVARS lib with GNU g++ compiler
make lib-meam args=
"
-m ifort
"
# build MEAM lib with Intel ifort compiler
make lib-meam args=
"
-m ifort
"
# build MEAM lib with Intel ifort compiler
"""
"""
# print error message or help
# print error message or help
def
error
(
str
=
None
):
def
error
(
str
=
None
):
if
not
str
:
print
help
if
not
str
:
print
(
help
)
else
:
print
"
ERROR
"
,
str
else
:
print
(
"
ERROR
"
,
str
)
sys
.
exit
()
sys
.
exit
()
# parse args
# parse args
...
@@ -47,12 +48,12 @@ while iarg < nargs:
...
@@ -47,12 +48,12 @@ while iarg < nargs:
if
args
[
iarg
]
==
"
-m
"
:
if
args
[
iarg
]
==
"
-m
"
:
if
iarg
+
2
>
nargs
:
error
()
if
iarg
+
2
>
nargs
:
error
()
machine
=
args
[
iarg
+
1
]
machine
=
args
[
iarg
+
1
]
iarg
+=
2
iarg
+=
2
elif
args
[
iarg
]
==
"
-e
"
:
elif
args
[
iarg
]
==
"
-e
"
:
if
iarg
+
2
>
nargs
:
error
()
if
iarg
+
2
>
nargs
:
error
()
extraflag
=
1
extraflag
=
1
suffix
=
args
[
iarg
+
1
]
suffix
=
args
[
iarg
+
1
]
iarg
+=
2
iarg
+=
2
else
:
error
()
else
:
error
()
# set lib from working dir
# set lib from working dir
...
@@ -62,7 +63,7 @@ lib = os.path.basename(cwd)
...
@@ -62,7 +63,7 @@ lib = os.path.basename(cwd)
# create Makefile.auto as copy of Makefile.machine
# create Makefile.auto as copy of Makefile.machine
# reset EXTRAMAKE if requested
# reset EXTRAMAKE if requested
if
not
os
.
path
.
exists
(
"
Makefile.%s
"
%
machine
):
if
not
os
.
path
.
exists
(
"
Makefile.%s
"
%
machine
):
error
(
"
lib/%s/Makefile.%s does not exist
"
%
(
lib
,
machine
))
error
(
"
lib/%s/Makefile.%s does not exist
"
%
(
lib
,
machine
))
...
@@ -80,12 +81,12 @@ fp.close()
...
@@ -80,12 +81,12 @@ fp.close()
# make the library via Makefile.auto
# make the library via Makefile.auto
print
"
Building lib%s.a ...
"
%
lib
print
(
"
Building lib%s.a ...
"
%
lib
)
cmd
=
"
make -f Makefile.auto clean; make -f Makefile.auto
"
cmd
=
"
make -f Makefile.auto clean; make -f Makefile.auto
"
txt
=
commands
.
getoutput
(
cmd
)
txt
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
)
print
txt
print
(
txt
)
if
os
.
path
.
exists
(
"
lib%s.a
"
%
lib
):
print
"
Build was successful
"
if
os
.
path
.
exists
(
"
lib%s.a
"
%
lib
):
print
(
"
Build was successful
"
)
else
:
error
(
"
Build of lib/%s/lib%s.a was NOT successful
"
%
(
lib
,
lib
))
else
:
error
(
"
Build of lib/%s/lib%s.a was NOT successful
"
%
(
lib
,
lib
))
if
not
os
.
path
.
exists
(
"
Makefile.lammps
"
):
if
not
os
.
path
.
exists
(
"
Makefile.lammps
"
):
print
"
lib/%s/Makefile.lammps was NOT created
"
%
lib
print
(
"
lib/%s/Makefile.lammps was NOT created
"
%
lib
)
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