diff --git a/readme.md b/readme.md index 66d6798..8fdf5fa 100644 --- a/readme.md +++ b/readme.md @@ -48,3 +48,13 @@ The output generated by the above example should look like the following: - Cython (only for building and installing, not for everyday use) - Pillow (friendly fork of PIL, used here for file I/O with the example and during unit tests) - CharLS (source included as subfolder) + +## Installing + +Under Linux, you need to set the environment variable `MSCV` to be able to install: + +``` +export MSCV=False +pip install . +``` + diff --git a/setup.py b/setup.py index 04c67a4..cae3562 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,9 @@ - - -import numpy as np +import os import setuptools - from setuptools import setup, find_packages from setuptools.extension import Extension +import numpy as np from Cython.Distutils import build_ext # Cython extension. @@ -20,8 +18,11 @@ extra_link_args = [] -flag_MSVC = True # Set this flag to True if using Visual Studio. -if flag_MSVC: +if 'MSCV' in os.environ and os.environ['MSCV'] == 'False': + flag_MSCV = False +else: + flag_MSCV = True +if flag_MSCV: extra_compile_args = ['/EHsc'] else: extra_compile_args = []