UnixJunkie / Durandal

Entropy-accelerated exact clustering of protein decoys (PDB files).
http://www.riken.jp/zhangiru/software.html
GNU Lesser General Public License v3.0
5 stars 2 forks source link

compilation problem on brand new Mac running the latest Xcode #1

Closed UnixJunkie closed 12 years ago

UnixJunkie commented 12 years ago

---------- Forwarded message ---------- From: terwill Date: Tue, Sep 4, 2012 at 2:10 PM Subject: durandal To: nechols, terwilliger

Hi Nat,

I got my compilation working using a mac-osx version (even though my computer is 64-bit I couldn't get that to work; it installed and then libraries were missing).

however there is one thing that didn't work. When compiling Durandal/:

In file included from /Users/terwill/unix/PHENIX/phenix-dev-1148/Durandal/src/DistMatrix.cc:33: /Users/terwill/unix/PHENIX/phenix-dev-1148/Durandal/src/Singleton.h:101:8: error: call to function 'operator<<' that is neither visible in the template definition nor found by argument-dependent lookup os << v[i] << '\n'; ^

Is this directory needed? And have you seen an error like that? seems weird that << would not be recognized.

All the best, Tom T

UnixJunkie commented 12 years ago

Here is more context...

---------- Forwarded message ---------- From: terwill Date: Tue, Sep 4, 2012 at 2:17 PM Subject: Re: durandal To: Nathaniel Echols

Hi Nat, Maybe the entire error message will be more helpful...here it is:

c++ -o Durandal/src/DistMatrix.o -c -DBOOST_ALL_NO_LIB -arch i386 -fPIC -fno-strict-aliasing -w -no-cpp-precomp -arch i386 -DNDEBUG -O1 -ffast-math /Users/terwill/unix/PHENIX/phenix-dev-1148/Durandal/src/DistMatrix.cc c++ -o Durandal/src/rmsd.o -c -DBOOST_ALL_NO_LIB -arch i386 -fPIC -fno-strict-aliasing -w -no-cpp-precomp -arch i386 -DNDEBUG -O1 -ffast-math /Users/terwill/unix/PHENIX/phenix-dev-1148/Durandal/src/rmsd.cc c++ -o Durandal/src/ranker.o -c -DBOOST_ALL_NO_LIB -arch i386 -fPIC -fno-strict-aliasing -w -no-cpp-precomp -arch i386 -DNDEBUG -O1 -ffast-math /Users/terwill/unix/PHENIX/phenix-dev-1148/Durandal/src/ranker.cc

In file included from /Users/terwill/unix/PHENIX/phenix-dev-1148/Durandal/src/DistMatrix.cc:33: /Users/terwill/unix/PHENIX/phenix-dev-1148/Durandal/src/Singleton.h:101:8: error: call to function 'operator<<' that is neither visible in the template definition nor found by argument-dependent lookup os << v[i] << '\n'; ^ /Users/terwill/unix/PHENIX/phenix-dev-1148/Durandal/src/DistMatrix.cc:844:12: note: in instantiation of function template specialization 'operator<<<std::pair<float, int> >' requested here cerr << bins; ^ /Users/terwill/unix/PHENIX/phenix-dev-1148/Durandal/src/Singleton.h:117:10: note: 'operator<<' should be declared prior to the call site ostream& operator<<(ostream& os, const pair<T, U>& p) { ^ 1 error generated.

All the best, Tom T

UnixJunkie commented 12 years ago

Hello,

I registered the bug under github's bugtracker here: https://github.com/HappyCrow/Durandal/issues?state=open

It would be nice if follow-ups go there.

I could not reproduce the problem at home on my mac.

Please provide the commands you ran to observe the bug.

I untared Durandal, ran make and it went fine.

Did you compile phenix using the install script?

What options did you give to this script?

Thanks, F.

terwill commented 12 years ago

The problem only appears to be with clang. Here is compilation with g++ and then clang:

terwill% mkdir -p build terwill% g++ -o build/DistMatrix.o -c -g -O3 -DNDEBUG -W -Wall src/DistMatrix.cc terwill% clang -o build/DistMatrix.o -c -g -O3 -DNDEBUG -W -Wall src/DistMatrix.cc In file included from src/DistMatrix.cc:33: src/Singleton.h:101:8: error: call to function 'operator<<' that is neither visible in the template definition nor found by argument-dependent lookup os << v[i] << '\n'; ^ src/DistMatrix.cc:844:12: note: in instantiation of function template specialization 'operator<<<std::pair<float, int> >' requested here cerr << bins; ^ src/Singleton.h:117:10: note: 'operator<<' should be declared prior to the call site ostream& operator<<(ostream& os, const pair<T, U>& p) { ^ 1 error generated.

UnixJunkie commented 12 years ago

I created a branch for fixes here: https://github.com/HappyCrow/Durandal/tree/fix_for_clang

Compilation goes further than before. I have binding of executable failing on Ubuntu but you should give it a try on a Mac.

UnixJunkie commented 12 years ago

I got until here: make find . -name "_.cc" > srcfiles find . -name ".h" >> src_files cat src_files | xargs etags -a -o src/TAGS rm -f src_files scons opt=true scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... clang -o build/DistMatrix.o -c -g -O3 -DNDEBUG -W -Wall src/DistMatrix.cc clang -o build/DistRange.o -c -g -O3 -DNDEBUG -W -Wall src/DistRange.cc clang -o build/SimpPDB.o -c -g -O3 -DNDEBUG -W -Wall src/SimpPDB.cc clang -o build/Singleton.o -c -g -O3 -DNDEBUG -W -Wall src/Singleton.cc clang -o build/Stru.o -c -g -O3 -DNDEBUG -W -Wall src/Stru.cc clang -o build/durandal.o -c -g -O3 -DNDEBUG -W -Wall src/durandal.cc clang -o build/ranker.o -c -g -O3 -DNDEBUG -W -Wall src/ranker.cc clang -o build/rmsd.o -c -g -O3 -DNDEBUG -W -Wall src/rmsd.cc clang -o durandal.cluster_pdbs build/durandal.o build/DistMatrix.o build/DistRange.o build/Stru.o build/SimpPDB.o build/rmsd.o build/Singleton.o Undefined symbols for architecture x86_64: "std::basic_string<char, std::char_traits, std::allocator >::basicstring(char const, std::allocator const&)", referenced from: contains(int, char, std::string) in durandal.o contains(int, char, std::string, std::string) in durandal.o get_option(int, char, std::string) in durandal.o main in durandal.o DistMatrix::DistMatrix(char const, float) in DistMatrix.o SimPDB::read(int, bool) in SimpPDB.o cstring_tostrategy(char const) in Singleton.o ... "std::string::_Rep::_S_empty_rep_storage", referenced from: contains(int, char, std::string) in durandal.o contains(int, char, std::string, std::string) in durandal.o get_option(int, char__, std::string) in durandal.o get_option(int, char, std::string, std::string) in durandal.o main in durandal.o DistMatrix::DistMatrix(char const, float) in DistMatrix.o DistMatrix::~DistMatrix() in DistMatrix.o ... "std::string::_Rep::_M_destroy(std::allocator const&)", referenced from: contains(int, char, std::string) in durandal.o contains(int, char, std::string, std::string) in durandal.o get_option(int, char, std::string) in durandal.o get_option(int, char, std::string, std::string) in durandal.o _main in durandal.o DistMatrix::DistMatrix(char const*, float) in DistMatrix.o DistMatrix::~DistMatrix() in DistMatrix.o ...

And I have no idea of what clang is missing.

UnixJunkie commented 12 years ago

Corrections were merged into the master branch. Thanks to Thomas Terwilliger for having confirmed the fixes are OK.