ufal / udpipe

UDPipe: Trainable pipeline for tokenizing, tagging, lemmatizing and parsing Universal Treebanks and other CoNLL-U files
Mozilla Public License 2.0
358 stars 75 forks source link

[OS X] pip install, fatal error: 'atomic' file not found #8

Closed evanmiltenburg closed 7 years ago

evanmiltenburg commented 7 years ago

I just tried to install this using pip install ufal.udpipe, but I got the following error:

    building 'ufal_udpipe' extension
    creating build/temp.macosx-10.6-x86_64-3.5
    creating build/temp.macosx-10.6-x86_64-3.5/udpipe
    /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda/include -arch x86_64 -Iudpipe/include -I/Applications/anaconda/include/python3.5m -c udpipe/udpipe.cpp -o build/temp.macosx-10.6-x86_64-3.5/udpipe/udpipe.o -std=c++11 -fvisibility=hidden -w
    udpipe/udpipe.cpp:7:10: fatal error: 'atomic' file not found
    #include <atomic>
             ^
    1 error generated.
    error: command '/usr/bin/clang' failed with exit status 1

    ----------------------------------------
Command "/Applications/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-qx1s775a/ufal.udpipe/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-03jnjoj8-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-qx1s775a/ufal.udpipe/

Stack Overflow suggests that this is due to a flag in the compiler. But I do not know how to fix this using pip.

foxik commented 7 years ago

The problem is that your compiler does not support C++11, which is required by UDPipe.(Unfortunately, such dependencies cannot be checked automatically through PyPI.)

On OS X, C++11 is officially supported only since 10.7 -- the 10.6 has some partial support (but, as you can see, it is missing the atomic header defined by C++11).

