timduly4 / pyglow

Upper atmosphere climatological models in Python
MIT License
103 stars 57 forks source link

Installation error while make all #94

Closed dinilbose closed 5 years ago

dinilbose commented 5 years ago

Thank you for your package I am trying to install the package on ubuntu 16.04. I have updated gfortran and numpy. I am encountering a following issue can you help me out with this?.

Thank you

Last part of error is shown below

customize Gnu95FCompiler Found executable /usr/bin/gfortran Found executable /iraf/iraf/unix/hlib/f77.sh Found executable /usr/bin/ranlib invalid parameter -print-file-name=libgfortran.so invalid parameter -print-file-name=libgfortran.so invalid parameter -print-libgcc-file-name customize Gnu95FCompiler invalid parameter -print-file-name=libgfortran.so invalid parameter -print-file-name=libgfortran.so invalid parameter -print-libgcc-file-name customize Gnu95FCompiler using build_ext building 'igrf11py' extension compiling C sources C compiler: gcc -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC

creating /tmp/tmpn_ax2041/tmp creating /tmp/tmpn_ax2041/tmp/tmpn_ax2041 creating /tmp/tmpn_ax2041/tmp/tmpn_ax2041/src.linux-x86_64-3.6 compile options: '-I/tmp/tmpn_ax2041/src.linux-x86_64-3.6 -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c' gcc: /tmp/tmpn_ax2041/src.linux-x86_64-3.6/igrf11pymodule.c gcc: /tmp/tmpn_ax2041/src.linux-x86_64-3.6/fortranobject.c In file included from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0, from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12, from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/arrayobject.h:4, from /tmp/tmpn_ax2041/src.linux-x86_64-3.6/fortranobject.h:13, from /tmp/tmpn_ax2041/src.linux-x86_64-3.6/igrf11pymodule.c:15: /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it with " \

^ In file included from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0, from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12, from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/arrayobject.h:4, from /tmp/tmpn_ax2041/src.linux-x86_64-3.6/fortranobject.h:13, from /tmp/tmpn_ax2041/src.linux-x86_64-3.6/fortranobject.c:2: /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it with " \

^ compiling Fortran sources Fortran f77 compiler: /iraf/iraf/unix/hlib//f77.sh -Wall -g -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops Fortran f90 compiler: /usr/bin/gfortran -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops Fortran fix compiler: /usr/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops compile options: '-I/tmp/tmpn_ax2041/src.linux-x86_64-3.6 -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c' f77.sh:f77: igrf11_modified.f igrf11_modified.f: igrf11syn: cc1: warning: command line option ‘-fno-second-underscore’ is valid for Fortran but not for C cc1: warning: unknown register name: form igrf11modified.f: In function ‘igrf11syn’: igrf11_modified.f:17:15: warning: missing braces around initializer [-Wmissing-braces] c colat = colatitude (0-180) ^ igrf11_modified.f:17:15: note: (near initialization for ‘equiv_23’) /usr/bin/gfortran -Wall -g -Wall -g -shared /tmp/tmpn_ax2041/tmp/tmpn_ax2041/src.linux-x86_64-3.6/igrf11pymodule.o /tmp/tmpn_ax2041/tmp/tmpn_ax2041/src.linux-x86_64-3.6/fortranobject.o /tmp/tmpn_ax2041/igrf11_modified.o -lgfortran -o ./igrf11py.cpython-36m-x86_64-linux-gnu.so gfortran: error: /tmp/tmpn_ax2041/igrf11_modified.o: No such file or directory error: Command "/usr/bin/gfortran -Wall -g -Wall -g -shared /tmp/tmpn_ax2041/tmp/tmpn_ax2041/src.linux-x86_64-3.6/igrf11pymodule.o /tmp/tmpn_ax2041/tmp/tmpn_ax2041/src.linux-x86_64-3.6/fortranobject.o /tmp/tmpn_ax2041/igrf11_modified.o -lgfortran -o ./igrf11py.cpython-36m-x86_64-linux-gnu.so" failed with exit status 1 make[2]: Leaving directory '/home/dlab/Desktop/ionosphere/python_package/pyglow/src/pyglow/models/dl_models/igrf11' make[1]: Leaving directory '/home/dlab/Desktop/ionosphere/python_package/pyglow/src/pyglow/models/dl_models/igrf11' rsync: link_stat "/home/dlab/Desktop/ionosphere/python_package/pyglow/src/pyglow/models/dl_models/igrf11/igrf11py*so" failed: No such file or directory (2) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1] Makefile:3: recipe for target 'all' failed make: *** [all] Error 23

