0

I am new to Linux environments, and trying to install a bioinformatics package (vcftools - https://vcftools.github.io/examples.html). For some reason I can compile without a problem in a Cygwin environment, other colleagues have installed the package without a glitch, but i get an error (per below) if I try to compile in an Ubuntu environment in a VirtualBox on the same computer. I get the following error. Does anyone have a suggestion on how to resolve this error?

$make install

output

Installing VCF tools
make[1]: Entering directory '/home/wde/selt/selectionTools/vcftools_0.1.11/cpp'
g++ -c -O2 -D_FILE_OFFSET_BITS=64  vcftools.cpp -o vcftools.o
g++ -MM -O2 -D_FILE_OFFSET_BITS=64  vcftools.cpp > vcftools.d
g++ -c -O2 -D_FILE_OFFSET_BITS=64  bcf_file.cpp -o bcf_file.o
g++ -MM -O2 -D_FILE_OFFSET_BITS=64  bcf_file.cpp > bcf_file.d
g++ -c -O2 -D_FILE_OFFSET_BITS=64  vcf_file.cpp -o vcf_file.o
vcf_file.cpp: In constructor ‘vcf_file::vcf_file()’:
**vcf_file.cpp:25:13: **error: cannot convert ‘bool’** to ‘gzFile {aka gzFile_s*}’ in assignment**
  gzvcf_in = false;
             ^~~~~
Makefile:53: recipe for target 'vcf_file.o' failed
make[1]: *** [vcf_file.o] Error 1
make[1]: Leaving directory '/home/wde/selt/selectionTools/vcftools_0.1.11/cpp'
/bin/sh: 2: cd: can't cd to perl
Makefile:24: recipe for target 'install' failed
make: *** [install] Error 2
error with make
zx8754
  • 52,746
  • 12
  • 114
  • 209
user1885116
  • 1,757
  • 4
  • 26
  • 39
  • Why do you want to compile from source? As I see you can install it from package (`sudo apt-get install vcf-tools`). http://packages.ubuntu.com/yakkety/vcftools – uzsolt Feb 28 '17 at 14:46
  • i have to admit that i had not realized, reading the webpage, that this was an option... thanks for the suggestion – user1885116 Feb 28 '17 at 15:44
  • You're welcome :) You said you're new in Linux so an advice: you should search programs ("packages") in your distro's Package Manager - you haven't to build own (and hunting programs on internet). – uzsolt Feb 28 '17 at 16:16

1 Answers1

1

Basically what the makefile does is automating the calls to the compiler. Thus, the output from the makefile is similar to usual compile errors you get, compiling a source file from within the command line. The important line from the error log above is:

vcf_file.cpp: In constructor ‘vcf_file::vcf_file()’:
**vcf_file.cpp:25:13: **error: cannot convert ‘bool’** to ‘gzFile {aka gzFile_s*}’ in assignment** gzvcf_in = false;

gzvcf_in is of type pointer to gzFile_s. Assigning a bool variable to a pointer type won't compile. Thus, the error message. Replace, inside the vcf_file.cpp, false with the pointer literal std::nullptr or the macro NULL and re-run the makefile.


Btw. I checked the vcf_file.cpp file in the github repo from vcf. They do not contain the line leading to the above error. May you have an outdated / modified version, introducing the compiler error.

clickMe
  • 993
  • 11
  • 33
  • Thanks! unfortunately - it is part of a longer pipeline script (./install.sh) that downloads and unpacks zipped files. I know this is bad practice, but as a dirty quick fix, is there a way to instruct the compiler to ignore this error in some way (i actually noticed that my cygwin compiler somehow only gives a warning)...? – user1885116 Feb 28 '17 at 15:04
  • Maybe there is one. I am not so familiar with the `g++` compiler options. But I guess there is already a similar question on SO. However, I highly discourage this approach. You should take compiler warnings and especially errors seriously as pointed out in the appendix of Kay answer. They are there for a reason, helping you to avoid not working code. – clickMe Feb 28 '17 at 16:37