There are some ways how to get C++11 compiler on OS X (for example, https://github.com/cmangos/issues/wiki/Getting-a-C--11-compiler-on-Mac-OS-X or http://stackoverflow.com/questions/14494513/how-do-i-get-back-c0x-c11-support-for-mac-os-x-10-6-deployment-using-xcode-4), but I am not using OS X myself.

I am closing this because C++11 is hard requirement of UDPipe (we are using it heavily).

evanmiltenburg commented 7 years ago

I am not suggesting that you should change the compiler, but merely pointing out that it's difficult to install the parser on OS X. Suppose I install this compiler, I still won't be able to install the parser using pip, right? That would mean I'd have to compile the parser (or maybe use a pre-compiled binary) and install the python module separately. That's not an ideal situation for classroom use.

foxik commented 7 years ago

For OS X 10.7 or newer, the install should be working fine (resulting in better situation for classroom use :-) As 10.7 is more than 5 years old, I believe it is a reasonable requirement. (BTW, for Linux and Windows, the situation is even "worse" -- g++ 4.7 is a bit more than 4 years old, and on Windows we require Visual C++ 2015.)

If you get working C++11 compiler, you can instruct pip to use it by

env CC=path_to_gcc_or_clang CXX=path_to_g++_or_clang++ pip install ufal.udpipe
evanmiltenburg commented 7 years ago

I am currently running OS X 10.12, so I don't know why it doesn't work, then. I'll try the environment thing, thanks!

evanmiltenburg commented 7 years ago

Both don't work.

Environment: env CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ pip install ufal.udpipe

Error: udpipe/udpipe.cpp:6:10: fatal error: 'algorithm' file not found

Environment: env CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc CXX=/Applications/Xcode.app/Contents/Developer/usr/bin/g++ pip install ufal.udpipe

Error: udpipe/udpipe.cpp:7:10: fatal error: 'atomic' file not found

foxik commented 7 years ago

Oh, I assumed the 10.6 because of the original log (temp.macosx-10.6-x86_64-3.5) and because of missing atomic (which is consistent with non-C++11 compiler). If you use 10.12, I am reopening this. (Note that my build logs correctly show build/lib.macosx-10.12-intel-2.7.)

On a OS X of a colleague of mine (also 10.12) I installed the ufal.udpipe package without any problem -- just by running easy_install --user ufal.udpipe. He has only Python 2.7.

It seems something is wrong with your compiler installation, but I am quite unfamiliar with OS X. You could start by getting the UDPipe from the github and then trying running make from the src directory, to see if the compiler is working fine.

evanmiltenburg commented 7 years ago

Compiling from source works!

$ sudo make
Password:
clang++ -o .build/udpipe.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c udpipe.cpp
clang++ -o .build/utils-options.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c utils/options.cpp
clang++ -o .build/morphodita-derivator-derivation_formatter.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/derivator/derivation_formatter.cpp
clang++ -o .build/morphodita-derivator-derivator_dictionary.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/derivator/derivator_dictionary.cpp
clang++ -o .build/morphodita-morpho-czech_morpho.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/morpho/czech_morpho.cpp
clang++ -o .build/morphodita-morpho-english_morpho.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/morpho/english_morpho.cpp
clang++ -o .build/morphodita-morpho-english_morpho_guesser.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/morpho/english_morpho_guesser.cpp
clang++ -o .build/morphodita-morpho-external_morpho.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/morpho/external_morpho.cpp
clang++ -o .build/morphodita-morpho-generic_morpho.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/morpho/generic_morpho.cpp
clang++ -o .build/morphodita-morpho-morpho.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/morpho/morpho.cpp
clang++ -o .build/morphodita-morpho-morpho_statistical_guesser.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/morpho/morpho_statistical_guesser.cpp
clang++ -o .build/morphodita-morpho-tag_filter.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/morpho/tag_filter.cpp
clang++ -o .build/morphodita-tagger-tagger.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tagger/tagger.cpp
clang++ -o .build/morphodita-tagset_converter-identity_tagset_converter.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tagset_converter/identity_tagset_converter.cpp
clang++ -o .build/morphodita-tagset_converter-pdt_to_conll2009_tagset_converter.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tagset_converter/pdt_to_conll2009_tagset_converter.cpp
clang++ -o .build/morphodita-tagset_converter-strip_lemma_comment_tagset_converter.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tagset_converter/strip_lemma_comment_tagset_converter.cpp
clang++ -o .build/morphodita-tagset_converter-strip_lemma_id_tagset_converter.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tagset_converter/strip_lemma_id_tagset_converter.cpp
clang++ -o .build/morphodita-tagset_converter-tagset_converter.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tagset_converter/tagset_converter.cpp
clang++ -o .build/morphodita-tokenizer-czech_tokenizer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/czech_tokenizer.cpp
clang++ -o .build/morphodita-tokenizer-english_tokenizer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/english_tokenizer.cpp
clang++ -o .build/morphodita-tokenizer-generic_tokenizer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/generic_tokenizer.cpp
clang++ -o .build/morphodita-tokenizer-ragel_tokenizer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/ragel_tokenizer.cpp
clang++ -o .build/morphodita-tokenizer-tokenizer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/tokenizer.cpp
clang++ -o .build/morphodita-tokenizer-unicode_tokenizer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/unicode_tokenizer.cpp
clang++ -o .build/morphodita-tokenizer-vertical_tokenizer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/vertical_tokenizer.cpp
clang++ -o .build/morphodita-version-version.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/version/version.cpp
clang++ -o .build/parsito-configuration-configuration.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/configuration/configuration.cpp
clang++ -o .build/parsito-configuration-node_extractor.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/configuration/node_extractor.cpp
clang++ -o .build/parsito-configuration-value_extractor.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/configuration/value_extractor.cpp
clang++ -o .build/parsito-embedding-embedding.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/embedding/embedding.cpp
clang++ -o .build/parsito-network-neural_network.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/network/neural_network.cpp
clang++ -o .build/parsito-parser-parser.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/parser/parser.cpp
clang++ -o .build/parsito-parser-parser_nn.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/parser/parser_nn.cpp
clang++ -o .build/parsito-transition-transition.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/transition/transition.cpp
clang++ -o .build/parsito-transition-transition_system.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/transition/transition_system.cpp
clang++ -o .build/parsito-transition-transition_system_link2.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/transition/transition_system_link2.cpp
clang++ -o .build/parsito-transition-transition_system_projective.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/transition/transition_system_projective.cpp
clang++ -o .build/parsito-transition-transition_system_swap.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/transition/transition_system_swap.cpp
clang++ -o .build/parsito-tree-tree.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/tree/tree.cpp
clang++ -o .build/parsito-tree-tree_format.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/tree/tree_format.cpp
clang++ -o .build/parsito-tree-tree_format_conllu.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/tree/tree_format_conllu.cpp
clang++ -o .build/parsito-version-version.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/version/version.cpp
clang++ -o .build/unilib-unicode.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c unilib/unicode.cpp
clang++ -o .build/unilib-utf8.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c unilib/utf8.cpp
clang++ -o .build/unilib-version.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c unilib/version.cpp
clang++ -o .build/utils-compressor_load.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c utils/compressor_load.cpp
clang++ -o .build/model-evaluator.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c model/evaluator.cpp
clang++ -o .build/model-model.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c model/model.cpp
clang++ -o .build/model-model_morphodita_parsito.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c model/model_morphodita_parsito.cpp
clang++ -o .build/model-pipeline.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c model/pipeline.cpp
clang++ -o .build/morphodita-morpho-generic_morpho_encoder.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/morpho/generic_morpho_encoder.cpp
clang++ -o .build/morphodita-morpho-morpho_statistical_guesser_encoder.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/morpho/morpho_statistical_guesser_encoder.cpp
clang++ -o .build/morphodita-morpho-morpho_statistical_guesser_trainer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/morpho/morpho_statistical_guesser_trainer.cpp
clang++ -o .build/morphodita-morpho-raw_morpho_dictionary_reader.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/morpho/raw_morpho_dictionary_reader.cpp
clang++ -o .build/morphodita-tokenizer-generic_tokenizer_factory.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/generic_tokenizer_factory.cpp
clang++ -o .build/morphodita-tokenizer-generic_tokenizer_factory_encoder.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/generic_tokenizer_factory_encoder.cpp
clang++ -o .build/morphodita-tokenizer-gru_tokenizer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/gru_tokenizer.cpp
clang++ -o .build/morphodita-tokenizer-gru_tokenizer_factory.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/gru_tokenizer_factory.cpp
clang++ -o .build/morphodita-tokenizer-gru_tokenizer_network.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/gru_tokenizer_network.cpp
clang++ -o .build/morphodita-tokenizer-gru_tokenizer_trainer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/gru_tokenizer_trainer.cpp
clang++ -o .build/morphodita-tokenizer-tokenizer_factory.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c morphodita/tokenizer/tokenizer_factory.cpp
clang++ -o .build/parsito-embedding-embedding_encode.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/embedding/embedding_encode.cpp
clang++ -o .build/parsito-network-neural_network_trainer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/network/neural_network_trainer.cpp
clang++ -o .build/parsito-parser-parser_nn_trainer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c parsito/parser/parser_nn_trainer.cpp
clang++ -o .build/sentence-input_format.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c sentence/input_format.cpp
clang++ -o .build/sentence-output_format.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c sentence/output_format.cpp
clang++ -o .build/sentence-sentence.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c sentence/sentence.cpp
clang++ -o .build/tokenizer-detokenizer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c tokenizer/detokenizer.cpp
clang++ -o .build/tokenizer-multiword_splitter.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c tokenizer/multiword_splitter.cpp
clang++ -o .build/tokenizer-multiword_splitter_trainer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c tokenizer/multiword_splitter_trainer.cpp
clang++ -o .build/trainer-trainer.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c trainer/trainer.cpp
clang++ -o .build/trainer-trainer_morphodita_parsito.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c trainer/trainer_morphodita_parsito.cpp
clang++ -o .build/trainer-training_failure.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c trainer/training_failure.cpp
clang++ -o .build/utils-compressor_save.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c utils/compressor_save.cpp
clang++ -o .build/version-version.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c version/version.cpp
clang++ -o udpipe -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. .build/udpipe.osx-clang-normal.o .build/utils-options.osx-clang-normal.o .build/morphodita-derivator-derivation_formatter.osx-clang-normal.o .build/morphodita-derivator-derivator_dictionary.osx-clang-normal.o .build/morphodita-morpho-czech_morpho.osx-clang-normal.o .build/morphodita-morpho-english_morpho.osx-clang-normal.o .build/morphodita-morpho-english_morpho_guesser.osx-clang-normal.o .build/morphodita-morpho-external_morpho.osx-clang-normal.o .build/morphodita-morpho-generic_morpho.osx-clang-normal.o .build/morphodita-morpho-morpho.osx-clang-normal.o .build/morphodita-morpho-morpho_statistical_guesser.osx-clang-normal.o .build/morphodita-morpho-tag_filter.osx-clang-normal.o .build/morphodita-tagger-tagger.osx-clang-normal.o .build/morphodita-tagset_converter-identity_tagset_converter.osx-clang-normal.o .build/morphodita-tagset_converter-pdt_to_conll2009_tagset_converter.osx-clang-normal.o .build/morphodita-tagset_converter-strip_lemma_comment_tagset_converter.osx-clang-normal.o .build/morphodita-tagset_converter-strip_lemma_id_tagset_converter.osx-clang-normal.o .build/morphodita-tagset_converter-tagset_converter.osx-clang-normal.o .build/morphodita-tokenizer-czech_tokenizer.osx-clang-normal.o .build/morphodita-tokenizer-english_tokenizer.osx-clang-normal.o .build/morphodita-tokenizer-generic_tokenizer.osx-clang-normal.o .build/morphodita-tokenizer-ragel_tokenizer.osx-clang-normal.o .build/morphodita-tokenizer-tokenizer.osx-clang-normal.o .build/morphodita-tokenizer-unicode_tokenizer.osx-clang-normal.o .build/morphodita-tokenizer-vertical_tokenizer.osx-clang-normal.o .build/morphodita-version-version.osx-clang-normal.o .build/parsito-configuration-configuration.osx-clang-normal.o .build/parsito-configuration-node_extractor.osx-clang-normal.o .build/parsito-configuration-value_extractor.osx-clang-normal.o .build/parsito-embedding-embedding.osx-clang-normal.o .build/parsito-network-neural_network.osx-clang-normal.o .build/parsito-parser-parser.osx-clang-normal.o .build/parsito-parser-parser_nn.osx-clang-normal.o .build/parsito-transition-transition.osx-clang-normal.o .build/parsito-transition-transition_system.osx-clang-normal.o .build/parsito-transition-transition_system_link2.osx-clang-normal.o .build/parsito-transition-transition_system_projective.osx-clang-normal.o .build/parsito-transition-transition_system_swap.osx-clang-normal.o .build/parsito-tree-tree.osx-clang-normal.o .build/parsito-tree-tree_format.osx-clang-normal.o .build/parsito-tree-tree_format_conllu.osx-clang-normal.o .build/parsito-version-version.osx-clang-normal.o .build/unilib-unicode.osx-clang-normal.o .build/unilib-utf8.osx-clang-normal.o .build/unilib-version.osx-clang-normal.o .build/utils-compressor_load.osx-clang-normal.o .build/model-evaluator.osx-clang-normal.o .build/model-model.osx-clang-normal.o .build/model-model_morphodita_parsito.osx-clang-normal.o .build/model-pipeline.osx-clang-normal.o .build/morphodita-morpho-generic_morpho_encoder.osx-clang-normal.o .build/morphodita-morpho-morpho_statistical_guesser_encoder.osx-clang-normal.o .build/morphodita-morpho-morpho_statistical_guesser_trainer.osx-clang-normal.o .build/morphodita-morpho-raw_morpho_dictionary_reader.osx-clang-normal.o .build/morphodita-tokenizer-generic_tokenizer_factory.osx-clang-normal.o .build/morphodita-tokenizer-generic_tokenizer_factory_encoder.osx-clang-normal.o .build/morphodita-tokenizer-gru_tokenizer.osx-clang-normal.o .build/morphodita-tokenizer-gru_tokenizer_factory.osx-clang-normal.o .build/morphodita-tokenizer-gru_tokenizer_network.osx-clang-normal.o .build/morphodita-tokenizer-gru_tokenizer_trainer.osx-clang-normal.o .build/morphodita-tokenizer-tokenizer_factory.osx-clang-normal.o .build/parsito-embedding-embedding_encode.osx-clang-normal.o .build/parsito-network-neural_network_trainer.osx-clang-normal.o .build/parsito-parser-parser_nn_trainer.osx-clang-normal.o .build/sentence-input_format.osx-clang-normal.o .build/sentence-output_format.osx-clang-normal.o .build/sentence-sentence.osx-clang-normal.o .build/tokenizer-detokenizer.osx-clang-normal.o .build/tokenizer-multiword_splitter.osx-clang-normal.o .build/tokenizer-multiword_splitter_trainer.osx-clang-normal.o .build/trainer-trainer.osx-clang-normal.o .build/trainer-trainer_morphodita_parsito.osx-clang-normal.o .build/trainer-training_failure.osx-clang-normal.o .build/utils-compressor_save.osx-clang-normal.o .build/version-version.osx-clang-normal.o
foxik commented 7 years ago

Then, could you please try env CC=clang CXX=clang++ pip install ufal.udpipe?

evanmiltenburg commented 7 years ago

It doesn't work:

udpipe/udpipe.cpp:7:10: fatal error: 'atomic' file not found
#include <atomic>
         ^
1 error generated.
error: command 'clang' failed with exit status 1
foxik commented 7 years ago

Ok, we have two compiling commands -- one

/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda/include -arch x86_64 -Iudpipe/include -I/Applications/anaconda/include/python3.5m -c udpipe/udpipe.cpp -o build/temp.macosx-10.6-x86_64-3.5/udpipe/udpipe.o -std=c++11 -fvisibility=hidden -w

from the failing compilation and second

clang++ -o .build/model-model.osx-clang-normal.o -MMD -MP -std=c++11 -W -Wall -mtune=generic -fvisibility=hidden -mmacosx-version-min=10.7 -stdlib=libc++ -O3 -I. -c model/model.cpp

Could you please try figuring out what is the problematic part? I assume running the following the src directory will compile:

clang++ -std=c++11 -stdlib=libc++ model/model.c -I. -c -o tmp_model.o

Could you then try what from the original command line make it fail? My first guesses are clang instead of clang++, or missing -stdlib=libc++ (leave the model/model.c and all after it intact; you can also ignore all -W* and -w switches, which just fiddle with warnings).

But maybe pip or anaconda (which I do not know anything about) somehow affects sompiler environment?

evanmiltenburg commented 7 years ago

There is no model.c.

$ sudo clang++ -std=c++11 -stdlib=libc++ model/model.c -I. -c -o tmp_model.o
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
clang: error: no such file or directory: 'model/model.c'
clang: error: no input files

But this works (no output):

sudo clang++ -std=c++11 -stdlib=libc++ model/model.cpp -I. -c -o tmp_model.o

(It does work with Anaconda on Ubuntu btw.)

foxik commented 7 years ago

Oh, I am sorry -- the source is model/model.cpp.

evanmiltenburg commented 7 years ago

I'm not sure what you're asking. Here's what I tried:

Emiels-MacBook-Pro:src Emiel$ sudo clang -std=c++11 model/model.cpp -I. -c -o tmp_model.o
Emiels-MacBook-Pro:src Emiel$ sudo clang++ -std=c++11 -stdlib=libc++  model/model.cpp -I. -c -o tmp_model.o
Emiels-MacBook-Pro:src Emiel$ sudo clang++ -stdlib=libc++  model/model.cpp -I. -c -o tmp_model.o
In file included from model/model.cpp:13:
In file included from model/model_morphodita_parsito.h:16:
./morphodita/tagger/tagger.h:34:96: error: a space is required between consecutive right angle brackets (use '> >')
  virtual void tag_analyzed(const vector<string_piece>& forms, const vector<vector<tagged_lemma>>& analyses, vector<int>& tags) const = 0;
                                                                                               ^~
                                                                                               > >
In file included from model/model.cpp:13:
In file included from model/model_morphodita_parsito.h:20:
In file included from ./utils/threadsafe_stack.h:12:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic:543:2: error: <atomic> is not implemented
#error <atomic> is not implemented
 ^
In file included from model/model.cpp:13:
In file included from model/model_morphodita_parsito.h:20:
./utils/threadsafe_stack.h:31:22: error: a space is required between consecutive right angle brackets (use '> >')
  vector<unique_ptr<T>> stack;
                     ^~
                     > >
./utils/threadsafe_stack.h:32:3: error: unknown type name 'atomic_flag'
  atomic_flag lock = ATOMIC_FLAG_INIT;
  ^
./utils/threadsafe_stack.h:32:20: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions]
  atomic_flag lock = ATOMIC_FLAG_INIT;
                   ^
