[SciPy-Dev] Building SciPy from source for development

Dr. Mark Alexander Mikofski PhD mikofski at berkeley.edu
Tue Sep 10 23:02:25 EDT 2019


Probably a more experienced contributor will also answer better, but what
worked for me was to use the runtest.py script in a virtualenv:
https://github.com/scipy/scipy/blob/master/runtests.py

there's good info here in the docs, look for "runtest" under "recommended
dev setup"
https://docs.scipy.org/doc/scipy/reference/hacking.html

there's some more info in the numpy docs on runtest.py and recommended dev
setup:
https://docs.scipy.org/doc/numpy/dev/development_environment.html

If you are trying to build scipy to install or package, then you may need
to change the settings in site.cfg (or setup.cfg), see the example
https://github.com/scipy/scipy/blob/master/site.cfg.example

I guess for Linux the INSTALL instructions are similar to the docs, but I
don't think they will work with Anaconda/miniconda
https://github.com/scipy/scipy/blob/master/INSTALL.rst.txt

Here's more info in the documentation:
* building from source:
https://docs.scipy.org/doc/scipy/reference/building/index.html
* dev guide: https://docs.scipy.org/doc/scipy/reference/dev/index.html
* hacking: https://docs.scipy.org/doc/scipy/reference/hacking.html

>From your diagnostic messages, SciPy seems to think you are on a Windows
machine instead of a Linux machine, not sure why:
>Warning: Can't read registry to find the necessary compiler setting
>Make sure that Python modules winreg, win32api or win32con are installed.

Linux doesn't have a "registry" does it? And winreg, win32api, and win32con
are python bindings for Windows machines right?

As I said, I first created a virtualenv, activated the venv, installed the
requirements (Numpy, pytest, cython, etc., see build docs), and then used
runtest.py - I did not use anaconda/miniconda

Are you on a mac, linux, or windows machine? On mac I used homebrew, and on
windows I used WSL.
https://brew.sh/
https://docs.microsoft.com/en-us/windows/wsl/install-win10

Good luck!

PS: If I have given any incorrect information, I do apologize.


On Tue, Sep 10, 2019 at 5:50 PM Isabel Kaspriskie <ikaspriskie at gmail.com>
wrote:

