Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F62419311
app_make.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
Mon, May 13, 01:55
Size
1 KB
Mime Type
text/x-python
Expires
Wed, May 15, 01:55 (2 d)
Engine
blob
Format
Raw Data
Handle
17644783
Attached To
rWIRELESGPU wireles-gpu
app_make.py
View Options
#!/usr/bin/env python
'''
Created on 18.04.2018
@author: trevaz (tristan.revaz@epfl.ch)
---------------------------------------------------------------------------------
app: make
---------------------------------------------------------------------------------
'''
#################################################################################
# IMPORTS
#################################################################################
import
os
from
fctlib
import
get_case_path
from
fctlib
import
get_config
#################################################################################
# CONSTANTS
#################################################################################
#################################################################################
# MAIN FUNCTION
#################################################################################
def
make
(
PATH
,
case_name
):
'''
DEF: monitor case.
INPUT: - case_name: name of the case, type=string
OUTPUT: - ()
'''
case_path
=
get_case_path
(
PATH
,
case_name
)
############################################################################
# EXTRACT CONFIG
print
(
'extract config...'
)
config
=
get_config
(
case_path
)
if
config
[
'double_flag'
]
==
0
:
print
(
'========================================='
)
print
(
'Single precision complie'
)
print
(
'========================================='
)
os
.
environ
[
"PRECISION"
]
=
""
else
:
print
(
'========================================='
)
print
(
'Double precision complie'
)
print
(
'========================================='
)
os
.
environ
[
"PRECISION"
]
=
"-DDOUBLE"
# Try to compile twice in case the first compiling falied due to dependency
os
.
system
(
'make -j2 -C '
+
str
(
os
.
path
.
join
(
case_path
,
'src'
)))
os
.
system
(
'make -j2 -C '
+
str
(
os
.
path
.
join
(
case_path
,
'src'
)))
Event Timeline
Log In to Comment