[SciPy-User] -KPIC flag compilation error
Jim Parker
jimparker96313 at gmail.com
Tue Oct 14 22:15:01 EDT 2014
Evan,
It appears you are having a conflict between Solaris Sun C compiler and
gcc. I'm guessing python was built with the native OS compiler for which
-KPIC is a valid option. When building scipy, apparently the build is
bringing in the same options that were used to build python. For reference
see this
https://www.prelude-ids.org/issues/288
Not the best reference, but I'm not a Solaris expert. Someone could improve
on this by finding a better site. This was just a quick search result.
The solution:
a) rebuild python using gcc and link against that version
b) pass CFLAGS=-fPIC at the command line
> CFLAGS='-fPIC' python setup.py build
for reference:
http://stackoverflow.com/questions/6928110/how-may-i-override-the-compiler-gcc-flags-that-setup-py-uses-by-default
Cheers,
--Jim
On Tue, Oct 14, 2014 at 11:46 AM, Evan Brown <brown.evand at gmail.com> wrote:
> Hi there
>
> I am trying to compile SciPy from source on Solaris 11.
>
> I have downloaded the latest version of the SciPi source code -
> scipy-0.14.0.
>
> I am running gcc 4.8.2 and gfortran and Python 2.6.
>
> When I run:
>
> python setup.py build
>
> in the SciPy source directory, the process runs for a while before exiting
> with the following error:
> ---------------------
>
> building 'rootfind' library
>
> compiling C sources
>
> C compiler: /usr/lib/python2.6/pycc -DNDEBUG -KPIC
>
>
> creating build/temp.solaris-2.11-i86pc-2.6/scipy/optimize/Zeros
>
> compile options: '-I/usr/lib/python2.6/vendor-packages/numpy/core/include
> -c'
>
> pycc: scipy/optimize/Zeros/brenth.c
>
> gcc: error: unrecognized command line option ‘-KPIC’
>
> gcc: error: unrecognized command line option ‘-KPIC’
>
> error: Command "/usr/lib/python2.6/pycc -DNDEBUG -KPIC
> -I/usr/lib/python2.6/vendor-packages/numpy/core/include -c
> scipy/optimize/Zeros/brenth.c -o
> build/temp.solaris-2.11-i86pc-2.6/scipy/optimize/Zeros/brenth.o" failed
> with exit status 1
>
> ------------------------
>
> My question is: how do I remove the apparently illegal -KPIC flag which is
> being passed to gcc? I can't find the location in the source or setup.py
> file where this flag is passed to the compiler.
>
>
> Any help would be much appreciated.
>
>
> Best wishes
>
>
> Evan
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20141014/472a50c0/attachment.html>
More information about the SciPy-User
mailing list