File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 88import numpy
99import re
1010import os
11+ import sys
12+ import subprocess
1113
1214here = path .abspath (path .dirname (__file__ ))
1315
16+
17+ os .environ ["CC" ] = "g++"
18+ os .environ ["CXX" ] = "g++"
19+
1420# dirty but working
1521__version__ = re .search (
1622 r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]' , # It excludes inline comment too
2430with open (os .path .join (ROOT , 'README.md' ), encoding = "utf-8" ) as f :
2531 README = f .read ()
2632
27- # add platform dependant optional compilation argument
2833opt_arg = ["-O3" ]
29- import platform
30- if platform .system ()== 'Darwin' :
31- if platform .release ()== '18.0.0' :
32- opt_arg .append ("-stdlib=libc++" ) # correspond to a compilation problem with Mojave and XCode 10
34+
35+ # add platform dependant optional compilation argument
36+ if sys .platform .startswith ('darwin' ):
37+ opt_arg .append ("-stdlib=libc++" )
38+ sdk_path = subprocess .check_output (['xcrun' , '--show-sdk-path' ])
39+ os .environ ['CFLAGS' ] = '-isysroot "{}"' .format (sdk_path .rstrip ().decode ("utf-8" ))
3340
3441setup (name = 'POT' ,
3542 version = __version__ ,
You can’t perform that action at this time.
0 commit comments