BUStools / bustools

Tools for working with BUS files
https://bustools.github.io/
BSD 2-Clause "Simplified" License
92 stars 23 forks source link

build problem - not declared in scope - pow #15

Closed bmcgough closed 5 years ago

bmcgough commented 5 years ago

Just hit an error with 'pow' on line 111 in bustools_whitelist.cpp in 0.39.3 not being declared in scope. Built 0.39.2 without issue.

dpryan79 commented 5 years ago

I ran into this same issue in the bioconda recipe and made the following patch:

--- src/bustools_whitelist.cpp  2019-08-05 11:34:18.187676079 +0200
+++ src/bustools_whitelist.cpp  2019-08-05 11:34:56.678678527 +0200
@@ -1,6 +1,7 @@
 #include <iostream>
 #include <fstream>
 #include <algorithm>
+#include <cmath>

 #include "Common.hpp"
 #include "BUSData.h"
Gibbsdavidl commented 5 years ago

Me too:

-- The C compiler identification is GNU 6.3.0 -- The CXX compiler identification is GNU 6.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done release mode -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Configuring done -- Generating done -- Build files have been written to: /home/jupyter/bustools/build Scanning dependencies of target bustools_core [ 7%] Building CXX object src/CMakeFiles/bustools_core.dir/BUSData.cpp.o [ 15%] Building CXX object src/CMakeFiles/bustools_core.dir/Common.cpp.o [ 23%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_capture.cpp.o [ 30%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_count.cpp.o [ 38%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_inspect.cpp.o [ 46%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_linker.cpp.o [ 53%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_main.cpp.o [ 61%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_project.cpp.o [ 69%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_sort.cpp.o [ 76%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_whitelist.cpp.o /home/jupyter/bustools/src/bustools_whitelist.cpp: In function ‘void bustools_whitelist(Bustools_opt&)’: /home/jupyter/bustools/src/bustools_whitelist.cpp:111:58: error: ‘pow’ was not declared in this scope threshold = avgCount * (1 - pow(1 - ERROR_RATE, bclen)); ^ src/CMakeFiles/bustools_core.dir/build.make:278: recipe for target 'src/CMakeFiles/bustools_core.dir/bustools_whitelist.cpp.o' failed make[2]: [src/CMakeFiles/bustools_core.dir/bustools_whitelist.cpp.o] Error 1 CMakeFiles/Makefile2:87: recipe for target 'src/CMakeFiles/bustools_core.dir/all' failed make[1]: [src/CMakeFiles/bustools_core.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: [all] Error 2 [ 7%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_whitelist.cpp.o /home/jupyter/bustools/src/bustools_whitelist.cpp: In function ‘void bustools_whitelist(Bustools_opt&)’: /home/jupyter/bustools/src/bustools_whitelist.cpp:111:58: error: ‘pow’ was not declared in this scope threshold = avgCount (1 - pow(1 - ERROR_RATE, bclen)); ^ src/CMakeFiles/bustools_core.dir/build.make:278: recipe for target 'src/CMakeFiles/bustools_core.dir/bustools_whitelist.cpp.o' failed make[2]: ** [src/CMakeFiles/bustools_core.dir/bustools_whitelist.cpp.o] Error 1 CMakeFiles/Makefile2:87: recipe for target 'src/CMakeFiles/bustools_core.dir/all' failed make[1]: [src/CMakeFiles/bustools_core.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

zacharylau10 commented 5 years ago

this error war discuss in https://community.particle.io/t/pow-was-not-declared-in-this-scope/4556. Adding #include <math.h> to error file, it works for me.