-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
78 additions
and
83 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import subprocess | ||
import shutil | ||
import os | ||
import os.path | ||
import sys | ||
|
||
os.chdir(os.path.dirname(os.path.abspath(__file__))) | ||
|
||
# replace new libraries | ||
linux = './openseespy/opensees/linux/' | ||
win = './openseespy/opensees/win/' | ||
so = '../openseespy/SRC/interpreter/opensees.so' | ||
pyd = '../openseespy/Win64/bin/opensees.pyd' | ||
|
||
if os.path.exists(linux+'opensees.so'): | ||
os.remove(linux+'opensees.so') | ||
if os.path.exists(win+'opensees.pyd'): | ||
os.remove(win+'opensees.pyd') | ||
|
||
shutil.copy(so, linux) | ||
shutil.copy(pyd, win) | ||
|
||
# get fortran library | ||
p = subprocess.run( | ||
["ldd", so], capture_output=True) | ||
|
||
for line in p.stdout.decode('utf-8').split('\n'): | ||
i = line.find('/') | ||
j = line.find(' ', i) | ||
if i < 0 or j < 0 or i >= j: | ||
continue | ||
|
||
if line[i:j].find('fortran') > 0: | ||
print('copying '+line[i:j]+' ....') | ||
shutil.copy(line[i:j], linux+'lib/') | ||
|
||
# clean folders | ||
subprocess.run(['rm', '-fr', 'build', 'dist', 'openseespy.egg-info']) | ||
|
||
# update tools | ||
subprocess.run(['/data2/Minjie/bin/anaconda3/bin/python3.7', '-m', 'pip', 'install', '--upgrade', 'setuptools', 'wheel', 'twine']) | ||
|
||
# compile wheel | ||
subprocess.run(['/data2/Minjie/bin/anaconda3/bin/python3.7', 'setup.py', 'bdist_wheel']) | ||
|
||
# test | ||
sys.path.append('openseespy/opensees/linux') | ||
|
||
from opensees import * | ||
|
||
os.chdir('tests') | ||
exec(open('Truss.py','r').read()) | ||
exec(open('MomentCurvature.py','r').read()) | ||
exec(open('RCFramePushover.py','r').read()) | ||
exec(open('ElasticFrame.py','r').read()) | ||
exec(open('DynAnal_BeamWithQuadElements.py','r').read()) | ||
exec(open('Ex1a.Canti2D.EQ.modif.py','r').read()) | ||
exec(open('EigenAnal_twoStoreyShearFrame7.py','r').read()) | ||
exec(open('EigenAnal_twoStoreyFrame1.py','r').read()) | ||
exec(open('sdofTransient.py','r').read()) | ||
exec(open('PlanarTruss.py','r').read()) | ||
exec(open('PlanarTruss.Extra.py','r').read()) | ||
exec(open('PortalFrame2d.py','r').read()) | ||
exec(open('EigenFrame.py','r').read()) | ||
exec(open('EigenFrame.Extra.py','r').read()) | ||
exec(open('AISC25.py','r').read()) | ||
exec(open('PlanarShearWall.py','r').read()) | ||
exec(open('PinchedCylinder.py','r').read()) | ||
os.chdir('..') | ||
|
||
|
||
print("================================================================") | ||
print("Done with testing examples.") | ||
print("================================================================") | ||
|
||
# upload | ||
subprocess.run(['/data2/Minjie/bin/anaconda3/bin/python3.7', '-m', 'twine', 'upload', 'dist/*']) | ||
|
This file was deleted.
Oops, something went wrong.