OrthoDB 1.6 Installation On Ubuntu 14.04 (And Related) – Build Errors And The Simple Fixes

UPDATE: 20 May 2016 – With thanks to OrthoDB’s very own Fredrik Tegenfeldt, here’s a more distro-complete fix for the Makefile.rules file.

# BRH flags
ifeq ($(USE_BRH),1)
BRH_DIR        = $(BASE_DIR)
CPPFLAGS    += -I$(BRH_DIR)/src
ifeq ($(WITH_RPATH),1)
LDFLAGS        += -L$(LIB_DIR) -Wl,-rpath,$(LIB_INSTDIR)
else
LDFLAGS        += -L$(LIB_DIR)
endif
LDLIBS        += -lbrh
endif

ifeq ($(USE_BOOST_THREAD),1)
CPPFLAGS    += -pthread -DHAS_BOOST_THREADS
LDFLAGS        += -pthread
LDLIBS      += -L$(DIR_BOOST_LIB) -lboost_system -L$(DIR_BOOST_THREAD) -l$(LIB_BOOST_THREAD) -lpthread
endif

And Happy New Year,

Yet another random Ubuntu-centric bioinformatics aside in the event others run into the same build issues (with errors included below, as you likely googled those first). For those wondering…

The Hierarchical Catalog of Orthologs v8

Orthology (website, download) is the cornerstone of comparative genomics and gene function prediction. OrthoDB aims to classify protein-coding genes from the increasing number of available sequenced genomes into groups of orthologs descended from a single gene of the last common ancestor (LCA) of each clade of species. Applying this concept to the hierarchy of LCAs along the species phylogeny results in multiple levels of orthology: the more closely-related the species, the more finely-resolved the orthologous relations.

The build here was on a fresh installation of 64-bit Ubuntu 14.04 (Trusty Tahr). All of the errors produced come from running on that clean install, meaning you’ll run into dumb errors (like missing build-essential), didn’t-know-we-needed-that errors (boost), and that’s-probbly-an-Ubuntu-oddity errors (with a modified Makefile.rules file with explicit boost calls linked to below; I suspect the developers are working on a non-Ubuntu distro).

Relevant apt-get’s

sudo apt-get install build-essential libboost-all-dev

Relevant Downloads

* tclap (1.2.1) – tclap.sourceforge.net/

Stage 1 – Just Trying The Easy Install

I build everything in /opt by default and propose you do the same (whatever). First steps included.

username@ubuntu:~$ cd Downloads/
username@ubuntu:~/Downloads$ sudo mv OrthoDB_soft_1.6.tgz /opt/
username@ubuntu:~/Downloads$ cd /opt/
username@ubuntu:/opt$ sudo tar xvf OrthoDB_soft_1.6.tgz 

