redpony / cdec

Decoder, aligner, and model optimizer for statistical machine translation and other structured prediction models based on (mostly) context-free formalisms
http://cdec-decoder.org/
Apache License 2.0
183 stars 77 forks source link

cdec/extractor/backoff_sampler.cc:24:18: error: ‘round’ was not declared in this scope #99

Open BramVanroy opened 5 years ago

BramVanroy commented 5 years ago

Trying to build with gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0. Yet another build issue.

[ 88%] Building CXX object extractor/CMakeFiles/extractor.dir/backoff_sampler.cc.o
/tmp/cdec/extractor/backoff_sampler.cc: In member function ‘virtual extractor::PhraseLocation extractor::BackoffSampler::Sample(const extractor::PhraseLocation&, const std::unordered_set<int>&) const’:
/tmp/cdec/extractor/backoff_sampler.cc:24:18: error: ‘round’ was not declared in this scope
     int sample = round(i);
                  ^~~~~
/tmp/cdec/extractor/backoff_sampler.cc:24:18: note: suggested alternative: ‘rand’
     int sample = round(i);
                  ^~~~~
                  rand
extractor/CMakeFiles/extractor.dir/build.make:86: recipe for target 'extractor/CMakeFiles/extractor.dir/backoff_sampler.cc.o' failed
make[2]: *** [extractor/CMakeFiles/extractor.dir/backoff_sampler.cc.o] Error 1
CMakeFiles/Makefile2:3227: recipe for target 'extractor/CMakeFiles/extractor.dir/all' failed
make[1]: *** [extractor/CMakeFiles/extractor.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2
N0rbert commented 5 years ago

Confirmed on Ubuntu 18.04.1 LTS amd64 (following this question on AskUbuntu). Steps to reproduce:

sudo apt-get install cmake git build-essential libboost-dev libboost-regex-dev libboost-filesystem-dev libboost-serialization-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libeigen3-dev libbz2-dev liblzma-dev flex libgtest-dev
cd ~/Downloads
git clone https://github.com/redpony/cdec.git
cd cdec
cmake .
make -j4

Errors:

$ make
[  6%] Built target utils
[  7%] Built target atools
[  8%] Built target weights_test
[  8%] Built target dedup_corpus
[  8%] Built target ts
[  9%] Built target logval_test
[ 10%] Built target sv_test
[ 11%] Built target dict_test
[ 12%] Built target stringlib_test
[ 13%] Built target m_test
[ 13%] Built target small_vector_test
[ 16%] Built target klm_util_double
[ 21%] Built target klm_util
[ 22%] Built target cat_compressed
[ 23%] Built target klm_util_stream
[ 28%] Built target klm
[ 28%] Built target ngram_query
[ 28%] Built target build_binary
[ 29%] Built target dump_counts
[ 32%] Built target lmplz
[ 34%] Built target ksearch
[ 39%] Built target mteval
[ 39%] Built target fast_score
[ 39%] Built target scorer_test
[ 39%] Built target mbr_kbest
[ 59%] Built target libcdec
[ 60%] Built target cdec
[ 61%] Built target trule_test
[ 62%] Built target hg_test
[ 63%] Built target parser_test
[ 63%] Built target grammar_test
[ 63%] Built target t2s_test
[ 64%] Built target lbfgs
[ 64%] Built target ll_test
[ 65%] Built target sentserver
[ 66%] Built target grammar_convert
[ 68%] Built target training_utils
[ 69%] Built target sentclient
[ 70%] Built target mpi_online_optimize
[ 71%] Built target mpi_adagrad_optimize
[ 72%] Built target mpi_extract_reachable
[ 72%] Built target mpi_flex_optimize
[ 73%] Built target mpi_batch_optimize
[ 74%] Built target mpi_compute_cllh
[ 74%] Built target mpi_baum_welch
[ 75%] Built target mpi_extract_features
[ 76%] Built target minrisk_optimize
[ 78%] Built target dpmert
[ 79%] Built target mr_dpmert_map
[ 79%] Built target lo_test
[ 80%] Built target mr_dpmert_reduce
[ 80%] Built target mr_dpmert_generate_mapper_input
[ 81%] Built target mr_pro_reduce
[ 81%] Built target mr_pro_map
[ 82%] Built target dtrain
[ 82%] Built target latent_svm
[ 82%] Built target kbest_cut_mira
[ 83%] Built target kbest_mira
[ 83%] Built target ada_opt_sm
[ 84%] Built target rampion_cccp
[ 85%] Built target argument_reorder_model_trainer
[ 86%] Built target const_reorder_model_trainer
[ 87%] Built target fast_align
[ 88%] Building CXX object extractor/CMakeFiles/extractor.dir/backoff_sampler.cc.o
/home/mate/cdec/extractor/backoff_sampler.cc: In member function ‘virtual extractor::PhraseLocation extractor::BackoffSampler::Sample(const extractor::PhraseLocation&, const std::unordered_set<int>&) const’:
/home/mate/cdec/extractor/backoff_sampler.cc:24:18: error: ‘round’ was not declared in this scope
     int sample = round(i);
                  ^~~~~
/home/mate/cdec/extractor/backoff_sampler.cc:24:18: note: suggested alternative: ‘rand’
     int sample = round(i);
                  ^~~~~
                  rand
extractor/CMakeFiles/extractor.dir/build.make:86: recipe for target 'extractor/CMakeFiles/extractor.dir/backoff_sampler.cc.o' failed
make[2]: *** [extractor/CMakeFiles/extractor.dir/backoff_sampler.cc.o] Error 1
CMakeFiles/Makefile2:3227: recipe for target 'extractor/CMakeFiles/extractor.dir/all' failed
make[1]: *** [extractor/CMakeFiles/extractor.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2