Two for the price of one: Mac OS X without GUI and DSSP 2.0.4 in Mountain Lion

Well, I complain that I don't get comments. But I got a very good one on how to go to the command line bypassing the GUI in Mac OS X, so good that I have to repost it in is full lenght:

Single-user mode is meant for debugging when things have gone really bad on your computer. This is why it only gives you a command-line and doesn't launch any of the built-in daemons. It can also make it inconvenient if you want to do something which relies on those daemons. If you want no graphics, just a command-line, but otherwise the same as a normal OS X session, you can use the little-known console. At least in 10.6, you can go to System Preferences > Accounts > Login Options and set "Display login window as:" to "Name and password". Then log out enter the user name ">console" (no quotes, but with the greater than symbol). A console will appear which will give you a chance to enter your username and password to get a command-line shell. on Single-user mode

There you have it. Thank you for your input, Anonymous.

Now, as for the DSSP stuff... It turns out that there is a bug in GROMACS 4.5.5 that prevents the use of DSSP (albeit, and old version). Thus, I set out to try and compile the newer version of DSSP, 2.0.4.
One my own, I failed for awhile until I ran into this blog:

http://proteinz.blogspot.mx/2012/06/compiling-dssp-on-osx-lion.html

Now, why to repost this? Well, after you read the instructions at the blog above you'll notice that they addressed the use of MacPorts or HomeBrew. I use neither, I am still loyal to Fink (just because, really). My contribution will be just to tell you how to compile dssp 2.0.4 using Boost installed with Fink.

First of all, install boost:

fink -y install boost1.46.1.cmake

When its done, you'll have the right libraries at your /sw tree. Downloads dssp (don't forget to get a license.) Now, you have to edit the mkdssp.ccp file located at dssp-2.0.4/src. Lines 40 and 60, you have to change VERSION to "2.0.4". Don't forget to save.

Now, while still at dssp-2.0.4/src/ run:

c++ -O3 -o dssp -I/sw/include -L/sw/lib  -Wall -Wno-multichar  -lboost_thread-mt -lboost_regex-mt  -lboost_filesystem-mt -lboost_program_options-mt  -lboost_date_time-mt -lboost_iostreams-mt -lboost_system-mt *.cpp 

This gave me a working dssp (tested against a PDB file but not from gromacs do_dssp, yet).

Well, I hope this helps you getting dssp 2.0.4 up and running.


UPDATE (Happy New Year 2013):

Luca Jovine gracefully commented on this post about how to compile dssp. The method changes the compilation string to this:

/opt/local/bin/c++-apple-4.2 -O3 -o dssp -I/opt/local/include -L/opt/local/lib -Wall -Wno-multichar -lboost_thread-mt -lboost_regex-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_date_time-mt -lboost_iostreams-mt -lboost_math_c99-mt -lboost_system-mt *.cpp

If you fail using my method try this other one.

Thanks, Luca!

Comments

Luca Jovine said…
I am afraid this does not work for me:

OSX> c++ -O3 -o dssp -I/sw/include -L/sw/lib -Wall -Wno-multichar -lboost_thread-mt -lboost_regex-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_date_time-mt -lboost_iostreams-mt -lboost_system-mt *.cpp
(...)
In file included from primitives-3d.cpp:16:
In file included from ./primitives-3d.h:12:
In file included from /sw/include/boost/tr1/tuple.hpp:53:
In file included from /sw/include/boost/fusion/include/tuple.hpp:10:
In file included from /sw/include/boost/fusion/tuple.hpp:10:
In file included from /sw/include/boost/fusion/tuple/tuple.hpp:15:
In file included from /sw/include/boost/fusion/sequence/comparison.hpp:11:
In file included from /sw/include/boost/fusion/sequence/comparison/greater.hpp:19:
In file included from /sw/include/boost/fusion/sequence/comparison/less.hpp:14:
/sw/include/boost/fusion/sequence/comparison/detail/less.hpp:37:17: warning: '&&' within '||' [-Wlogical-op-parentheses]
&& call(fusion::next(a), fusion::next(b));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/sw/include/boost/fusion/sequence/comparison/detail/less.hpp:37:17: note: place parentheses around the '&&' expression to silence this warning
&& call(fusion::next(a), fusion::next(b));
^
In file included from primitives-3d.cpp:17:
./matrix.h:313:19: error: call to function 'min' that is neither visible in the template definition nor found by argument-dependent lookup
matrix result(min(lhs.dim_m(), rhs.dim_m()), min(lhs.dim_n(), rhs.dim_n()));
^
primitives-3d.cpp:336:23: note: in instantiation of function template specialization 'operator-' requested here
matrix t = N - li;
^
/usr/include/c++/4.2.1/bits/stl_algobase.h:182:5: note: 'min' should be declared prior to the call site
min(const _Tp& __a, const _Tp& __b)
^
In file included from primitives-3d.cpp:17:
./matrix.h:313:50: error: call to function 'min' that is neither visible in the template definition nor found by argument-dependent lookup
matrix result(min(lhs.dim_m(), rhs.dim_m()), min(lhs.dim_n(), rhs.dim_n()));
^
/usr/include/c++/4.2.1/bits/stl_algobase.h:182:5: note: 'min' should be declared prior to the call site
min(const _Tp& __a, const _Tp& __b)
^
1 warning and 2 errors generated.
OSX>
Luca Jovine said…
However, going the MacPorts way works:

OSX> /opt/local/bin/c++-apple-4.2 -O3 -o dssp -I/opt/local/include -L/opt/local/lib -Wall -Wno-multichar -lboost_thread-mt -lboost_regex-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_date_time-mt -lboost_iostreams-mt -lboost_math_c99-mt -lboost_system-mt *.cpp
OSX> ls -l dssp
-rwxr-xr-x 1 luca wheel 912724 Dec 30 06:59 dssp
OSX>
wtigger said…
Very interesting Luca, thanks for sharing !

Popular Posts