# -*- coding: utf-8 -*-
########################################################################
# Copyright (C) 2018 by Marek Wojciechowski
# <mwojc@p.lodz.pl>
#
# Distributed under the terms of GPL-2.0 license
# https://opensource.org/licenses/GPL-2.0
########################################################################
from __future__ import print_function
import sys
import os
import platform
import tarfile
import zipfile
from distutils import sysconfig
from distutils.core import setup
if sys.version_info.major == 2:
from urllib2 import urlopen
else:
from urllib.request import urlopen
if __name__ == "__main__":
server = 'http://gmsh.info/bin'
version = '4.1.3'
iversion = version+'-2' # installer number
system = platform.system().lower()
machine = platform.machine().lower()
plat = None
plat = 'Linux64' if 'linux' in system and '64' in machine else plat
plat = 'Linux32' if 'linux' in system and '64' not in machine else plat
plat = 'Windows64' if 'windows' in system and '64' in machine else plat
plat = 'Windows32' if 'windows' in system and '64' not in machine else plat
plat = 'MacOSX' if 'darwin' in system else plat
if plat is None:
raise TypeError(
"Platform '{}' is not supported.".format(system+'-'+machine))
name = "gmsh-{}-{}-sdk".format(version, plat)
ext = '.zip' if plat.startswith('Windows') else '.tgz'
fname = name + ext
if plat.startswith('Linux'):
url = server + "/Linux/" + fname
elif plat.startswith('Windows'):
url = server + "/Windows/" + fname
else:
url = server + "/MacOSX/" + fname
if not os.path.isfile('.downloaded'):
print('Downloading {}, please wait...'.format(url))
with open(fname, "wb") as f:
f.write(urlopen(url).read())
with open('.downloaded', 'a'):
pass
if not os.path.isfile('.extracted'):
print('Extracting {}, please wait...'.format(fname))
tar = tarfile.open(fname) if ext == '.tgz' else zipfile.ZipFile(fname, 'r')
tar.extractall()
with open('.extracted', 'a'):
pass
pth = open('gmsh.pth', 'w')
pth.write(name+'/lib\n')
pth.write(name+'/bin')
pth.close()
site_dirpath = sysconfig.get_python_lib(prefix='')
dirs = [site_dirpath]
files = [['gmsh.pth']]
for (dirpath, dirnames, filenames) in os.walk(name):
dirs += [os.path.join(site_dirpath, dirpath)]
files += [[os.path.join(dirpath, file) for file in filenames]]
data_files = list(zip(dirs, files))
scripts = ['gmsh', 'gmsh.bat'] if plat.startswith('Windows') else ['gmsh']
setup(name = 'gmsh-sdk',
version = iversion,
description = 'Gmsh SDK installer. Gmsh is a three-dimensional finite element mesh generator.',
long_description = open('README.rst', 'r').read(),
long_description_content_type='text/x-rst',
maintainer = 'Marek Wojciechowski',
maintainer_email = 'mrkwjc@gmail.com',
keywords = ['fem', 'mesh', 'finite element method'],
url = 'https://github.com/mrkwjc/gmsh-sdk',
license = 'GPL-2',
platforms = 'Posix, Windows',
classifiers = ['Development Status :: 5 - Production/Stable',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)',
'Operating System :: POSIX :: Linux',
'Operating System :: Microsoft :: Windows',
'Operating System :: MacOS :: MacOS X',
'Programming Language :: C',
'Programming Language :: C++',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Scientific/Engineering'],
data_files=data_files,
scripts=scripts
)
![avatar](https://profile-avatar.csdnimg.cn/277f6345dca0446498fbbc03843436aa_qq_38161040.jpg!1)
挣扎的蓝藻
- 粉丝: 14w+
- 资源: 15万+
最新资源
- 跨平台开发指南-YOLOv11在Android、iOS端实时检测落地实践.pdf
- 跨平台开发指南-YOLOv11模型转ONNX及移动端部署最佳实践.pdf
- MATLAB实现IBES-ELM基于改进的秃鹰搜索优化算法优化极限学习机的数据回归预测 (含模型描述及示例代码)
- 跨域迁移学习-YOLOv11在极地科考中的冰雪目标快速适配方案.pdf
- 零基础入门YOLOv11-从PyTorch训练到ONNX跨平台部署全流程.pdf
- 跨行业应用-YOLOv11在野生动物追踪与生态监测中的创新实践.pdf
- 零售场景深度应用-YOLOv11实现货架商品识别与库存动态管理.pdf
- 零售盗窃预防-YOLOv11实时异常行为检测与报警联动方案.pdf
- 零售场景落地-YOLOv11多目标顾客行为分析与货架陈列优化系统(新零售).pdf
- 零售货架管理-YOLOv11缺货检测与SKU匹配自动化系统设计.pdf
- 零售货架管理-YOLOv11商品缺货预警与陈列合规性检测模型部署.pdf
- 零售货架管理-YOLOv11商品缺货检测与陈列合规性自动审核.pdf
- 零售结算革命-YOLOv11多商品并行识别与自动计价技术实现.pdf
- 零售货架智能管理-YOLOv11商品缺货检测与补货提醒.pdf
- 零售结算革命-YOLOv11+RFID融合的无人便利店商品识别方案.pdf
- 零售收银升级-YOLOv11商品自动识别与价格结算系统开发.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)