So, I've found some other clang error's on here that appear to be somewhat similar, however, the fixes aren't applicable to my situation.
I'm using OSX Mavericks and we're trying to get Ansible installed.
I got pip to install correctly, but when I try to install Ansible, I get this clang error.
We thought, at first, that it might be a version issue, so I re-installed gcc46 after having this same error with gcc49, but I'm still getting the error.
Does anyone know how to fix this?
My complete error report from the pip.log log file is as follows:
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -Wall -Wstrict-prototypes -Wshorten-64-to-32 -fwrapv -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.9-intel-2.7/src/MD2.o
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Removing temporary dir /private/tmp/pip_build_root...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_7evji-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/pycrypto
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_7evji-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/pycrypto
Thanks to anyone who can help me with this. We've spent the past several hours trying to get this to install, and it's starting to get fairly frustrating.
I ran into the same problem recently while trying to install a different package.
Setting the following environment variables prior to installing with pip resolved the issue for me:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
If you're installing via sudo, don't forget to use "sudo -E" so that your environment variables propagate through sudo.
If that doesn't work for you, try the following command instead:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install ansible
Alternatively, as yet another potential solution, you can attempt to recompile a fresh version of python using Homebrew.
See this question for more information.
Hope this helps!
For the beginners, who read and tried the answer above but still failed (me):
sudo su -
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
pip install ansible
exit
You need to run those export commands as the root user. The previous answer clearly states this, but what it actually meant didn't translate to me as a terminal novice. What sudo su - does is basically switch to the root user. Then any commands you type are executed as root, and this thing works.
This finally let me get Ansible running on OSX 10.9.2 after a lot of head-banging.
Solution reference: https://github.com/ansible/ansible/issues/7146#issuecomment-41239561
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future cc .....
or
export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
Related
I was trying to install a splicing program "MAJIQ". I was able to run it on Centos but unable to install on MAC OS.
Description of the MAJIQ program.
Before installation
MAJIQ installation requires the following lib/software to be installed in your system.
C++11 compiler with openMP. GCC includes that by default, but clang can be updated to include those (Clang/OMP). MAJIQ/VOILA has been tested to work with GNU GCC>=7.2, RedHat GCC>=4.7.2.
HTSlib library. This is a C library for reading/writing high-throughput sequencing data developed by Samtools organisation. MAJIQ installation assumes the library and its header files are present in the Unix default locations (/usr/local/lib, /usr/local/include). If that is not the case the appropiate locations can be specified setting the following environment variables.
$ export HTSLIB_LIBRARY_DIR=/path/to/htslib/lib
$ export HTSLIB_INCLUDE_DIR=/path/to/htslib/include
Installation
To download and install MAJIQ/Voila run the following commands:
$ python3 -m venv env
$ source env/bin/activate
$ pip install pip -U
$ pip install wheel setuptools -U
$ pip install cython numpy GitPython -U
$ pip install git+https://bitbucket.org/biociphers/majiq_stable.git#egg=majiq
If there is an error during install please verify that you're installing these packages with python 3 and the installed version of pip is current. Also, check if you have git, a c compiler (gcc, clang, etc.), and zlib installed.
Troubleshooting
1) I have tried conda install llvm, conda install gcc or conda install libgcc from https://github.com/velocyto-team/velocyto.py/issues/53
2) Also, tried in given way.
brew install llvm
LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
Error in output
In file included from /private/var/root/env/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:
/private/var/root/env/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with " \
^
1 warning generated.
g++ -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.7/majiq/src/polyfitnb.o -o build/lib/majiq/src/polyfitnb.cpython-37m-darwin.so
building 'majiq.src.build' extension
creating build/temp.macosx-10.9-x86_64-3.7/majiq/src/internals
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I./majiq/src/internals -I./voila/c -Imajiq/src/internals -Ivoila/c -I/private/var/root/env/lib/python3.7/site-packages/numpy/core/include -I/usr/local/include -I/private/var/root/env/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c majiq/src/build.cpp -o build/temp.macosx-10.9-x86_64-3.7/majiq/src/build.o -fopenmp -DSCYTHE_COMPILE_DIRECT -DSCYTHE_PTHREAD
clang: error: unsupported option '-fopenmp'
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/private/var/root/env/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/tmp/pip-install-8vjv35m9/majiq/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-sfcn1usm/install-record.txt --single-version-externally-managed --compile --install-headers /private/var/root/env/include/site/python3.7/majiq" failed with error code 1 in /private/tmp/pip-install-8vjv35m9/majiq/
I had the same issue, and setting CC and CXX as follows solved it:
CC=/usr/local/bin/gcc-9 CXX=/usr/local/bin/g++-9 python3 -m pip install git+https://bitbucket.org/biociphers/majiq_stable.git#egg=majiq
g++-9
This is based on
https://groups.google.com/forum/#!topic/majiq_voila/exTAxHb_HNY
I ran pip install annoy and got the following error:
Collecting annoy
Using cached https://files.pythonhosted.org/packages/b5/28/f8ce7400344090bb5cfa1c9fae3fdb03b9438db082d458686442633d82a3/annoy-1.15.0.tar.gz
Building wheels for collected packages: annoy
Running setup.py bdist_wheel for annoy ... error
Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/yp/4w8nvxls4y99r68kpxzzwdl00000gn/T/pip-build-h3hirwtn/annoy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/yp/4w8nvxls4y99r68kpxzzwdl00000gn/T/tmpdqliidvopip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.6-x86_64-3.6
creating build/lib.macosx-10.6-x86_64-3.6/annoy
copying annoy/__init__.py -> build/lib.macosx-10.6-x86_64-3.6/annoy
running build_ext
building 'annoy.annoylib' extension
creating build/temp.macosx-10.6-x86_64-3.6
creating build/temp.macosx-10.6-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/anaconda3/include/python3.6m -c src/annoymodule.cc -o build/temp.macosx-10.6-x86_64-3.6/src/annoymodule.o -O3 -ffast-math -fno-associative-math -march=native
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from src/annoymodule.cc:15:
src/annoylib.h:49:10: fatal error: 'vector' file not found
#include <vector>
^~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
From reading other stackoverflow answers, I should compile with g++ rather than gcc? How do I do that?
I should compile with g++ rather than gcc : visibly yes, #include <vector> is typically C++, not C
The way to install g++ depend on the platform/OS you use
I've run into an error while installing Kivy, which told me to install Cython, so I did.
Except I run into an error, I've tried installing with pip,easy_install, manually but it results in the same. I also tried installing a older version of Cython but no luck.
Error message:
Command /usr/bin/python -c "import setuptools, tokenize;file='/private/tmp/pip_build_root/Cython/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-nXMqSR-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/Cython
Storing debug log for failure in /Users/jorn/Library/Logs/pip.log
When I install manually I get this error:
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c Cython/Plex/Scanners.c -o build/temp.macosx-10.8-intel-2.7/Cython/Plex/Scanners.o
unable to execute clang: No such file or directory
error: command 'clang' failed with exit status 1
I have read and tried all solutions I could find but none work..
I'm running on Mac osx 10.8.5
Ok, thanks to what #RaynP just said about it being a osx/clang issue I found the solution:
credits to this blog: http://kaspermunck.github.io/2014/03/fixing-clang-error/
The error is related to Xcode 5.1.
You will have to download the cython-master from GitHub. Installing with pip will not work and results in another error.
in terminal go to the cython-master file and enter: sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future python setup.py install
This is a workaround the error.
Now I have installed Cython and can finally compile my app with Kivy/Buildozer:D
I am trying to install PIL inside virtual as below
pip intall PIL
And i got the below error
Downloading/unpacking PIL
Running setup.py egg_info for package PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
Installing collected packages: PIL
Running setup.py install for PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
--- using frameworks at /System/Library/Frameworks
building '_imagingft' extension
cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -pipe -Wno-error=unused-command-line-argument-hard-error-in-future -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/opt/local/include -I/Users/user/.virtualenvs/proj/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imagingft.c -o build/temp.macosx-10.9-intel-2.7/_imagingft.o
_imagingft.c:73:10: fatal error: 'freetype/fterrors.h' file not found
#include <freetype/fterrors.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
Complete output from command /Users/user/.virtualenvs/proj/bin/python -c "import setuptools;__file__='/Users/user/.virtualenvs/proj/build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/x1/1bwt313j0qvgdh5pfzpbpvcw0000gn/T/pip-R5JSVs-record/install-record.txt --single-version-externally-managed --install-headers /Users/user/.virtualenvs/proj/include/site/python2.7:
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
running install
running build
running build_py
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imagingft' extension
cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -pipe -Wno-error=unused-command-line-argument-hard-error-in-future -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/opt/local/include -I/Users/user/.virtualenvs/proj/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imagingft.c -o build/temp.macosx-10.9-intel-2.7/_imagingft.o
_imagingft.c:73:10: fatal error: 'freetype/fterrors.h' file not found
#include <freetype/fterrors.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Command /Users/user/.virtualenvs/proj/bin/python -c "import setuptools;__file__='/Users/user/.virtualenvs/proj/build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/x1/1bwt313j0qvgdh5pfzpbpvcw0000gn/T/pip-R5JSVs-record/install-record.txt --single-version-externally-managed --install-headers /Users/user/.virtualenvs/proj/include/site/python2.7 failed with error code 1 in /Users/user/.virtualenvs/proj/build/PIL
So how to fix it and can some one let me know why it is throwing me an error on my new macbook air ?
I suggest you try Pillow, the fork of PIL. I've not tried in a virtual machine but on Mac OS X you can do this:
brew install libtiff libjpeg webp little-cms2
pip install Pillow
Full details here: http://pillow.readthedocs.org/en/latest/installation.html#mac-os-x-installation
I'm trying to install saltstack on OS X 10.8 using Xcode v 5.0 with installed dev. tools, following this tutorial.
The installation with pip install salt gives me the following error:
clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/include -I/Users/TK/.virtualenvs/cattapp/build/M2Crypto/SWIG -c SWIG/_m2crypto_wrap.c -o build/temp.macosx-10.6-intel-2.7/SWIG/_m2crypto_wrap.o -DTHREADING
clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g build/temp.macosx-10.6-intel-2.7/SWIG/_m2crypto_wrap.o -L/usr/lib -lssl -lcrypto -o build/lib.macosx-10.6-intel-2.7/M2Crypto/__m2crypto.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
----------------------------------------
Command /Users/TK/.virtualenvs/cattapp/bin/python -c "import setuptools;__file__='/Users/TK/.virtualenvs/venv/build/M2Crypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-kUuPr8-record/install-record.txt --install-headers /Users/TK/.virtualenvs/venv/bin/../include/site/python2.7 failed with error code 1 in /Users/TK/.virtualenvs/venv/build/M2Crypto
Exception information:
Traceback (most recent call last):
File "/Users/TK/.virtualenvs/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py", line 104, in main
status = self.run(options, args)
File "/Users/TK/.virtualenvs/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.py", line 250, in run
requirement_set.install(install_options, global_options)
File "/Users/TK/.virtualenvs/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 1133, in install
requirement.install(install_options, global_options)
File "/Users/TK/.virtualenvs/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 577, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Users/TK/.virtualenvs/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/__init__.py", line 256, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /Users/TK/.virtualenvs/cattapp/bin/python -c "import setuptools;__file__='/Users/TK/.virtualenvs/venv/build/M2Crypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-kUuPr8-record/install-record.txt --install-headers /Users/TK/.virtualenvs/venv/bin/../include/site/python2.7 failed with error code 1 in /Users/TK/.virtualenvs/venv/build/M2Crypto
Obivously the lssl library could not be found. Any idea how to install it or what went wrong?
It's the ssl library that cannot be found.
Install libssl then try again.