timduly4 commented 5 years ago

@dinilbose Can you list your versions of both gfortran and numpy? That is:

~ $ gfortran --version
GNU Fortran (Homebrew GCC 8.2.0) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
~ $ python -c "import numpy; print(numpy.__version__)"
1.13.1

~ $ python3 -c "import numpy; print(numpy.__version__)"
1.15.1
dinilbose commented 5 years ago

@timduly4 Looks like Fortran is little too old... apt-get install gfortran --upgrade says it's up to date..Please find the versions below

dlab@dlab-ThinkPad-E470:~$ gfortran --version GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING

dlab@dlab-ThinkPad-E470:~$ python -c "import numpy; print(numpy.version)" 1.14.3 python3 -c "import numpy; print(numpy.version)" #python3.5 1.14.2 python3.6 -c "import numpy; print(numpy.version)" 1.16.0

timduly4 commented 5 years ago

@dinilbose Maybe try upgrading your package list, then hit upgrade:

$ sudo apt-get update && apt-get install gfortran --upgrade
dinilbose commented 5 years ago

@timduly4 I have updated my gfortran to 8.1.0. I have used update-alternative to set my gfortran to 8. Now make all is showing another error (given last). But it seems to be taking iraf (astronomy software) f77.sh file...I am not sure why this happens?.

f2py options: [] f2py: sig_file_patched.pyf Reading fortran codes... Reading file 'sig_file_patched.pyf' (format:free) Post-processing... Block: igrf11py Block: igrf11syn Post-processing (stage 2)... Building modules... Building module "igrf11py"... Constructing wrapper function "igrf11syn"... x,y,z,f = igrf11syn(isv,date,itype,alt,colat,elong) Wrote C/API module "igrf11py" to file "/tmp/tmpgqgvnseq/src.linux-x86_64-3.6/igrf11pymodule.c" adding '/tmp/tmpgqgvnseq/src.linux-x86_64-3.6/fortranobject.c' to sources. adding '/tmp/tmpgqgvnseq/src.linux-x86_64-3.6' to include_dirs. copying /usr/local/lib/python3.6/dist-packages/numpy/f2py/src/fortranobject.c -> /tmp/tmpgqgvnseq/src.linux-x86_64-3.6 copying /usr/local/lib/python3.6/dist-packages/numpy/f2py/src/fortranobject.h -> /tmp/tmpgqgvnseq/src.linux-x86_64-3.6 build_src: building npy-pkg config files running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext get_default_fcompiler: matching types: '['gnu95', 'intel', 'lahey', 'pg', 'absoft', 'nag', 'vast', 'compaq', 'intele', 'intelem', 'gnu', 'g95', 'pathf95', 'nagfor']' customize Gnu95FCompiler Found executable /usr/bin/gfortran Found executable /iraf/iraf/unix/hlib/f77.sh Found executable /usr/bin/ranlib invalid parameter -print-file-name=libgfortran.so invalid parameter -print-file-name=libgfortran.so invalid parameter -print-libgcc-file-name customize Gnu95FCompiler invalid parameter -print-file-name=libgfortran.so invalid parameter -print-file-name=libgfortran.so invalid parameter -print-libgcc-file-name customize Gnu95FCompiler using build_ext building 'igrf11py' extension compiling C sources C compiler: gcc -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC

