jacobjma / PyQSTEM

A Python interface to the electron microscopy simulation program QSTEM
GNU General Public License v3.0
60 stars 30 forks source link

Updating setup.py to compile on recent macOS CLANG #5

Closed martiantenor closed 4 months ago

martiantenor commented 6 years ago

add compile flag "-stdlib=libc++" to allow the software to compile on Apple LLVM CLang 9.0.0, macOS 10.12.6

DS-Wen commented 6 years ago

I try to compile the software on my macOS 10.12.6 with clang 9.0.0 and I meet this problem: clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) in fact, as I said, my macOS is 10.12.6. I don't know where it gets the macOS version 10.6 from the installation information. -----------installation info----- running install running bdist_egg running egg_info creating qstem.egg-info writing qstem.egg-info/PKG-INFO writing dependency_links to qstem.egg-info/dependency_links.txt writing top-level names to qstem.egg-info/top_level.txt writing manifest file 'qstem.egg-info/SOURCES.txt' reading manifest file 'qstem.egg-info/SOURCES.txt' writing manifest file 'qstem.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.6-intel/egg running install_lib running build_py creating build creating build/lib.macosx-10.6-intel-3.6 creating build/lib.macosx-10.6-intel-3.6/pyqstem copying pyqstem/init.py -> build/lib.macosx-10.6-intel-3.6/pyqstem copying pyqstem/detection.py -> build/lib.macosx-10.6-intel-3.6/pyqstem copying pyqstem/imaging.py -> build/lib.macosx-10.6-intel-3.6/pyqstem copying pyqstem/potentials.py -> build/lib.macosx-10.6-intel-3.6/pyqstem copying pyqstem/thermal.py -> build/lib.macosx-10.6-intel-3.6/pyqstem copying pyqstem/util.py -> build/lib.macosx-10.6-intel-3.6/pyqstem copying pyqstem/wave.py -> build/lib.macosx-10.6-intel-3.6/pyqstem running build_ext building 'pyqstem.qstem_interface' extension creating build/temp.macosx-10.6-intel-3.6 creating build/temp.macosx-10.6-intel-3.6/pyqstem creating build/temp.macosx-10.6-intel-3.6/source /Library/Developer/CommandLineTools/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Ipyqstem -I/Users/Wendongsheng/Library/Python/3.6/lib/python/site-packages/numpy/core/include -I/Users/Wendongsheng/bin/PyQSTEM/fftw -I/Users/Wendongsheng/bin/PyQSTEM/source/ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pyqstem/qstem_interface.cpp -o build/temp.macosx-10.6-intel-3.6/pyqstem/qstem_interface.o -std=c++11 -stdlib=libc++ -D MS_WIN64 clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) error: command '/Library/Developer/CommandLineTools/usr/bin/clang' failed with exit status 1

DS-Wen commented 6 years ago

Add "-mmacosx-version-min=10.7" flag to the 'extra_compile_args' in setup.py seemed to solve the problem.