Re: [Rdkit-devel] "symbol(s) not found" on Mac OS X 10.7.3
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: James S. <jsw...@gm...> - 2012-08-23 19:46:56
|
Sorry for the red herring, Andrew. FWIW, per the comment in CMakeLists.txt, I was able to reproduce the error on GCC 4.4.3 on our corporate ubuntu distribution by removing the -O0 flag. Experimentation revealed that building Dict.cpp with -O1 links successfully, so I assume the particular optimization that is eliding these symbols is in O2 or beyond. Best, James On Wed, Aug 22, 2012 at 11:56 PM, Greg Landrum <gre...@gm...>wrote: > Hi Andrew, > > On Wed, Aug 22, 2012 at 12:17 PM, Andrew Dalke > <da...@da...> wrote: > > On Aug 17, 2012, at 11:35 AM, Greg Landrum wrote: > >> Here is, hopefully, the last update on this topic. Apologies for the > verbosity. > > > > I'm trying to build the latests from the new repository. Here's > > the message I get: > > > > [ 4%] Building CXX object > Code/RDGeneral/CMakeFiles/testDict.dir/testDict.cpp.o > > Linking CXX executable testDict > > ld: warning: path '/usr/lib/libpython2.7.dylib' following -L not a > directory > > Undefined symbols for architecture x86_64: > > "boost::any RDKit::Dict::toany<std::vector<std::vector<int, > std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > > >(std::vector<std::vector<int, std::allocator<int> >, > std::allocator<std::vector<int, std::allocator<int> > > >) const", > referenced from: > > void RDKit::Dict::setVal<std::vector<std::vector<int, > std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > > >(std::string const&, std::vector<std::vector<int, > std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > >&) in testDict.cpp.o > > "std::vector<int, std::allocator<int> > > RDKit::Dict::fromany<std::vector<int, std::allocator<int> > >(boost::any > const&) const", referenced from: > > void RDKit::Dict::getVal<std::vector<int, std::allocator<int> > > >(std::string const&, std::vector<int, std::allocator<int> >&) const in > testDict.cpp.o > > "boost::any RDKit::Dict::toany<std::vector<int, std::allocator<int> > > >(std::vector<int, std::allocator<int> >) const", referenced from: > > void RDKit::Dict::setVal<std::vector<int, std::allocator<int> > > >(std::string const&, std::vector<int, std::allocator<int> >&) in > testDict.cpp.o > > "int RDKit::Dict::fromany<int>(boost::any const&) const", referenced > from: > > void RDKit::Dict::getVal<int>(std::string const&, int&) const in > testDict.cpp.o > > "boost::any RDKit::Dict::toany<int>(int) const", referenced from: > > void RDKit::Dict::setVal<int>(std::string const&, int&) in > testDict.cpp.o > > ld: symbol(s) not found for architecture x86_64 > > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > > > > Nikolas Fechner, who has a MacBookPro running Lion, and I just got > this figured out. > There's a test at line 4 of $RDBASE/Code/RDGeneral/CMakeLists.txt: > > if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG) > # Dict.cpp behaves badly if compiled with optimization under g++ > SET_SOURCE_FILES_PROPERTIES(Dict.cpp PROPERTIES COMPILE_FLAGS -O0) > endif() > > apparently neither of those two variables is set under Lion. The > "fix", which I will check in later today, is: > > if(NOT MSVC) > # Dict.cpp behaves badly if compiled with optimization under g++ > SET_SOURCE_FILES_PROPERTIES(Dict.cpp PROPERTIES COMPILE_FLAGS -O0) > endif() > > After making this change we were able to complete an RDKit build on > Niko's machine. > > I will try to remember to do a longer explanation of why the above is > necessary later, but right now I have to run to a meeting. > > Hope this helps, > -greg > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Rdkit-devel mailing list > Rdk...@li... > https://lists.sourceforge.net/lists/listinfo/rdkit-devel > |