./utils/threadsafe_stack.h:41:28: error: use of undeclared identifier 'memory_order_acquire'
  while (lock.test_and_set(memory_order_acquire)) {}
                           ^
./utils/threadsafe_stack.h:43:14: error: use of undeclared identifier 'memory_order_release'
  lock.clear(memory_order_release);
             ^
./utils/threadsafe_stack.h:50:28: error: use of undeclared identifier 'memory_order_acquire'
  while (lock.test_and_set(memory_order_acquire)) {}
                           ^
./utils/threadsafe_stack.h:55:14: error: use of undeclared identifier 'memory_order_release'
  lock.clear(memory_order_release);
             ^
In file included from model/model.cpp:13:
model/model_morphodita_parsito.h:27:68: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
  virtual input_format* new_tokenizer(const string& options) const override;
                                                                   ^
model/model_morphodita_parsito.h:28:77: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
  virtual bool tag(sentence& s, const string& options, string& error) const override;
                                                                            ^
model/model_morphodita_parsito.h:29:79: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
  virtual bool parse(sentence& s, const string& options, string& error) const override;
                                                                              ^
model/model_morphodita_parsito.h:50:63: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
    virtual bool read_block(istream& is, string& block) const override;
                                                              ^
model/model_morphodita_parsito.h:51:70: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
    virtual void set_text(string_piece text, bool make_copy = false) override;
                                                                     ^