OrthoDB_soft_1.6/
OrthoDB_soft_1.6/BRHCLUS-1.12.7/
...
OrthoDB_soft_1.6/README
OrthoDB_soft_1.6/LICENSE
username@ubuntu:/opt$ cd OrthoDB_soft_1.6/
username@ubuntu:/opt/OrthoDB_soft_1.6$ sudo make WITH_RPATH=1 prefix=$(pwd) all
make: *** No rule to make target `all'.  Stop.

If you read the README file, you figure out to move to the BRHCLUS folder, then discover the need for the boost libraries, available via an apt-get:

username@ubuntu:/opt/OrthoDB_soft_1.6$ cd BRHCLUS-1.12.7/
username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo ./configure.sh 
FATAL: cannot find boost libraries!
- Is boost installed (boost_system) ?
- Is boost installed in any of the search paths ?
  If not, add the path to PATH_SEARCH_LIB at the top of this script.

Stage 2 – sudo apt-get install libboost-all-dev

username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo apt-get install libboost-all-dev 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  account-plugin-windows-live libupstart1
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  icu-devtools libboost-atomic-dev libboost-atomic1.54-dev
  libboost-atomic1.54.0 libboost-chrono-dev libboost-chrono1.54-dev
...
  libxml2-dev mpi-default-bin mpi-default-dev ocl-icd-libopencl1 openmpi-bin
  openmpi-common zlib1g-dev
0 upgraded, 102 newly installed, 0 to remove and 14 not upgraded.
Need to get 46.7 MB of archives.
After this operation, 262 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libboost-atomic1.54.0 amd64 1.54.0-4ubuntu3.1 [8,076 B]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libboost-chrono1.54.0 amd64 1.54.0-4ubuntu3.1 [12.5 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/universe libboost-context1.54.0 amd64 1.54.0-4ubuntu3.1 [8,028 B]
Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libboost-filesystem1.54.0 amd64 1.54.0-4ubuntu3.1 [34.2 kB]
...
Setting up libboost-wave-dev:amd64 (1.54.0.1ubuntu1) ...
Setting up libboost-all-dev (1.54.0.1ubuntu1) ...
Setting up libhwloc-plugins (1.8-1ubuntu1.14.04.1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...

The configure stage now works…

username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo ./configure.sh 
OK - boost libraries
OK - boost thread libraries
OK - boost include dir
OK - tclap include dir
OK - thread pool include dir
Config file (/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/Makefile.config) successfully created

But, right off the bat, a clean install is missing build tools.

username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo make WITH_RPATH=1 prefix=$(pwd) all
  Compiling brh_version.cpp
/bin/sh: 1: g++: not found
make[2]: *** [.linux/brh_version.o] Error 127
make[1]: *** [src] Error 2
make: *** [all] Error 2

Stage 3 – sudo apt-get install build-essential

username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo apt-get install build-essential 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  account-plugin-windows-live libupstart1
...
0 upgraded, 9 newly installed, 0 to remove and 14 not upgraded.
Need to get 15.9 MB of archives.
After this operation, 27.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main g++-4.8 amd64 4.8.4-2ubuntu1~14.04 [15.0 MB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty/main g++ amd64 4:4.8.2-1ubuntu6 [1,490 B]
Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main dpkg-dev all 1.17.5ubuntu5.5 [726 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty/main build-essential amd64 11.6ubuntu6 [4,838 B]
...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
Setting up libalgorithm-diff-perl (1.19.02-3) ...
Setting up libalgorithm-diff-xs-perl (0.04-2build4) ...
Setting up libalgorithm-merge-perl (0.08-2) ...

And the build process now takes steps forward.

username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo make WITH_RPATH=1 prefix=$(pwd) all
  Compiling brh_version.cpp
  Compiling brh_common.cpp
  Compiling pairdataset.cpp
  Compiling brh_functions.cpp
  Compiling keymap.cpp
  Compiling inparalog.cpp
  Compiling clusterdata.cpp
  Compiling cluster.cpp
  Compiling clusterize.cpp
  Compiling cluster_functions.cpp
  Compiling modularity.cpp
  Compiling tri4algo.cpp
  Linking libbrh.so
  Compiling brhclus.cpp
  Linking brhclus
.linux/brhclus.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:222: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:223: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:224: undefined reference to `boost::system::system_category()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::detail::get_current_thread_data()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::this_thread::disable_interruption::disable_interruption()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::this_thread::interruption_point()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::start_thread_noexcept()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::interrupt()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::this_thread::hiden::sleep_until(timespec const&)'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::join_noexcept()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `vtable for boost::detail::thread_data_base'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::native_handle()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::detach()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::this_thread::disable_interruption::~disable_interruption()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `typeinfo for boost::detail::thread_data_base'
collect2: error: ld returned 1 exit status
make[2]: *** [/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/bin/brhclus] Error 1
make[1]: *** [tools/brhclus] Error 2
make: *** [all] Error 2

Stage 4 – tclap Install

A quick google search produces the following from info.circ.rochester.edu/BlueHive/Software/Bioinformatics/orthodb.html indicating that tclap is an OrthoDB dependency that needs to be satisfied. The version I’ve built below (1.2.1) can be downloaded from tclap.sourceforge.net

username@ubuntu:/opt$ ls
OrthoDB_soft_1.6  OrthoDB_soft_1.6.tgz  tclap-1.2.1.tar.gz

Extract and expand.

username@ubuntu:/opt$ sudo tar xvf tclap-1.2.1.tar.gz 
tclap-1.2.1/
tclap-1.2.1/aclocal.m4
tclap-1.2.1/AUTHORS
tclap-1.2.1/ChangeLog
...
tclap-1.2.1/config/Makefile.am
tclap-1.2.1/config/Makefile.in
tclap-1.2.1/config/missing
tclap-1.2.1/config/mkinstalldirs

The build process goes without issue.

username@ubuntu:/opt$ cd tclap-1.2.1/
username@ubuntu:/opt/tclap-1.2.1$ sudo ./configure 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
...
config.status: creating tests/Makefile
config.status: creating config/config.h
config.status: executing depfiles commands
config.status: executing default commands

Onto make…

username@ubuntu:/opt/tclap-1.2.1$ sudo make
Making all in include
make[1]: Entering directory `/opt/tclap-1.2.1/include'
Making all in tclap
make[2]: Entering directory `/opt/tclap-1.2.1/include/tclap'
make[2]: Nothing to be done for `all'.
...
make[1]: Leaving directory `/opt/tclap-1.2.1/config'
make[1]: Entering directory `/opt/tclap-1.2.1'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/opt/tclap-1.2.1'

And make install…

username@ubuntu:/opt/tclap-1.2.1$ sudo make install
Making install in include
make[1]: Entering directory `/opt/tclap-1.2.1/include'
Making install in tclap
make[2]: Entering directory `/opt/tclap-1.2.1/include/tclap'
...
test -z "/usr/local/lib/pkgconfig" || /bin/mkdir -p "/usr/local/lib/pkgconfig"
 /usr/bin/install -c -m 644 'tclap.pc' '/usr/local/lib/pkgconfig/tclap.pc'
make[2]: Leaving directory `/opt/tclap-1.2.1'
make[1]: Leaving directory `/opt/tclap-1.2.1'

Stage 5 – Re-attempt The OrthoDB Build

The configure goes without issue again…

username@ubuntu:/opt$ cd OrthoDB_soft_1.6/
username@ubuntu:/opt/OrthoDB_soft_1.6$ cd BRHCLUS-1.12.7/
username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo make clean
username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo ./configure.sh 
OK - boost libraries
OK - boost thread libraries
OK - boost include dir
OK - tclap include dir
OK - thread pool include dir
Config file (/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/Makefile.config) successfully created

But there’s still an error at the make stage.

username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo make all
  Compiling brh_version.cpp
  Compiling brh_common.cpp
  Compiling pairdataset.cpp
  Compiling brh_functions.cpp
  Compiling keymap.cpp
  Compiling inparalog.cpp
  Compiling clusterdata.cpp
  Compiling cluster.cpp
  Compiling clusterize.cpp
  Compiling cluster_functions.cpp
  Compiling modularity.cpp
  Compiling tri4algo.cpp
  Linking libbrh.so
  Compiling brhclus.cpp
  Linking brhclus
.linux/brhclus.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:222: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:223: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:224: undefined reference to `boost::system::system_category()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::detail::get_current_thread_data()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::this_thread::disable_interruption::disable_interruption()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::this_thread::interruption_point()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::start_thread_noexcept()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::interrupt()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::this_thread::hiden::sleep_until(timespec const&)'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::join_noexcept()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `vtable for boost::detail::thread_data_base'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::native_handle()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::detach()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::this_thread::disable_interruption::~disable_interruption()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `typeinfo for boost::detail::thread_data_base'
collect2: error: ld returned 1 exit status
make[2]: *** [/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/bin/brhclus] Error 1
make[1]: *** [tools/brhclus] Error 2
make: *** [all] Error 2

