Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation problems #17

Open
student123abc opened this issue Feb 24, 2023 · 4 comments
Open

Installation problems #17

student123abc opened this issue Feb 24, 2023 · 4 comments

Comments

@student123abc
Copy link

I've been trying to install gtextutils and fastx, using the commands in this link: https://zhanglab.c2b2.columbia.edu/index.php/CTK_FAQ

However, I get the following error after running "make" in downloading gtextutils:
text_line_reader.cpp: In member function 'bool TextLineReader::next_line()':
text_line_reader.cpp:47:9: error: cannot convert 'std::istream' {aka 'std::basic_istream'} to 'bool' in return
47 | return input_stream ;
| ^~~~~~~~~~~~
| |
| std::istream {aka std::basic_istream}
make[3]: *** [text_line_reader.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1

@jpcartailler
Copy link

I have the same problem with
https://github.com/agordon/libgtextutils/releases/download/0.7/libgtextutils-0.7.tar.gz

downloaded it, unpacked it, then:

./configure # runs fine
make # same error as above

error:

make  all-recursive
make[1]: Entering directory '/data/libgtextutils-0.7'
Making all in m4
make[2]: Entering directory '/data/libgtextutils-0.7/m4'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/data/libgtextutils-0.7/m4'
Making all in src
make[2]: Entering directory '/data/libgtextutils-0.7/src'
Making all in gtextutils
make[3]: Entering directory '/data/libgtextutils-0.7/src/gtextutils'
/bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../..     -g -O2 -Wall -Wextra -Wformat-nonliteral -Wformat-security -Wswitch-default -Wswitch-enum -Wunused-parameter -Wfloat-equal -Werror -DDEBUG -g -O1 -DDEBUG -g -O1 -MT stream_wrapper.lo -MD -MP -MF .deps/stream_wrapper.Tpo -c -o stream_wrapper.lo stream_wrapper.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../.. -g -O2 -Wall -Wextra -Wformat-nonliteral -Wformat-security -Wswitch-default -Wswitch-enum -Wunused-parameter -Wfloat-equal -Werror -DDEBUG -g -O1 -DDEBUG -g -O1 -MT stream_wrapper.lo -MD -MP -MF .deps/stream_wrapper.Tpo -c stream_wrapper.cpp  -fPIC -DPIC -o .libs/stream_wrapper.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../.. -g -O2 -Wall -Wextra -Wformat-nonliteral -Wformat-security -Wswitch-default -Wswitch-enum -Wunused-parameter -Wfloat-equal -Werror -DDEBUG -g -O1 -DDEBUG -g -O1 -MT stream_wrapper.lo -MD -MP -MF .deps/stream_wrapper.Tpo -c stream_wrapper.cpp -o stream_wrapper.o >/dev/null 2>&1
mv -f .deps/stream_wrapper.Tpo .deps/stream_wrapper.Plo
/bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../..     -g -O2 -Wall -Wextra -Wformat-nonliteral -Wformat-security -Wswitch-default -Wswitch-enum -Wunused-parameter -Wfloat-equal -Werror -DDEBUG -g -O1 -DDEBUG -g -O1 -MT text_line_reader.lo -MD -MP -MF .deps/text_line_reader.Tpo -c -o text_line_reader.lo text_line_reader.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../.. -g -O2 -Wall -Wextra -Wformat-nonliteral -Wformat-security -Wswitch-default -Wswitch-enum -Wunused-parameter -Wfloat-equal -Werror -DDEBUG -g -O1 -DDEBUG -g -O1 -MT text_line_reader.lo -MD -MP -MF .deps/text_line_reader.Tpo -c text_line_reader.cpp  -fPIC -DPIC -o .libs/text_line_reader.o
text_line_reader.cpp: In member function ‘bool TextLineReader::next_line()’:
text_line_reader.cpp:47:16: error: cannot convert ‘std::istream’ {aka ‘std::basic_istream<char>’} to ‘bool’ in return
   47 |         return input_stream ;
      |                ^~~~~~~~~~~~
      |                |
      |                std::istream {aka std::basic_istream<char>}
make[3]: *** [Makefile:495: text_line_reader.lo] Error 1
make[3]: Leaving directory '/data/libgtextutils-0.7/src/gtextutils'
make[2]: *** [Makefile:352: all-recursive] Error 1
make[2]: Leaving directory '/data/libgtextutils-0.7/src'
make[1]: *** [Makefile:466: all-recursive] Error 1
make[1]: Leaving directory '/data/libgtextutils-0.7'
make: *** [Makefile:374: all] Error 2
...

@dstyaaaaaa
Copy link

I have the same problem. Configure runs fine.

text_line_reader.cpp:47:16: error: cannot convert ‘std::istream’ {aka ‘std::basic_istream<char>’} to ‘bool’ in return
   47 |         return input_stream ;
      |                ^~~~~~~~~~~~
      |                |
      |                std::istream {aka std::basic_istream<char>}
make[3]: *** [Makefile:495: text_line_reader.lo] Error 1
make[3]: Leaving directory '/mnt/data/home/tycloud/libgtextutils-0.7/src/gtextutils'
make[2]: *** [Makefile:352: all-recursive] Error 1
make[2]: Leaving directory '/mnt/data/home/tycloud/libgtextutils-0.7/src'
make[1]: *** [Makefile:466: all-recursive] Error 1
make[1]: Leaving directory '/mnt/data/home/tycloud/libgtextutils-0.7'
make: *** [Makefile:374: all] Error 2

@dstyaaaaaa
Copy link

The configure output like this:

configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking dependency style of g++... (cached) gcc3
checking how to run the C++ preprocessor... g++ -E
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for ld used by g++... /bin/ld -m elf_x86_64
checking if the linker (/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating m4/Makefile
config.status: creating src/Makefile
config.status: creating src/gtextutils/Makefile
config.status: creating gtextutils.pc
config.status: creating tests/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

@XuzheWang
Copy link

Modify the code in text_line_reader.cpp to the content below, and it will work:

bool TextLineReader::next_line() {
  if (unget_line_active) {
      unget_line_active = false;
      current_line_stream.clear();
      current_line_stream.str(current_line_string);
      ++current_line_number;
      return true;
  }

  std::getline(input_stream, current_line_string);
  if (input_stream) {
      current_line_stream.clear();
      current_line_stream.str(current_line_string);
      ++current_line_number;
      return true;
  } else {
      return false;
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants