diff --git a/setup.py b/setup.py index 5a2bd511..9f2c4e66 100644 --- a/setup.py +++ b/setup.py @@ -15,20 +15,13 @@ # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see . -import distutils +from setuptools import setup import os import shutil import numpy as np import ctypes.util import sys -#If prefix is set, we want to allow installation in a directory that is not on PYTHONPATH -#and this is only possible with distutils, not setuptools -if str(sys.argv[1:]).find("--prefix") == -1: - from setuptools import setup -else: - from distutils.core import setup - try: from Cython.Distutils import build_ext from Cython.Build import cythonize @@ -104,7 +97,6 @@ copy_gcc_lib = False gcc_lib = None force_32bit = False -no_msvcr = False with_openmp = False static_link_gcc = "-static-libgcc" @@ -113,8 +105,6 @@ # Fix path sep for x in sys.argv[1:]: - if not x.find('--prefix'): - copy_args[copy_args.index(x)] = x.replace('/',os.sep) if not x.find('--fmil-home'): incdirs = os.path.join(x[12:],'include') libdirs = os.path.join(x[12:],'lib') @@ -134,10 +124,6 @@ if x[14:].upper() == "TRUE": force_32bit = True copy_args.remove(x) - if not x.find('--no-msvcr'): - if x[11:].upper() == "TRUE": - no_msvcr = True - copy_args.remove(x) if not x.find('--extra-c-flags'): extra_c_flags = x[16:] copy_args.remove(x) @@ -178,14 +164,6 @@ shutil.copy2(path_gcc_lib,os.path.join(".","src","pyfmi")) gcc_lib = os.path.join(".","src","pyfmi","libgcc_s_dw2-1.dll") -if no_msvcr: - # prevent the MSVCR* being added to the DLLs passed to the linker - def msvc_runtime_library_mod(): - return None - - import numpy.distutils - numpy.distutils.misc_util.msvc_runtime_library = msvc_runtime_library_mod - def check_extensions(): ext_list = [] extra_link_flags = [] @@ -308,7 +286,6 @@ def check_extensions(): extra_package_data = ['*fmilib_shared*'] if sys.platform.startswith("win") else [] extra_package_data += ['libgcc_s_dw2-1.dll'] if copy_gcc_lib else [] -from numpy.distutils.core import setup setup(name=NAME, version=VERSION, license=LICENSE,