space-physics / lowtran

LOWTRAN atmospheric absorption extinction, scatter and irradiance model--in Python and Matlab
MIT License
102 stars 42 forks source link

internal compiler error: segmentation fault #10

Closed aschneid42 closed 5 years ago

aschneid42 commented 5 years ago

@scivision Hi, I've successfully installed Fortran compilers on Windows 10 and tested that it works. But when I run the command "pip install -e ." from the lowtran folder, I get this segmentation fault error! Have you encountered this before? Any ideas?

Found executable C:\cygwin64\bin\gfortran.exe
Using built-in specs.
COLLECT_GCC=/usr/bin/gfortran
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/gcc/gcc-7.4.0-1.x86_64/src/gcc-7.4.0/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-7.4.0-1.x86_64/src/gcc-7.4  .0 --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C --build=x86_64-  pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib --enable-shared --enab  le-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_atexit --with-dwarf2 --with-tune=generic --enable  -languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-graphite --enable-threads=posix --enable-libatomic --enable-libcilkrts --enable-libgomp --enable-lib  itm --enable-libquadmath --enable-libquadmath-support --disable-libssp --enable-libada --disable-symvers --with-gnu-ld --with-gnu-as --with-cloog-include=/  usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-comp  atible --enable-libstdcxx-filesystem-ts
Thread model: posix
gcc version 7.4.0 (GCC)
customize Gnu95FCompiler
Using built-in specs.
COLLECT_GCC=/usr/bin/gfortran
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/gcc/gcc-7.4.0-1.x86_64/src/gcc-7.4.0/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-7.4.0-1.x86_64/src/gcc-7.4  .0 --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C --build=x86_64-  pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib --enable-shared --enab  le-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_atexit --with-dwarf2 --with-tune=generic --enable  -languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-graphite --enable-threads=posix --enable-libatomic --enable-libcilkrts --enable-libgomp --enable-lib  itm --enable-libquadmath --enable-libquadmath-support --disable-libssp --enable-libada --disable-symvers --with-gnu-ld --with-gnu-as --with-cloog-include=/  usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-comp  atible --enable-libstdcxx-filesystem-ts
Thread model: posix
gcc version 7.4.0 (GCC)
customize Gnu95FCompiler using build_ext
building 'lowtran7' extension
compiling C sources
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ib  uild\src.win-amd64-3.6\build\src.win-amd64-3.6 -IC:\Users\ad006850\AppData\Local\Temp\pip-build-env-w9xs3_x1\overlay\Lib\site-packages\numpy\core\include -  Ic:\anaconda3\include -Ic:\anaconda3\include -Ic:\anaconda3\include -Ic:\anaconda3\include -IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools  \VC\Tools\MSVC\14.16.27023\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17  763.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um -IC:\Progr  am Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt /Tcbuild\src.win-amd64-3.6  \lowtran7module.c /Fobuild\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\lowtran7module.obj
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ib  uild\src.win-amd64-3.6\build\src.win-amd64-3.6 -IC:\Users\ad006850\AppData\Local\Temp\pip-build-env-w9xs3_x1\overlay\Lib\site-packages\numpy\core\include -  Ic:\anaconda3\include -Ic:\anaconda3\include -Ic:\anaconda3\include -Ic:\anaconda3\include -IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools  \VC\Tools\MSVC\14.16.27023\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17  763.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um -IC:\Progr  am Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt /Tcbuild\src.win-amd64-3.6  \build\src.win-amd64-3.6\fortranobject.c /Fobuild\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\build\src.win-amd64-3.6\fortranobject.obj
compiling Fortran sources
Fortran f77 compiler: C:\cygwin64\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -O3 -funroll-loops
Fortran f90 compiler: C:\cygwin64\bin\gfortran.exe -Wall -g -fno-second-underscore -O3 -funroll-loops
Fortran fix compiler: C:\cygwin64\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -O3 -funroll-loops
compile options: '-Ibuild\src.win-amd64-3.6\build\src.win-amd64-3.6 -IC:\Users\ad006850\AppData\Local\Temp\pip-build-env-w9xs3_x1\overlay\Lib\site-pack  ages\numpy\core\include -Ic:\anaconda3\include -Ic:\anaconda3\include -Ic:\anaconda3\include -Ic:\anaconda3\include -c'
extra f77 options: '-w'
gfortran.exe:f77: src/lowtran7.f
extra f77 options: '-w'
gfortran.exe:f77: build\src.win-amd64-3.6\lowtran7-f2pywrappers.f
build\src.win-amd64-3.6\lowtran7-f2pywrappers.f:227:0:

       subroutine f2pyinit_BLNK_(setupfunc)

internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
src/lowtran7.f:5285:0:

       SUBROUTINE TRANS(IPH,ISOURC,IDAY,ANGLEM,nwl,TXPy,VPy,ALAMPy,

internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
error: Command "C:\cygwin64\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -O3 -funroll-loops -Ibuild\src.win-amd64-3.6\build\src.win-am  d64-3.6 -IC:\Users\ad006850\AppData\Local\Temp\pip-build-env-w9xs3_x1\overlay\Lib\site-packages\numpy\core\include -Ic:\anaconda3\include -Ic:\anaconda3\in  clude -Ic:\anaconda3\include -Ic:\anaconda3\include -c -c build\src.win-amd64-3.6\lowtran7-f2pywrappers.f -o build\temp.win-amd64-3.6\Release\build\src.win  -amd64-3.6\lowtran7-f2pywrappers.o -w" failed with exit status 1
----------------------------------------

ERROR: Command errored out with exit status 1: 'c:\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Projects\lowtran-mas ter\setup.py'"'"'; file='"'"'C:\Projects\lowtran-master\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"' "'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

scivision commented 5 years ago

This looks like a Gfortran 7.4.0 bug on Cygwin. I have not used Cygwin since Windows Subsystem for Linux became available a few years ago, as WSL is superior is virtually every way including computational speed.

I just tried Cygwin, and Cygwin seems totally broken for Numpy (in addition to this Cygwin-specific Gfortran issue) so I would consider these alternatives (in general too, not just for Lowtran):

  1. Windows Subsystem for Linux--I use this every day, it's quite performant and reliable.
  2. native Windows: using MSYS2 or MinGW to install Gfortran.

native Windows only: One-time configure to point to Gfortran using Powershell:

echo "[build]`ncompiler=mingw32" | Out-File -Encoding ASCII ~/pydistutils.cfg
scivision commented 5 years ago

please reopen if you have further issues, sadly I can't help the broken internals of Cygwin