Commit 643301d8 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles

Improve python packaging

parent 1e4a73fd
......@@ -9,6 +9,8 @@
#py stuffs
dist
*egg-info*
py/swig/py_unsio.py
py/swig/*.cpp
# tilda
*~
......
......@@ -62,7 +62,7 @@ FIND_PACKAGE(HDF5 COMPONENTS CXX REQUIRED)
MESSAGE( STATUS "1) HDF5_CXX_LIBRARIES=" ${HDF5_CXX_LIBRARIES})
if(LINUX_ISSUE MATCHES "Mageia")
SET(HDF5_CXX_LIBRARIES hdf5_hl_cpp.a hdf5_cpp.a hdf5.a) # use this trick to compile against hdf5 static libs, to keep compatibility between hdf5 libs, works only on mageia...
# SET(HDF5_CXX_LIBRARIES hdf5_hl_cpp.a hdf5_cpp.a hdf5.a) # use this trick to compile against hdf5 static libs, to keep compatibility between hdf5 libs, works only on mageia...
endif()
MESSAGE( STATUS "2) HDF5_CXX_LIBRARIES=" ${HDF5_CXX_LIBRARIES})
......@@ -130,6 +130,10 @@ IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
ENDIF ()#NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
MESSAGE( STATUS "--------> CMAKE_INSTALL_PREFIX =" ${CMAKE_INSTALL_PREFIX})
# following line is important for building python wheel package later from docker ci
set_target_properties(unsio PROPERTIES LINK_FLAGS "-Wl,-rpath=${CMAKE_INSTALL_PREFIX}/${PREFIX_LIB}")
if (OSX)
#MESSAGE(STATUS "\nAfter running \"make install\", do not forget to set your environment variable DYLD_LIBRARY_PATH using command:\n\n export DYLD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib\n")
MESSAGE(STATUS "\nBetter run cmake on macosx using clang compiler with commnand:\nCC=/usr/bin/cc CXX=/usr/bin/c++ cmake ..\n")
......@@ -221,17 +225,17 @@ endif()
# ----------------------------------------------------------
# UNS specific includes
INSTALL(FILES ${UNSIO2_BINARY_DIR}/../src/uns.h DESTINATION ${PREFIX_INC}/uns)
INSTALL(FILES ${UNSIO2_BINARY_DIR}/../src/version.h DESTINATION ${PREFIX_INC}/uns)
INSTALL(FILES ${UNSIO2_BINARY_DIR}/../src/unsdebug.h DESTINATION ${PREFIX_INC}/uns)
INSTALL(FILES ${UNSIO2_BINARY_DIR}/../src/snapshotinterface.h DESTINATION ${PREFIX_INC}/uns)
INSTALL(FILES ${UNSIO2_BINARY_DIR}/../src/componentrange.h DESTINATION ${PREFIX_INC}/uns)
INSTALL(FILES ${UNSIO2_BINARY_DIR}/../src/ctools.h DESTINATION ${PREFIX_INC}/uns)
INSTALL(FILES ${UNSIO2_BINARY_DIR}/../src/userselection.h DESTINATION ${PREFIX_INC}/uns)
INSTALL(FILES ${UNSIO2_SOURCE_DIR}/src/uns.h DESTINATION ${PREFIX_INC}/uns)
INSTALL(FILES ${UNSIO2_SOURCE_DIR}/src/version.h DESTINATION ${PREFIX_INC}/uns)
INSTALL(FILES ${UNSIO2_SOURCE_DIR}/src/unsdebug.h DESTINATION ${PREFIX_INC}/uns)
INSTALL(FILES ${UNSIO2_SOURCE_DIR}/src/snapshotinterface.h DESTINATION ${PREFIX_INC}/uns)
INSTALL(FILES ${UNSIO2_SOURCE_DIR}/src/componentrange.h DESTINATION ${PREFIX_INC}/uns)
INSTALL(FILES ${UNSIO2_SOURCE_DIR}/src/ctools.h DESTINATION ${PREFIX_INC}/uns)
INSTALL(FILES ${UNSIO2_SOURCE_DIR}/src/userselection.h DESTINATION ${PREFIX_INC}/uns)
# unsio lib
INSTALL(FILES ${UNSIO2_BINARY_DIR}/lib/libunsio.${LIBEXT} DESTINATION ${PREFIX_LIB})
# man
INSTALL(FILES ${UNSIO2_BINARY_DIR}/../man/man3/unsiof.3 DESTINATION ${PREFIX_MAN}/man3)
INSTALL(FILES ${UNSIO2_SOURCE_DIR}/man/man3/unsiof.3 DESTINATION ${PREFIX_MAN}/man3)
#
# NEMO specific lib and includes
......@@ -258,16 +262,16 @@ if (NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr")
# module though which comes with this install....
# install sqlite3 database files
INSTALL(FILES ${UNSIO2_BINARY_DIR}/../scripts/perl/lib/Tools/Tools.pm DESTINATION "${PREFIX_SCR}/perl/lib/Tools")
INSTALL(FILES ${UNSIO2_BINARY_DIR}/../scripts/perl/lib/Tools/Sqlite3.pm DESTINATION "${PREFIX_SCR}/perl/lib/Tools")
INSTALL(FILES ${UNSIO2_BINARY_DIR}/../scripts/sql/create_unsio_db.sql DESTINATION "${PREFIX_SCR}/sql")
INSTALL(FILES ${UNSIO2_BINARY_DIR}/../scripts/sql/README DESTINATION "${PREFIX_SCR}/sql")
INSTALL(FILES ${UNSIO2_SOURCE_DIR}/scripts/perl/lib/Tools/Tools.pm DESTINATION "${PREFIX_SCR}/perl/lib/Tools")
INSTALL(FILES ${UNSIO2_SOURCE_DIR}/scripts/perl/lib/Tools/Sqlite3.pm DESTINATION "${PREFIX_SCR}/perl/lib/Tools")
INSTALL(FILES ${UNSIO2_SOURCE_DIR}/scripts/sql/create_unsio_db.sql DESTINATION "${PREFIX_SCR}/sql")
INSTALL(FILES ${UNSIO2_SOURCE_DIR}/scripts/sql/README DESTINATION "${PREFIX_SCR}/sql")
# some binaries
INSTALL(PROGRAMS ${UNSIO2_BINARY_DIR}/../scripts/perl/mains/unsio_sql3_get_info.pl DESTINATION bin)
INSTALL(PROGRAMS ${UNSIO2_BINARY_DIR}/../scripts/perl/mains/unsio_sql3_update_info.pl DESTINATION bin)
INSTALL(PROGRAMS ${UNSIO2_BINARY_DIR}/../scripts/perl/mains/unsio_sql3_update_nemorange.pl DESTINATION bin)
INSTALL(PROGRAMS ${UNSIO2_BINARY_DIR}/../scripts/perl/mains/unsio_sql3_create_db.pl DESTINATION bin)
INSTALL(PROGRAMS ${UNSIO2_SOURCE_DIR}/scripts/perl/mains/unsio_sql3_get_info.pl DESTINATION bin)
INSTALL(PROGRAMS ${UNSIO2_SOURCE_DIR}/scripts/perl/mains/unsio_sql3_update_info.pl DESTINATION bin)
INSTALL(PROGRAMS ${UNSIO2_SOURCE_DIR}/scripts/perl/mains/unsio_sql3_update_nemorange.pl DESTINATION bin)
INSTALL(PROGRAMS ${UNSIO2_SOURCE_DIR}/scripts/perl/mains/unsio_sql3_create_db.pl DESTINATION bin)
endif()
# ----------
......
include py/swig/numpy.i
include src/uns.h src/snapshotinterface.h src/componentrange.h src/userselection.h src/snapshotinterface.h src/ctools.h src/version.h
exclude py/swig/py_unsio.py
#!/usr/bin/env python
"""
UNSIO : Universal Nbody Snapshot Input Output
>> PACKAGING
......@@ -43,18 +44,55 @@ try:
except AttributeError:
numpy_include = numpy.get_numpy_include()
if sys.version_info[:2] < (2, 7) or (3, 0) <= sys.version_info[:2] < (3, 4):
raise RuntimeError("Python version 2.7 or >= 3.4 required.")
# detect python version (2 or 3)
pyversion="3"
if sys.version_info[0]<3 :
pyversion=""
long_description="""\
**UNSIO** (**U**niversal **N**body **S**napshot **I**nput **O**utput) is an API which perform input/output operations
in a generic way, and on different kind of nbody files format (nemo, Gadget binaries 1 and 2, Gadget hdf5, Ramses).
By using this API, a user could write only one analysis program which will work on all known files format supported by UNSIO.
It's not necessary anymore to know how is implemented a file format, UNSIO will do transparently and automatically
all the hard work for you ! With UNSIO, you will spend less time to develop your analysis program.
UNSIO comes with an integrated sqlite3 database which can be used to retrieve automatically all your data
among terabytes of hard disks.
"""
setup(
name='python'+pyversion+'-unsio',
#name='python'+pyversion+'-unsio',
name='python-unsio',
version='1.0',
description='Python wrapper to unsio',
long_description=long_description,
author='Jean-Charles LAMBERT',
author_email='jean-charles.lambert@lam.fr',
url='https://projets.lam.fr/projects/unsio',
license='CeCILL2.1 (https://opensource.org/licenses/CECILL-2.1)',
classifiers = ["Development Status :: 1 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: CeCILL2.1",
"Classifier: Programming Language :: C",
"Classifier: Programming Language :: C++",
"Classifier: Programming Language :: Python",
"Classifier: Programming Language :: Python :: 2",
"Classifier: Programming Language :: Python :: 2.7",
"Classifier: Programming Language :: Python :: 3",
"Classifier: Programming Language :: Python :: 3.4",
"Classifier: Programming Language :: Python :: 3.5",
"Classifier: Programming Language :: Python :: 3.6",
"Classifier: Programming Language :: Python :: 3.7",
"Classifier: Programming Language :: Python :: Implementation :: SWIG",
"Topic :: Scientific/Engineering :: nbody simulation",
"Topic :: Scientific/Engineering :: analysis pipeline"],
platforms = ["Linux", "Mac OS-X", "Unix"],
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
# 'unsio' -> installation directory
# 'swig' -> about all the py source in 'src'
package_dir={'unsio':'py/swig'},
......@@ -71,11 +109,9 @@ setup(
#runtime_library_dirs=[os.environ['NEMOLIB']]
)
],
install_requires=['numpy'],
#install_requires=['numpy'],
setup_requires=['numpy']
#
#py_modules = ["py_baryc"]
#data_files=[('',['src/numpy.i'])]
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment