refresh-bio / colord

A versatile compressor of third generation sequencing reads.
GNU General Public License v3.0
46 stars 12 forks source link

compile error #2

Open huangnengCSU opened 2 years ago

huangnengCSU commented 2 years ago

Hi, when I compile the code, it shows the error as follows:

huangneng@bio2:~/tools/CoLoRd-master$ make
g++ -Wall -O3 -std=c++17 -static -Wl,--whole-archive -lstdc++fs -lpthread -Wl,--no-whole-archive  -I src/colord/../common/libs/zlib -I src/colord/libs/kmc_api -I src/colord/libs/edlib -I src/colord/libs/CLI11 -c src/colord/utils.cpp -o src/colord/utils.o
src/colord/utils.cpp:28:10: fatal error: filesystem: No such file or directory
 #include <filesystem>
          ^~~~~~~~~~~~
compilation terminated.
Makefile:83: recipe for target 'src/colord/utils.o' failed
make: *** [src/colord/utils.o] Error 1

OS: Ubuntu 16.04 GCC: 7.5.0

best Neng

agudys commented 2 years ago

Hi,

It seems like GCC 7.5.0 doesn't have <filesystem> header. Could you please replace #include <filesystem> statement in src/colord/utils.cpp file with #include <experimental/filesystem> and recompile? In the future release we will add some automatic detection of GCC version.

Regards, Adam

huangnengCSU commented 2 years ago

To agudys, Thanks for your response. I have modified the code according to your suggestion but there are still some error information.

huangneng@bio2:~/tools/CoLoRd-master$ make
g++ -Wall -O3 -std=c++17 -static -Wl,--whole-archive -lstdc++fs -lpthread -Wl,--no-whole-archive  -I src/colord/../common/libs/zlib -I src/colord/libs/kmc_api -I src/colord/libs/edlib -I src/colord/libs/CLI11 -c src/colord/utils.cpp -o src/colord/utils.o
src/colord/utils.cpp: In function ‘std::__cxx11::string create_tmp_dir(const string&)’:
src/colord/utils.cpp:310:20: error: ‘std::filesystem’ has not been declared
   auto path = std::filesystem::path(where) / name;
                    ^~~~~~~~~~
src/colord/utils.cpp:311:13: error: ‘std::filesystem’ has not been declared
   if (!std::filesystem::exists(path))
             ^~~~~~~~~~
src/colord/utils.cpp:314:9: error: ‘std::filesystem’ has not been declared
    std::filesystem::create_directory(path, ec);
         ^~~~~~~~~~
Makefile:83: recipe for target 'src/colord/utils.o' failed
make: *** [src/colord/utils.o] Error 1

Best Neng

agudys commented 2 years ago

Well, it looks like suiting the code to GCC 7.5.0 may be not that easy. For now, I recommend installing GCC 8 at your system, as this is the version on which CoLoRd was tested. The following should work:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-8 g++-8
gcc-8 --version

Then, you can replace g++ with g++-8 in the makefile or change the default system compiler to GCC 8.