forked from pyne/pyne
-
Notifications
You must be signed in to change notification settings - Fork 0
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
6 changed files
with
139 additions
and
16 deletions.
There are no files selected for viewing
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
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
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,18 @@ | ||
# | ||
# Runs setup.py install | ||
# | ||
set(PYTHON_EXECUTABLE @PYTHON_EXECUTABLE@) | ||
message("############### Begin Python Install ###############") | ||
message("-- Python installer:") | ||
message(" PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}") | ||
message(" CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") | ||
message(" CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}") | ||
execute_process(COMMAND ${PYTHON_EXECUTABLE} setup_sub.py install | ||
"--prefix=${CMAKE_INSTALL_PREFIX}" | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
RESULT_VARIABLE res_var) | ||
if(NOT "${res_var}" STREQUAL "0") | ||
message(FATAL_ERROR "Process setup_sub.py install failed, " | ||
"res_var = '${res_var}'") | ||
endif() | ||
message("############### End Python Install ###############") |
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
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 |
---|---|---|
@@ -1,13 +1,11 @@ | ||
# Python extension modules | ||
include_directories(${PYNE_INCLUDE_DIRS}) | ||
get_property(inc_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES) | ||
message("-- Include paths for ${CMAKE_CURRENT_SOURCE_DIR}: ${inc_dirs}") | ||
|
||
# xs | ||
set_source_files_properties("${PROJECT_SOURCE_DIR}/pyne/xs/models.pyx" | ||
PROPERTIES CYTHON_IS_CXX TRUE) | ||
cython_add_module(models models.pyx) | ||
target_link_libraries(models pyne) | ||
|
||
|
||
# Print include dir | ||
get_property(inc_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES) | ||
message("-- Include paths for ${CMAKE_CURRENT_SOURCE_DIR}: ${inc_dirs}") | ||
install(TARGETS models LIBRARY DESTINATION "${PYTHON_SITE_PACKAGES}/pyne/xs") |
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,77 @@ | ||
#!/usr/bin/env python | ||
"""Welcome to PyNE's setup.py sub script.""" | ||
from __future__ import print_function | ||
|
||
import io | ||
import os | ||
import re | ||
import sys | ||
import imp | ||
import shutil | ||
import tarfile | ||
import argparse | ||
import platform | ||
import warnings | ||
import subprocess | ||
from glob import glob | ||
from distutils import core, dir_util, sysconfig | ||
from contextlib import contextmanager | ||
if sys.version_info[0] < 3: | ||
from urllib import urlopen | ||
else: | ||
from urllib.request import urlopen | ||
from distutils.core import setup | ||
|
||
|
||
VERSION = '0.5.3' | ||
IS_NT = os.name == 'nt' | ||
|
||
|
||
def main(): | ||
scripts = [os.path.join('scripts', f) for f in os.listdir('scripts')] | ||
scripts = [s for s in scripts if (os.name == 'nt' and s.endswith('.bat')) | ||
or (os.name != 'nt' and | ||
not s.endswith('.bat'))] | ||
packages = ['pyne', 'pyne.dbgen', 'pyne.apigen', 'pyne.xs', | ||
'pyne.transmute', 'pyne.gui', 'pyne.cli', 'pyne.fortranformat'] | ||
pack_dir = { | ||
'pyne': 'pyne', | ||
'pyne.xs': 'pyne/xs', | ||
'pyne.gui': 'pyne/gui', | ||
'pyne.cli': 'pyne/cli', | ||
'pyne.dbgen': 'pyne/dbgen', | ||
'pyne.apigen': 'pyne/apigen', | ||
'pyne.transmute': 'pyne/transmute', | ||
'pyne.fortranformat': 'pyne/fortranformat', | ||
} | ||
extpttn = ['*.dll', '*.so', '*.dylib', '*.pyd', '*.pyo'] | ||
pack_data = { | ||
'lib': extpttn, | ||
'pyne': ['*.pxd', | ||
#'include/*.h', 'include/*.pxi', 'include/*/*.h', | ||
#'include/*/*/*.h', 'include/*/*/*/*.h', | ||
'*.json', '*.inp', | ||
#'_includes/*.txt', '_includes/*.pxd', '_includes/*/*', | ||
#'_includes/*/*/*' | ||
] + extpttn, | ||
'pyne.xs': ['*.pxd'] + extpttn, | ||
'pyne.gui': ['*.pyw'], | ||
'pyne.dbgen': ['*.html', '*.csv', 'abundances.txt', 'mass.mas12'], | ||
} | ||
setup_kwargs = { | ||
"name": "pyne", | ||
"version": VERSION, | ||
"description": 'The Nuclear Engineering Toolkit', | ||
"author": 'PyNE Development Team', | ||
"author_email": '[email protected]', | ||
"url": 'http:https://pyne.github.com/', | ||
"packages": packages, | ||
"package_dir": pack_dir, | ||
"package_data": pack_data, | ||
"scripts": scripts, | ||
} | ||
rtn = setup(**setup_kwargs) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |