veg / tn93

TN93 fast distance calculator
MIT License
15 stars 7 forks source link

Error compiling on Windows Subsystem for Linux - Ubuntu 18.04 #18

Closed niemasd closed 1 year ago

niemasd commented 4 years ago

When I run cmake . in the tn93 directory, I get the following:

-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.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
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/niema/Desktop/tn93

Then, when I run make, I get the following:

Scanning dependencies of target nucfreqsfasta
[  2%] Building CXX object CMakeFiles/nucfreqsfasta.dir/src/nuc_freqs_from_fasta.cpp.o
[  4%] Building CXX object CMakeFiles/nucfreqsfasta.dir/src/stringBuffer.cc.o
[  7%] Building CXX object CMakeFiles/nucfreqsfasta.dir/src/tn93_shared.cc.o
[  9%] Linking CXX executable nucfreqsfasta
[  9%] Built target nucfreqsfasta
Scanning dependencies of target readreduce
[ 11%] Building CXX object CMakeFiles/readreduce.dir/src/read_reducer.cpp.o
[ 14%] Building CXX object CMakeFiles/readreduce.dir/src/stringBuffer.cc.o
[ 16%] Building CXX object CMakeFiles/readreduce.dir/src/tn93_shared.cc.o
[ 19%] Building CXX object CMakeFiles/readreduce.dir/src/argparse_merge.cpp.o
[ 21%] Linking CXX executable readreduce
[ 21%] Built target readreduce
make[2]: *** No rule to make target 'CMakeFiles/seqcoverage.dir/depend'.  Stop.
CMakeFiles/Makefile2:173: recipe for target 'CMakeFiles/seqcoverage.dir/all' failed
make[1]: *** [CMakeFiles/seqcoverage.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Much thanks in advance!

spond commented 4 years ago

Dear @niemasd,

Do individual targets build, e.g. make tn93 ? I've not seen this issue before and I wonder if its specific to the Windows/Linux interaction.

Best, Sergei

niemasd commented 4 years ago

Dear Sergei,

Thanks for the response! The individual build target make tn93 worked properly and yielded a functional tn93 executable. This seems to be sufficient for my purposes, but I'd be happy to help test things out further if you wanted to investigate why the general make does not seem to run.

Best, -Niema

Huanchang-Yan commented 4 years ago

Dear @niemasd ,

I met the same error on the Ubuntu, recently. It did bother me a lot. Could you share how you solve it, please? Thank you very much.

Best, Yan

spond commented 4 years ago

Dear @Huanchang-Yan,

Try make TN93 to build just the tn93 binary.

Best, Sergei

pekarj commented 3 years ago

Hi Sergei,

I'm actually running into this issue too, except on unix. When I run cmake . in the tn93 directory, I get the following:

CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- The C compiler identification is AppleClang 11.0.3.11030032
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jonathanpekar/tn93

And then when I run make install, I get:

[  2%] Building CXX object CMakeFiles/validate_fasta.dir/src/validate_fasta.cpp.o
[  4%] Building CXX object CMakeFiles/validate_fasta.dir/src/stringBuffer.cc.o
[  7%] Building CXX object CMakeFiles/validate_fasta.dir/src/tn93_shared.cc.o
[  9%] Linking CXX executable validate_fasta
[  9%] Built target validate_fasta
Scanning dependencies of target selectreads
[ 11%] Building CXX object CMakeFiles/selectreads.dir/src/trim_reads.cpp.o
[ 14%] Building CXX object CMakeFiles/selectreads.dir/src/stringBuffer.cc.o
[ 16%] Building CXX object CMakeFiles/selectreads.dir/src/tn93_shared.cc.o
[ 19%] Building CXX object CMakeFiles/selectreads.dir/src/argparse_trim.cpp.o
[ 21%] Linking CXX executable selectreads
[ 21%] Built target selectreads
Scanning dependencies of target ShortestPathTN93
[ 23%] Building CXX object CMakeFiles/ShortestPathTN93.dir/src/ShortestPathTN93.cpp.o
[ 26%] Building CXX object CMakeFiles/ShortestPathTN93.dir/src/stringBuffer.cc.o
[ 28%] Building CXX object CMakeFiles/ShortestPathTN93.dir/src/tn93_shared.cc.o
[ 30%] Linking CXX executable ShortestPathTN93
[ 30%] Built target ShortestPathTN93
make[2]: *** No rule to make target `CMakeFiles/tn93.dir/depend'.  Stop.
make[1]: *** [CMakeFiles/tn93.dir/all] Error 2
make: *** [all] Error 2

Do you have thoughts on how to fix this? make tn93 did not work for me, unfortunately.

Thank you!

Best, Jonathan

spond commented 3 years ago

Dear @pekarj,

What version of cmake are you using? I am not able to replicate the issue with 3.8.13.

Best, Sergei

pekarj commented 3 years ago

Hi Sergei,

I had version 3.19.0, which I installed via brew, but I just uninstalled it and then installed via pip, which installed version 3.18.4. I got the same cmake issues:

-- The C compiler identification is AppleClang 11.0.3.11030032
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jonathanpekar/tn93

However, then the install worked:

Scanning dependencies of target validate_fasta
[  2%] Building CXX object CMakeFiles/validate_fasta.dir/src/validate_fasta.cpp.o
[  4%] Building CXX object CMakeFiles/validate_fasta.dir/src/stringBuffer.cc.o
[  7%] Building CXX object CMakeFiles/validate_fasta.dir/src/tn93_shared.cc.o
[  9%] Linking CXX executable validate_fasta
[  9%] Built target validate_fasta
Scanning dependencies of target selectreads
[ 11%] Building CXX object CMakeFiles/selectreads.dir/src/trim_reads.cpp.o
[ 14%] Building CXX object CMakeFiles/selectreads.dir/src/stringBuffer.cc.o
[ 16%] Building CXX object CMakeFiles/selectreads.dir/src/tn93_shared.cc.o
[ 19%] Building CXX object CMakeFiles/selectreads.dir/src/argparse_trim.cpp.o
[ 21%] Linking CXX executable selectreads
[ 21%] Built target selectreads
Scanning dependencies of target ShortestPathTN93
[ 23%] Building CXX object CMakeFiles/ShortestPathTN93.dir/src/ShortestPathTN93.cpp.o
[ 26%] Building CXX object CMakeFiles/ShortestPathTN93.dir/src/stringBuffer.cc.o
[ 28%] Building CXX object CMakeFiles/ShortestPathTN93.dir/src/tn93_shared.cc.o
[ 30%] Linking CXX executable ShortestPathTN93
[ 30%] Built target ShortestPathTN93
Scanning dependencies of target tn93
[ 33%] Building CXX object CMakeFiles/tn93.dir/src/TN93.cpp.o
[ 35%] Building CXX object CMakeFiles/tn93.dir/src/stringBuffer.cc.o
[ 38%] Building CXX object CMakeFiles/tn93.dir/src/tn93_shared.cc.o
[ 40%] Building CXX object CMakeFiles/tn93.dir/src/argparse.cpp.o
[ 42%] Linking CXX executable tn93
[ 42%] Built target tn93
Scanning dependencies of target nucfreqsfasta
[ 45%] Building CXX object CMakeFiles/nucfreqsfasta.dir/src/nuc_freqs_from_fasta.cpp.o
[ 47%] Building CXX object CMakeFiles/nucfreqsfasta.dir/src/stringBuffer.cc.o
[ 50%] Building CXX object CMakeFiles/nucfreqsfasta.dir/src/tn93_shared.cc.o
[ 52%] Linking CXX executable nucfreqsfasta
[ 52%] Built target nucfreqsfasta
Scanning dependencies of target readreduce
[ 54%] Building CXX object CMakeFiles/readreduce.dir/src/read_reducer.cpp.o
[ 57%] Building CXX object CMakeFiles/readreduce.dir/src/stringBuffer.cc.o
[ 59%] Building CXX object CMakeFiles/readreduce.dir/src/tn93_shared.cc.o
[ 61%] Building CXX object CMakeFiles/readreduce.dir/src/argparse_merge.cpp.o
[ 64%] Linking CXX executable readreduce
[ 64%] Built target readreduce
Scanning dependencies of target seqcoverage
[ 66%] Building CXX object CMakeFiles/seqcoverage.dir/src/charfreqs.cpp.o
[ 69%] Building CXX object CMakeFiles/seqcoverage.dir/src/stringBuffer.cc.o
[ 71%] Building CXX object CMakeFiles/seqcoverage.dir/src/tn93_shared.cc.o
[ 73%] Building CXX object CMakeFiles/seqcoverage.dir/src/argparse_cf.cpp.o
[ 76%] Linking CXX executable seqcoverage
[ 76%] Built target seqcoverage
Scanning dependencies of target fasta_diff
[ 78%] Building CXX object CMakeFiles/fasta_diff.dir/src/fasta_diff.cpp.o
[ 80%] Building CXX object CMakeFiles/fasta_diff.dir/src/stringBuffer.cc.o
[ 83%] Building CXX object CMakeFiles/fasta_diff.dir/src/tn93_shared.cc.o
[ 85%] Building CXX object CMakeFiles/fasta_diff.dir/src/argparse_fasta_diff.cpp.o
[ 88%] Linking CXX executable fasta_diff
[ 88%] Built target fasta_diff
Scanning dependencies of target tn93-cluster
[ 90%] Building CXX object CMakeFiles/tn93-cluster.dir/src/cluster.cpp.o
/Users/jonathanpekar/tn93/src/cluster.cpp:241:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
    auto outer_iterator = remaining.begin();
    ^
/Users/jonathanpekar/tn93/src/cluster.cpp:253:7: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
      auto inner_iterator = remaining.begin();
      ^
/Users/jonathanpekar/tn93/src/cluster.cpp:314:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
    auto outer_iterator = remaining.begin();
    ^
/Users/jonathanpekar/tn93/src/cluster.cpp:366:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
        auto cluster_iterator = join_to.begin();
        ^
4 warnings generated.
[ 92%] Building CXX object CMakeFiles/tn93-cluster.dir/src/stringBuffer.cc.o
[ 95%] Building CXX object CMakeFiles/tn93-cluster.dir/src/tn93_shared.cc.o
[ 97%] Building CXX object CMakeFiles/tn93-cluster.dir/src/argparse_cluster.cpp.o
[100%] Linking CXX executable tn93-cluster
[100%] Built target tn93-cluster
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/tn93
-- Installing: /usr/local/bin/tn93-cluster
-- Installing: /usr/local/bin/selectreads
-- Installing: /usr/local/bin/seqcoverage
-- Installing: /usr/local/bin/readreduce
-- Installing: /usr/local/bin/fasta_diff
-- Installing: /usr/local/bin/ShortestPathTN93
-- Installing: /usr/local/bin/nucfreqsfasta

So I think I'm set for now then. Thank you!

Best, Jonathan

spond commented 3 years ago

Dear @pekarj,

Great to hear. You may want to use gcc for building TN93 since Apple clang does not support OpenMP, so everything will be single-threaded. Assuming you have gcc-10 installed (via brew), you can try

rm -rf CMakeFiles CMakeCache.txt; CC=gcc-10 CXX=g++-10 cmake ./; make; make install

Best, Sergei

pekarj commented 3 years ago

Dear Sergei,

That worked too, and without the cmake "missing" messages from before:

-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/bin/gcc-10 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/g++-10 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jonathanpekar/tn93
Scanning dependencies of target validate_fasta
[  2%] Building CXX object CMakeFiles/validate_fasta.dir/src/validate_fasta.cpp.o
[  4%] Building CXX object CMakeFiles/validate_fasta.dir/src/stringBuffer.cc.o
[  7%] Building CXX object CMakeFiles/validate_fasta.dir/src/tn93_shared.cc.o
[  9%] Linking CXX executable validate_fasta
[  9%] Built target validate_fasta
Scanning dependencies of target selectreads
[ 11%] Building CXX object CMakeFiles/selectreads.dir/src/trim_reads.cpp.o
[ 14%] Building CXX object CMakeFiles/selectreads.dir/src/stringBuffer.cc.o
[ 16%] Building CXX object CMakeFiles/selectreads.dir/src/tn93_shared.cc.o
[ 19%] Building CXX object CMakeFiles/selectreads.dir/src/argparse_trim.cpp.o
[ 21%] Linking CXX executable selectreads
[ 21%] Built target selectreads
Scanning dependencies of target ShortestPathTN93
[ 23%] Building CXX object CMakeFiles/ShortestPathTN93.dir/src/ShortestPathTN93.cpp.o
[ 26%] Building CXX object CMakeFiles/ShortestPathTN93.dir/src/stringBuffer.cc.o
[ 28%] Building CXX object CMakeFiles/ShortestPathTN93.dir/src/tn93_shared.cc.o
[ 30%] Linking CXX executable ShortestPathTN93
[ 30%] Built target ShortestPathTN93
Scanning dependencies of target tn93
[ 33%] Building CXX object CMakeFiles/tn93.dir/src/TN93.cpp.o
[ 35%] Building CXX object CMakeFiles/tn93.dir/src/stringBuffer.cc.o
[ 38%] Building CXX object CMakeFiles/tn93.dir/src/tn93_shared.cc.o
[ 40%] Building CXX object CMakeFiles/tn93.dir/src/argparse.cpp.o
[ 42%] Linking CXX executable tn93
[ 42%] Built target tn93
Scanning dependencies of target nucfreqsfasta
[ 45%] Building CXX object CMakeFiles/nucfreqsfasta.dir/src/nuc_freqs_from_fasta.cpp.o
[ 47%] Building CXX object CMakeFiles/nucfreqsfasta.dir/src/stringBuffer.cc.o
[ 50%] Building CXX object CMakeFiles/nucfreqsfasta.dir/src/tn93_shared.cc.o
[ 52%] Linking CXX executable nucfreqsfasta
[ 52%] Built target nucfreqsfasta
Scanning dependencies of target readreduce
[ 54%] Building CXX object CMakeFiles/readreduce.dir/src/read_reducer.cpp.o
[ 57%] Building CXX object CMakeFiles/readreduce.dir/src/stringBuffer.cc.o
[ 59%] Building CXX object CMakeFiles/readreduce.dir/src/tn93_shared.cc.o
[ 61%] Building CXX object CMakeFiles/readreduce.dir/src/argparse_merge.cpp.o
[ 64%] Linking CXX executable readreduce
[ 64%] Built target readreduce
Scanning dependencies of target seqcoverage
[ 66%] Building CXX object CMakeFiles/seqcoverage.dir/src/charfreqs.cpp.o
[ 69%] Building CXX object CMakeFiles/seqcoverage.dir/src/stringBuffer.cc.o
[ 71%] Building CXX object CMakeFiles/seqcoverage.dir/src/tn93_shared.cc.o
[ 73%] Building CXX object CMakeFiles/seqcoverage.dir/src/argparse_cf.cpp.o
[ 76%] Linking CXX executable seqcoverage
[ 76%] Built target seqcoverage
Scanning dependencies of target fasta_diff
[ 78%] Building CXX object CMakeFiles/fasta_diff.dir/src/fasta_diff.cpp.o
[ 80%] Building CXX object CMakeFiles/fasta_diff.dir/src/stringBuffer.cc.o
[ 83%] Building CXX object CMakeFiles/fasta_diff.dir/src/tn93_shared.cc.o
[ 85%] Building CXX object CMakeFiles/fasta_diff.dir/src/argparse_fasta_diff.cpp.o
[ 88%] Linking CXX executable fasta_diff
[ 88%] Built target fasta_diff
Scanning dependencies of target tn93-cluster
[ 90%] Building CXX object CMakeFiles/tn93-cluster.dir/src/cluster.cpp.o
[ 92%] Building CXX object CMakeFiles/tn93-cluster.dir/src/stringBuffer.cc.o
[ 95%] Building CXX object CMakeFiles/tn93-cluster.dir/src/tn93_shared.cc.o
[ 97%] Building CXX object CMakeFiles/tn93-cluster.dir/src/argparse_cluster.cpp.o
[100%] Linking CXX executable tn93-cluster
[100%] Built target tn93-cluster
[  9%] Built target validate_fasta
[ 21%] Built target selectreads
[ 30%] Built target ShortestPathTN93
[ 42%] Built target tn93
[ 52%] Built target nucfreqsfasta
[ 64%] Built target readreduce
[ 76%] Built target seqcoverage
[ 88%] Built target fasta_diff
[100%] Built target tn93-cluster
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/tn93
-- Installing: /usr/local/bin/tn93-cluster
-- Installing: /usr/local/bin/selectreads
-- Installing: /usr/local/bin/seqcoverage
-- Installing: /usr/local/bin/readreduce
-- Installing: /usr/local/bin/fasta_diff
-- Installing: /usr/local/bin/ShortestPathTN93
-- Installing: /usr/local/bin/nucfreqsfasta

Thank you for the help!

Best, Jonathan

niemasd commented 1 year ago

I don't remember what's happened since Jonathan and I posted on this issue, but tn93 compiles perfectly fine on Ubuntu WSL now (I just tested compiling tn93 version 1.0.11 right now, and it compiled + installed + ran fine)