Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem installing on Windows 10 using MinGW #16

Closed
gregstarr opened this issue Mar 13, 2019 · 19 comments
Closed

problem installing on Windows 10 using MinGW #16

gregstarr opened this issue Mar 13, 2019 · 19 comments

Comments

@gregstarr
Copy link
Contributor

running install
running bdist_egg
running egg_info
running build_src
build_src
building extension "apexpy.fortranapex" sources
f2py options: []
adding 'build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c' to sources.
adding 'build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy' to include_dirs.
adding 'build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers.f' to sources.
adding 'build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90' to sources.
build_src: building npy-pkg config files
writing src\apexpy.egg-info\PKG-INFO
writing dependency_links to src\apexpy.egg-info\dependency_links.txt
writing entry points to src\apexpy.egg-info\entry_points.txt
writing requirements to src\apexpy.egg-info\requires.txt
writing top-level names to src\apexpy.egg-info\top_level.txt
reading manifest file 'src\apexpy.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '.py[cod~]' found anywhere in distribution
warning: no previously-included files matching 'pycache' found anywhere in distribution
warning: no previously-included files matching '
.so' found anywhere in distribution
warning: no previously-included files matching '*.dylib' found anywhere in distribution
writing manifest file 'src\apexpy.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
No module named 'numpy.distutils.msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
customize MSVCCompiler using build_ext
get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
customize GnuFCompiler
Could not locate executable g77
Could not locate executable f77
customize IntelVisualFCompiler
Could not locate executable ifort
Could not locate executable ifl
customize AbsoftFCompiler
Could not locate executable f90
customize CompaqVisualFCompiler
Could not locate executable DF
customize IntelItaniumVisualFCompiler
Could not locate executable efl
customize Gnu95FCompiler
Found executable C:\MinGW\bin\gfortran.exe
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\gfortran.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic --enable-libgomp --disable-libvtv --enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
customize Gnu95FCompiler
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\gfortran.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic --enable-libgomp --disable-libvtv --enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
customize Gnu95FCompiler using build_ext
copying build\temp.win-amd64-3.6\Release.libs\libapexsh.UJFRKYGDN7P5LGGMZBJUWNEONNJ7KRCN.gfortran-win_amd64.dll -> build\lib.win-amd64-3.6\apexpy.libs
copying build\temp.win-amd64-3.6\Release.libs\libapexsh.ZGPHGEE3MPBTQ6RVB5N56Q4UUMJ43TUU.gfortran-win_amd64.dll -> build\lib.win-amd64-3.6\apexpy.libs
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\apexpy
creating build\bdist.win-amd64\egg\apexpy.libs
copying build\lib.win-amd64-3.6\apexpy.libs\libapexsh.UJFRKYGDN7P5LGGMZBJUWNEONNJ7KRCN.gfortran-win_amd64.dll -> build\bdist.win-amd64\egg\apexpy.libs
copying build\lib.win-amd64-3.6\apexpy.libs\libapexsh.ZGPHGEE3MPBTQ6RVB5N56Q4UUMJ43TUU.gfortran-win_amd64.dll -> build\bdist.win-amd64\egg\apexpy.libs
copying build\lib.win-amd64-3.6\apexpy\apex.py -> build\bdist.win-amd64\egg\apexpy
copying build\lib.win-amd64-3.6\apexpy\apexsh.dat -> build\bdist.win-amd64\egg\apexpy
copying build\lib.win-amd64-3.6\apexpy\fortranapex.cp36-win_amd64.pyd -> build\bdist.win-amd64\egg\apexpy
copying build\lib.win-amd64-3.6\apexpy\helpers.py -> build\bdist.win-amd64\egg\apexpy
copying build\lib.win-amd64-3.6\apexpy_init
.py -> build\bdist.win-amd64\egg\apexpy
copying build\lib.win-amd64-3.6\apexpy_main_.py -> build\bdist.win-amd64\egg\apexpy
byte-compiling build\bdist.win-amd64\egg\apexpy\apex.py to apex.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\apexpy\helpers.py to helpers.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\apexpy_init_.py to init.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\apexpy_main_.py to main.cpython-36.pyc
creating stub loader for apexpy\fortranapex.cp36-win_amd64.pyd
byte-compiling build\bdist.win-amd64\egg\apexpy\fortranapex.py to fortranapex.cpython-36.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying src\apexpy.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying src\apexpy.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying src\apexpy.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying src\apexpy.egg-info\entry_points.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying src\apexpy.egg-info\not-zip-safe -> build\bdist.win-amd64\egg\EGG-INFO
copying src\apexpy.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying src\apexpy.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
creating 'dist\apexpy-1.0.3-py3.6-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing apexpy-1.0.3-py3.6-win-amd64.egg
removing 'c:\programdata\anaconda3\envs\space-physics-machine-learning\lib\site-packages\apexpy-1.0.3-py3.6-win-amd64.egg' (and everything under it)
creating c:\programdata\anaconda3\envs\space-physics-machine-learning\lib\site-packages\apexpy-1.0.3-py3.6-win-amd64.egg
Extracting apexpy-1.0.3-py3.6-win-amd64.egg to c:\programdata\anaconda3\envs\space-physics-machine-learning\lib\site-packages
apexpy 1.0.3 is already the active version in easy-install.pth
Installing apexpy-script.py script to C:\ProgramData\Anaconda3\envs\space-physics-machine-learning\Scripts
Installing apexpy.exe script to C:\ProgramData\Anaconda3\envs\space-physics-machine-learning\Scripts

Installed c:\programdata\anaconda3\envs\space-physics-machine-learning\lib\site-packages\apexpy-1.0.3-py3.6-win-amd64.egg
Processing dependencies for apexpy==1.0.3
Searching for numpy==1.16.2
Best match: numpy 1.16.2
Adding numpy 1.16.2 to easy-install.pth file
Installing f2py-script.py script to C:\ProgramData\Anaconda3\envs\space-physics-machine-learning\Scripts
Installing f2py.exe script to C:\ProgramData\Anaconda3\envs\space-physics-machine-learning\Scripts

Using c:\programdata\anaconda3\envs\space-physics-machine-learning\lib\site-packages
Finished processing dependencies for apexpy==1.0.3