model/model_morphodita_parsito.h:52:60: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
    virtual bool next_sentence(sentence& s, string& error) override;
                                                           ^
7 warnings and 8 errors generated.
foxik commented 7 years ago

Thanks! Both my guesses seem to be wrong. (The third fail is expected, and -std=c++11 is present in the original failing command.)

The command from the original report however failed. I modified it by replacing the source file by model/model.cpp:

/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda/include -arch x86_64 -I/Applications/anaconda/include/python3.5m -c model/model.cpp -o tmp_model.o -std=c++11 -fvisibility=hidden

Could you please try that? It should fail (assumming the original report log was produced on your computer). If it does, could you find out what to change so that the compilation succeeds?

BTW, using sudo seems an overkill on just compiling (although at this point some of the output files are already owned by root and will not be writable by a regular user).

evanmiltenburg commented 7 years ago

Ok, I just copy-pasted that code. Here is the result:

$ sudo /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda/include -arch x86_64 -I/Applications/anaconda/include/python3.5m -c model/model.cpp -o tmp_model.o -std=c++11 -fvisibility=hidden
Password:
In file included from model/model.cpp:12:
model/model.h:12:10: fatal error: 'common.h' file not found
#include "common.h"
         ^
1 error generated.
foxik commented 7 years ago

If you are still not tired, please try adding -I. to the previous command, i.e.:

/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda/include -arch x86_64 -I/Applications/anaconda/include/python3.5m -c model/model.cpp -o tmp_model.o -I. -std=c++11 -fvisibility=hidden
evanmiltenburg commented 7 years ago

That one worked!

foxik commented 7 years ago

Ouch -- it should have not. It is nearly the same as the command in the original error report. If it worked now, I see no reason why it was not working during pip install.

To be sure, could you please repeat the pip install -v -v --user ufal.udpipe and post the build logs?

evanmiltenburg commented 7 years ago

Here's the log:

$ pip install -v -v --user ufal.udpipe
Collecting ufal.udpipe
  1 location(s) to search for versions of ufal.udpipe:
  * https://pypi.python.org/simple/ufal-udpipe/
  Getting page https://pypi.python.org/simple/ufal-udpipe/
  Looking up "https://pypi.python.org/simple/ufal-udpipe/" in the cache
  Current age based on date: 45
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 600
  The response is "fresh", returning cached response
  600 > 45
  Analyzing links from page https://pypi.python.org/simple/ufal-udpipe/
    Found link https://pypi.python.org/packages/b3/b5/c49e891fc0011dfd1913d20fa0888169e3276ecaf738b87bef6bbd7bdb81/ufal.udpipe-1.0.0.1.tar.gz#md5=70eaadca6559bc347a7d4f3128fa0aec (from https://pypi.python.org/simple/ufal-udpipe/), version: 1.0.0.1
  Using version 1.0.0.1 (newest of versions: 1.0.0.1)
  Looking up "https://pypi.python.org/packages/b3/b5/c49e891fc0011dfd1913d20fa0888169e3276ecaf738b87bef6bbd7bdb81/ufal.udpipe-1.0.0.1.tar.gz" in the cache
  Current age based on date: 32625
  Freshness lifetime from max-age: 31557600
  The response is "fresh", returning cached response
  31557600 > 32625
  Using cached ufal.udpipe-1.0.0.1.tar.gz
  Downloading from URL https://pypi.python.org/packages/b3/b5/c49e891fc0011dfd1913d20fa0888169e3276ecaf738b87bef6bbd7bdb81/ufal.udpipe-1.0.0.1.tar.gz#md5=70eaadca6559bc347a7d4f3128fa0aec (from https://pypi.python.org/simple/ufal-udpipe/)
  Running setup.py (path:/private/var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/pip-build-dayr9hkl/ufal.udpipe/setup.py) egg_info for package ufal.udpipe
    Running command python setup.py egg_info
    running egg_info
    creating pip-egg-info/ufal.udpipe.egg-info
    writing dependency_links to pip-egg-info/ufal.udpipe.egg-info/dependency_links.txt
    writing top-level names to pip-egg-info/ufal.udpipe.egg-info/top_level.txt
    writing pip-egg-info/ufal.udpipe.egg-info/PKG-INFO
    writing manifest file 'pip-egg-info/ufal.udpipe.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'pip-egg-info/ufal.udpipe.egg-info/SOURCES.txt'
    writing manifest file 'pip-egg-info/ufal.udpipe.egg-info/SOURCES.txt'
  Source in /private/var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/pip-build-dayr9hkl/ufal.udpipe has version 1.0.0.1, which satisfies requirement ufal.udpipe from https://pypi.python.org/packages/b3/b5/c49e891fc0011dfd1913d20fa0888169e3276ecaf738b87bef6bbd7bdb81/ufal.udpipe-1.0.0.1.tar.gz#md5=70eaadca6559bc347a7d4f3128fa0aec
Building wheels for collected packages: ufal.udpipe
  Running setup.py bdist_wheel for ufal.udpipe ...   Destination directory: /var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/tmpm15o_omypip-wheel-
  Running command /Applications/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/pip-build-dayr9hkl/ufal.udpipe/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/tmpm15o_omypip-wheel- --python-tag cp35
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.6-x86_64-3.5
  creating build/lib.macosx-10.6-x86_64-3.5/ufal
  copying ufal/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/ufal
  copying ufal/udpipe.py -> build/lib.macosx-10.6-x86_64-3.5/ufal
  running build_ext
  building 'ufal_udpipe' extension
  creating build/temp.macosx-10.6-x86_64-3.5
  creating build/temp.macosx-10.6-x86_64-3.5/udpipe
  /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda/include -arch x86_64 -Iudpipe/include -I/Applications/anaconda/include/python3.5m -c udpipe/udpipe.cpp -o build/temp.macosx-10.6-x86_64-3.5/udpipe/udpipe.o -std=c++11 -fvisibility=hidden -w
  udpipe/udpipe.cpp:7:10: fatal error: 'atomic' file not found
  #include <atomic>
           ^
  1 error generated.
  error: command '/usr/bin/clang' failed with exit status 1
error
  Failed building wheel for ufal.udpipe
  Running setup.py clean for ufal.udpipe
  Running command /Applications/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/pip-build-dayr9hkl/ufal.udpipe/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" clean --all
  running clean
  removing 'build/temp.macosx-10.6-x86_64-3.5' (and everything under it)
  removing 'build/lib.macosx-10.6-x86_64-3.5' (and everything under it)
  'build/bdist.macosx-10.6-x86_64' does not exist -- can't clean it
  'build/scripts-3.5' does not exist -- can't clean it
  removing 'build'
Failed to build ufal.udpipe
Installing collected packages: ufal.udpipe
  Running setup.py install for ufal.udpipe ...     Running command /Applications/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/pip-build-dayr9hkl/ufal.udpipe/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/pip-e2x5qfme-record/install-record.txt --single-version-externally-managed --compile --user --prefix=
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.6-x86_64-3.5
    creating build/lib.macosx-10.6-x86_64-3.5/ufal
    copying ufal/__init__.py -> build/lib.macosx-10.6-x86_64-3.5/ufal
    copying ufal/udpipe.py -> build/lib.macosx-10.6-x86_64-3.5/ufal
    running build_ext
    building 'ufal_udpipe' extension
    creating build/temp.macosx-10.6-x86_64-3.5
    creating build/temp.macosx-10.6-x86_64-3.5/udpipe
    /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda/include -arch x86_64 -Iudpipe/include -I/Applications/anaconda/include/python3.5m -c udpipe/udpipe.cpp -o build/temp.macosx-10.6-x86_64-3.5/udpipe/udpipe.o -std=c++11 -fvisibility=hidden -w
    udpipe/udpipe.cpp:7:10: fatal error: 'atomic' file not found
    #include <atomic>
             ^
    1 error generated.
    error: command '/usr/bin/clang' failed with exit status 1
error
Cleaning up...
  Removing source in /private/var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/pip-build-dayr9hkl/ufal.udpipe
