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
ffb778cf
Commit
ffb778cf
authored
7 years ago
by
Axel Kohlmeyer
Browse files
Options
Downloads
Patches
Plain Diff
make Install.py for lib/smd and lib/voronoi consistent
parent
f3850da9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/smd/.gitignore
+5
-0
5 additions, 0 deletions
lib/smd/.gitignore
lib/smd/Install.py
+45
-43
45 additions, 43 deletions
lib/smd/Install.py
lib/voronoi/Install.py
+2
-3
2 additions, 3 deletions
lib/voronoi/Install.py
with
52 additions
and
46 deletions
lib/smd/.gitignore
0 → 100644
+
5
−
0
View file @
ffb778cf
# ignore these entries with git
/eigen.tar.gz
/eigen-eigen-*
/includelink
/eigen3
This diff is collapsed.
Click to expand it.
lib/smd/Install.py
+
45
−
43
View file @
ffb778cf
...
...
@@ -11,30 +11,28 @@ except: from urllib import urlretrieve as geturl
# help message
help
=
"""
Syntax from src dir: make lib-smd args=
"
-h hpath hdir -g -l
"
Syntax from lib dir: python Install.py -h hpath hdir -g -l
Syntax from src dir: make lib-smd
or: make lib-smd args=
"
-p /usr/include/eigen3
"
Syntax from lib dir: python Install.py
or: python Install.py -p /usr/include/eigen3
"
or: python Install.py -v 3.3.4 -b
specify one or more options, order does not matter
-h = set home dir of Eigen to be hpath/hdir
hpath can be full path, contain
'
~
'
or
'
.
'
chars
default hpath = . = lib/smd
default hdir =
"
ee
"
= what tarball unpacks to (eigen-eigen-*)
-g = grab (download) tarball from http://eigen.tuxfamily.org website
unpack it to hpath/hdir
hpath must already exist
if hdir already exists, it will be deleted before unpack
-l = create softlink (includelink) in lib/smd to Eigen src dir
-b = download and unpack/configure the Eigen library (default)
-p = specify folder holding an existing installation of Eigen
-v = set version of Eigen library to download and set up (default = 3.3.4)
Example:
make lib-smd args=
"
-
g -l
"
# download/build in default lib/smd/eigen-eigen-*
make lib-smd args=
"
-
b
"
# download/build in default lib/smd/eigen-eigen-*
"""
# settings
version
=
'
3.3.4
'
url
=
"
http://bitbucket.org/eigen/eigen/get/%s.tar.gz
"
%
version
tarball
=
"
eigen.tar.gz
"
# print error message or help
...
...
@@ -46,59 +44,65 @@ def error(str=None):
# expand to full path name
# process leading '~' or relative path
def
fullpath
(
path
):
return
os
.
path
.
abspath
(
os
.
path
.
expanduser
(
path
))
# parse args
args
=
sys
.
argv
[
1
:]
nargs
=
len
(
args
)
if
nargs
==
0
:
error
()
homepath
=
"
.
"
homedir
=
"
e
e
"
homedir
=
"
e
igen3
"
grabflag
=
0
linkflag
=
0
grabflag
=
True
buildflag
=
True
pathflag
=
False
linkflag
=
True
iarg
=
0
while
iarg
<
nargs
:
if
args
[
iarg
]
==
"
-h
"
:
if
iarg
+
3
>
nargs
:
error
()
homepath
=
args
[
iarg
+
1
]
homedir
=
args
[
iarg
+
2
]
iarg
+=
3
elif
args
[
iarg
]
==
"
-g
"
:
grabflag
=
1
iarg
+=
1
elif
args
[
iarg
]
==
"
-l
"
:
linkflag
=
1
if
args
[
iarg
]
==
"
-v
"
:
if
iarg
+
2
>
nargs
:
error
()
version
=
args
[
iarg
+
1
]
iarg
+=
2
elif
args
[
iarg
]
==
"
-p
"
:
if
iarg
+
2
>
nargs
:
error
()
eigenpath
=
fullpath
(
args
[
iarg
+
1
])
pathflag
=
True
buildflag
=
False
iarg
+=
2
elif
args
[
iarg
]
==
"
-b
"
:
buildflag
=
True
iarg
+=
1
else
:
error
()
homepath
=
fullpath
(
homepath
)
if
not
os
.
path
.
isdir
(
homepath
):
error
(
"
Eigen path does not exist
"
)
if
(
pathflag
):
if
not
os
.
path
.
isdir
(
eigenpath
):
error
(
"
Eigen path does not exist
"
)
if
(
buildflag
and
pathflag
):
error
(
"
Cannot use -b and -p flag at the same time
"
)
# download and unpack Eigen tarball
# glob to find name of dir it unpacks to
#
use
glob to find name of dir it unpacks to
if
grab
flag
:
if
build
flag
:
print
(
"
Downloading Eigen ...
"
)
url
=
"
http://bitbucket.org/eigen/eigen/get/%s.tar.gz
"
%
version
geturl
(
url
,
"
%s/%s
"
%
(
homepath
,
tarball
))
print
(
"
Unpacking Eigen tarball ...
"
)
edir
=
glob
.
glob
(
"
%s/eigen-eigen-*
"
%
homepath
)
for
one
in
edir
:
if
os
.
path
.
isdir
(
one
):
subprocess
.
check_output
(
"
rm -rf %s
"
%
one
,
shell
=
True
)
subprocess
.
check_output
(
"
rm -rf %s
"
%
one
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
)
cmd
=
'
cd
"
%s
"
; tar -xzvf %s
'
%
(
homepath
,
tarball
)
subprocess
.
check_output
(
cmd
,
shell
=
True
)
if
homedir
!=
"
ee
"
:
if
os
.
path
.
exists
(
homedir
):
subprocess
.
check_output
(
"
rm -rf %s
"
%
homedir
,
shell
=
True
)
edir
=
glob
.
glob
(
"
%s/eigen-eigen-*
"
%
homepath
)
os
.
rename
(
edir
[
0
],
"
%s/%s
"
%
(
homepath
,
homedir
))
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
)
edir
=
glob
.
glob
(
"
%s/eigen-eigen-*
"
%
homepath
)
os
.
rename
(
edir
[
0
],
"
%s/%s
"
%
(
homepath
,
homedir
))
# create link in lib/smd to Eigen src dir
...
...
@@ -106,9 +110,7 @@ if linkflag:
print
(
"
Creating link to Eigen files
"
)
if
os
.
path
.
isfile
(
"
includelink
"
)
or
os
.
path
.
islink
(
"
includelink
"
):
os
.
remove
(
"
includelink
"
)
if
homedir
==
"
ee
"
:
edir
=
glob
.
glob
(
"
%s/eigen-eigen-*
"
%
homepath
)
linkdir
=
edir
[
0
]
if
pathflag
:
linkdir
=
eigenpath
else
:
linkdir
=
"
%s/%s
"
%
(
homepath
,
homedir
)
cmd
=
"
ln -s %s includelink
"
%
linkdir
subprocess
.
check_output
(
cmd
,
shell
=
True
)
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
)
This diff is collapsed.
Click to expand it.
lib/voronoi/Install.py
+
2
−
3
View file @
ffb778cf
...
...
@@ -2,6 +2,7 @@
# Install.py tool to download, unpack, build, and link to the Voro++ library
# used to automate the steps described in the README file in this dir
from
__future__
import
print_function
import
sys
,
os
,
re
,
subprocess
try
:
from
urllib.request
import
urlretrieve
as
geturl
...
...
@@ -21,8 +22,7 @@ specify one or more options, order does not matter
-b = download and build the Voro++ library (default)
-p = specify folder of existing Voro++ installation
-v = version of Voro++ to download and build
default version = voro++-0.4.6 (current as of Jan 2015)
-v = set version of Voro++ to download and build (default voro++-0.4.6)
Example:
...
...
@@ -51,7 +51,6 @@ def fullpath(path):
args
=
sys
.
argv
[
1
:]
nargs
=
len
(
args
)
if
nargs
==
0
:
error
()
homepath
=
"
.
"
homedir
=
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