@aburrell
Copy link
Owner

Hi @gregstarr thank you for submitting this issue. I'm not a windows user, but on another project I ran into issues unit testing on a windows operating system with the latest numpy version. Since I don't see any error or failure messages in your comment, I wonder if this may be the issue.

Otherwise, could you identify where the install is failing?

@gregstarr
Copy link
Contributor Author

gregstarr commented Mar 13, 2019

It didn't seem like the install was failing, but I am not an expert. The problem came when I tried to import apexpy, it gave me the ERROR: fortranapex module could not be imported. apexpy probably won't work error.

@gregstarr
Copy link
Contributor Author

Are you saying that if I roll back numpy to an earlier version then this might work?

@aburrell
Copy link
Owner

Looking at the type of error you got, no I don't think it will. The problem looks like it is occurring when the fortran library is compiled, not afterwards. I don't suppose you know which compilers you have?

You could test this by going to to the apexpy/src/fortranapex directory and running the makefile there. If it can't compile that would confirm the problem.

@gregstarr
Copy link
Contributor Author

gregstarr commented Mar 16, 2019 via email

@gregstarr
Copy link
Contributor Author

gregstarr commented Mar 26, 2019 via email

@aburrell
Copy link
Owner

aburrell commented Apr 5, 2019

Which version of python are you using?

@aburrell
Copy link
Owner

I have a colleague who uses Windows looking into this. It's something he'll be doing in his free time, so probably won't be quick, but will likely succeed.

@gregstarr
Copy link
Contributor Author

gregstarr commented Apr 29, 2019 via email

@scivision
Copy link

scivision commented May 30, 2019

This is a matter of setup.py / setup.cfg needing reconfiguration. This fork works for Windows: https://github.com/space-physics/apexpy3

I am upstreaming this work here as a series of pull requests.

@CodeFHD
Copy link

CodeFHD commented Oct 25, 2019

I just ended up having the same problem as was described here. When calling import apexpy I got the error ERROR: fortranapex module could not be imported. apexpy probably won't work, and when calling import apexpy.apexfortran I got ImportError: DLL load failed: The specified module could not be found.
I was able to solve it by adding the .libs/ subdirectory of the apexpy installation to Windows' PATH variable. Apparently it can't find it by default. I don't know if it is the same as in the sourcecode given by the answer above, but perhaps it will help someone...

@gregstarr
Copy link
Contributor Author

I have a new problem now where I can't even install apexpy. I installed a fresh copy on anaconda version 2020.02, I created a new conda environment using python version 3.6.10, finally, I went to https://github.com/space-physics/apexpy and cloned apexpy. I cd'ed into the directory and used pip install -e . This gave me the following error:

C:\Users\Greg\code\apexpy>pip install -e .
Obtaining file:///C:/Users/Greg/code/apexpy
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: numpy in c:\users\greg\.conda\envs\trough_analysis\lib\site-packages (from apexpy==1.0.4) (1.18.1)
Installing collected packages: apexpy
  Running setup.py develop for apexpy
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Greg\.conda\envs\trough_analysis\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Greg\\code\\apexpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Greg\\code\\apexpy\\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
         cwd: C:\Users\Greg\code\apexpy\
    Complete output (60 lines):
    running develop
    running build_scripts
    running egg_info
    running build_src
    build_src
    building extension "apexpy.fortranapex" sources
    f2py options: []
      adding 'build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c' to sources.
      adding 'build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy' to include_dirs.
      adding 'build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers.f' to sources.
      adding 'build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90' to sources.
    building data_files sources
    Not existing data file: apexpy/apexsh.dat
    build_src: building npy-pkg config files
    writing src\apexpy.egg-info\PKG-INFO
    writing dependency_links to src\apexpy.egg-info\dependency_links.txt
    writing entry points to src\apexpy.egg-info\entry_points.txt
    writing requirements to src\apexpy.egg-info\requires.txt
    writing top-level names to src\apexpy.egg-info\top_level.txt
    reading manifest file 'src\apexpy.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '*.py[cod~]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    warning: no previously-included files matching '*.dylib' found anywhere in distribution
    writing manifest file 'src\apexpy.egg-info\SOURCES.txt'
    running build_ext
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Greg\code\apexpy\setup.py", line 28, in <module>
        setup(ext_modules=extensions)
      File "C:\Users\Greg\AppData\Local\Temp\pip-build-env-iq2d_x13\overlay\Lib\site-packages\numpy\distutils\core.py", line 171, in setup
        return old_setup(**new_attr)
      File "C:\Users\Greg\AppData\Local\Temp\pip-build-env-iq2d_x13\overlay\Lib\site-packages\setuptools\__init__.py", line 161, in setup
        return distutils.core.setup(**attrs)
      File "C:\Users\Greg\.conda\envs\trough_analysis\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Users\Greg\.conda\envs\trough_analysis\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:\Users\Greg\.conda\envs\trough_analysis\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\Greg\AppData\Local\Temp\pip-build-env-iq2d_x13\overlay\Lib\site-packages\setuptools\command\develop.py", line 38, in run
        self.install_for_development()
      File "C:\Users\Greg\AppData\Local\Temp\pip-build-env-iq2d_x13\overlay\Lib\site-packages\numpy\distutils\command\develop.py", line 17, in install_for_development
        old_develop.install_for_development(self)
      File "C:\Users\Greg\AppData\Local\Temp\pip-build-env-iq2d_x13\overlay\Lib\site-packages\setuptools\command\develop.py", line 140, in install_for_development
        self.run_command('build_ext')
      File "C:\Users\Greg\.conda\envs\trough_analysis\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Users\Greg\.conda\envs\trough_analysis\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\Greg\AppData\Local\Temp\pip-build-env-iq2d_x13\overlay\Lib\site-packages\numpy\distutils\command\build_ext.py", line 124, in run
        force=self.force)
      File "C:\Users\Greg\AppData\Local\Temp\pip-build-env-iq2d_x13\overlay\Lib\site-packages\numpy\distutils\ccompiler.py", line 771, in new_compiler
        compiler = klass(None, dry_run, force)
      File "C:\Users\Greg\AppData\Local\Temp\pip-build-env-iq2d_x13\overlay\Lib\site-packages\numpy\distutils\mingw32ccompiler.py", line 69, in __init__
        dry_run, force)
      File "C:\Users\Greg\.conda\envs\trough_analysis\lib\distutils\cygwinccompiler.py", line 129, in __init__
        if self.ld_version >= "2.10.90":
    TypeError: '>=' not supported between instances of 'NoneType' and 'str'
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Greg\.conda\envs\trough_analysis\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Greg\\code\\apexpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Greg\\code\\apexpy\\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.