creating /tmp/tmpgqgvnseq/tmp creating /tmp/tmpgqgvnseq/tmp/tmpgqgvnseq creating /tmp/tmpgqgvnseq/tmp/tmpgqgvnseq/src.linux-x86_64-3.6 compile options: '-I/tmp/tmpgqgvnseq/src.linux-x86_64-3.6 -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c' gcc: /tmp/tmpgqgvnseq/src.linux-x86_64-3.6/igrf11pymodule.c gcc: /tmp/tmpgqgvnseq/src.linux-x86_64-3.6/fortranobject.c In file included from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0, from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12, from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/arrayobject.h:4, from /tmp/tmpgqgvnseq/src.linux-x86_64-3.6/fortranobject.h:13, from /tmp/tmpgqgvnseq/src.linux-x86_64-3.6/fortranobject.c:2: /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it with " \

^ In file included from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0, from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12, from /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/arrayobject.h:4, from /tmp/tmpgqgvnseq/src.linux-x86_64-3.6/fortranobject.h:13, from /tmp/tmpgqgvnseq/src.linux-x86_64-3.6/igrf11pymodule.c:15: /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it with " \

^ compiling Fortran sources Fortran f77 compiler: /iraf/iraf/unix/hlib//f77.sh -Wall -g -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops Fortran f90 compiler: /usr/bin/gfortran -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops Fortran fix compiler: /usr/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops compile options: '-I/tmp/tmpgqgvnseq/src.linux-x86_64-3.6 -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c' f77.sh:f77: igrf11_modified.f igrf11_modified.f: igrf11syn: cc1: warning: command line option ‘-fno-second-underscore’ is valid for Fortran but not for C cc1: warning: unknown register name: form igrf11modified.f: In function ‘igrf11syn’: igrf11_modified.f:17:15: warning: missing braces around initializer [-Wmissing-braces] c colat = colatitude (0-180) ^ igrf11_modified.f:17:15: note: (near initialization for ‘equiv_23’) /usr/bin/gfortran -Wall -g -Wall -g -shared /tmp/tmpgqgvnseq/tmp/tmpgqgvnseq/src.linux-x86_64-3.6/igrf11pymodule.o /tmp/tmpgqgvnseq/tmp/tmpgqgvnseq/src.linux-x86_64-3.6/fortranobject.o /tmp/tmpgqgvnseq/igrf11_modified.o -lgfortran -o ./igrf11py.cpython-36m-x86_64-linux-gnu.so gfortran: error: /tmp/tmpgqgvnseq/igrf11_modified.o: No such file or directory error: Command "/usr/bin/gfortran -Wall -g -Wall -g -shared /tmp/tmpgqgvnseq/tmp/tmpgqgvnseq/src.linux-x86_64-3.6/igrf11pymodule.o /tmp/tmpgqgvnseq/tmp/tmpgqgvnseq/src.linux-x86_64-3.6/fortranobject.o /tmp/tmpgqgvnseq/igrf11_modified.o -lgfortran -o ./igrf11py.cpython-36m-x86_64-linux-gnu.so" failed with exit status 1 make[2]: Leaving directory '/home/dlab/Desktop/ionosphere/python_package/pyglow/src/pyglow/models/dl_models/igrf11' make[1]: Leaving directory '/home/dlab/Desktop/ionosphere/python_package/pyglow/src/pyglow/models/dl_models/igrf11' rsync: link_stat "/home/dlab/Desktop/ionosphere/python_package/pyglow/src/pyglow/models/dl_models/igrf11/igrf11py*so" failed: No such file or directory (2) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1] Makefile:3: recipe for target 'all' failed make: *** [all] Error 23

dinilbose commented 5 years ago

@timduly4 I am sorry. The issue was with my environment variables. IRAF software had created F77 env variable and I hope f2py was using this variable for compilation. I deleted the variable. Now things are fine. I was able to create .so files. I will be looking forward to using your package. Thank you for your help.

timduly4 commented 5 years ago

@dinilbose , glad to hear it worked for you-- you were on the right track with the f77.sh. I believe there's a way to force f2py to use gfortran, which may have resolved your issue sooner. I'll create a ticket.