Stage 6 – Google Says Make Some Symbolic Links

A first fix for the boost error was to make symbolic links for libboost_thread.so and libboost_timer.so in /usr/lib.

username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ cd /usr/lib/x86_64-linux-gnu/
username@ubuntu:/usr/lib/x86_64-linux-gnu$ sudo ln -s libboost_thread.so /usr/lib
username@ubuntu:/usr/lib/x86_64-linux-gnu$ sudo ln -s libboost_timer.so /usr/lib
username@ubuntu:/usr/lib/x86_64-linux-gnu$ cd /opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/
username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo make clean
username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo ./configure.sh 
OK - boost libraries
OK - boost thread libraries
OK - boost include dir
OK - tclap include dir
OK - thread pool include dir
Config file (/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/Makefile.config) successfully created

But this didn’t work either.

username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo make all
  Compiling brh_version.cpp
  Compiling brh_common.cpp
  Compiling pairdataset.cpp
  Compiling brh_functions.cpp
  Compiling keymap.cpp
  Compiling inparalog.cpp
  Compiling clusterdata.cpp
  Compiling cluster.cpp
  Compiling clusterize.cpp
  Compiling cluster_functions.cpp
  Compiling modularity.cpp
  Compiling tri4algo.cpp
  Linking libbrh.so
  Compiling brhclus.cpp
  Linking brhclus
