richardmleggett / nextclip

Nextera Long Mate Pair analysis and processing tool
GNU General Public License v3.0
19 stars 7 forks source link

errors compiling nextclip on mac 10.8.5 and 10.9 #2

Closed mafofoj closed 10 years ago

mafofoj commented 10 years ago

$ make all MAC=1 rm -rf obj mkdir -p obj; gcc -Iinclude -Wall -O3 -DNUMBER_OF_BITFIELDS_IN_BINARY_KMER=2 -pthread -g -c src/nextclip.c -o obj/nextclip.o In file included from src/nextclip.c:17: include/binary_kmer.h:101:58: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] boolean binary_kmer_comparison_operator(const BinaryKmer const left, ^ include/binary_kmer.h:102:20: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] const BinaryKmer const right); ^ include/binary_kmer.h:103:48: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] boolean binary_kmer_less_than(const BinaryKmer const left, ^ include/binary_kmer.h:104:20: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] const BinaryKmer const right, short kmer_size); ^ src/nextclip.c:1651:42: error: expected ';' at end of declaration void store_duplicates(Element * node) { ^ ; 4 warnings and 1 error generated. make: *\ [obj/nextclip.o] Error 1

I'm not sure how to solve this

richardmleggett commented 10 years ago

This happens when using the Apple compiler instead of GCC. As detailed in the NextClip manual, it does need to be compiled with GCC and you need to edit the line beginning cc= in the Makefile to point to the GCC binary.

Apple's compiler is a pain!

richardmleggett commented 10 years ago

Please let me know how you get on - I'm keen to see NextClip used.

mafofoj commented 10 years ago

I did that;


BIN = bin MAXK = 63

ifdef MAC CC=gcc

CC=~/gcc/bin/gcc

On older versions of XCode, it was necessary to include the following

MACFLAG = -fnested-functions -L/opt/local/lib/

endif


Still I get this error. I updated xcode to 5.0.2 and commandline tools but that doesn't seem to change anything.

richardmleggett commented 10 years ago

Hi,

It's not sufficient to just put CC=gcc. You need to put a full path. Apple aliases the command gcc to it's own compiler. You can see this if you type gcc -v. For example:

n79048:nextclip-master-2 leggettr$ gcc -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix n79048:nextclip-master-2 leggettr$

So you need to set CC= full path to gcc. Have you installed GCC separately, or are you assuming it's installed? You can get an Apple binary from http://hpc.sourceforge.net.

richardmleggett commented 10 years ago

If you're actually running GCC, you'd get something like this: n79048:nextclip-master-2 leggettr$ ~/gcc/bin/gcc -v Using built-in specs. COLLECT_GCC=/Users/leggettr/gcc/bin/gcc COLLECT_LTO_WRAPPER=/Users/leggettr/gcc/bin/../libexec/gcc/x86_64-apple-darwin12.5.0/4.8.1/lto-wrapper Target: x86_64-apple-darwin12.5.0 Configured with: ../gcc-4.8.1/configure --enable-languages=c++,fortran Thread model: posix gcc version 4.8.1 (GCC) n79048:nextclip-master-2 leggettr$

mafofoj commented 10 years ago

I installed gcc-4.8.2 (brew install apple-48) and now I get the following error;

src/nextclip.c:1652:21: error: use of undeclared identifier 'node' int count = node->count; ^ 4 warnings and 1 error generated. make: *\ [obj/nextclip.o] Error 1

mafofoj commented 10 years ago

So after upgrading to gcc-4.8.2, I get this;


mkdir -p obj; /usr/local/Cellar/gcc48/4.8.2/bin/gcc-4.8 -Iinclude -Wall -O3 -DNUMBER_OF_BITFIELDS_IN_BINARY_KMER=2 -pthread -g -c src/nextclip.c -o obj/nextclip.o src/nextclip.c: In function 'calculate_pcr_duplicate_stats': src/nextclip.c:1652:21: error: 'node' undeclared (first use in this function) int count = node->count; ^ src/nextclip.c:1652:21: note: each undeclared identifier is reported only once for each function it appears in make: *\ [obj/nextclip.o] Error 1


I still can't get away from the error src/nextclip.c:1652:21: error: 'node' undeclared (first use in this function) int count = node->count; ^

richardmleggett commented 10 years ago

Hi,

Sorry you are still having problems. It seems to be the nested functions which are failing - which is strange, as this is why GCC needs to be used.

Can you send me the output off the following command: /usr/local/Cellar/gcc48/4.8.2/bin/gcc-4.8 -v

Also, where did you download GCC 4.8.2 from and was it a binary or did you compile it yourself?

Thanks, Richard

mafofoj commented 10 years ago

The output for "/usr/local/Cellar/gcc48/4.8.2/bin/gcc-4.8 -v" is pasted below; I installed gcc using homebrew "brew install gcc48"


jmafofo-2:~ jmafofo$ /usr/local/Cellar/gcc48/4.8.2/bin/gcc-4.8 -v Using built-in specs. COLLECT_GCC=/usr/local/Cellar/gcc48/4.8.2/bin/gcc-4.8 COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc48/4.8.2/libexec/gcc/x86_64-apple-darwin13.0.0/4.8.2/lto-wrapper Target: x86_64-apple-darwin13.0.0 Configured with: ../configure --build=x86_64-apple-darwin13.0.0 --prefix=/usr/local/Cellar/gcc48/4.8.2 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp4 --with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08 --with-cloog=/usr/local/opt/cloog018 --with-isl=/usr/local/opt/isl011 --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --enable-plugin --disable-nls --disable-multilib Thread model: posix gcc version 4.8.2 (GCC)


richardmleggett commented 10 years ago

Hi there,

Hmmm, it’s probably down to how that version is configured - you have lots more flags in your “Configured with” than I do. All I have is... Configured with: ../gcc-4.8.1/configure --enable-languages=c++,fortran

A quick solution is to install GCC from here http://hpc.sourceforge.net - it’s just a case of downloading the tar and unzipping it, then pointing the Makefile to that GCC.

I need to work out what’s going on with your version, but that will take me a bit longer as I don’t have homebrew installed.

Thanks, Richard

On 17 Dec 2013, at 10:29, mafofoj notifications@github.com wrote:

The output for "/usr/local/Cellar/gcc48/4.8.2/bin/gcc-4.8 -v" is pasted below; I installed gcc using homebrew "brew install gcc48"

jmafofo-2:~ jmafofo$ /usr/local/Cellar/gcc48/4.8.2/bin/gcc-4.8 -v Using built-in specs. COLLECT_GCC=/usr/local/Cellar/gcc48/4.8.2/bin/gcc-4.8 COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc48/4.8.2/libexec/gcc/x86_64-apple-darwin13.0.0/4.8.2/lto-wrapper Target: x86_64-apple-darwin13.0.0 Configured with: ../configure --build=x86_64-apple-darwin13.0.0 --prefix=/usr/local/Cellar/gcc48/4.8.2 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp4 --with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08 --with-cloog=/usr/local/opt/cloog018 --with-isl=/usr/local/opt/isl011 --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --enable-plugin --disable-nls --disable-multilib Thread model: posix gcc version 4.8.2 (GCC)

— Reply to this email directly or view it on GitHub.