Question: Problem Compiling Velvet On Mac Osx
0
gravatar for James Ashmore
6.2 years ago by
London
James Ashmore90 wrote:

Hello, I'm trying to compile Velvet on Mac OSX however I get the following error message:

rm obj/*.o obj/dbg/*.o 
rm: obj/dbg/*.o: No such file or directory
make: [cleanobj] Error 1 (ignored)
mkdir -p obj
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/tightString.c -o obj/tightString.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/run.c -o obj/run.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/splay.c -o obj/splay.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/splayTable.c -o obj/splayTable.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/graph.c -o obj/graph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/run2.c -o obj/run2.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/fibHeap.c -o obj/fibHeap.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/fib.c -o obj/fib.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/concatenatedGraph.c -o obj/concatenatedGraph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/passageMarker.c -o obj/passageMarker.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/graphStats.c -o obj/graphStats.o 
src/graphStats.c:1961:69: warning: format specifies type 'long' but the argument
      has type 'long long' [-Wformat]
  ..."PLACEHLDR.%ld PLACEHOLDER000", (int64_t) refIndex + 1);
                ~~~                  ^~~~~~~~~~~~~~~~~~~~~~
                %lld
/usr/include/secure/_stdio.h:49:56: note: expanded from macro 'sprintf'
  __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                                                       ^
1 warning generated.
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/correctedGraph.c -o obj/correctedGraph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/dfib.c -o obj/dfib.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/dfibHeap.c -o obj/dfibHeap.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/recycleBin.c -o obj/recycleBin.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/readSet.c -o obj/readSet.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/binarySequences.c -o obj/binarySequences.o 
src/binarySequences.c:304:69: warning: format specifies type 'unsigned long' but
      the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
  ...location 0x%lx for seq %ld beyond end 0x%lx\n", (uint64_t) tmp, (uint64_...
                ~~~                                  ^~~~~~~~~~~~~~
                %llx
src/binarySequences.c:304:85: warning: format specifies type 'long' but the
      argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
  ...seq %ld beyond end 0x%lx\n", (uint64_t) tmp, (uint64_t) sequenceIndex, (...
         ~~~                                      ^~~~~~~~~~~~~~~~~~~~~~~~
         %llu
src/binarySequences.c:304:111: warning: format specifies type 'unsigned long'
      but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
  ...0x%lx\n", (uint64_t) tmp, (uint64_t) sequenceIndex, (uint64_t) arrayEnd);
       ~~~                                               ^~~~~~~~~~~~~~~~~~~
       %llx
src/binarySequences.c:389:45: warning: format specifies type 'long' but the
      argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
        velvetLog("CnySeq bufIdx %ld too large\n", bufIdx);
                                 ~~~               ^~~~~~
                                 %llu
4 warnings generated.
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/shortReadPairs.c -o obj/shortReadPairs.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/locallyCorrectedGraph.c -o obj/locallyCorrectedGraph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/graphReConstruction.c -o obj/graphReConstruction.o 
src/graphReConstruction.c:1407:65: warning: format specifies type 'long' but the
      argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat]
  ...=== Ghost-Threaded in %ld.%06ld s\n", diff.tv_sec, diff.tv_usec);
                               ~~~~~                    ^~~~~~~~~~~~
                               %06d
src/graphReConstruction.c:1436:59: warning: format specifies type 'long' but the
      argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat]
        velvetLog(" === Threaded in %ld.%06ld s\n", diff.tv_sec, diff.tv_usec);
                                        ~~~~~                    ^~~~~~~~~~~~
                                        %06d
2 warnings generated.
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/roadMap.c -o obj/roadMap.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/preGraph.c -o obj/preGraph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/preGraphConstruction.c -o obj/preGraphConstruction.o 
src/preGraphConstruction.c:525:58: warning: format specifies type 'long' but the
      argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
  ...velvetLog("readIndex %ld beyond string len %ld\n", (uint64_t) readIndex...
                          ~~~                           ^~~~~~~~~~~~~~~~~~~~
                          %llu
src/preGraphConstruction.c:525:80: warning: format specifies type 'long' but the
      argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
  ...string len %ld\n", (uint64_t) readIndex, (uint64_t) tString->length);
                ~~~                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
                %llu
2 warnings generated.
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/concatenatedPreGraph.c -o obj/concatenatedPreGraph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/readCoherentGraph.c -o obj/readCoherentGraph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/utility.c -o obj/utility.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/kmer.c -o obj/kmer.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/scaffold.c -o obj/scaffold.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/kmerOccurenceTable.c -o obj/kmerOccurenceTable.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/allocArray.c -o obj/allocArray.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/autoOpen.c -o obj/autoOpen.o 
src/autoOpen.c:56:19: warning: duplicate 'const' declaration specifier
      [-Wduplicate-decl-specifier]
static const char const* decompressors[] = {"","pigz", "gunzip", "pbunzi...
                  ^
1 warning generated.
gcc -Wall -m64 -O3  -o velveth obj/tightString.o obj/run.o obj/recycleBin.o obj/splay.o obj/splayTable.o obj/readSet.o obj/binarySequences.o obj/utility.o obj/kmer.o obj/kmerOccurenceTable.o obj/autoOpen.o -lz -lm
Undefined symbols for architecture x86_64:
  "_isCreateBinary", referenced from:
      _main in run.o
      _inputSequenceArrayIntoSplayTableAndArchive in splayTable.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [velveth] Error 1

To overcome this issue I have searched Biostar and tried the following advice :

  1. Uncommenting the following line in the Makefile 'CFLAGS = -Wall -m64'
  2. Running the make command with 'BUNDLEDZLIB=1'
  3. Ensuring gcc is installed via Xcode and Command Line Developer Tools

Sorry if I'm missing anything which might be glaringly obvious to some, thanks for the help!

James

velvet • 2.8k views
ADD COMMENTlink modified 6.2 years ago by John Marshall1.9k • written 6.2 years ago by James Ashmore90
2
gravatar for John Marshall
6.2 years ago by
John Marshall1.9k
Glasgow, Scotland
John Marshall1.9k wrote:

You have run across a different problem, one that is not addressed by the pieces of advice you listed.

isCreateBinary has been marked as inline, but it can't be. You should make these changes to readSet.c and readSet.h and try compiling again. (Daniel has now applied that to his velvet repository at GitHub, so I guess this fix will be in the next velvet release when that comes along.)

ADD COMMENTlink written 6.2 years ago by John Marshall1.9k

I made the changes you suggested but much of the same warning messages still occur, with the final warning different from the one posted above:

rm obj/*.o obj/dbg/*.o 
rm: obj/*.o: No such file or directory
rm: obj/dbg/*.o: No such file or directory
make: [cleanobj] Error 1 (ignored)
mkdir -p obj
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/tightString.c -o obj/tightString.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/run.c -o obj/run.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/splay.c -o obj/splay.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/splayTable.c -o obj/splayTable.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/graph.c -o obj/graph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/run2.c -o obj/run2.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/fibHeap.c -o obj/fibHeap.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/fib.c -o obj/fib.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/concatenatedGraph.c -o obj/concatenatedGraph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/passageMarker.c -o obj/passageMarker.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/graphStats.c -o obj/graphStats.o 
src/graphStats.c:1961:69: warning: format specifies type 'long' but the argument
      has type 'long long' [-Wformat]
  ..."PLACEHLDR.%ld PLACEHOLDER000", (int64_t) refIndex + 1);
                ~~~                  ^~~~~~~~~~~~~~~~~~~~~~
                %lld
/usr/include/secure/_stdio.h:49:56: note: expanded from macro 'sprintf'
  __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                                                       ^
1 warning generated.
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/correctedGraph.c -o obj/correctedGraph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/dfib.c -o obj/dfib.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/dfibHeap.c -o obj/dfibHeap.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/recycleBin.c -o obj/recycleBin.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/readSet.c -o obj/readSet.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/binarySequences.c -o obj/binarySequences.o 
src/binarySequences.c:304:69: warning: format specifies type 'unsigned long' but
      the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
  ...location 0x%lx for seq %ld beyond end 0x%lx\n", (uint64_t) tmp, (uint64_...
                ~~~                                  ^~~~~~~~~~~~~~
                %llx
src/binarySequences.c:304:85: warning: format specifies type 'long' but the
      argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
  ...seq %ld beyond end 0x%lx\n", (uint64_t) tmp, (uint64_t) sequenceIndex, (...
         ~~~                                      ^~~~~~~~~~~~~~~~~~~~~~~~
         %llu
src/binarySequences.c:304:111: warning: format specifies type 'unsigned long'
      but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
  ...0x%lx\n", (uint64_t) tmp, (uint64_t) sequenceIndex, (uint64_t) arrayEnd);
       ~~~                                               ^~~~~~~~~~~~~~~~~~~
       %llx
src/binarySequences.c:389:45: warning: format specifies type 'long' but the
      argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
        velvetLog("CnySeq bufIdx %ld too large\n", bufIdx);
                                 ~~~               ^~~~~~
                                 %llu
4 warnings generated.
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/shortReadPairs.c -o obj/shortReadPairs.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/locallyCorrectedGraph.c -o obj/locallyCorrectedGraph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/graphReConstruction.c -o obj/graphReConstruction.o 
src/graphReConstruction.c:1407:65: warning: format specifies type 'long' but the
      argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat]
  ...=== Ghost-Threaded in %ld.%06ld s\n", diff.tv_sec, diff.tv_usec);
                               ~~~~~                    ^~~~~~~~~~~~
                               %06d
src/graphReConstruction.c:1436:59: warning: format specifies type 'long' but the
      argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat]
        velvetLog(" === Threaded in %ld.%06ld s\n", diff.tv_sec, diff.tv_usec);
                                        ~~~~~                    ^~~~~~~~~~~~
                                        %06d
2 warnings generated.
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/roadMap.c -o obj/roadMap.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/preGraph.c -o obj/preGraph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/preGraphConstruction.c -o obj/preGraphConstruction.o 
src/preGraphConstruction.c:525:58: warning: format specifies type 'long' but the
      argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
  ...velvetLog("readIndex %ld beyond string len %ld\n", (uint64_t) readIndex...
                          ~~~                           ^~~~~~~~~~~~~~~~~~~~
                          %llu
src/preGraphConstruction.c:525:80: warning: format specifies type 'long' but the
      argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
  ...string len %ld\n", (uint64_t) readIndex, (uint64_t) tString->length);
                ~~~                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
                %llu
2 warnings generated.
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/concatenatedPreGraph.c -o obj/concatenatedPreGraph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/readCoherentGraph.c -o obj/readCoherentGraph.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/utility.c -o obj/utility.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/kmer.c -o obj/kmer.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/scaffold.c -o obj/scaffold.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/kmerOccurenceTable.c -o obj/kmerOccurenceTable.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/allocArray.c -o obj/allocArray.o 
gcc -Wall -m64 -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -c src/autoOpen.c -o obj/autoOpen.o 
src/autoOpen.c:56:19: warning: duplicate 'const' declaration specifier
      [-Wduplicate-decl-specifier]
static const char const* decompressors[] = {"","pigz", "gunzip", "pbunzi...
                  ^
1 warning generated.
gcc -Wall -m64 -O3  -o velveth obj/tightString.o obj/run.o obj/recycleBin.o obj/splay.o obj/splayTable.o obj/readSet.o obj/binarySequences.o obj/utility.o obj/kmer.o obj/kmerOccurenceTable.o obj/autoOpen.o -lz -lm
gcc -Wall -m64 -O3  -o velvetg obj/tightString.o obj/graph.o obj/run2.o obj/fibHeap.o obj/fib.o obj/concatenatedGraph.o obj/passageMarker.o obj/graphStats.o obj/correctedGraph.o obj/dfib.o obj/dfibHeap.o obj/recycleBin.o obj/readSet.o obj/binarySequences.o obj/shortReadPairs.o obj/scaffold.o obj/locallyCorrectedGraph.o obj/graphReConstruction.o obj/roadMap.o obj/preGraph.o obj/preGraphConstruction.o obj/concatenatedPreGraph.o obj/readCoherentGraph.o obj/utility.o obj/kmer.o obj/kmerOccurenceTable.o obj/allocArray.o obj/autoOpen.o -lz -lm
ADD REPLYlink modified 6.2 years ago • written 6.2 years ago by James Ashmore90

Plenty of warnings remain, but they are relatively unimportant. The Undefined symbols for architecture x86_64 linker errors that were preventing you from getting a working executable are now fixed.

ADD REPLYlink written 6.2 years ago by John Marshall1.9k

Oh I see, thanks for the help!

ADD REPLYlink written 6.2 years ago by James Ashmore90
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1173 users visited in the last hour