Compilation problem with VPhaser-2-02112013

186 views
Skip to first unread message

Ben Woodcroft

unread,
Dec 4, 2013, 9:38:58 PM12/4/13
to viral-to...@googlegroups.com
Hi,

I'm interested in trying out VPhaser 2, but I'm having some problems installing it. Here's the error I'm getting

VPhaser-2-02112013/src$ make
/usr/bin/g++ -fopenmp -O3 -I/srv/sw/bamtools/github_version//include/ -I/srv/sw/boost/1.47.0// -L/srv/sw/bamtools/github_version//lib *.cpp -o ../bin/variant_caller -lpthread -lbamtools
bam_manip.cpp: In function ‘void sampling(int&, int&, int&, int&, int&, const strvec_t&, int)’:
bam_manip.cpp:184:9: error: ‘INT_MAX’ was not declared in this scope
  minQ = INT_MAX;
         ^
bam_manip.cpp:185:9: error: ‘INT_MIN’ was not declared in this scope
  maxQ = INT_MIN;
         ^
make: *** [all] Error 1

I managed to work around this by using this helpful question
http://stackoverflow.com/questions/3233054/error-int32-max-was-not-declared-in-this-scope



Thanks,
ben

Adrian Pelin

unread,
Sep 18, 2014, 5:26:19 PM9/18/14
to viral-to...@googlegroups.com
Even after reading this and the mentioned link I still had trouble compiling. I am suprised this hasn't been addressed yet, but anyways, to get rid of this error, edit the bam_manip.cpp file so that the first few lines are as follows:

...
#include "bam_manip.h"
#include <ctime>
#include <limits>
#include <cstdint>
#define __STDC_LIMIT_MACROS
#include <stdint.h>

const int INT_MAX = std::numeric_limits<int32_t>::max();
const int INT_MIN = std::numeric_limits<int32_t>::min();

/**********************************************************************
 * @brief       parse bam headers, check if bam file is sorted,

...

Also edit the makefile to:
...
all:
        $(COMPILER) -std=c++0x -fopenmp -O3 -I$(MYPATH)/include/ -I$(BOOSTPATH)/ -L$(MYPATH)/lib *.cpp -o $(PROG) -lpthread $(LIB)

...

I am not sure which of the modifications here did the trick, as I did them stepwise, but for me the error vanished after adding:
const int INT_MAX = std::numeric_limits<int32_t>::max();
const int INT_MIN = std::numeric_limits<int32_t>::min();


Adrian
Reply all
Reply to author
Forward
0 new messages