.linux/brhclus.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:222: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:223: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:224: undefined reference to `boost::system::system_category()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::detail::get_current_thread_data()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::this_thread::disable_interruption::disable_interruption()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::this_thread::interruption_point()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::start_thread_noexcept()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::interrupt()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::this_thread::hiden::sleep_until(timespec const&)'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::join_noexcept()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `vtable for boost::detail::thread_data_base'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::native_handle()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::thread::detach()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `boost::this_thread::disable_interruption::~disable_interruption()'
/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib/libbrh.so: undefined reference to `typeinfo for boost::detail::thread_data_base'
collect2: error: ld returned 1 exit status
make[2]: *** [/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/bin/brhclus] Error 1
make[1]: *** [tools/brhclus] Error 2
make: *** [all] Error 2

Stage 7 – The Boost Issue May Be Ubuntu-Specific

The final solution was to modify the Makefile.rules file to explicitly call on boost in Ubuntu. Make a backup copy of the Makefile.rules in the OrthoDB folder, then place this new Makefile.rules file into the same folder. The modified Makefile.rules is below for copy+paste, else you can download it here: 2016mar25_orthodb_Makefile_rules.txt (just rename the file and place into OrthoDB_soft_1.6/BRHCLUS-1.12.7).

username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo nano Makefile.rules 
#
# Build rules
#

# Keep secondary files
.SECONDARY:

include $(ROOT_DIR)/Makefile.config
ifeq ($(strip $(DIR_TCLAP)),)
$(error "Build requires TCLAP package (http://tclap.sourceforge.net)")
endif

# if install, read build details
ifeq "$(MAKE-TARGET)" "install"
include $(ROOT_DIR)/.makefile.build
endif

# Object directory
OBJ_DIR		= .linux

# Use gcc4
CXX		= g++

# Use rpath or not
WITH_RPATH	?= 1

LDFLAGS		= 
ifeq "$(MAKE-TARGET)" "static"
WITH_RPATH	= 0
LDFLAGS		+= -static -lboost_system -lboost_thread -lpthread
endif

# check BOOST
USE_BOOST ?= 1

# check boost threads
USE_BOOST_THREAD ?= 1

ifeq ($(strip $(LIB_BOOST_THREAD)),)
USE_BOOST_THREAD = 0
USE_THREADPOOL = 0
endif

ifeq ($(strip $(DIR_THREADPOOL)),)
USE_THREADPOOL = 0
endif

# Library and binary directories
BASE_DIR	:= $(shell cd $(ROOT_DIR) ; pwd)

# Install directories
# With rpath, enforce install dir same as build
# Without, use same as build as default
# prefix - install topdir
# libdir/bindir - install lib/bin
# BASE_DIR - build top dir
# LIB_DIR/BIN_DIR - build top dir
#
# with rpath :
#   build and install dirs are the same
#   default top is BASE_DIR
# else :
#   build is always under BASE_DIR
#   install under prefix (default BASE_DIR)
#
#ifeq ($(WITH_RPATH),1)
#prefix		?= $(BASE_DIR)
#libdir		= $(prefix)/lib
#bindir		= $(prefix)/bin
##LIB_DIR		:= $(shell mkdir -p $(libdir) ; cd $(libdir) ; pwd)
##BIN_DIR		:= $(shell mkdir -p $(bindir) ; cd $(bindir) ; pwd)
#LIB_DIR		:= $(libdir)
#BIN_DIR		:= $(bindir)
#else
#LIB_DIR		:= $(shell mkdir -p $(BASE_DIR)/lib ; cd $(BASE_DIR)/lib ; pwd)
#BIN_DIR		:= $(shell mkdir -p $(BASE_DIR)/bin ; cd $(BASE_DIR)/bin ; pwd)
#prefix		?= $(BASE_DIR)
#libdir		?= $(LIB_DIR)
#bindir		?= $(BIN_DIR)
#endif
LIB_DIR		:= $(shell mkdir -p $(BASE_DIR)/lib ; cd $(BASE_DIR)/lib ; pwd)
BIN_DIR		:= $(shell mkdir -p $(BASE_DIR)/bin ; cd $(BASE_DIR)/bin ; pwd)
prefix		?= $(BASE_DIR)
libdir		?= $(LIB_DIR)
bindir		?= $(BIN_DIR)
LIB_INSTDIR := $(prefix)/lib
BIN_INSTDIR := $(prefix)/bin

# Install user/group
INST_USR	 = $(shell whoami)
INST_GRP	?= $(shell groups | cut -f 1 -d ' ' )

# Establish install command
# if rpath -> always chown
# else
#   if targetdir==installdir -> chown
#   else install
# endif
#ifeq ($(WITH_RPATH),1)
#INST_CMD	 = chown $(INST_USR).$(INST_GRP)
#else
TARGET_DIR	= $(dir $(TARGET))
rpTARGET	= $(realpath $(firstword $(TARGET_DIR)))
rpINSTDIR	= $(realpath $(prefix)/$(INSTDIR))
ifeq ($(rpTARGET),$(rpINSTDIR))
INST_CMD	 = chown $(INST_USR).$(INST_GRP)
else
INST_CMD	 = mkdir -p $(prefix)/$(INSTDIR); install -D -m 755 -g $(INST_GRP) -t $(prefix)/$(INSTDIR)
endif
#endif

# Definitions concerning build environment
CPPFLAGS	+= -DBRH_BUILD_ENV="\"$(shell uname -s -r -v -m -i -p -o)\""
CPPFLAGS	+= -DBRH_BUILD_TIME="\"$(shell date)\""

# Default pre-processor flags
CPPFLAGS	+= -DBASE_DIR="\"$(BASE_DIR)\""
CPPFLAGS	+= -D_REENTRANT
CPPFLAGS	+= -D_XOPEN_SOURCE

# c++ standard
CPPFLAGS	+= -std=c++11
CXXFLAGS	+= -std=c++11

# debug flag
ifeq ($(USE_DEBUG),3)
CXXFLAGS	+= -fno-inline -fbounds-check
else ifeq ($(USE_DEBUG),2)
CPPFLAGS	+= -DBRH_DEBUG
CXXFLAGS	+= -fno-inline -fbounds-check
else ifeq ($(USE_DEBUG),1)
CPPFLAGS	+= -DBRH_CHECK_IT
CXXFLAGS	+= -finline-functions -fbounds-check
else
CXXFLAGS	+= -finline-functions
endif

# Default compiler flags
CXXFLAGS	+= -fPIC
CXXFLAGS	+= -MMD
CXXFLAGS	+= -g
CXXFLAGS	+= -Wall -Werror
CXXFLAGS	+= -fexceptions
#CXXFLAGS	+= -fno-inline
CXXFLAGS	+= -O3
#CXXFLAGS	+= -O0
CXXFLAGS	+= -I$(BASE_DIR)/src
#CXXFLAGS	+= -std=c++11
#CXXFLAGS	+= -pg
#LDFLAGS		+= -pg

# BRH flags
ifeq ($(USE_BRH),1)
BRH_DIR		= $(BASE_DIR)
CPPFLAGS	+= -I$(BRH_DIR)/src
ifeq ($(WITH_RPATH),1)
LDFLAGS		+= -L$(LIB_DIR) -Wl,-rpath,$(LIB_INSTDIR) -lboost_system -lboost_thread -lpthread
else
LDFLAGS		+= -L$(LIB_DIR) -lboost_system -lboost_thread -lpthread
endif
LDLIBS		+= -lbrh -lboost_system -lboost_thread -lpthread
endif

ifeq ($(USE_BOOST_THREAD),1)
CPPFLAGS	+= -pthread -DHAS_BOOST_THREADS
LDFLAGS		+= -pthread -L$(DIR_BOOST_LIB) -lboost_system -lboost_thread -lpthread -L$(DIR_BOOST_THREAD) -l$(LIB_BOOST_THREAD)
endif

ifeq ($(USE_THREADPOOL),1)
CPPFLAGS	+= -DHAS_BOOST_THREADPOOL
CPPFLAGS	+= -I$(DIR_THREADPOOL)
endif

ifeq ($(USE_BOOST),1)
CPPFLAGS	+= -I$(DIR_BOOST_INC)
endif

# TCLAP flags
ifeq ($(USE_TCLAP),1)
CPPFLAGS	+= -I$(DIR_TCLAP)
endif

# BOOST flags
ifeq ($(USE_THREAD),1)
endif

# Check file type
ifeq ($(suffix $(firstword $(SOURCES))),.cpp)
IS_CPP		= 1
else
IS_CPP		= 0
endif

# List of objects
ifeq ($(IS_CPP),1)
OBJECTS		= $(SOURCES:%.cpp=$(OBJ_DIR)/%.o)
endif

# Default build
default:	all

ifeq ($(IS_CPP),1)
# Build a binary
$(BIN_DIR)/%: $(OBJECTS) Makefile $(BASE_DIR)/Makefile.rules
	@echo "  Linking $(@F)"
	@mkdir -p $(@D)
	@$(LINK.cc) $(LDFLAGS) -o $@ $(OBJECTS) $(LDLIBS)

# Build a shared library
$(LIB_DIR)/%.so: $(OBJECTS) Makefile $(BASE_DIR)/Makefile.rules
	@echo "  Linking $(@F)"
	@mkdir -p $(@D)
	@$(LINK.cc) -shared -o $@ $(OBJECTS) $(LDLIBS)

# Build a static library
$(LIB_DIR)/%.a: $(OBJECTS) Makefile $(BASE_DIR)/Makefile.rules
	@echo "  Linking $(@F)"
	@mkdir -p $(@D)
	@ar rcs $@ $(OBJECTS)

# Include dependency files
-include $(OBJECTS:%.o=%.d)

# Build an object file
$(OBJ_DIR)/%.o: %.cpp Makefile
	@echo "  Compiling $< "
	@mkdir -p $(@D)
	@$(COMPILE.cc) -o $@ $<
else
$(BIN_DIR)/%.py: %.py
	@echo "  Copying $< to target dir"
	@cp -f $< $@
endif



# Main targets are phony
.PHONY: default all clean_target clean_obj doc clean_doc clean install static

# Build target
all:	$(TARGET)

static:	$(TARGET)

# Clean objects
clean_obj:
	@$(RM) -r $(OBJ_DIR)

# Clean build
clean_target:
	@$(RM) -r $(OBJ_DIR) $(TARGET)

# Build documentation
doc:
	@$(MAKE) -C $(BASE_DIR) $@

# Clean build
clean: clean_target

# Install
install:
#	@echo "rpT   : $(rpTARGET)"
#	@echo "rpI   : $(rpINSTDIR)"
#	@echo "rpath : $(WITH_RPATH)"
#	@echo "inst  : $(INST_CMD) $(TARGET)"
	@target="$(TARGET)"; \
	[ $${#target} -gt 0 ] || target="$(OUTPUT)"; \
	for f in $${target}; do \
	    fname=`basename $$f`; \
	    if [ -f $$f ]; then \
	       echo "Installing in $(prefix)/$(INSTDIR)    <$$fname>"; \
	       $(INST_CMD) $$f; \
	    fi; \
	done

The configure step runs fine…

username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo make clean
username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo ./configure.sh 
OK - boost libraries
OK - boost thread libraries
OK - boost include dir
OK - tclap include dir
OK - thread pool include dir
Config file (/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/Makefile.config) successfully created

…and the build itself runs fine.

username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo make all
  Compiling brh_version.cpp
  Compiling brh_common.cpp
  Compiling pairdataset.cpp
  Compiling brh_functions.cpp
  Compiling keymap.cpp
  Compiling inparalog.cpp
  Compiling clusterdata.cpp
  Compiling cluster.cpp
  Compiling clusterize.cpp
  Compiling cluster_functions.cpp
  Compiling modularity.cpp
  Compiling tri4algo.cpp
  Linking libbrh.so
  Compiling brhclus.cpp
  Linking brhclus
  Compiling evolrate.cpp
  Linking evolrate
  Compiling statbrh.cpp
  Linking statbrh
  Compiling brh2x.cpp
  Linking brh2x
  Compiling statclus.cpp
  Linking statclus
  Compiling cmpclus.cpp
  Linking cmpclus
  Compiling getclus.cpp
  Linking getclus
  Compiling cmpbrh.cpp
  Linking cmpbrh
  Compiling cmpinpar.cpp
  Linking cmpinpar
  Compiling renumclus.cpp
  Linking renumclus
  Compiling getinpar.cpp
  Linking getinpar
  Compiling mergeinpar.cpp
  Linking mergeinpar
  Compiling align2brh.cpp
  Linking align2brh
  Compiling findbrh.cpp
  Linking findbrh
  Copying parsedump.py to target dir
  Copying getbrh.py to target dir
  Copying plot_brhclus_progress.py to target dir

Stage 8 – Build The Tests

Just to make sure all is working, make globaltest.

username@ubuntu:/opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7$ sudo make globaltest 

-------------------------------------------------------------
Binary  dir : /opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/bin
Library dir : /opt/OrthoDB_soft_1.6/BRHCLUS-1.12.7/lib
-------------------------------------------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST MACHINE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uname [ Linux ubuntux 3.16.0-59-generic #79~14.04.1-Ubuntu SMP Mon Jan 18 15:41:27...]
cpu   [ Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz]
mem   [ MemTotal:        3949740 kB]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST BRHCLUS
with option --single
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
run default setup
------------------------------
------------------------------
run with harder e-value cuts
------------------------------
------------------------------
run with soft e-value cuts
------------------------------
------------------------------
Check output files
------------------------------
default                                [OK]
hard_e-val                             [OK]
soft_e-val                             [OK]
------------------------------
Check timing
------------------------------
default                                [16 %]
hard_e-val                             [-8 %]
soft_e-val                             [10 %]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST BRHCLUS, resume function
with option --single
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
resume                                 [OK, contents same but clids or seqs differ]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST BRHCLUS
with option --nostringent
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
run default setup
------------------------------
------------------------------
run with harder e-value cuts
------------------------------
------------------------------
run with soft e-value cuts
------------------------------
------------------------------
Check output files
------------------------------
default                                [OK]
hard_e-val                             [OK]
soft_e-val                             [OK]
------------------------------
Check timing
------------------------------
default                                [18 %]
hard_e-val                             [10 %]
soft_e-val                             [2 %]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST BRHCLUS, resume function
with option --nostringent
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
resume                                 [OK, contents same but clids or seqs differ]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST BRHCLUS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
run default setup
------------------------------
------------------------------
run with harder e-value cuts
------------------------------
------------------------------
run with soft e-value cuts
------------------------------
------------------------------
Check output files
------------------------------
default                                [OK]
hard_e-val                             [OK]
soft_e-val                             [OK]
------------------------------
Check timing
------------------------------
default                                [7 %]
hard_e-val                             [8 %]
soft_e-val                             [12 %]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST BRHCLUS, resume function
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
resume                                 [OK, contents same but clids or seqs differ]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST BRHCLUS
with option --lowmem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
run default setup
------------------------------
------------------------------
run with harder e-value cuts
------------------------------
------------------------------
run with soft e-value cuts
------------------------------
------------------------------
Check output files
------------------------------
default                                [OK]
hard_e-val                             [OK]
soft_e-val                             [OK]
------------------------------
Check timing
------------------------------
default                                [6 %]
hard_e-val                             [8 %]
soft_e-val                             [7 %]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST BRHCLUS, resume function
with option --lowmem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
resume                                 [OK, contents same but clids or seqs differ]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST BRHCLUS
merge BRHs into an existing cluster configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mergebrh                               [OK]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST STATCLUS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
default                                [OK]
hard_e-val                             [OK]
soft_e-val                             [OK]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST CMPCLUS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
exact_match                            [OK]
mis-match                              [OK]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST CMPCLUS
related groups
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
default                                [OK]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST MERGEINPAR
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clusters                               [OK]
unresolved                             [OK]


------------------------------------------
Warnings (4) were detected.
------------------------------------------

Most likely this is of not concern and the probable origin are messages like

  [OK, contents same but clids or seqs differ]

They may be caused by rounding errors on different architectures/versions of the software.

NAMOT Pre-Release 2.2.0-pre4 In OSX 10.8 (Maybe Older Versions)

A recent visit to the College of Nanoscale Science and Engineering (CNSE) at SUNY Albany inspired a few new DNA ideas that I decided would be greatly simplified by having NAMOT available again for design. Having failed at the base install of the NAMOT 2 version and, unfortunately, not having NAMOT available in Fink for a simple installation, the solution became to build the pre-release from scratch. Ignoring the many errors one encounters while walking through an OSX/Xcode/Fink/X11 bootstrap, the final procedure worked well and without major problem. As usual, the error messages at varied steps are provided below because, I assume, those messages are what you’re searching for when you find your way here.

0. Required Installations

You’ll need the following installed for this particular build. I believe XCode is the only thing that you’ll have to pay for (if you don’t already have it. I seem to remember paying $5 through the App Store).

1. XCode

The OSX Developer Suite – developer.apple.com/xcode

2. XQuartz

An OSX (X.Org) X Window System – xquartz.macosforge.org/landing/

3. Fink

An OSX port program for a host of Unix codes and libraries – www.finkproject.org

3a. GSL

The GNU Scientific (C and C++) Libraries – www.gnu.org/software/gsl. This will be installed with Fink.

3b. LessTif

An OSF/Motif clone (made available for OSX through Fink) – lesstif.sourceforge.net. This will be installed with Fink.

4. NAMOT2.2.0-pre4

The -pre4 is currently available (from 2003) from sourceforge.net/projects/namot/files/. I did not try -pre3 and had no luck with the official 2 release.

And, with that…

1. XCode

Blindly follow the install procedure. Several steps below deal with working around the default install locations (specifically, /sw).

2. XQuartz

If you don’t have XQuartz installed, you’re configure step…

cd Downloads
cd namot-2.2.0-pre4
./configure 

will produce the following error…

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
...
creating libtool
checking for X... no
checking for main in -lX11... no
NAMOT requires Xwindows

Blindly follow the XQuartz install process. After the installations, you’ll receive the same error as above. The –x-libraries= and –x-includes= additions to configure below direct the script to the proper libraries and includes.

./configure --x-libraries=/usr/X11/lib/ --x-includes=/usrX11/include/

Hopefully, you’ll find yourself past the first install problem and onto the second problem.

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
...
creating libtool
checking for X... libraries /usr/X11/lib/, headers /usrX11/include/
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for main in -lX11... yes
checking for main in -lgslcblas... no
NAMOT requires GNU Scientific Library

3. Fink

The next two codes that need to be installed are the GNU Scientific Libraries and LessTif, both of which are much easier to install using Fink. It is generally useful for many other codes as well, so a good program for any computational chemist to have on hand. The install should be non-problematic despite having to build it from source in 10.6 – 10.8 (as of January 2013). If you build with all the default settings, you’ll have no trouble after.

cd Downloads
cd fink-0.34.4
./bootstrap 

I chose the default settings throughout.

Fink must be installed and run with superuser (root) privileges. Fink can automatically try to become root when it's run from a user account. Since you're currently running this script as a normal user, the method you choose will also be used immediately for this script. Available methods:

(1)	Use sudo
(2)	Use su
(3)	None, fink must be run as root

Choose a method: [1] 

...

You should now have a working Fink installation in '/sw'. You still need package descriptions if you want to compile packages yourself. You can get them by running either of the commands: 'fink selfupdate-rsync', to update via rsync (generally preferred); or 'fink selfupdate-cvs', to update via CVS (more likely to work through a firewall).

Run '. /sw/bin/init.sh' to set up this terminal session environment to use Fink. To make the software installed by Fink available in all of your future terminal shells, add '. /sw/bin/init.sh' to the init script '.profile' or '.bash_profile' in your home directory. The program /sw/bin/pathsetup.sh can help with this. Enjoy.

Then you run the final step in Fink below:

/sw/bin/pathsetup.sh

Which will produce the following two pop-ups notifying you of shell modifications.

3a. GSL

With the install of Fink, you need to install GSL and LessTif. If you try to install either immediately after installation…

fink install gsl

…you’ll receive the following error:

Password:
Scanning package description files..........
Information about 305 packages read in 0 seconds.
no package found for "gsl"
Failed: no package found for specification 'gsl'!

Required after the installation is a fink selfupdate.

fink selfupdate

As usual, follow the default settings…

fink needs you to choose a SelfUpdateMethod.

(1)	cvs
(2)	Stick to point releases
(3)	rsync

Choose an update method [3] 
/usr/bin/find /sw/fink -name CVS -type d -print0 | xargs -0 /bin/rm -rf
fink is setting your default update method to rsync
...
Updating the list of locally available binary packages.
Scanning dists/stable/main/binary-darwin-i386
New package: dists/stable/main/binary-darwin-i386/base/base-files_1.9.13-1_darwin-i386.deb
New package: dists/stable/main/binary-darwin-i386/base/fink-mirrors_0.34.4.1-1_darwin-i386.deb

Which then leads to a successful GSL install.

fink install gsl

Producing the following output…

Information about 12051 packages read in 1 seconds.
The package 'gsl' will be built and installed.
Reading build dependency for gsl-1.15-1...
Reading dependency for gsl-1.15-1...
Reading runtime dependency for gsl-1.15-1...
Reading dependency for gsl-shlibs-1.15-1...
...
Updating the list of locally available binary packages.
Scanning dists/stable/main/binary-darwin-i386
New package: dists/stable/main/binary-darwin-i386/sci/gsl-shlibs_1.15-1_darwin-i386.deb
New package: dists/stable/main/binary-darwin-i386/sci/gsl_1.15-1_darwin-i386.deb

Attempting a fresh build after the GSL step…

./configure --x-libraries=/usr/X11/lib/ --x-includes=/usrX11/include/

…then still produces the following error:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
...
checking for IceConnectionNumber in -lICE... yes
checking for main in -lX11... yes
checking for main in -lgslcblas... no
NAMOT requires GNU Scientific Library

As mentioned above, there are a few redirects that need to be made after the XCode / Fink install to put libraries and includes where, in this case, NAMOT expects them. To perform this task, we’ll be using symbolic links.

sudo ln -s /sw/include/gsl /usr/include/
sudo ln -s /sw/lib/libgsl* /usr/lib

Now attempting a build…

./configure --x-libraries=/usr/X11/lib/ --x-includes=/usrX11/include

Gets you past the GSL issue.

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
…
checking for IceConnectionNumber in -lICE... yes
checking for main in -lX11... yes
checking for main in -lgslcblas... yes
checking for main in -lgsl... yes
checking for XShmCreateImage in -lXext... yes
checking for main in -lXt... yes
checking for main in -lXm... no
NAMOT requires Motif...try LessTif(http://www.lesstif.org)

3b. LessTif

The LessTif symbolic links work the same as the GSL symbolic links. This fink install may take a while.

fink install lesstif

Output below…

Information about 12051 packages read in 1 seconds.
The package 'lesstif' will be built and installed.
Reading build dependency for lesstif-0.95.2-4...
Reading dependency for lesstif-0.95.2-4...
Reading runtime dependency for lesstif-0.95.2-4...
...
Setting up lesstif (0.95.2-4) ...
Clearing dependency_libs of .la files being installed

Updating the list of locally available binary packages.
Scanning dists/stable/main/binary-darwin-i386
New package: dists/stable/main/binary-darwin-i386/x11/app-defaults_20010814-12_darwin-i386.deb
New package: dists/stable/main/binary-darwin-i386/x11/lesstif-bin_0.95.2-4_darwin-i386.deb
New package: dists/stable/main/binary-darwin-i386/x11/lesstif-shlibs_0.95.2-4_darwin-i386.deb
New package: dists/stable/main/binary-darwin-i386/x11/lesstif_0.95.2-4_darwin-i386.deb
./configure --x-libraries=/usr/X11/lib/ --x-includes=/usrX11/include/

But, unfortunately, the LessTif libraries are not in the expected locations.

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
...
checking for IceConnectionNumber in -lICE... yes
checking for main in -lX11... yes
checking for main in -lgslcblas... yes
checking for main in -lgsl... yes
checking for XShmCreateImage in -lXext... yes
checking for main in -lXt... yes
checking for main in -lXm... no
NAMOT requires Motif...try LessTif(http://www.lesstif.org)

So we add the symbolic links…

sudo ln -s /sw/lib/libXm.* /usr/lib
sudo ln -s /sw/include/Xm /usr/include

Which, finally, runs configure…

./configure --x-libraries=/usr/X11/lib/ --x-includes=/usrX11/include/

…with no errors.

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
...
config.status: creating docs/demos/curve/Makefile
config.status: creating docs/demos/dit/Makefile
config.status: creating docs/demos/Makefile
config.status: creating config.h
config.status: executing depfiles commands

NOTE: The make step with Python 2.6 produces the following error below. I did not diagnose this beyond the failure to build under 10.6. OSX 10.8 comes with Python 2.7, which did not produce this problem (I’m assuming this is the origin of the problem).

make

…will produce the following error at the pngwriter.c step.

/bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I..    -DLIB_HOME="\"/usr/local/share/namot\"" -DHELP_FILE_DIR="\"/usr/local/share/namot\"" -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config -g -O2 -c -o _pynamot_la-pngwriter.lo `test -f 'pngwriter.c' || echo './'`pngwriter.c
gcc -DHAVE_CONFIG_H -I. -I. -I.. -DLIB_HOME=\"/usr/local/share/namot\" -DHELP_FILE_DIR=\"/usr/local/share/namot\" -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config -g -O2 -c pngwriter.c -MT _pynamot_la-pngwriter.lo -MD -MP -MF .deps/_pynamot_la-pngwriter.TPlo  -fno-common -DPIC -o _pynamot_la-pngwriter.lo
pngwriter.c: In function 'dump_PNG':
pngwriter.c:28: error: 'png_structp' undeclared (first use in this function)
pngwriter.c:28: error: (Each undeclared identifier is reported only once
pngwriter.c:28: error: for each function it appears in.)
pngwriter.c:28: error: expected ';' before 'png_ptr'
pngwriter.c:29: error: 'png_infop' undeclared (first use in this function)
pngwriter.c:29: error: expected ';' before 'info_ptr'
pngwriter.c:30: error: 'png_byte' undeclared (first use in this function)
pngwriter.c:30: error: 'row_pointers' undeclared (first use in this function)
pngwriter.c:30: error: expected expression before ')' token
pngwriter.c:31: error: 'png_text' undeclared (first use in this function)
pngwriter.c:31: error: expected ';' before 'text_ptr'
pngwriter.c:39: warning: incompatible implicit declaration of built-in function 'memset'
pngwriter.c:39: error: 'text_ptr' undeclared (first use in this function)
pngwriter.c:47: error: 'png_ptr' undeclared (first use in this function)
pngwriter.c:47: error: 'PNG_LIBPNG_VER_STRING' undeclared (first use in this function)
pngwriter.c:48: error: 'png_voidp' undeclared (first use in this function)
pngwriter.c:57: error: 'info_ptr' undeclared (first use in this function)
pngwriter.c:60: error: 'png_infopp' undeclared (first use in this function)
pngwriter.c:82: error: 'PNG_COLOR_TYPE_RGB' undeclared (first use in this function)
pngwriter.c:82: error: 'PNG_INTERLACE_ADAM7' undeclared (first use in this function)
pngwriter.c:83: error: 'PNG_COMPRESSION_TYPE_DEFAULT' undeclared (first use in this function)
pngwriter.c:83: error: 'PNG_FILTER_TYPE_DEFAULT' undeclared (first use in this function)
pngwriter.c:85: error: 'PNG_sRGB_INTENT_ABSOLUTE' undeclared (first use in this function)
pngwriter.c:90: error: 'PNG_TEXT_COMPRESSION_NONE' undeclared (first use in this function)
pngwriter.c:93: error: 'PNG_TEXT_COMPRESSION_zTXt' undeclared (first use in this function)
pngwriter.c:104: error: expected expression before ')' token
make[2]: *** [_pynamot_la-pngwriter.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

The build on 10.8 continues as below, with a few warnings about the symbolic link usage that do not seem to affect the program usability (or continued build).

make

Results below…

make  all-recursive
Making all in src
source='namot_wrap.c' object='_pynamot_la-namot_wrap.lo' libtool=yes \
	depfile='.deps/_pynamot_la-namot_wrap.Plo' tmpdepfile='.deps/_pynamot_la-namot_wrap.TPlo' \
	depmode=gcc3 /bin/sh ../depcomp \
	/bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I..    -DLIB_HOME="\"/usr/local/share/namot\"" -DHELP_FILE_DIR="\"/usr/local/share/namot\"" -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -g -O2 -c -o _pynamot_la-namot_wrap.lo `test -f 'namot_wrap.c' || echo './'`namot_wrap.c

...

*** Warning: linker path does not have real file for library -lXm.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libXm and none of the candidates passed a file format test
*** using a file magic. Last file checked: /sw/lib/libXm.la

*** Warning: linker path does not have real file for library -lgsl.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libgsl and none of the candidates passed a file format test
*** using a file magic. Last file checked: /sw/lib/libgsl.la

*** Warning: linker path does not have real file for library -lgslcblas.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libgslcblas and none of the candidates passed a file format test
*** using a file magic. Last file checked: /sw/lib/libgslcblas.la

*** Warning: libtool could not satisfy all declared inter-library
*** dependencies of module _pynamot.  Therefore, libtool will create
*** a static module, that should work as long as the dlopening
*** application is linked with the -dlopen flag.

...

Making all in libs
make[2]: Nothing to be done for `all'.
Making all in docs
Making all in helpfiles
make[3]: Nothing to be done for `all'.
Making all in demos
Making all in 6way
make[4]: Nothing to be done for `all'.
Making all in bending
make[4]: Nothing to be done for `all'.
Making all in cube
make[4]: Nothing to be done for `all'.
Making all in curve
make[4]: Nothing to be done for `all'.
Making all in dit
make[4]: Nothing to be done for `all'.
make[4]: Nothing to be done for `all-am'.
make[3]: Nothing to be done for `all-am'.
Making all in etc
make[2]: Nothing to be done for `all'.

Finally, the install…

make install

Which produces the following:

Making install in src
/bin/sh ../mkinstalldirs /usr/local/lib
 /bin/sh ../libtool --mode=install /usr/bin/install -c  _pynamot.la /usr/local/lib/_pynamot.la
/usr/bin/install -c .libs/_pynamot.lai /usr/local/lib/_pynamot.la
/usr/bin/install -c .libs/_pynamot.a /usr/local/lib/_pynamot.a
ranlib /usr/local/lib/_pynamot.a
chmod 644 /usr/local/lib/_pynamot.a
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
...
/bin/sh ../mkinstalldirs /usr/local/share/namot
 /usr/bin/install -c -m 644 Namot2.512 /usr/local/share/namot/Namot2.512
 /usr/bin/install -c -m 644 Namot2.600 /usr/local/share/namot/Namot2.600
 /usr/bin/install -c -m 644 Namot2.700 /usr/local/share/namot/Namot2.700
 /usr/bin/install -c -m 644 icon1.xv /usr/local/share/namot/icon1.xv
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.

With luck, your launching of NAMOT will open XQuartz and produce a fully operational NAMOT session.

namot

And, for more assistance with producing DNA files for GROMACS, consider the Modifications To The ffG53a6.rtp And ffG53a5.rtp Residue Topology Files Required For Using GROMOS96-NAMOT-GROMACS v1, sed-Based Script For Converting NAMOT And NAMOT2 DNA Output To GROMOS96 Format For GROMACS Topology Generation v1, and sed-Based Script For Converting NAMOT And NAMOT2 DNA Output To ffAMBER Format For GROMACS Topology Generation v1 pages on this blog.

A Most Unlikely Obvious Molecule: DNA And Its Consequences – Slides From The CNY Skeptics Talk

I’ve been fortunate twice this year to have the Central New York (CNY) Skeptics force me to commit to a presentation topics I thought were worth presenting. As a complement to the audio that will appear at some point on the CNY Skeptics site, I’ve posted the non-animated slides as a PDF below. And the press photo’s from a way-back Excelsior Cornet Band gig where I had too long a wait between playing and marching.


Download: DGAllis_CNY_Skeptics_DNA_Lecture_7_Nov_2012.pdf, 8.3 MB

CNY Skeptics Presents Damian Allis, Ph.D., on “A Most Unlikely Obvious Molecule: DNA And Its Consequences”

Wednesday, November 7, 2012, 7:00 pm
DeWitt Community Library at Shoppingtown Mall
Buckland Community Room

DNA is Nature’s medium of digital information storage and access from which cellular machinery produces life itself. The 60 years of advances in our understanding of DNA have run in parallel with advances in computer technology and information science, and we are now entering an age of whole-genome maps, customized diagnoses, medicines, and dosages from genetic testing, and genetic modification that may eradicate some disorders completely. From super crops to super humans, the genetic information age offers humanity many different possible outcomes. This lecture will cover some of the history, machinery, possibilities, and consequences of DNA life.

Dr. Damian Allis is a research professor in the Department of Chemistry at Syracuse University, research fellow with the Forensic and National Security Sciences Institute, and bioinformaticist for Aptamatrix, Inc. He contains approximately 20 billion miles of DNA.