-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
executable file
·36 lines (24 loc) · 1004 Bytes
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3
from pydefs.do_call import do_call
import os
import platform
import subprocess
import sys
do_call([sys.executable, 'clean.py'])
if platform.system() == 'Windows':
do_call(['where', 'cmake'], fix_message='Install cmake, add cmake to PATH')
do_call(['where', 'R'], fix_message='Install R, add R.exe to PATH')
do_call(['where', 'sh'], fix_message='Install Rtools, add sh.exe to PATH')
do_call(['where', 'g++'], fix_message='Install Rtools, add g++.exe to PATH')
else:
do_call(['which', 'cmake'])
local_library = os.path.join(os.getcwd(), '_library')
os.mkdir(local_library)
packname = 'FIMSCMake_1.0.tar.gz'
logfiles = ['00install.out']
logfiles = [os.path.join('FIMSCMake.Rcheck', x) for x in logfiles]
do_call(['R', 'CMD', 'build', '.'])
do_call(['R', 'CMD', 'check', packname], info_files=logfiles)
do_call(['R', 'CMD', 'INSTALL', '-l', local_library, packname])
result_out = os.path.join(os.getcwd(), 'mytest.Rout')
os.environ['R_LIBS_USER'] = local_library