> Hello,
>
> I am setting up my development environment in order to start contributing
> to the scipy repo. I have run into an error that I have not been able to
> diagnose myself. When running `python setup.py install --user`, I find the
> following error. The output is large, so I have only copied the end of it,
> but please let me know if it is acceptable to attach a text file of the
> output if that helps.
>
> ...
> building 'rectangular_lsap' library
> compiling C++ sources
> C compiler: g++ -pthread -B
> /home/isabelgk/miniconda3/envs/scipy-dev/compiler_compat -Wl,--sysroot=/
> -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC
>
> creating build/temp.linux-x86_64-3.7/scipy/optimize/rectangular_lsap
> compile options:
> '-I/home/isabelgk/miniconda3/envs/scipy-dev/lib/python3.7/site-packages/numpy/core/include
> -I/home/isabelgk/miniconda3/envs/scipy-dev/include/python3.7m -c'
> g++: scipy/optimize/rectangular_lsap/rectangular_lsap.cpp
> error: Command "g++ -pthread -B
> /home/isabelgk/miniconda3/envs/scipy-dev/compiler_compat -Wl,--sysroot=/
> -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC
> -I/home/isabelgk/miniconda3/envs/scipy-dev/lib/python3.7/site-packages/numpy/core/include
> -I/home/isabelgk/miniconda3/envs/scipy-dev/include/python3.7m -c
> scipy/optimize/rectangular_lsap/rectangular_lsap.cpp -o
> build/temp.linux-x86_64-3.7/scipy/optimize/rectangular_lsap/rectangular_lsap.o
> -MMD -MF
> build/temp.linux-x86_64-3.7/scipy/optimize/rectangular_lsap/rectangular_lsap.o.d"
> failed with exit status 127
>
>
>
> I have run the numpy diagnose utility, and it seems that there is a
> warning about being unable to read the registry to find my Fortran compiler
> setting.
>
> >>> python -c 'from numpy.f2py.diagnose import run; run()'
>
> ------
> os.name='posix'
> ------
> sys.platform='linux'
> ------
> sys.version:
> 3.7.4 (default, Aug 13 2019, 20:35:49)
> [GCC 7.3.0]
> ------
> sys.prefix:
> /home/isabelgk/miniconda3/envs/scipy-dev
> ------
> sys.path=':/home/isabelgk/miniconda3/envs/scipy-dev/lib/python37.zip:/home/isabelgk/miniconda3/envs/scipy-dev/lib/python3.7:/home/isabelgk/miniconda3/envs/scipy-dev/lib/python3.7/lib-dynload:/home/isabelgk/.local/lib/python3.7/site-packages:/home/isabelgk/miniconda3/envs/scipy-dev/lib/python3.7/site-packages'
> ------
> Found new numpy version '1.16.4' in /home/isabelgk/miniconda3/envs/scipy-dev/lib/python3.7/site-packages/numpy/__init__.py
> Found f2py2e version '2' in /home/isabelgk/miniconda3/envs/scipy-dev/lib/python3.7/site-packages/numpy/f2py/f2py2e.py
> Found numpy.distutils version '0.4.0' in '/home/isabelgk/miniconda3/envs/scipy-dev/lib/python3.7/site-packages/numpy/distutils/__init__.py'
> ------
> Importing numpy.distutils.fcompiler ... ok
> ------
> Checking availability of supported Fortran compilers:
> Warning: Can't read registry to find the necessary compiler setting
> Make sure that Python modules winreg, win32api or win32con are installed.
> Gnu95FCompiler instance properties:
>   archiver        = ['/usr/bin/gfortran', '-cr']
>   compile_switch  = '-c'
>   compiler_f77    = ['/usr/bin/gfortran', '-Wall', '-g', '-ffixed-form', '-
>                     fno-second-underscore', '-fPIC', '-O3', '-funroll-loops']
>   compiler_f90    = ['/usr/bin/gfortran', '-Wall', '-g', '-fno-second-
>                     underscore', '-fPIC', '-O3', '-funroll-loops']
>   compiler_fix    = ['/usr/bin/gfortran', '-Wall', '-g', '-ffixed-form', '-
>                     fno-second-underscore', '-Wall', '-g', '-fno-second-
>                     underscore', '-fPIC', '-O3', '-funroll-loops']
>   libraries       = ['gfortran']
>   library_dirs    = ['/usr/lib/gcc/x86_64-linux-gnu/7', '/usr/lib/gcc/x86_64
>                     -linux-gnu/7']
>   linker_exe      = ['/usr/bin/gfortran', '-Wall', '-Wall']
>   linker_so       = ['/usr/bin/gfortran', '-Wall', '-g', '-Wall', '-g', '-
>                     shared']
>   object_switch   = '-o '
>   ranlib          = ['/usr/bin/gfortran']
>   version         = LooseVersion ('7')
>   version_cmd     = ['/usr/bin/gfortran', '-dumpversion']
> Fortran compilers found:
>   --fcompiler=gnu95  GNU Fortran 95 compiler (7)
> Compilers available for this platform, but not found:
>   --fcompiler=absoft   Absoft Corp Fortran Compiler
>   --fcompiler=compaq   Compaq Fortran Compiler
>   --fcompiler=g95      G95 Fortran Compiler
>   --fcompiler=gnu      GNU Fortran 77 compiler
>   --fcompiler=intel    Intel Fortran Compiler for 32-bit apps
>   --fcompiler=intele   Intel Fortran Compiler for Itanium apps
>   --fcompiler=intelem  Intel Fortran Compiler for 64-bit apps
>   --fcompiler=lahey    Lahey/Fujitsu Fortran 95 Compiler
>   --fcompiler=nag      NAGWare Fortran 95 Compiler
>   --fcompiler=nagfor   NAG Fortran Compiler
>   --fcompiler=pathf95  PathScale Fortran Compiler
>   --fcompiler=pg       Portland Group Fortran Compiler
>   --fcompiler=vast     Pacific-Sierra Research Fortran 90 Compiler
> Compilers not available on this platform:
>   --fcompiler=flang     Portland Group Fortran LLVM Compiler
>   --fcompiler=hpux      HP Fortran 90 Compiler
>   --fcompiler=ibm       IBM XL Fortran Compiler
>   --fcompiler=intelev   Intel Visual Fortran Compiler for Itanium apps
>   --fcompiler=intelv    Intel Visual Fortran Compiler for 32-bit apps
>   --fcompiler=intelvem  Intel Visual Fortran Compiler for 64-bit apps
>   --fcompiler=mips      MIPSpro Fortran Compiler
>   --fcompiler=none      Fake Fortran compiler
>   --fcompiler=sun       Sun or Forte Fortran 95 Compiler
> For compiler details, run 'config_fc --verbose' setup command.
> ------
> Importing numpy.distutils.cpuinfo ... ok
> ------
> CPU information: CPUInfoBase__get_nbits getNCPUs has_mmx has_sse has_sse2 has_sse3 has_ssse3 is_64bit is_Intel is_i686 ------
>
>
> Thank you in advance,
>
> Isabel
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at python.org
> https://mail.python.org/mailman/listinfo/scipy-dev
>


-- 
Mark Mikofski, PhD (2005)
*Fiat Lux*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20190910/da8b6824/attachment.html>


More information about the SciPy-Dev mailing list