timflutre / eqtlbma

Package to detect eQTLs jointly in multiple subgroups (e.g. tissues) via Bayesian Model Averaging.
http://www.plosgenetics.org/article/info%3Adoi%2F10.1371%2Fjournal.pgen.1003486
GNU General Public License v3.0
22 stars 12 forks source link

Installation & make check on Mac OS X #24

Closed pcarbo closed 8 years ago

pcarbo commented 8 years ago

Hi Tim,

I see that you have made some effort to make eqtlbma work on Mac OS X. I wanted to share with you my experiences installing eqtlbma on Mac OS X and perhaps we can provide some Mac-specific installation instructions for others on the Wiki.

I've found that Homebrew is key to making the installation process smoother, especially due to the constraints imposed by more recent editions of OS X (e.g., El Capitan). However, one should keep in mind that Homebrew seems to be in flux, so the exact steps may differ depending on the version of Homebrew used.

Here are the steps I took:

  1. Install Homebrew 1.0.7 from http://brew.sh. Note before I need to install command-line tools: xcode-select --install. I'm using XCode 8.0.
  2. Install gcc 4.8.5 using Homebrew: brew install homebrew/versions/gcc48
  3. Install gsl 1.16: brew install homebrew/versions/gsl1
  4. Install zlib 1.2.8: brew install homebrew/dupes/zlib
  5. Install R 3.3.1 from http://r-project.org.
  6. Install R package MASS 7.3-45.
  7. Install eqtlbma 1.3.1:
./configure --prefix=/Users/msmith/eqtlbma \
  LDFLAGS="-L/usr/local/lib -L/usr/local/opt/zlib/lib" CXX="g++-4.8" \
  CPPFLAGS="-I/usr/local/include -I/usr/local/opt/zlib/include"

The only issue I've found so far is against with the tests. It is a strange problem in which zcmp does not work because sh does not seem to be supported. One solution is simply to use cmp instead of zcmp in the bash scripts. For example, in test_basic.bash, write

        gunzip obs_bf_sumstats_s${i}.txt.gz
        gunzip exp_bf_sumstats_s${i}.txt.gz
        if ! cmp -s obs_bf_sumstats_s${i}.txt exp_bf_sumstats_s${i}.txt; then
            echo "file 'obs_bf_sumstats_s${i}.txt.gz' has differences with exp"
            exit 1
        fi
        gzip obs_bf_sumstats_s${i}.txt
        gzip exp_bf_sumstats_s${i}.txt

Perhaps you can find a more elegant (or more compact) solution, but this works for me.

Peter

timflutre commented 8 years ago

Hi Peter,

a while ago, I made a wiki page on this topic. At the time, I didn't have to use Homebrew.

As I don't own any computer with Mac OS, I can't test thoroughly, especially when the versions of Mac OS change.

About zcmp, can you look in Homebrew if you can install Zutils? Otherwise, it should be possible to install it from the source code. If it's too difficult, then you can indeed change the source code of all bash scripts implementing a test.

pcarbo commented 8 years ago

Tim,

I did not see your Wiki page for Mac OS X! My steps are similar, but I find that Homebrew makes the whole installation process much simpler. (And more recent editions of OS X have made installation of libraries more complicated due to stronger restrictions on edit permissions.) Would it be okay if I updated that Wiki page?

On Mac OS X (version 10.11.6), zcmp is available at '/usr/bin/zcmp'. The problem is that the script uses the sh shell, which does not seem to be fully supported on Mac OS X. It is a strange problem that I'm not sure how to fix, and I was unable to find any help from Google searches. I suspect that very few people use zcmp on Mac. So it seems like the simpler solution would be to use cmp instead of zcmp.

Peter

timflutre commented 8 years ago

Yes, you can modify the page.

Ok, then you can convert all usages of zcmp into usages of cmp. The files to be compared are not very big, so it shouldn't be such a problem to decompress-recompress them.

pcarbo commented 8 years ago

Tim, once you have a chance, please merge branch no-zcmp with master. (Or, if you prefer, I can do the merge.) To merge, I think you want to do something like this:

git remote update origin
git fetch origin

To see the differences:

git diff --stat no-zcmp..master
git diff no-zcmp..master

Then do the merge:

git checkout master
git merge no-zcmp 
pcarbo commented 8 years ago

Tim, I've updated the Wiki.

timflutre commented 8 years ago

All the edits seem fine to me. I will let you do the merge. Can you also update the version to 1.3.2, tag it, and push the tag to GitHub so that it appears here?

pcarbo commented 8 years ago

I merged to master, and added the v1.3.2 tag:

https://github.com/timflutre/eqtlbma/releases

Does that look okay?

timflutre commented 8 years ago

looks good, thank!