iqbal-lab-org / gramtools

Genome inference from a population reference graph
MIT License
92 stars 15 forks source link

pip3 install => build.cpp:68:1: error: expected '}' at end of input #99

Closed tseemann closed 6 years ago

tseemann commented 6 years ago

Any ideas?

   Scanning dependencies of target gramtools
    [ 47%] Building CXX object libgramtools/CMakeFiles/gramtools.dir/src/common/utils.cpp.o
    [ 48%] Building CXX object libgramtools/CMakeFiles/gramtools.dir/src/common/timer_report.cpp.o
    [ 49%] Building CXX object libgramtools/CMakeFiles/gramtools.dir/src/search/search.cpp.o
    /tmp/linuxbrew/pip-hx3exc5r-build/libgramtools/src/search/search.cpp: In function 'std::__cxx11::string serialize_search_state(const SearchState&)':
    /tmp/linuxbrew/pip-hx3exc5r-build/libgramtools/src/search/search.cpp:675:41: warning: switch condition has type bool [-Wswitch-bool]
         switch (search_state.cache_populated) {
                                             ^
    [ 50%] Building CXX object libgramtools/CMakeFiles/gramtools.dir/src/build/build.cpp.o
    In file included from /tmp/linuxbrew/pip-hx3exc5r-build/libgramtools/src/build/build.cpp:10:0:
    /tmp/linuxbrew/pip-hx3exc5r-build/libgramtools/include/build/build.hpp:4:19: error: expected '{' before '::' token
     namespace commands::build {
                       ^
    /tmp/linuxbrew/pip-hx3exc5r-build/libgramtools/include/build/build.hpp:4:21: error: 'build' in namespace '::' does not name a type
     namespace commands::build {
                         ^
    /tmp/linuxbrew/pip-hx3exc5r-build/libgramtools/src/build/build.cpp:13:16: error: 'commands::build' has not been declared
     void commands::build::run(const Parameters &parameters) {
                    ^
    /tmp/linuxbrew/pip-hx3exc5r-build/libgramtools/src/build/build.cpp:68:1: error: expected '}' at end of input
     }
     ^
    make[2]: *** [libgramtools/CMakeFiles/gramtools.dir/build.make:102: libgramtools/CMakeFiles/gramtools.dir/src/build/build.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:103: libgramtools/CMakeFiles/gramtools.dir/all] Error 2
    make: *** [Makefile:84: all] Error 2
    error: [Errno 2] No such file or directory: '/tmp/linuxbrew/pip-hx3exc5r-build/cmake-build-debug/libgramtools/tests/test_main': '/tmp/linuxbrew/pip-hx3exc5r-build/cmake-build-debug/libgramtools/tests/test_main'

    ----------------------------------------
Command "/home/linuxbrew/.linuxbrew/opt/python/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/linuxbrew/pip-hx3exc5r-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/linuxbrew/pip-3pi1_8nx-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/linuxbrew/pip-hx3exc5r-build/
iqbal-lab commented 6 years ago

The upshot of our pip experience is we are building stand alone executable binaries. In the middle of that process @tseemann

ffranr commented 6 years ago

@tseemann Thank you for taking the time to point out this problem!

I think this occurs because the C++ compiler used for building the backend does not support C++17.

The solution to this problem has two parts: 1) CMake ensures compiler handles C++17 (https://github.com/iqbal-lab-org/gramtools/issues/100) 2) Release includes pre built backend binaries (https://github.com/iqbal-lab-org/gramtools/issues/101)

tseemann commented 6 years ago

Ok, yeah I don't have a C++17 capable compiler by default. If i get time i'll try brew install gcc@7.0 and see how I go. But I suspect i'll get problems integrating into my python setup.

ffranr commented 6 years ago

Solving #101 (Release includes pre built backend binaries) will take a bit more time than expected. #100 (CMake ensures compiler handles C++17) has been implemented and I think that it should be enough to provide an informative error. With that, I'll close this issue and leave #101 open.