You are here

Numerous problems when building PyRosetta from source - issues linking clang 5.1

8 posts / 0 new
Last post
Numerous problems when building PyRosetta from source - issues linking clang 5.1
#1

I'm running a Mac 10.9 64Bit system, and I'm trying to build it against a homebrewed install of Python 2.7.6. I'm using the 2014wk05 rosetta bundle.

clang --version
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

There have been several issues along the way, which have been addressed in a different thread (https://www.rosettacommons.org/node/3608) but it seemed it would be more appropriate to move the discussion here.

I found that when using clang to compile PyRosetta, there were multiple points at which the compiler was expecting clang version 5.0 when the current version is 5.1 - specifically, it's looking for a bunch of lib files in build/src/pyrosetta/macos/10.9/64/x86/clang/5.0/default/ when the actual directory tree uses 5.1 instead of 5.0. To illustrate, here's the error that it returns when it tries to link libmini.dylib:

Linking mini lib...
cd /Users/juliaudell/Downloads/rosetta_2014wk05_bundle/main/source && cd build/src/pyrosetta/macos/10.9/64/x86/clang/5.0/default/ && gcc -dynamiclib -Xlinker -headerpad_max_install_names\
... [long list of .os files]
-lz -lstdc++ -o /Users/juliaudell/Downloads/rosetta_2014wk05_bundle/main/source/src/python/bindings/rosetta/libmini.dylib
it gives the error
/bin/sh: line 0: cd: build/src/pyrosetta/macos/10.9/64/x86/clang/5.0/default/: No such file or directory

Furthermore it looks like the clang version is hard coded in BuildBindings.py, line 684:
elif platform.release()[:2] == '13': lib_path = 'build/src/'+mode+'/macos/10.9/64/x86/clang/'; version_add_on = '5.0/default/'
lib_path = lib_path += version_add_on

Using -I/ and -L/ doesn't help things, and while I can include a flag for a different compiler, there doesn't appear to be a way to flag for the version.

Changing the version number in the version_add_on variable yields a whole slew of "symbols not found for architecture x86_64" errors, attached here.

Where do I go from here?

AttachmentSize
linking_mini_lib_errors.txt16.83 KB
Post Situation: 
Thu, 2014-04-17 11:26
JuliaUdell

I'll forward your question to Sergey, he should be able to help. But, in the meantime, why not use the precompiled binaries for lion/mountain lion (the snow leopard binaries will not work). I havn't had any issues using them after the upgrade to mavericks. Are they not working for you?

Thu, 2014-04-17 22:11
jadolfbr

Thank you for passing my question along.

I have the precompiled binaries for lion, but I can't get them to import. When I run "import rosetta" this is what I get:

ImportError: dlopen(/Users/juliaudell/Documents/PythonProjects/PyRosetta.MacOSX.Lion.64Bit.release-r8/rosetta/utility/__utility_all_at_once_.so, 2): Library not loaded: rosetta/libmini.dylib
Referenced from: /Users/juliaudell/Documents/PythonProjects/PyRosetta.MacOSX.Lion.64Bit.release-r8/rosetta/utility/__utility_all_at_once_.so
Reason: image not found

If I can circumvent this error then I'd be happy to start playing with the precompiled version.

Fri, 2014-04-18 10:03
JuliaUdell

Have you ran SetPyRosettaEnvironment.sh?

Fri, 2014-04-18 10:50
jadolfbr

Apparently not. I found the issue - I was trying to run SetPyRosettaEnvironment.sh through Eclipse, which doesn't work because it modifies the bash environment options. It now runs fine (as far as I can tell) when launched from the native python.

Tue, 2014-04-22 10:08
JuliaUdell

Did you copy libboost* to src/python/bindings/ dir? The error is basically saying that one of the dynamic lib is missing etc.

Tue, 2014-04-22 11:39
Sergey

Also, pre-compiled binaries will only work on Apple-Python. So if you replace your default python you need to ether restore it or just run the right executable. Try 'which python' to see what interpreter you using. If you want to use other python binaries (say from MacPorts or Homebrew then you absolutely need to rebuild PyRosetta and use that other Python interpreter and insure that it have dynamic lib.

Tue, 2014-04-22 11:42
Sergey

Regarding your build errors: it looks like you trying to use clang for rebuild. New clang came with new std lib which is not very compatible yet. Solution for this is to rebuild with GCC (you need GCC away to run gccxml). Please check what output you get when running 'gcc -v' because by default Xcode replace gcc with symlink to clang.

Tue, 2014-04-22 11:46
Sergey