Issue with Clang Compiler and gcc for MAJIQ pipeline installation - gcc

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

Related

rJava on MacOS Sierra 10.12.15: unsupported option fopenmp

I'm trying to install rJava on MacOS Sierra. Have to tried the tips and guides elsewhere for other other version MacOS such as https://github.com/snowflakedb/dplyr-snowflakedb/wiki/Configuring-R-rJava-RJDBC-on-Mac-OS-X
and Install xlsx and rJava on Mac
but it does not work out. Much appreciate any help. Thanks.
My Mac version: macOS Sierra, version 10.12.15
My R version: 3.4.0 (2017-04-21)
My Rstudio version: Version 0.99.903
Java version:
bash-3.2$ /usr/libexec/java_home -V
bash-3.2$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
bash-3.2$ R CMD javareconf
Java interpreter : /usr/bin/java
Java version : 1.8.0_131
Java home path : /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
Non-system Java on macOS
trying to compile and link a JNI program
detected JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/darwin
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/../include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/../include/darwin -I/usr/local/include -fPIC -Wall -g -O2 -c conftest.c -o conftest.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o conftest.so conftest.o -L/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/server -ljvm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
JAVA_HOME : /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre
Java library path: $(JAVA_HOME)/lib/server
JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/darwin
JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
Updating Java configuration in /Library/Frameworks/R.framework/Resources
override rw-r--r-- root/admin for /Library/Frameworks/R.framework/Resources/etc/Makeconf? (y/n [n]) n
not overwritten
override rw-r--r-- root/admin for /Library/Frameworks/R.framework/Resources/etc/ldpaths? (y/n [n]) n
not overwritten
Done.
When I tried to install rJava, I ran
`R --quiet -e 'install.packages("rJava", type="source", repos="http://cran.us.r-project.org")`
I got the errors:
clang: error: unsupported option '-fopenmp'
make[2]: *** [libjri.jnilib] Error 1
make[1]: *** [src/JRI.jar] Error 2
make: *** [jri] Error 2
ERROR: compilation failed for package ‘rJava’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava’
The downloaded source packages are in
‘/private/var/folders/w8/ksbj8dh15bz2lkss7h2tpzk80000gn/T/Rtmp6r9HI0/downloaded_packages’
Warning message:
In install.packages("rJava", type = "source", repos = "http://cran.us.r-project.org") :
installation of package ‘rJava’ had non-zero exit status
I ran:
"curl -#ROL https://www.rforge.net/rJava/snapshot/rJava_0.9-8.tar.gz
R CMD INSTALL rJava_0.9-8.tar.gz"
and got the following error messages:
clang: error: unsupported option '-fopenmp'
make[2]: *** [libjri.jnilib] Error 1
make[1]: *** [src/JRI.jar] Error 2
make: *** [jri] Error 2
ERROR: compilation failed for package ‘rJava’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava’
I dont know what to do. Thanks for your help.
This article here solved this fopenmp issue for me on macOS Sierra 10.12.4. I outlined the solution here but also below. The problem is that forenmp option is not supported in macOS gcc so we have to compile a new version of the gcc.
Solution to forenmp problem
I have tested this with Homerew's r-app brew cask install r-app and Oracle's JDK. Then I did the following
brew install homebrew/versions/gcc49 --without-multilib #Long ~70min compiling...
sudo chown -R $(whoami):admin /usr/local
brew link --overwrite --force gcc49
brew unlink gcc49 && brew link gcc49
brew install llvm
mkdir ~/.R; touch ~/.R/Makevars
echo "VER=-4.9
CC=gcc$(VER)
CXX=g++$(VER)
CXX1X=g++$(VER)
CFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
CXXFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
FLIBS=-L/usr/local/Cellar/gcc/4.9.3/lib/gcc/4.9" > ~/.R/Makevars
and now
sudo R CMD javareconf
Rscript -e 'install.packages("rJava", repos="http://rforge.net", type="source")'
and now rJava is working!
Comments using OSX 10.12.6 with Java 1.8.0_181 and dealing with the above issue and another issue related to compiling rJava.
First:
Install rJava with these commands:
wget https://cran.r-project.org/src/contrib/rJava_0.9-10.tar.gz
tar xvfz rJava_0.9-10.tar.gz
cd rJava
R CMD INSTALL rJava
Why use R CMD INSTALL? This will keep the config.log file that will allow you to debug things; install.packages() does not and help you get might not be very helpful in that case (e.g. https://github.com/s-u/rJava/issues/111).
Second:
Make sure you run the following, if you've updated Java (remember you need the JDK, not JRE).
sudo R CMD javareconf
Error (checking JNI data types):
To fix this error:
checking JNI data types... configure: error: One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this.
do this:
sudo ln -f -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
sudo ln -f -s /usr/local/lib/libjvm.dylib /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/
Error (unsupported option '-fopenmp):
To fix this error:
clang: error: unsupported option '-fopenmp
do the following:
Note: The instructions may need to be modified for newer versions of gcc, but make sure you get a version greater than 7 (see notes that follow); the following command can be used to find out the available versions:
brew search gcc
Then install gcc:
brew install gcc#7
sudo chown -R $(whoami):admin /usr/local
brew link --overwrite --force gcc#7
brew unlink gcc#7 && brew link gcc#7
brew install llvm
mkdir -p ~/.R
## Check the versions and folder in FLIBS match what you install
echo "CC=gcc-7
CXX=g++-7
CXX1X=g++-7
CFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
CXXFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
FLIBS=-L/usr/local/Cellar/gcc\#7/7.3.0/lib/gcc/7" > ~/.R/Makevars
Notes: You need any version of gcc greater than 7; the without-multilib flag mentioned in the earlier answer may not be available, but it is important. Why the without-multilib flag?: https://thecoatlessprofessor.com/programming/openmp-in-r-on-os-x/ and OpenMP/gcc on macOS : gcc --without-multilib not available
Then install rJava
R CMD INSTALL rJava
Finally, test library (you should see your Java version):
library(rJava)
.jinit()
.jcall("java/lang/System", "S", "getProperty", "java.runtime.version")
Take a look here:
http://www.owsiak.org/?p=3671
You can find quite detailed description of how to deal with rJava in macOS.
Make sure to install JDK that is provided by Oracle before you proceed.

Lektor installation fails on MacBookPro OS X 10.6.8

I am trying to install Lektor on a MacbookPro with OS X 10.6.8.
Imagemagick and Python2.7 are already installed.
When I run the installation command:
curl -sf https://www.getlektor.com/install.sh | sh
The build process runs until it gets an error when building '_watchdog_fsevents' extension. The error is:
cc1: error: -Werror=unused-command-line-argument-hard-error-in-future: No option -Wunused-command-line-argument-hard-error-in-future
I've cut and pasted the output just prior to the error into the following code section.
How should I overcome this?
running build_ext
building '_watchdog_fsevents' extension
creating build/temp.macosx-10.6-x86_64-2.7
creating build/temp.macosx-10.6-x86_64-2.7/src
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -Wno-error=unused-command-line-argument-hard-error-in-future -DWATCHDOG_VERSION_STRING="0.8.3" -DWATCHDOG_VERSION_MAJOR=0 -DWATCHDOG_VERSION_MINOR=8 -DWATCHDOG_VERSION_BUILD=3 -I/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/watchdog_fsevents.c -o build/temp.macosx-10.6-x86_64-2.7/src/watchdog_fsevents.o -std=c99 -pedantic -Wall -Wextra -fPIC -Wno-error=unused-command-line-argument-hard-error-in-future
cc1: error: -Werror=unused-command-line-argument-hard-error-in-future: No option -Wunused-command-line-argument-hard-error-in-future
cc1: error: -Werror=unused-command-line-argument-hard-error-in-future: No option -Wunused-command-line-argument-hard-error-in-future
error: command 'gcc-4.2' failed with exit status 1
----------------------------------------
Failed building wheel for watchdog
Failed to build watchdog
Most likely your version of OS X is too old to support the installation of watchdog with the version of gcc you have. If you cannot upgrade your OS X installation then I recommend installing a recent version of clang via brew and install lektor after exporting CC=clang.
Note though that Lektor is not tested for OS X < 10.9.
Your problem may be an updated version of Xcode in which you have not agreed to the license. Try running this first:
sudo xcodebuild -license
scroll to the very bottom and it will allow you to type "agree".
This resolved the issue for me.

PIL installation error on Mac OS Maverics inside virtual env

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

Ansible Installation -clang: error: unknown argument: '-mno-fused-madd'

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"

Building numpy/scipy for Python3 on Mac OS Lion

I can't get Numpy or Scipy to work with Python3 on MAC OSX Lion.
I have used pip successfully to install numpy, scipy and matplotlib, and they work well with Python2.7, but in Python3 typing import numpy brings up No module named numpy. I've tried downloading the source code directly and then running 'python3 setup.py build', but I get various error warnings, some in red that have to do with fortran (e.g. 'Could not locate executable f95'). The error message that appears to fail in the end is 'RuntimeError: Broken toolchain: cannot link a simple C program', and appears to be related to the previous line 'sh: gcc-4.2: command not found'.
The Scipy website suggests that there may be issues with the c compiler, but the same problems didn't arise using pip to install for python2.7. I have followed the instructions on the website regarding changing the compiler but this has not made any difference.
I have also tried installing from a virtual environment:
mkvirtualenv -p python3.2 test1
pip install numpy
But this fails with Command python setup.py egg_info failed with error code 1 in /Users/Eddy/.virtualenvs/test1/build/numpy
I've considered making python3 default, and then I thought a pip install might work, but I don't know how to do that. Does anyone have any suggestions for how I might proceed? Thanks.
I ran into the same issue of
scipy/sparse/linalg/dsolve/superlumodule.c:268:9: error: non-void function 'PyInit_superlu' should return a value [-Wreturn-type]
someone on the scipy mailing list suggested the following:
what happens if you change the line 268 ( in scipy/sparse/linalg/dsolve/_superlumodule.c)
from
return;
to
return NULL;
sure enough it worked
I've made some progress with this problem, with much assistance from Ned Deily on the pythonmac mailing list. I can now build numpy for python3, but scipy still won't build.
To install numpy:
The scipy website (http://www.scipy.org/Installing_SciPy/Mac_OS_X) suggests working around the C compiler problem with three typed commands, but these are insufficient, you need one more:
$ export CC=clang
$ export CXX=clang
$ export FFLAGS=-ff2c
$ export LDSHARED='clang -bundle -undefined dynamic_lookup \
-arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -g'
After this building from source should work. See here for details.
Problem building scipy:
I don't know what the issue here is, something with the C compiler again though I think. Here are the error messages. I'd greatly appreciate any thoughts on this matter.
Thanks, Eddy
error messages:
compiling C sources
C compiler: clang -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk
compile options: '-DNO_ATLAS_INFO=3 -DUSE_VENDOR_BLAS=1 -I/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m -c'
extra options: '-msse3'
clang: scipy/sparse/linalg/dsolve/_superlumodule.c
In file included from scipy/sparse/linalg/dsolve/_superlumodule.c:18:
In file included from /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/arrayobject.h:15:
In file included from /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/ndarraytypes.h:1972:
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API"
^
scipy/sparse/linalg/dsolve/_superlumodule.c:268:9: error: non-void function 'PyInit__superlu' should return a value [-Wreturn-type]
return;
^
1 warning and 1 error generated.
In file included from scipy/sparse/linalg/dsolve/_superlumodule.c:18:
In file included from /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/arrayobject.h:15:
In file included from /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/ndarraytypes.h:1972:
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API"
^
scipy/sparse/linalg/dsolve/_superlumodule.c:268:9: error: non-void function 'PyInit__superlu' should return a value [-Wreturn-type]
return;
^
1 warning and 1 error generated.
error: Command "clang -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -DNO_ATLAS_INFO=3 -DUSE_VENDOR_BLAS=1 -I/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m -c scipy/sparse/linalg/dsolve/_superlumodule.c -o build/temp.macosx-10.6-intel-3.2/scipy/sparse/linalg/dsolve/_superlumodule.o -msse3" failed with exit status 1
I had this problem and one of these sorted it - not sure which one but I include both for completeness:
I had this in my .bash_profile "export CC=gcc-4.2" which was probably some kind of hack from previous OS X compilation problems, I removed it.
Installed the standalone GCC from here https://github.com/kennethreitz/osx-gcc-installer/ over my XCode install
booted up a new terminal window and pip install numpy worked fine

Resources