Do you have any ideas of how I can fix this?

@gregstarr
Copy link
Contributor Author

During a subsequent attempt, I tried opening a MinGW terminal, cd'ing to the apexpy directory and running pip install -e . and this also failed with the following result:

Greg@DESKTOP-3DVEVSU /c/Users/Greg/code/apexpy
$ pip install -e .
Obtaining file:///C:/Users/Greg/code/apexpy
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: numpy in c:\users\greg\.conda\envs\trough_analysis\lib\site-packages (from apexpy==1.0.4) (1.18.1)
Installing collected packages: apexpy
  Running setup.py develop for apexpy
    ERROR: Command errored out with exit status 1:
     command: 'c:\Users\Greg\.conda\envs\trough_analysis\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Greg\\code\\apexpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Greg\\code\\apexpy\\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
         cwd: C:\Users\Greg\code\apexpy\
    Complete output (367 lines):
    running develop
    running build_scripts
    running egg_info
    running build_src
    build_src
    building extension "apexpy.fortranapex" sources
    f2py options: []
      adding 'build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c' to sources.
      adding 'build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy' to include_dirs.
      adding 'build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers.f' to sources.
      adding 'build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90' to sources.
    building data_files sources
    Not existing data file: apexpy/apexsh.dat
    build_src: building npy-pkg config files
    writing src\apexpy.egg-info\PKG-INFO
    writing dependency_links to src\apexpy.egg-info\dependency_links.txt
    writing entry points to src\apexpy.egg-info\entry_points.txt
    writing requirements to src\apexpy.egg-info\requires.txt
    writing top-level names to src\apexpy.egg-info\top_level.txt
    reading manifest file 'src\apexpy.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '*.py[cod~]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    warning: no previously-included files matching '*.dylib' found anywhere in distribution
    writing manifest file 'src\apexpy.egg-info\SOURCES.txt'
    running build_ext
    customize Mingw32CCompiler
    customize Mingw32CCompiler using build_ext
    get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
    customize GnuFCompiler
    Could not locate executable g77
    Could not locate executable f77
    customize IntelVisualFCompiler
    Could not locate executable ifort
    Could not locate executable ifl
    customize AbsoftFCompiler
    Could not locate executable f90
    customize CompaqVisualFCompiler
    Found executable C:\MinGW\msys\1.0\bin\DF.exe
    customize IntelItaniumVisualFCompiler
    Could not locate executable efl
    customize Gnu95FCompiler
    Found executable C:\MinGW\bin\gfortran.exe
    customize Gnu95FCompiler
    customize Gnu95FCompiler using build_ext
    building 'apexpy.fortranapex' extension
    compiling C sources
    C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes

    compile options: '-D__MSVCRT_VERSION__=0x1916 -Ibuild\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy -IC:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -c'
    gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1916 -Ibuild\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy -IC:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -c build\src.win-amd64-3.6\apexpy\fortranapexmodule.c -o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapexmodule.o
    gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1916 -Ibuild\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy -IC:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -c build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c -o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.o
    In file included from c:\Users\Greg\.conda\envs\trough_analysis\include/Python.h:77:0,
                     from build\src.win-amd64-3.6\apexpy\fortranapexmodule.c:15:
    c:\Users\Greg\.conda\envs\trough_analysis\include/pytime.h:122:12: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
         struct timeval *tv,
                ^~~~~~~
    In file included from c:\Users\Greg\.conda\envs\trough_analysis\include/Python.h:77:0,
                     from build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.h:7,
                     from build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:2:
    c:\Users\Greg\.conda\envs\trough_analysis\include/pytime.h:122:12: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
         struct timeval *tv,
                ^~~~~~~
    c:\Users\Greg\.conda\envs\trough_analysis\include/pytime.h:127:12: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
         struct timeval *tv,
                ^~~~~~~
    c:\Users\Greg\.conda\envs\trough_analysis\include/pytime.h:127:12: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
         struct timeval *tv,
                ^~~~~~~
    In file included from c:\Users\Greg\.conda\envs\trough_analysis\include/Python.h:128:0,
                     from build\src.win-amd64-3.6\apexpy\fortranapexmodule.c:15:
    c:\Users\Greg\.conda\envs\trough_analysis\include/pylifecycle.h:65:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
     int _Py_CheckPython3();
     ^~~
    In file included from c:\Users\Greg\.conda\envs\trough_analysis\include/Python.h:128:0,
                     from build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.h:7,
                     from build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:2:
    c:\Users\Greg\.conda\envs\trough_analysis\include/pylifecycle.h:65:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
     int _Py_CheckPython3();
     ^~~
    In file included from C:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:1832:0,
                     from C:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:12,
                     from C:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include/numpy/arrayobject.h:4,
                     from build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.h:13,
                     from build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:2:
    C:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h:14:9: note: #pragma message: C:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
     #pragma message(_WARN___LOC__"Using deprecated NumPy API, disable it with " \
             ^~~~~~~
    In file included from C:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:1832:0,
                     from C:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:12,
                     from C:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include/numpy/arrayobject.h:4,
                     from build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy/fortranobject.h:13,
                     from build\src.win-amd64-3.6\apexpy\fortranapexmodule.c:16:
    C:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h:14:9: note: #pragma message: C:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
     #pragma message(_WARN___LOC__"Using deprecated NumPy API, disable it with " \
             ^~~~~~~
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c: In function 'format_def':
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:133:32: warning: unknown conversion type character 'l' in format [-Wformat=]
         n = PyOS_snprintf(p, size, "array(%" NPY_INTP_FMT, def.dims.d[0]);
                                    ^~~~~~~~~
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:133:32: warning: too many arguments for format [-Wformat-extra-args]
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:141:36: warning: unknown conversion type character 'l' in format [-Wformat=]
             n = PyOS_snprintf(p, size, ",%" NPY_INTP_FMT, def.dims.d[i]);
                                        ^~~~
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:141:36: warning: too many arguments for format [-Wformat-extra-args]
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c: In function 'fortran_doc':
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:255:60: warning: unknown conversion type character 'z' in format [-Wformat=]
         fprintf(stderr, "fortranobject.c: fortran_doc: len(p)=%zd>%zd=size:"
                                                                ^
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:255:64: warning: unknown conversion type character 'z' in format [-Wformat=]
         fprintf(stderr, "fortranobject.c: fortran_doc: len(p)=%zd>%zd=size:"
                                                                    ^
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:255:21: warning: too many arguments for format [-Wformat-extra-args]
         fprintf(stderr, "fortranobject.c: fortran_doc: len(p)=%zd>%zd=size:"
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c: In function 'array_from_pyobj':
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:707:43: warning: unknown conversion type character 'l' in format [-Wformat=]
                     sprintf(mess+strlen(mess),"%" NPY_INTP_FMT ",",dims[i]);
                                               ^~~
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:707:43: warning: too many arguments for format [-Wformat-extra-args]
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:755:25: warning: unknown conversion type character 'l' in format [-Wformat=]
                             " -- expected at least elsize=%d but got %" NPY_INTP_FMT,
                             ^
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:755:25: warning: too many arguments for format [-Wformat-extra-args]
                             " -- expected at least elsize=%d but got %" NPY_INTP_FMT,
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:797:25: warning: unknown conversion type character 'l' in format [-Wformat=]
                             " -- expected elsize=%d but got %" NPY_INTP_FMT,
                             ^
    build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:797:25: warning: too many arguments for format [-Wformat-extra-args]
                             " -- expected elsize=%d but got %" NPY_INTP_FMT,
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    build\src.win-amd64-3.6\apexpy\fortranapexmodule.c:177:12: warning: 'f2py_size' defined but not used [-Wunused-function]
     static int f2py_size(PyArrayObject* var, ...)
                ^~~~~~~~~
    compiling Fortran 90 module sources
    creating build\temp.win-amd64-3.6\Release\apexpy
    Fortran f77 compiler: C:\MinGW\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -O3 -funroll-loops
    Fortran f90 compiler: C:\MinGW\bin\gfortran.exe -Wall -g -fno-second-underscore -O3 -funroll-loops
    Fortran fix compiler: C:\MinGW\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -O3 -funroll-loops
    creating build\temp.win-amd64-3.6\Release\src
    creating build\temp.win-amd64-3.6\Release\src\fortranapex
    compile options: '-Ibuild\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy -IC:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -c'
    extra options: '-Jbuild\temp.win-amd64-3.6\Release\apexpy -Ibuild\temp.win-amd64-3.6\Release\apexpy'
    gfortran.exe:f90: src/fortranapex/apexsh.f90
    src/fortranapex/apexsh.f90:315:33:

         integer(4)               :: i, l, iterm, itermsh
                                     1
    Warning: Unused variable 'i' declared at (1) [-Wunused-variable]
    src/fortranapex/apexsh.f90:520:36:

         real(4)                  :: mlon, f1(1:2), f2(1:2), f
                                        1
    Warning: Unused variable 'mlon' declared at (1) [-Wunused-variable]
    compiling Fortran sources
    Fortran f77 compiler: C:\MinGW\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -O3 -funroll-loops
    Fortran f90 compiler: C:\MinGW\bin\gfortran.exe -Wall -g -fno-second-underscore -O3 -funroll-loops
    Fortran fix compiler: C:\MinGW\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\apexpy -IC:\Users\Greg\AppData\Local\Temp\pip-build-env-tlylnnm0\overlay\Lib\site-packages\numpy\core\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -Ic:\Users\Greg\.conda\envs\trough_analysis\include -c'
    extra options: '-Jbuild\temp.win-amd64-3.6\Release\apexpy -Ibuild\temp.win-amd64-3.6\Release\apexpy'
    gfortran.exe:f90: src/fortranapex/makeapexsh.f90
    src/fortranapex/makeapexsh.f90:95:11:

         lat0 = -90E0 + latspace/2D0
               1
    Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
    src/fortranapex/makeapexsh.f90:220:14:

         write(iun), nepoch, nmax, mmax, lmax, nterm
                  1
    Warning: Legacy Extension: Comma before i/o item list at (1)
    src/fortranapex/makeapexsh.f90:221:14:

         write(iun), epochgrid, coeff0
                  1
    Warning: Legacy Extension: Comma before i/o item list at (1)
    gfortran.exe:f90: src/fortranapex/checkapexsh.f90
    gfortran.exe:f90: build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'coeff0' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'dpolynomq' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'dxqdrhocoeff' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'dyqdrhocoeff' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'dzqdrhocoeff' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'epochgrid' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'gcoeff0' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'pbar' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'polynomg' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'polynomq' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'qcoeff0' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'sh' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'shgradphi' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'shgradtheta' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'vbar' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'wbar' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'xgcoeff' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'xqcoeff' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'ygcoeff' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'yqcoeff' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'zgcoeff' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

           use apxshmodule, only : nterm
              1
    Warning: Unused module variable 'zqcoeff' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

           use alfbasismodule, only : nmax0
              1
    Warning: Unused module variable 'anm' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

           use alfbasismodule, only : nmax0
              1
    Warning: Unused module variable 'bnm' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

           use alfbasismodule, only : nmax0
              1
    Warning: Unused module variable 'cm' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

           use alfbasismodule, only : nmax0
              1
    Warning: Unused module variable 'dnm' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

           use alfbasismodule, only : nmax0
              1
    Warning: Unused module variable 'en' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

           use alfbasismodule, only : nmax0
              1
    Warning: Unused module variable 'marr' which has been explicitly imported at (1) [-Wunused-variable]
    build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

           use alfbasismodule, only : nmax0
              1
    Warning: Unused module variable 'narr' which has been explicitly imported at (1) [-Wunused-variable]
    gfortran.exe:f77: build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers.f
    gfortran.exe:f77: src/fortranapex/apex.f
    gfortran.exe:f77: src/fortranapex/magfld.f
    src/fortranapex/magfld.f:1458:32:

           IF (IY .LT. NEPO) GB(I) = (GYR(NN,MM,IY) +                             ! interpolate (m=0 terms)
                                    1
    Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
    src/fortranapex/magfld.f:1460:32:

           IF (IY .EQ. NEPO) GB(I) = (GYR(NN,MM,IY) + GT(NN,MM)    *T  ) * F0     ! extrapolate (m=0 terms)
                                    1
    Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
    src/fortranapex/magfld.f:1469:17:

             GB(I)  = (GYR(NN,MM,IY) +
                     1
    Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
    src/fortranapex/magfld.f:1471:17:

             GB(I1) = (HYR(NN,MM,IY) +
                     1
    Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
    src/fortranapex/magfld.f:1474:17:

             GB(I)  = (GYR(NN,MM,IY) +GT (NN,MM)    *T  ) * F
                     1
    Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
    src/fortranapex/magfld.f:1475:17:

             GB(I1) = (HYR(NN,MM,IY) +HT (NN,MM)    *T  ) * F
                     1
    Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
    src/fortranapex/magfld.f:1440:0:

           IY = I

    Warning: 'iy' may be used uninitialized in this function [-Wmaybe-uninitialized]
    C:\MinGW\bin\gfortran.exe -Wall -g -Wall -g -shared build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapexmodule.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.o build\temp.win-amd64-3.6\Release\src\fortranapex\apexsh.o build\temp.win-amd64-3.6\Release\src\fortranapex\magfld.o build\temp.win-amd64-3.6\Release\src\fortranapex\apex.o build\temp.win-amd64-3.6\Release\src\fortranapex\makeapexsh.o build\temp.win-amd64-3.6\Release\src\fortranapex\checkapexsh.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.o -Lc:\mingw\lib\gcc\mingw32\6.3.0 -Lc:\Users\Greg\.conda\envs\trough_analysis\libs -Lc:\Users\Greg\.conda\envs\trough_analysis\PCbuild\amd64 -lpython36 -lgfortran -o src\apexpy\fortranapex.cp36-win_amd64.pyd
    c:\Users\Greg\.conda\envs\trough_analysis\libs/libpython36.a: error adding symbols: File format not recognized
    collect2.exe: error: ld returned 1 exit status
    error: Command "C:\MinGW\bin\gfortran.exe -Wall -g -Wall -g -shared build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapexmodule.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.o build\temp.win-amd64-3.6\Release\src\fortranapex\apexsh.o build\temp.win-amd64-3.6\Release\src\fortranapex\magfld.o build\temp.win-amd64-3.6\Release\src\fortranapex\apex.o build\temp.win-amd64-3.6\Release\src\fortranapex\makeapexsh.o build\temp.win-amd64-3.6\Release\src\fortranapex\checkapexsh.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.o -Lc:\mingw\lib\gcc\mingw32\6.3.0 -Lc:\Users\Greg\.conda\envs\trough_analysis\libs -Lc:\Users\Greg\.conda\envs\trough_analysis\PCbuild\amd64 -lpython36 -lgfortran -o src\apexpy\fortranapex.cp36-win_amd64.pyd" failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\Users\Greg\.conda\envs\trough_analysis\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Greg\\code\\apexpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Greg\\code\\apexpy\\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
Copy link

scivision commented Jun 1, 2020

Ensure that your Windows system has a file %USERPROFILE%\pydistutils.cfg containing:

[build]
compiler=mingw32

then after cloning https://github.com/space-physics/apexpy
install by

cd apexpy

python setup.py develop

and then

pytest

all tests pass on Windows with GCC, including GCC 10.

If you have GCC 10, there is a general bug with Numpy that I fixed in numpy/numpy#16468
It is acknowledged by Numpy but isn't yet released.

@gregstarr
Copy link
Contributor Author

gregstarr commented Jun 1, 2020

By adding a pydistutils.cfg to my user directory and running python setup.py develop using my conda base environment (python 3.7.6), I get the following error. Is this the numpy gcc10 bug?

C:\Users\Greg\code\apexpy>python setup.py develop
C:\ProgramData\Anaconda3\lib\site-packages\numpy\__init__.py:140: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
  from . import _distributor_init
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 24, in <module>
    from . import multiarray
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\multiarray.py", line 14, in <module>
    from . import overrides
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
    from numpy.core._multiarray_umath import (
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 12, in <module>
    from numpy.distutils.core import setup, Extension
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import core
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 54, in <module>
    raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
  1. Check that you expected to use Python3.7 from "C:\ProgramData\Anaconda3\python.exe",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.18.1" you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: DLL load failed: The specified module could not be found.

When I do the same thing (in cmd or in anaconda terminal) except in a conda environment with python 3.6, I get this error:

(trough_analysis) C:\Users\Greg\code\apexpy>python setup.py develop
running develop
running build_scripts
running egg_info
running build_src
build_src
building extension "apexpy.fortranapex" sources
f2py options: []
  adding 'build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c' to sources.
  adding 'build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy' to include_dirs.
  adding 'build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers.f' to sources.
  adding 'build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90' to sources.
building data_files sources
Not existing data file: apexpy/apexsh.dat
build_src: building npy-pkg config files
writing src\apexpy.egg-info\PKG-INFO
writing dependency_links to src\apexpy.egg-info\dependency_links.txt
writing entry points to src\apexpy.egg-info\entry_points.txt
writing requirements to src\apexpy.egg-info\requires.txt
writing top-level names to src\apexpy.egg-info\top_level.txt
reading manifest file 'src\apexpy.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.py[cod~]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dylib' found anywhere in distribution
writing manifest file 'src\apexpy.egg-info\SOURCES.txt'
running build_ext
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
customize GnuFCompiler
Could not locate executable g77
Could not locate executable f77
customize IntelVisualFCompiler
Could not locate executable ifort
Could not locate executable ifl
customize AbsoftFCompiler
Could not locate executable f90
customize CompaqVisualFCompiler
Could not locate executable DF
customize IntelItaniumVisualFCompiler
Could not locate executable efl
customize Gnu95FCompiler
Found executable C:\MinGW\bin\gfortran.exe
customize Gnu95FCompiler
customize Gnu95FCompiler using build_ext
building 'apexpy.fortranapex' extension
compiling C sources
C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes

compile options: '-D__MSVCRT_VERSION__=0x1916 -Ibuild\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy -IC:\Users\Greg\.conda\envs\trough_analysis\lib\site-packages\numpy\core\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -c'
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1916 -Ibuild\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy -IC:\Users\Greg\.conda\envs\trough_analysis\lib\site-packages\numpy\core\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -c build\src.win-amd64-3.6\apexpy\fortranapexmodule.c -o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapexmodule.o
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1916 -Ibuild\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy -IC:\Users\Greg\.conda\envs\trough_analysis\lib\site-packages\numpy\core\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -c build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c -o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.o
In file included from C:\Users\Greg\.conda\envs\trough_analysis\include/Python.h:77:0,
                 from build\sIn file included frc.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranromobject.h:7,
         C:\Users\Greg\.conda\envs\trough_ana         from build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:l2y:
C:\Users\Greg\.conda\envs\trough_analysis\include/pytime.h:122:12: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
     struct timeval *tv,
       sis\include/Python.h:77:0,
                 from build\src.win-amd64-3.6\apexpy\fortranapexmodule.     ^~~~~~~
c:15:
C:\Users\Greg\.conda\envs\trougC:\Users\Greg\.conda\envs\trough_analysis\include/pytime.h:127:12: warning: 'struct timeval' declared insih_analysis\de parameter list will not be visible outside of this definition or declaration
     struct timeval *tv,
            ^~~~~~~
include/pytime.h:122:12: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
     struct timeval *tv,
            ^~~~~~~
C:\Users\Greg\.conda\envs\trough_analysis\include/pytime.h:127:12: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
     struct timeval *tv,
            ^~~~~~~
In file included from C:\Users\Greg\.conda\envs\trough_analysis\include/Python.h:128:0,
                 from build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.h:7,
                 from build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:2:
C:\Users\Greg\.conda\envs\trough_analysis\include/pylifecycle.h:65:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
 int _Py_CheckPython3();
 ^~~
In file included from C:\Users\Greg\.conda\envs\trough_analysis\include/Python.h:128:0,
                 from build\src.win-amd64-3.6\apexpy\fortranapexmodule.c:15:
C:\Users\Greg\.conda\envs\trough_analysis\include/pylifecycle.h:65:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
 int _PIn file included from C:\Users\Greg\.conda\envs\trough_analysis\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:1832:0,
                 from C:\Users\Greg\.conda\envs\try_CheckPython3();
 ^~~
ough_analysis\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:12,
                 from C:\Users\Greg\.conda\envs\trough_analysis\lib\site-packages\numpy\core\include/numpy/arrayobject.h:4,
                 from build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.h:13,
                 from build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:2:
C:\Users\Greg\.conda\envs\trough_analysis\lib\site-packages\numpy\core\include/numpy/In file included from C:\Users\Greg\.conda\envs\trough_analysis\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:1832:0,
                 fromnpy_1_ C:\Users\Greg\.conda\envs\trough_analysis\li7_deprecated_api.h:14:9: note: #pragma message: C:\Users\Greg\.conda\envs\trough_analysis\lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
 #pragma message(_WARN___LOC__"Using deprecated NumPy API, disable it with " \b\s
         ^~~~~~~
ite-packages\numpy\core\include/numpy/ndarrayobject.h:12,
                 from C:\Users\Greg\.conda\envs\trough_analysis\lib\site-packages\numpy\core\include/numpy/arrayobject.h:4,
                 from build\src.win-abmd6uil4-3.6\build\src.win-amd64-3.6\apexpy/fortranobject.h:13,
                 from build\srcd\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c: In function 'format_def':
.win-amd64-3.6\apexpy\fortranapexmodule.c:16:
C:\Users\Greg\.conda\envs\trough_analysis\lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h:14:9: note: #pragma message: C:\Users\Greg\.conda\envs\trough_analysis\lib\site-packages\numpy\build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:133:32: warning: unkncore\include/numpy/npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
 #pragma message(_WARN___LOC__"Using deprecated NumPy API, disable it with " \
own conversion type character 'l' in format [-Wformat=]
     n = PyOS_snprintf(p, size, "array(%" NPY_INTP_FMT, def.dims.d[0]);
                                ^~~~~~~~~
         ^~~~~~~
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:133:32: warning: too many arguments for format [-Wformat-extra-args]
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:141:36: warning: unknown conversion type character 'l' in format [-Wformat=]
         n = PyOS_snprintf(p, size, ",%" NPY_INTP_FMT, def.dims.d[i]);
                                    ^~~~
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:141:36: warning: too many arguments for format [-Wformat-extra-args]
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c: In function 'fortran_doc':
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:255:60: warning: unknown conversion type character 'z' in format [-Wformat=]
     fprintf(stderr, "fortranobject.c: fortran_doc: len(p)=%zd>%zd=size:"
                                                            ^
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:255:64: warning: unknown conversion type character 'z' in format [-Wformat=]
     fprintf(stderr, "fortranobject.c: fortran_doc: len(p)=%zd>%zd=size:"
                                                                ^
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:255:21: warning: too many arguments for format [-Wformat-extra-args]
     fprintf(stderr, "fortranobject.c: fortran_doc: len(p)=%zd>%zd=size:"
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build\src.win-amd64-3.6\apexpy\fortranapexmodule.c:177:12: warning: 'f2py_size' defined but not used [-Wunused-function]
 static int f2py_size(PyArrayObject* var, ...)
            ^~~~~~~~~
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c: In function 'array_from_pyobj':
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:707:43: warning: unknown conversion type character 'l' in format [-Wformat=]
                 sprintf(mess+strlen(mess),"%" NPY_INTP_FMT ",",dims[i]);
                                           ^~~
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:707:43: warning: too many arguments for format [-Wformat-extra-args]
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:755:25: warning: unknown conversion type character 'l' in format [-Wformat=]
                         " -- expected at least elsize=%d but got %" NPY_INTP_FMT,
                         ^
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:755:25: warning: too many arguments for format [-Wformat-extra-args]
                         " -- expected at least elsize=%d but got %" NPY_INTP_FMT,
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:797:25: warning: unknown conversion type character 'l' in format [-Wformat=]
                         " -- expected elsize=%d but got %" NPY_INTP_FMT,
                         ^
build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.c:797:25: warning: too many arguments for format [-Wformat-extra-args]
                         " -- expected elsize=%d but got %" NPY_INTP_FMT,
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling Fortran 90 module sources
Fortran f77 compiler: C:\MinGW\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -O3 -funroll-loops
Fortran f90 compiler: C:\MinGW\bin\gfortran.exe -Wall -g -fno-second-underscore -O3 -funroll-loops
Fortran fix compiler: C:\MinGW\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\apexpy -IC:\Users\Greg\.conda\envs\trough_analysis\lib\site-packages\numpy\core\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -c'
extra options: '-Jbuild\temp.win-amd64-3.6\Release\apexpy -Ibuild\temp.win-amd64-3.6\Release\apexpy'
gfortran.exe:f90: src/fortranapex/apexsh.f90
src/fortranapex/apexsh.f90:315:33:

     integer(4)               :: i, l, iterm, itermsh
                                 1
Warning: Unused variable 'i' declared at (1) [-Wunused-variable]
src/fortranapex/apexsh.f90:520:36:

     real(4)                  :: mlon, f1(1:2), f2(1:2), f
                                    1
Warning: Unused variable 'mlon' declared at (1) [-Wunused-variable]
compiling Fortran sources
Fortran f77 compiler: C:\MinGW\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -O3 -funroll-loops
Fortran f90 compiler: C:\MinGW\bin\gfortran.exe -Wall -g -fno-second-underscore -O3 -funroll-loops
Fortran fix compiler: C:\MinGW\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\apexpy -IC:\Users\Greg\.conda\envs\trough_analysis\lib\site-packages\numpy\core\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -IC:\Users\Greg\.conda\envs\trough_analysis\include -c'
extra options: '-Jbuild\temp.win-amd64-3.6\Release\apexpy -Ibuild\temp.win-amd64-3.6\Release\apexpy'
gfortran.exe:f90: src/fortranapex/makeapexsh.f90
src/fortranapex/makeapexsh.f90:95:11:

     lat0 = -90E0 + latspace/2D0
           1
Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
src/fortranapex/makeapexsh.f90:220:14:

     write(iun), nepoch, nmax, mmax, lmax, nterm
              1
Warning: Legacy Extension: Comma before i/o item list at (1)
src/fortranapex/makeapexsh.f90:221:14:

     write(iun), epochgrid, coeff0
              1
Warning: Legacy Extension: Comma before i/o item list at (1)
gfortran.exe:f90: src/fortranapex/checkapexsh.f90
gfortran.exe:f90: build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'coeff0' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'dpolynomq' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'dxqdrhocoeff' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'dyqdrhocoeff' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'dzqdrhocoeff' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'epochgrid' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'gcoeff0' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'pbar' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'polynomg' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'polynomq' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'qcoeff0' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'sh' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'shgradphi' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'shgradtheta' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'vbar' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'wbar' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'xgcoeff' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'xqcoeff' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'ygcoeff' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'yqcoeff' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'zgcoeff' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:674:10:

       use apxshmodule, only : nterm
          1
Warning: Unused module variable 'zqcoeff' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

       use alfbasismodule, only : nmax0
          1
Warning: Unused module variable 'anm' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

       use alfbasismodule, only : nmax0
          1
Warning: Unused module variable 'bnm' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

       use alfbasismodule, only : nmax0
          1
Warning: Unused module variable 'cm' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

       use alfbasismodule, only : nmax0
          1
Warning: Unused module variable 'dnm' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

       use alfbasismodule, only : nmax0
          1
Warning: Unused module variable 'en' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

       use alfbasismodule, only : nmax0
          1
Warning: Unused module variable 'marr' which has been explicitly imported at (1) [-Wunused-variable]
build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.f90:986:10:

       use alfbasismodule, only : nmax0
          1
Warning: Unused module variable 'narr' which has been explicitly imported at (1) [-Wunused-variable]
gfortran.exe:f77: src/fortranapex/magfld.f
gfortran.exe:f77: src/fortranapex/apex.f
gfortran.exe:f77: build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers.f
src/fortranapex/magfld.f:1458:32:

       IF (IY .LT. NEPO) GB(I) = (GYR(NN,MM,IY) +                             ! interpolate (m=0 terms)
                                1
Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
src/fortranapex/magfld.f:1460:32:

       IF (IY .EQ. NEPO) GB(I) = (GYR(NN,MM,IY) + GT(NN,MM)    *T  ) * F0     ! extrapolate (m=0 terms)
                                1
Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
src/fortranapex/magfld.f:1469:17:

         GB(I)  = (GYR(NN,MM,IY) +
                 1
Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
src/fortranapex/magfld.f:1471:17:

         GB(I1) = (HYR(NN,MM,IY) +
                 1
Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
src/fortranapex/magfld.f:1474:17:

         GB(I)  = (GYR(NN,MM,IY) +GT (NN,MM)    *T  ) * F
                 1
Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
src/fortranapex/magfld.f:1475:17:

         GB(I1) = (HYR(NN,MM,IY) +HT (NN,MM)    *T  ) * F
                 1
Warning: Possible change of value in conversion from REAL(8) to REAL(4) at (1) [-Wconversion]
src/fortranapex/magfld.f:1440:0:

       IY = I

Warning: 'iy' may be used uninitialized in this function [-Wmaybe-uninitialized]
C:\MinGW\bin\gfortran.exe -Wall -g -Wall -g -shared build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapexmodule.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.o build\temp.win-amd64-3.6\Release\src\fortranapex\apexsh.o build\temp.win-amd64-3.6\Release\src\fortranapex\magfld.o build\temp.win-amd64-3.6\Release\src\fortranapex\apex.o build\temp.win-amd64-3.6\Release\src\fortranapex\makeapexsh.o build\temp.win-amd64-3.6\Release\src\fortranapex\checkapexsh.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.o -Lc:\mingw\lib\gcc\mingw32\6.3.0 -LC:\Users\Greg\.conda\envs\trough_analysis\libs -LC:\Users\Greg\.conda\envs\trough_analysis\PCbuild\amd64 -lpython36 -lgfortran -o src\apexpy\fortranapex.cp36-win_amd64.pyd
C:\Users\Greg\.conda\envs\trough_analysis\libs/libpython36.a: error adding symbols: File format not recognized
collect2.exe: error: ld returned 1 exit status
error: Command "C:\MinGW\bin\gfortran.exe -Wall -g -Wall -g -shared build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapexmodule.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\build\src.win-amd64-3.6\apexpy\fortranobject.o build\temp.win-amd64-3.6\Release\src\fortranapex\apexsh.o build\temp.win-amd64-3.6\Release\src\fortranapex\magfld.o build\temp.win-amd64-3.6\Release\src\fortranapex\apex.o build\temp.win-amd64-3.6\Release\src\fortranapex\makeapexsh.o build\temp.win-amd64-3.6\Release\src\fortranapex\checkapexsh.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers.o build\temp.win-amd64-3.6\Release\build\src.win-amd64-3.6\apexpy\fortranapex-f2pywrappers2.o -Lc:\mingw\lib\gcc\mingw32\6.3.0 -LC:\Users\Greg\.conda\envs\trough_analysis\libs -LC:\Users\Greg\.conda\envs\trough_analysis\PCbuild\amd64 -lpython36 -lgfortran -o src\apexpy\fortranapex.cp36-win_amd64.pyd" failed with exit status 1

When I run the command in the Anaconda terminal using my base environment I get:

(base) C:\Users\Greg\code\apexpy>python setup.py develop
running develop
running build_scripts
running egg_info
running build_src
build_src
building extension "apexpy.fortranapex" sources
f2py options: []
  adding 'build\src.win-amd64-3.7\build\src.win-amd64-3.7\apexpy\fortranobject.c' to sources.
  adding 'build\src.win-amd64-3.7\build\src.win-amd64-3.7\apexpy' to include_dirs.
  adding 'build\src.win-amd64-3.7\apexpy\fortranapex-f2pywrappers.f' to sources.
  adding 'build\src.win-amd64-3.7\apexpy\fortranapex-f2pywrappers2.f90' to sources.
building data_files sources
Not existing data file: apexpy/apexsh.dat
build_src: building npy-pkg config files
writing src\apexpy.egg-info\PKG-INFO
writing dependency_links to src\apexpy.egg-info\dependency_links.txt
writing entry points to src\apexpy.egg-info\entry_points.txt
writing requirements to src\apexpy.egg-info\requires.txt
writing top-level names to src\apexpy.egg-info\top_level.txt
reading manifest file 'src\apexpy.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.py[cod~]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dylib' found anywhere in distribution
writing manifest file 'src\apexpy.egg-info\SOURCES.txt'
running build_ext
Looking for python37.dll
Building import library (arch=AMD64): "C:\ProgramData\Anaconda3\libs\libpython37.a" (from C:\ProgramData\Anaconda3\python37.dll)
objdump.exe: C:\ProgramData\Anaconda3\python37.dll: File format not recognized
Traceback (most recent call last):
  File "setup.py", line 21, in <module>
    setup(ext_modules=extensions)
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\distutils\core.py", line 171, in setup
    return old_setup(**new_attr)
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\develop.py", line 38, in run
    self.install_for_development()
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\distutils\command\develop.py", line 17, in install_for_development
    old_develop.install_for_development(self)
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\develop.py", line 140, in install_for_development
    self.run_command('build_ext')
  File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\distutils\command\build_ext.py", line 124, in run
    force=self.force)
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\distutils\ccompiler.py", line 771, in new_compiler
    compiler = klass(None, dry_run, force)
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\distutils\mingw32ccompiler.py", line 103, in __init__
    build_import_library()
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\distutils\mingw32ccompiler.py", line 415, in build_import_library
    return _build_import_library_amd64()
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\distutils\mingw32ccompiler.py", line 471, in _build_import_library_amd64
    generate_def(dll_file, def_file)
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\distutils\mingw32ccompiler.py", line 301, in generate_def
    raise ValueError("Symbol table not found")
ValueError: Symbol table not found

@gregstarr
Copy link
Contributor Author

gregstarr commented Jun 3, 2020

With the help of @scivision I was able to get apexpy compiled and working. Here's what I had to do:

  1. install a fresh copy of miniconda*
  2. uninstall my old mingw and install MSYS, which contains a newer version of mingw
  3. I added the mingw bin folder (C:\msys64\mingw64\bin by default) to my Path environment variable*
  4. find the numpy directory in your python directory, open numpy/distutils/fcompiler/gnu.py and remove all mentions of -mno-cygwin from the file. For me this meant removing:

lines 106 - 109:

# use -mno-cygwin for g77 when Python is not Cygwin-Python
if sys.platform == 'win32':
    for key in ['version_cmd', 'compiler_f77', 'linker_so', 'linker_exe']:
        executables[key].append('-mno-cygwin')

lines 276 - 287:

if v >= '4.':
    # gcc-4 series releases do not support -mno-cygwin option
    pass
else:
    # use -mno-cygwin flag for gfortran when Python is not
    # Cygwin-Python
    if sys.platform == 'win32':
        for key in [
                'version_cmd', 'compiler_f77', 'compiler_f90',
                'compiler_fix', 'linker_so', 'linker_exe'
        ]:
            self.executables[key].append('-mno-cygwin')
  1. install apexpy by cloning scivision's repo, cd'ing into it, and running python setup.py develop

Hope this helps!

EDIT: numpy commit hash for which this is valid fb314a390851d4c21f3f6a2a87cffd329219c524

@gregstarr
Copy link
Contributor Author

I can install apexpy 1.0.3 using pip no problem on windows 10 now (without using the above procedure). I think this can be closed.

@aburrell
Copy link
Owner

aburrell commented Jan 4, 2021

@gregstarr thank you for letting us know! I am glad windows and apexpy are playing well again :)

@aburrell aburrell closed this as completed Jan 4, 2021
@hlmxlj2018
Copy link

fortranapex module could not be imported,I encountered this problem and didn't know how to solve it. Apexpy can be installed, but fortranex module cannot be used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants