Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F88637653
tamaas.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Oct 19, 21:50
Size
2 KB
Mime Type
text/x-python
Expires
Mon, Oct 21, 21:50 (2 d)
Engine
blob
Format
Raw Data
Handle
21801987
Attached To
rTAMAAS tamaas
tamaas.py
View Options
# coding: utf-8
#
# @author Lucas Frérot <lucas.frerot@epfl.ch>
#
# @section LICENSE
#
# Copyright (©) 2017 EPFL (Ecole Polytechnique Fédérale de
# Lausanne) Laboratory (LSMS - Laboratoire de Simulation en Mécanique des
# Solides)
#
# Tamaas is free software: you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# Tamaas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Tamaas. If not, see <http://www.gnu.org/licenses/>.
import
os
import
SCons
from
SCons.Errors
import
StopError
from
SCons.Script
import
*
def
generate
(
env
):
"""Sets correct environement variables for Tamaas.
- 'TAMAAS_PATH' is the path to the build directory of Tamaas"""
if
env
.
GetOption
(
"clean"
):
return
if
'TAMAAS_PATH'
not
in
env
:
raise
StopError
(
"Please set the 'TAMAAS_PATH' variable in your "
+
"scons environment"
)
tm_path
=
env
[
'TAMAAS_PATH'
]
include_dir
=
tm_path
+
'/src'
subdirs
=
"core model solvers bem surface percolation"
.
split
(
" "
)
include_dirs
=
[
os
.
path
.
abspath
(
os
.
path
.
join
(
include_dir
,
x
))
for
x
in
subdirs
]
lib_dir
=
include_dir
env
.
AppendUnique
(
CPPPATH
=
include_dirs
)
env
.
AppendUnique
(
LIBPATH
=
[
os
.
path
.
abspath
(
lib_dir
)])
env
.
AppendUnique
(
RPATH
=
[
os
.
path
.
abspath
(
lib_dir
)])
env
.
AppendUnique
(
CXXFLAGS
=
[
"-std=c++11"
])
env
.
AppendUnique
(
CPPDEFINES
=
[
"THRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_OMP"
])
env
.
AppendUnique
(
LIBS
=
[
'fftw3'
,
'fftw3_omp'
])
conf
=
Configure
(
env
)
if
not
conf
.
CheckLibWithHeader
(
"Tamaas"
,
"tamaas.hh"
,
language
=
"CXX"
):
raise
StopError
(
"Tamaas not found in {}"
.
format
(
os
.
path
.
abspath
(
tm_path
)))
env
[
'TAMAAS_PATH'
]
=
os
.
path
.
abspath
(
tm_path
)
env
=
conf
.
Finish
()
def
exists
(
env
):
if
'TAMAAS_PATH'
in
env
:
return
True
return
False
Event Timeline
Log In to Comment