Command "/Applications/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/pip-build-dayr9hkl/ufal.udpipe/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/pip-e2x5qfme-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /private/var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/pip-build-dayr9hkl/ufal.udpipe/
Exception information:
Traceback (most recent call last):
  File "/Applications/anaconda/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Applications/anaconda/lib/python3.5/site-packages/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/Applications/anaconda/lib/python3.5/site-packages/pip/req/req_set.py", line 742, in install
    **kwargs
  File "/Applications/anaconda/lib/python3.5/site-packages/pip/req/req_install.py", line 880, in install
    spinner=spinner,
  File "/Applications/anaconda/lib/python3.5/site-packages/pip/utils/__init__.py", line 718, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "/Applications/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/pip-build-dayr9hkl/ufal.udpipe/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/pip-e2x5qfme-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /private/var/folders/p0/dfmctn613mj8l2q3rpksnsz80000gn/T/pip-build-dayr9hkl/ufal.udpipe/
foxik commented 7 years ago

Thank you very much for your cooperation.

Unfortunately, I am unsure how I can help you any further. In the pip logs, the command

/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda/include -arch x86_64 -Iudpipe/include -I/Applications/anaconda/include/python3.5m -c udpipe/udpipe.cpp -o build/temp.macosx-10.6-x86_64-3.5/udpipe/udpipe.o -std=c++11 -fvisibility=hidden -w

fails, while manually running

/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda/include -arch x86_64 -I/Applications/anaconda/include/python3.5m -c model/model.cpp -o tmp_model.o -I. -std=c++11 -fvisibility=hidden

is fine -- but the commands are nearly the same. I only have wild theories left -- it is possible that the pip install also modifies some environmental variables, or that the sudo which you seem to be using in only one of the commands interacts, or the pip install runs in a chroot...

Maybe someone more experienced with PyPI could help here...

evanmiltenburg commented 7 years ago

Posted to Reddit! I hope someone knows a good fix :)

graingert commented 7 years ago

You should make macOS, windows and manylinux1 wheels available so that your users don't need to compile this library themselves

foxik commented 7 years ago

@graingert The wheels would definitely be more comfortable for the user. However, I am taking care of several projects each having four or more language bindings, so I cannot spend as much time with Python bindings as I would like.

The last time I looked into binary platform wheels, I remeber finding out that I would have to build very many platform wheels (the first example on PyPI I tried, https://pypi.python.org/pypi/PyYAML , has 6 Windows binary wheels; plus you would need ~6 more Linux and ~3 OS X, which is quite a lot). Or is there some better way?

Also until now, I was quite happy with source PyPI packages -- the C++ extension requires only C++11 standard compiler, no additional libraries, and worked for quite a lot of people.

foxik commented 7 years ago

Closing, feel free to reopen if you have any additional information.

geovedi commented 7 years ago

I managed to have this compiled on OSX with the following command

$ CFLAGS='-stdlib=libc++'  pip install ufal.udpipe
evanmiltenburg commented 7 years ago

Thanks! This works for me as well, so it might be a good idea to add this to the documentation.

geovedi commented 7 years ago

@foxik, @evanmiltenburg: could you test this?

diff --git a/releases/pypi/setup.py b/releases/pypi/setup.py
index 74e60f1..c979ce4 100644
--- a/releases/pypi/setup.py
+++ b/releases/pypi/setup.py
@@ -1,8 +1,14 @@
+from sys import platform
 from distutils.core import setup, Extension

 with open('README') as file:
     readme = file.read()

+if platform == "darwin":
+    extra_compile_args = ['-std=c++11', '-stdlib=libc++', '-fvisibility=hidden', '-w']
+else:
+    extra_compile_args = ['-std=c++11', '-fvisibility=hidden', '-w']
+
 setup(
     name             = 'ufal.udpipe',
     version          = '',
@@ -18,7 +24,7 @@ setup(
         ['udpipe/udpipe.cpp', 'udpipe/udpipe_python.cpp'],
         language = 'c++',
         include_dirs = ['udpipe/include'],
-        extra_compile_args = ['-std=c++11', '-fvisibility=hidden', '-w'])],
+        extra_compile_args = extra_compile_args)],
     classifiers = [
         'Development Status :: 5 - Production/Stable',
         'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
foxik commented 7 years ago

I had the impression that stdlib=libc++ should be default since Maverick; but I am definitely fine adding it (since I think it would be used anyway) -- I just released PyPI package version 1.1.0.2.