tudat-team / tudatpy-feedstock

A conda-smithy repository for tudatpy.
https://tudat-team.github.io/tudatpy/
BSD 3-Clause "New" or "Revised" License
4 stars 3 forks source link

Unable to compile for windows with MinGW #3

Closed geoffreygarrett closed 4 years ago

geoffreygarrett commented 4 years ago

Attempting to compile with MinGW:

Scanning dependencies of target kernel
[  5%] Building CXX object tudatpy/CMakeFiles/kernel.dir/kernel/kernel.cpp.obj
In file included from C:/bld/tudatpy_1596528182009/_build_env/Library/mingw-w64/include/c++/5.3.0/random:38:0,
                 from C:/bld/tudatpy_1596528182009/_build_env/Library/mingw-w64/include/c++/5.3.0/bits/stl_algo.h:66,
                 from C:/bld/tudatpy_1596528182009/_build_env/Library/mingw-w64/include/c++/5.3.0/algorithm:62,
                 from C:/bld/tudatpy_1596528182009/_h_env/Library/include/boost/core/swap.hpp:25,
                 from C:/bld/tudatpy_1596528182009/_h_env/Library/include/boost/swap.hpp:15,
                 from C:/bld/tudatpy_1596528182009/_h_env/Library/include/boost/array.hpp:47,
                 from C:/bld/tudatpy_1596528182009/_h_env/Library/include/tudat/astro/aerodynamics/hypersonicLocalInclinationAnalysis.h:25,
                 from C:\bld\tudatpy_1596528182009\work\tudatpy\kernel\expose_aerodynamics.h:9,
                 from C:\bld\tudatpy_1596528182009\work\tudatpy\kernel\kernel.cpp:6:
C:/bld/tudatpy_1596528182009/_build_env/Library/mingw-w64/include/c++/5.3.0/cmath:1119:11: error: '::hypot' has not been declared
   using ::hypot;
           ^
mingw32-make.exe[2]: *** [tudatpy/CMakeFiles/kernel.dir/kernel/kernel.cpp.obj] Error 1
tudatpy\CMakeFiles\kernel.dir\build.make:81: recipe for target 'tudatpy/CMakeFiles/kernel.dir/kernel/kernel.cpp.obj' failed
CMakeFiles\Makefile2:111: recipe for target 'tudatpy/CMakeFiles/kernel.dir/all' failed
mingw32-make.exe[1]: *** [tudatpy/CMakeFiles/kernel.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2
Makefile:158: recipe for target 'all' failed
(%BUILD_PREFIX%) %SRC_DIR%\build>if errorlevel 1 exit 1 
Traceback (most recent call last):
  File "C:\Miniconda36-x64\Scripts\conda-build-script.py", line 10, in <module>
    sys.exit(main())
  File "C:\Miniconda36-x64\lib\site-packages\conda_build\cli\main_build.py", line 474, in main
    execute(sys.argv[1:])
  File "C:\Miniconda36-x64\lib\site-packages\conda_build\cli\main_build.py", line 465, in execute
    verify=args.verify, variants=args.variants)
  File "C:\Miniconda36-x64\lib\site-packages\conda_build\api.py", line 209, in build
    notest=notest, need_source_download=need_source_download, variants=variants)
  File "C:\Miniconda36-x64\lib\site-packages\conda_build\build.py", line 2864, in build_tree
    notest=notest,
  File "C:\Miniconda36-x64\lib\site-packages\conda_build\build.py", line 1962, in build
    windows.build(m, build_file, stats=build_stats, provision_only=provision_only)
  File "C:\Miniconda36-x64\lib\site-packages\conda_build\windows.py", line 294, in build
    check_call_env(cmd, cwd=m.config.work_dir, stats=stats, rewrite_stdout_env=rewrite_env)
  File "C:\Miniconda36-x64\lib\site-packages\conda_build\utils.py", line 404, in check_call_env
    return _func_defaulting_env_to_os_environ('call', *popenargs, **kwargs)
  File "C:\Miniconda36-x64\lib\site-packages\conda_build\utils.py", line 384, in _func_defaulting_env_to_os_environ
    raise subprocess.CalledProcessError(proc.returncode, _args)
subprocess.CalledProcessError: Command '['cmd.exe', '/d', '/c', 'conda_build.bat']' returned non-zero exit status 1.
Command exited with code 1

The relevant part to the error:

C:/bld/tudatpy_1596528182009/_build_env/Library/mingw-w64/include/c++/5.3.0/cmath:1119:11: error: '::hypot' has not been declared

It appears to be an issue with a conflict between cmath and python with regards to how the hypot library is used.

Stack overflow: ::hypot has not been declared

These are however not proper solutions, and are not feasible for the context of conda, where MinGW is provided precompiled by mysys2.