airinnova / pytornado

:airplane: An implementation of the vortex-lattice method (VLM)
https://pytornado.readthedocs.io/
Apache License 2.0
25 stars 7 forks source link

Fix MacOS installation and testing #5

Open aarondettmann opened 4 years ago

aarondettmann commented 4 years ago

Compilation on MacOS fails. Running pip install -e . yields

     ERROR: Command errored out with exit status 1:
     command: .../bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'...pytornado/setup.py'"'"'; __file__='"'"'...pytornado/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: ...pytornado/
    Complete output (25 lines):
    running develop
    running egg_info
    writing src/lib/pytornado.egg-info/PKG-INFO
    writing dependency_links to src/lib/pytornado.egg-info/dependency_links.txt
    writing requirements to src/lib/pytornado.egg-info/requires.txt
    writing top-level names to src/lib/pytornado.egg-info/top_level.txt
    reading manifest file 'src/lib/pytornado.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'src/lib/pytornado.egg-info/SOURCES.txt'
    running build_ext
    building 'pytornado.aero.c_vlm' extension
    creating build
    creating build/temp.macosx-10.7-x86_64-3.6
    creating build/temp.macosx-10.7-x86_64-3.6/src
    creating build/temp.macosx-10.7-x86_64-3.6/src/lib
    creating build/temp.macosx-10.7-x86_64-3.6/src/lib/pytornado
    creating build/temp.macosx-10.7-x86_64-3.6/src/lib/pytornado/aero

    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I.../include -arch x86_64 -I.../include -arch x86_64 -Isrc/lib/pytornado/aero/ -I/usr/include/python3.6 -I.../lib/python3.6/site-packages/numpy/core/include/numpy -I.../lib/python3.6/site-packages/numpy/core/include -I.../include/python3.6m -c src/lib/pytornado/aero/c_vlm.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/lib/pytornado/aero/c_vlm.o
    warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    In file included from src/lib/pytornado/aero/c_vlm.cpp:39:
    src/lib/pytornado/aero/c_vlm.h:53:10: fatal error: 'iostream' file not found
    #include <iostream>
             ^~~~~~~~~~
    1 warning and 1 error generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: .../bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'...pytornado/setup.py'"'"'; __file__='"'"'...pytornado/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.
aarondettmann commented 4 years ago

TODO

aarondettmann commented 4 years ago
aidanjungo commented 4 years ago

I still get the error "error: command 'gcc' failed with exit status 1" when I try to install PyTornado on macOS Catalina. I tried "pip install pytornado" or locally after cloning the repository "pip install . " Should I do something special to make it works?

aarondettmann commented 4 years ago

Hi Aidan, thanks for reporting this. Unfortunately, I cannot help too much with this since I don't have any MacOS system to test this on myself. As you may have seen in my comment above, I have extended the TravisCI tests, so I know that PyTornado should be able to run on MacOS.

Btw: pip install pytornado still does not work (since we do not provide any binaries at the moment). We should perhaps find a solution for this or change the PyPI package with some dummy package, and update/clarify the documentation...

aidanjungo commented 4 years ago

Hi Aaron, I redid some tests, but the error I get is exactly the same that I got in September (first message of this issue). Apparently it is a common problem with the "#include ", but I cannot find a way to solve it with Catalina OS. @fei-von-sivers did you also have this error during your installation?

aidanjungo commented 4 years ago

I think I solve the problem, before I was trying to install pyTornado from a Conda environment, because of that it could not access to the gcc library of my Mac. So, I deactivate the Conda environment before I install pyTornado. I also install (but not sure if made a difference) "Command line Tools for Xcode" which is a lighter version of Xcode and it contains the GCC compiler. @aarondettmann I think now you can close this issue :) Thanks