Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,33 @@
# setup.py for pytorch module
################################################################################
import os
import pathlib
import shutil

from sys import platform as _platform
from setuptools import setup, find_packages
from setuptools.command.install import install

from sys import platform as _platform

retVal = -1
if _platform == "linux" or _platform == "linux2":
lib_fname = 'build/lib/libleapct.so'
retVal = os.system(r'sh ./etc/build.sh')
if retVal != 0:
print('Failed to compile!')
quit()


elif _platform == "win32":
lib_fname = r'win_build\bin\Release\libleapct.dll'
retVal = os.system(r'.\etc\win_build_agn.bat')
if retVal != 0:
print('Failed to compile!')
quit()

import site
copy_text = 'copy ' + str(lib_fname) + ' ' + str(os.path.join(site.getsitepackages()[1], 'libleapct.dll'))
os.system(copy_text)

elif _platform == "darwin":
lib_fname = 'build/lib/libleapct.dylib'
retVal = os.system(r'sh ./etc/build.sh')
if retVal != 0:
print('Failed to compile!')
quit()

if retVal != 0:
print('Failed to compile!')
quit()

shutil.copy(
lib_fname,
os.path.join('src', 'leapct', os.path.basename(lib_fname)),
)

setup(
name='leapct',
Expand All @@ -49,6 +46,6 @@
packages=find_packages("src"),
package_dir={'': 'src'},
install_requires=['numpy', 'torch'],
py_modules=['leaptorch', 'leapctype', 'leap_filter_sequence', 'leap_preprocessing_algorithms'],
package_data={'': [lib_fname]},
package_data={'leapct': [os.path.basename(lib_fname)]},
include_package_data=True,
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.