Good day to everyone,
I've an error trying to compile and install Pygraphviz 1.2 in OS X 10.9
I've downloaded the pygraphviz archive from https://pypi.python.org/packages/source/p/pygraphviz/pygraphviz-1.2.zip#md5=90c728a8db276eede4e3af2f990a8985
From Terminal I've typed
sudo ./setup.py install
the output was:
Trying pkg-config
library_path=/usr/local/Cellar/graphviz/2.38.0/lib
include_path=/usr/local/Cellar/graphviz/2.38.0/include/graphviz
running install
running build
running build_py
running build_ext
building 'pygraphviz._graphviz' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/local/Cellar/graphviz/2.38.0/include/graphviz -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pygraphviz/graphviz_wrap.c -o build/temp.macosx-10.9-intel-2.7/pygraphviz/graphviz_wrap.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
As you can see I've already installed graphviz with Homebrew.
The error is in clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
Solution from clang error: unknown argument: '-mno-fused-madd' (python package installation failure) is:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
Related
I am having trouble installing PyLucene JCC on Mac OSX.
I dowloaded the latest version of JCC from apache lucene site and fallowed the instruction to install it using the command
python setup.py build
But I am getting the following error while installing
ld: internal error: atom not found in symbolIndex(__ZN7JNIEnv_13CallIntMethodEP8_jobjectP10_jmethodIDz) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'c++' failed with exit status 1
I have tried following the instruction given on the official site of adding the flag "-framework", "Python" to the LFLAGS value when installing on mac OSX or using the export CFLAGS=-Qunused-arguments and export CPPFLAGS=-Qunused-arguments before runnig the install command to ignore the warnings while build. But none of them are working.
The full trace of error is
found JAVAHOME = /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home
found JAVAFRAMEWORKS = /System/Library/Frameworks/JavaVM.framework
Loading source files for package org.apache.jcc...
doc/serialized-form.html...
Building index for all the packages and classes...
Generating javadoc/overview-tree.html...
Generating javadoc/index-all.html...
Generating javadoc/deprecated-list.html...
Building index for all classes...
Generating javadoc/allclasses-frame.html...
Generating javadoc/allclasses-noframe.html...
Generating javadoc/index.html...
Generating javadoc/help-doc.html...
running build
running build_py
writing /Users/harshsingh/Documents/Codes/IR/jcc/jcc/config.py
copying jcc/config.py -> build/lib.macosx-10.10-intel-2.7/jcc
copying jcc/classes/org/apache/jcc/PythonVM.class -> build/lib.macosx-10.10-intel-2.7/jcc/classes/org/apache/jcc
copying jcc/classes/org/apache/jcc/PythonException.class -> build/lib.macosx-10.10-intel-2.7/jcc/classes/org/apache/jcc
running build_ext
building 'jcc' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX - DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -dynamiclib -D_jcc_lib -DJCC_VER="2. 21" -I/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.7.0_45. jdk/Contents/Home/include/darwin -I_jcc -Ijcc/sources -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c jcc/sources/jcc.cpp - o build/temp.macosx-10.10-intel-2.7/jcc/sources/jcc.o -DPYTHON -fno-strict-aliasing -Wno-write-strings
clang: warning: argument unused during compilation: '-dynamiclib'
jcc/sources/jcc.cpp:197:16: warning: implicit conversion loses integer precision: 'long' to 'int'
[-Wshorten-64-to-32]
int hash = PyObject_Hash(arg);
~~~~ ^~~~~~~~~~~~~~~~~~
1 warning generated.
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX - DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -dynamiclib -D_jcc_lib -DJCC_VER="2. 21" -I/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.7.0_45. jdk/Contents/Home/include/darwin -I_jcc -Ijcc/sources -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c jcc/sources/JCCEnv. cpp -o build/temp.macosx-10.10-intel-2.7/jcc/sources/JCCEnv.o -DPYTHON -fno-strict-aliasing -Wno-write-strings
clang: warning: argument unused during compilation: '-dynamiclib'
c++ -Wl,-x -dynamiclib -undefined dynamic_lookup build/temp.macosx-10.10-intel-2.7/jcc/sources/jcc.o build/temp.macosx-10.10-intel-2.7/jcc/sources/JCCEnv. o -o build/lib.macosx-10.10-intel-2.7/libjcc.dylib -L/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib -ljava - L/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/server -ljvm -Wl,-rpath -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_45. jdk/Contents/Home/jre/lib -Wl,-rpath -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/server -Wl,-S -install_name #rpath/libjcc. dylib -current_version 2.21 -compatibility_version 2.21
ld: internal error: atom not found in symbolIndex(__ZN7JNIEnv_13CallIntMethodEP8_jobjectP10_jmethodIDz) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'c++' failed with exit status 1
I am really lost now and any help will be really great.
If rebuilding from source still ends up giving the same errors, you could probably try the following approach.
Seems like there is a bug with running the clang++ command (below) with the -x flag, on OSX 10.9+ (referenced here)
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX - DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -dynamiclib -D_jcc_lib -DJCC_VER="2. 21" -I/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.7.0_45. jdk/Contents/Home/include/darwin -I_jcc -Ijcc/sources -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c jcc/sources/JCCEnv. cpp -o build/temp.macosx-10.10-intel-2.7/jcc/sources/JCCEnv.o -DPYTHON -fno-strict-aliasing -Wno-write-strings
clang: warning: argument unused during compilation: '-dynamiclib'
c++ -Wl,-x -dynamiclib -undefined dynamic_lookup build/temp.macosx-10.10-intel-2.7/jcc/sources/jcc.o build/temp.macosx-10.10-intel-2.7/jcc/sources/JCCEnv. o -o build/lib.macosx-10.10-intel-2.7/libjcc.dylib -L/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib -ljava - L/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/server -ljvm -Wl,-rpath -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_45. jdk/Contents/Home/jre/lib -Wl,-rpath -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/server -Wl,-S -install_name #rpath/libjcc. dylib -current_version 2.21 -compatibility_version 2.21
Run the clang++ command again without the -x flag and then run:
python setup.py build
Same problem here - from pyLucene-dev:
You must ensure that the compiler used to build Python is the same as the compiler you're using. If you did not build Python then it's likely you're htting a clang/gcc mismatch and you need to rebuild Python from sources, using the same compiler as you're using to build JCC.
The clang problem is fixed as given here. However, its not pushed in the PyLucene latest(as of May 2018) version(v6.5). However, you can still get the next build(v7.2) of Pylucene from this link. Using Pylucene 7.2.0 fixed the issue for me.
I'm trying to upgrade the scipy (currently I have version '0.11.0') on my machine, but I'm getting some compiler error that I can not work around:
When I invoke:
sudo pip install --upgrade scipy
I get:
cc: scipy/optimize/Zeros/bisect.c
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
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 -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -c scipy/optimize/Zeros/bisect.c -o build/temp.macosx-10.9-intel-2.7/scipy/optimize/Zeros/bisect.o" failed with exit status 1
Any help is very welcomed!!!
Try:
sudo $ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install --upgrade scipy
reating build/temp.macosx-10.9-intel-2.7
creating build/temp.macosx-10.9-intel-2.7/Cython
creating build/temp.macosx-10.9-intel-2.7/Cython/Plex
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c Cython/Plex/Scanners.c -o build/temp.macosx-10.9-intel-2.7/Cython/Plex/Scanners.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
I got this error while installing Cython from setup.py.
I was installing the scikit-learn package while get the same error. (-mno-fused-madd unknown argument)
Is there anything, any package needed before I install cython?
Many thanks
You need probably need to install another C compiler. Try compiling it with GCC.
clang: error: unknown argument: '-mno-fused-madd'
Alternatively, you can edit the configure script and change the compiler flags.
On a side note, this seems like it is a bug you should report.
I was trying to install python package scikit-learn. I keep get an error.
I tried
pip install scikit-learn
The error looks like following. What is the problem of my installation?
compile options: '-I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -c'
c++: sklearn/svm/src/libsvm/libsvm_template.cpp
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
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 "c++ -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -c sklearn/svm/src/libsvm/libsvm_template.cpp -o build/temp.macosx-10.9-intel-2.7/sklearn/svm/src/libsvm/libsvm_template.o" failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/scikit-learn/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-GYuqQN-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/scikit-learn
Storing debug log for failure in /Users/johnkuk/Library/Logs/pip.log
I also tried several different ways to install the package. From easy_install, I also got following error message.
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
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: Setup script exited with error: Command "c++ -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -c /private/tmp/easy_install-oD3dwa/scikit-learn-0.14.1/sklearn/svm/src/libsvm/libsvm_template.cpp -o build/temp.macosx-10.9-intel-2.7/private/tmp/easy_install-oD3dwa/scikit-learn-0.14.1/sklearn/svm/src/libsvm/libsvm_template.o" failed with exit status 1
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/distutils/misc_util.py:252: RuntimeWarning: Parent module 'numpy.distutils' not found while handling absolute import
from numpy.distutils import log
I had the same trouble today, after trying many things the one that worked me was setting some environment variables before installing with pip resolved the issue for me:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
And then install with sudo:
sudo -E pip install -U scikit-learn
it's seems to be a problem with xcode update (5.1.1 for me), it does not accept '-mno-fused-madd' as an argument, before it threw it a warning, know is an error, the first two commands ignore the unused arguments witch are the same that throw the error.
Hope it helps, any comments/corrections are welcome.
When I try to build PIL on Mac OS X 10.8.1 Mountain Lion, I get the following result:
$ sudo python setup.py install
Password:
running install
running build
running build_py
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
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 -DHAVE_LIBJPEG -DHAVE_LIBZ -IlibImaging -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.8-intel-2.7/_imaging.o
clang: warning: argument unused during compilation: '-mno-fused-madd'
_imaging.c:75:10: fatal error: 'Python.h' file not found
#include "Python.h"
^
1 error generated.
error: command 'clang' failed with exit status 1
PIL does not keep up with support for new operating systems (by making changes to setup.py for new lib dirs, etc). But intstead of PIL, you can use the "friendly PIL fork" Pillow:
http://pypi.python.org/pypi/Pillow
And if you get the same error, please report the issue:
https://github.com/python-imaging/Pillow/issues/new
From this SO question, I was able to find Python.h in /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7. (note that i have Xcode installed)
I then ran sudo python setup.py build_ext --include-dirs /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7:/Developer/SDKs/MacOSX10.7.sdk/usr/include
(note: /Developer/SDKs/MacOSX10.7.sdk/usr/include added because stdio.h was missing once the Python.h was resolved)
Finally, I ran sudo python setup.py install