From 31d7486e62babece315b1ed8206ff98d43248499 Mon Sep 17 00:00:00 2001 From: MatthewThe Date: Mon, 11 Mar 2019 19:00:23 +0100 Subject: [PATCH] Fixed some more build errors and updated ReadMe --- ReadMe.md | 12 +++++- admin/builders/centos64_build.sh | 2 +- admin/builders/install_proteowizard.sh | 8 ++-- admin/builders/install_qt.sh | 8 ++-- admin/vagrant/batch.sh | 54 +++++++++++++------------- admin/vagrant/manager.sh | 11 +++--- src/qt-gui/CMakeLists.txt | 8 ++-- 7 files changed, 55 insertions(+), 48 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 4f02cfb..24fabf5 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -4,14 +4,22 @@ This repository holds the source code for clustering and merging of fragment spe ### Installation -Installers for several operating systems can be found on the [Release page](https://github.com/statisticalbiotechnology/maracluster/releases). +Installers for several operating systems can be found on the [Release page](https://github.com/statisticalbiotechnology/maracluster/releases). Both a command line as well as a graphical user interface are available for all platforms. If you prefer to compile from source, or are running on a different operating system, [click here](#installation-from-source). -### Interface +### Example An example, including spectrum files and a shell script, can be downloaded from http://kaell.org/files/maracluster_sample.zip. +### Graphical User Interface (GUI) + +To run the example, simply select the spectrum files after clicking the `Add ms2 files` button, select an output folder and click the `Run MaRaCluster` button. + +A more elaborate guide for using the GUI can be found from the Help menu in the menu bar of the GUI. + +### Command Line Interface (CLI) + The main functionality of MaRaCluster is provided by the `maracluster` command. This command has several sub-commands to execute different parts of the clustering and merging. The most important ones are `maracluster batch` and `maracluster consensus`. The first takes a list of ms2 spectra as input and outputs a list of clusters, the second takes one of these outputs and creates consensus spectra for each cluster. To run `maracluster batch`, a flat text file with the absolute/relative path to each of the ms2 spectrum files (one per line) is needed. Such a file can easily be generated using a `ls -1` command, *e.g.* `ls -1 ms2/* > files.txt`. Any ms2 spectrum format readable by ProteoWizard can be used as input. Use the following command to start clustering: diff --git a/admin/builders/centos64_build.sh b/admin/builders/centos64_build.sh index 0128736..b7caadd 100755 --- a/admin/builders/centos64_build.sh +++ b/admin/builders/centos64_build.sh @@ -28,7 +28,7 @@ fi rm -f $build_dir/{maracluster,maracluster-gui}/mar*.rpm -sudo yum install -y gcc gcc-c++ rpm-build cmake +sudo yum install -y gcc gcc-c++ rpm-build cmake rsync CMAKE_BINARY=cmake # this can be overridden if a newer version of cmake is needed mkdir -p ${build_dir}/tools diff --git a/admin/builders/install_proteowizard.sh b/admin/builders/install_proteowizard.sh index c13f2d8..d7e8f28 100755 --- a/admin/builders/install_proteowizard.sh +++ b/admin/builders/install_proteowizard.sh @@ -44,11 +44,9 @@ echo "Building ProteoWizard and Boost, this may take some time.." find build-*-x86_64/ -type f | grep -i libboost_regex-.*\.a$ | xargs -I{} cp {} ../lib find build-*-x86_64/ -type f | grep -i libboost_program_options-.*\.a$ | xargs -I{} cp {} ../lib -cd libraries/zlib-1.2.3 -find ./ -type f | grep -i '.h$\|.hpp$' | xargs -I{} cp --parents {} ../../../include/ -cd ../../ -rsync -ap libraries/boost_aux/boost/ ../include/boost -rsync -ap --include '*.ipp' --exclude '*' libraries/boost_1_67_0/boost/ ../include/boost +rsync -ap --include "*/" --include "*.h" --include "*.hpp" --exclude "*" libraries/zlib-1.2.3/ ../include/zlib +rsync -ap --include "*/" --include "*.h" --include "*.hpp" --exclude "*" libraries/boost_aux/boost/ ../include/boost +rsync -ap --include "*/" --include '*.ipp' --exclude '*' libraries/boost_1_67_0/boost/ ../include/boost # the boost libraries' naming convention does not always work well with cmake, so we force a more simple naming convention ln -s -f ../lib/libboost_system-*.a ../lib/libboost_system.a diff --git a/admin/builders/install_qt.sh b/admin/builders/install_qt.sh index d1c5a38..11830f3 100755 --- a/admin/builders/install_qt.sh +++ b/admin/builders/install_qt.sh @@ -13,18 +13,18 @@ if [ ! -d Qt-dynamic ]; then tar xf ${linux_qt}.tar.xz cd ${linux_qt} - ./configure -prefix ${tools_dir}/Qt-dynamic -opensource -confirm-license -nomake tools -nomake examples -nomake tests + ./configure -prefix ${tools_dir}/Qt-dynamic -opensource -confirm-license -nomake tools -nomake examples -nomake tests -release > ../qt_config.log 2>&1 echo "Building Qt base, this may take some time.." - make -j4 > ../qt_installation.log 2>&1 - make install -j4 + make -j4 > ../qt_build.log 2>&1 + make install -j4 > ../qt_install.log 2>&1 fi cd ${tools_dir} # Qt5 requires CMake >= 3.5 -function version_lt() { test "$(echo "$@" | tr " " "\n" | (sort -rV || gsort -rV | head -n 1)" != "$1"; } +function version_lt() { test "$(echo "$@" | tr " " "\n" | (sort -rV || gsort -rV) | head -n 1)" != "$1"; } if version_lt $(cmake --version | head -n1 | cut -f3 -d ' ') "3.5"; then wget https://github.com/Kitware/CMake/releases/download/v3.13.3/cmake-3.13.3-Linux-x86_64.sh diff --git a/admin/vagrant/batch.sh b/admin/vagrant/batch.sh index 7c604fe..bc6dc94 100755 --- a/admin/vagrant/batch.sh +++ b/admin/vagrant/batch.sh @@ -1,34 +1,34 @@ #!/bin/bash export LANG=en_US.UTF-8 export LC_ALL="en_US.UTF-8" -release_dir=${HOME}/release - -echo "Building Ubuntu binaries" -./manager.sh -p ubuntu -r ${release_dir}/ubuntu64 > ubuntu_output.txt 2>&1 -if [[ $? -eq 0 ]]; then - echo "Building of Ubuntu binaries succeeded" -fi +trap 'echo "Batch script killed"; exit 1' INT TERM -echo "Building Fedora binaries" -./manager.sh -p fedora -r ${release_dir}/fedora64 > fedora_output.txt 2>&1 -if [[ $? -eq 0 ]]; then - echo "Building of Fedora binaries succeeded" -fi +release_dir=${HOME}/release -echo "Building CentOS binaries" -./manager.sh -p centos -r ${release_dir}/centos64 > centos_output.txt 2>&1 -if [[ $? -eq 0 ]]; then - echo "Building of CentOS binaries succeeded" -fi +platforms=() +platforms+=(osx) +#platforms+=(win64) +#platforms+=(win32) +#platforms+=(centos) +#platforms+=(fedora) +#platforms+=(ubuntu) -echo "Building native 64-bit Windows binaries" -./manager.sh -p nw64 -r ${release_dir}/win64 > nw64_output.txt 2>&1 -if [[ $? -eq 0 ]]; then - echo "Building of native 64-bit Windows binaries succeeded" -fi +for platform in ${platforms[@]}; do + echo "Building $platform binaries" + ./manager.sh -p $platform -r ${release_dir}/$platform > ${platform}_output.txt 2>&1 + if [[ $? -eq 0 ]]; then + echo "Building of ${platform} binaries succeeded" + else + echo "Building of ${platform} binaries failed" + fi +done -echo "Building native 32-bit Windows binaries" -./manager.sh -p nw32 -r ${release_dir}/win32 > nw32_output.txt 2>&1 -if [[ $? -eq 0 ]]; then - echo "Building of native 32-bit Windows binaries succeeded" -fi +# for the osx build, root priviliges are necessary but we can skip the password prompt: +# Vagrant NFS access https://www.vagrantup.com/docs/synced-folders/nfs.html#root-privilege-requirement +# add the following lines with $sudo visudo +#Cmnd_Alias VAGRANT_EXPORTS_CHOWN = /bin/chown 0\:0 /tmp/* +#Cmnd_Alias VAGRANT_EXPORTS_MV = /bin/mv -f /tmp/* /etc/exports +#Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status +#Cmnd_Alias VAGRANT_NFSD_START = /bin/systemctl start nfs-server.service +#Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar +#%sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_CHOWN, VAGRANT_EXPORTS_MV, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY diff --git a/admin/vagrant/manager.sh b/admin/vagrant/manager.sh index 1e718b5..010fa91 100755 --- a/admin/vagrant/manager.sh +++ b/admin/vagrant/manager.sh @@ -13,7 +13,7 @@ usage: $0 [[-h]] [[-a]] [[-b branch]]|[[-s source_directory]] [[-r release_directory]] - -p ubuntu|centos|fedora|nw32|nw64 + -p ubuntu|centos|fedora|win32|win64|osx If no branch and source_directory is provided, the source code from which the sourcecode is checked out from will be used. @@ -61,14 +61,14 @@ while getopts “hab:s:r:p:” OPTION; do vagbox_url="" package_ext="rpm" ;; - nw32) + win32) post="nativew32" batfile=true vagbox_name="win10vs15" vagbox_url="~/VagrantWin7/win10vs15.box" package_ext="exe" ;; - nw64) + win64) post="nativew64" batfile=true vagbox_name="win10vs15" @@ -181,7 +181,7 @@ Vagrant.configure("2") do |config| config.vm.box = "${vagbox_name}" config.vm.box_url = "${vagbox_url}" config.ssh.insert_key = false - config.ssh.password = "vagrant" # private key authentication does not work on this box + #config.ssh.password = "vagrant" # private key authentication does not work on this box config.vm.boot_timeout = 600 config.vm.network "private_network", ip: "192.168.56.10" @@ -239,7 +239,7 @@ Vagrant.configure("2") do |config| end config.vm.provision :shell do |shell| shell.path = "${tmp_dir}/${builder}" - shell.args = "-s /vagrant/src -r /vagrant/" + shell.args = "-s /vagrant/src -b /vagrant/build -r /vagrant/" end end EOF @@ -295,6 +295,7 @@ if [[ $? -eq 0 ]] && [[ -z ${alive} ]]; then vagrant destroy -f else echo "-a option set or encountered error: keeping the VM alive, remember to close and delete the VM manually." + exit 1 fi #--------------------------------------------------------------------------------------- diff --git a/src/qt-gui/CMakeLists.txt b/src/qt-gui/CMakeLists.txt index 8cba4e4..24f28b9 100644 --- a/src/qt-gui/CMakeLists.txt +++ b/src/qt-gui/CMakeLists.txt @@ -2,14 +2,14 @@ cmake_minimum_required(VERSION 3.5) project(MARACLUSTER_GUI) set(MARACLUSTER_GUI_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) -if (UNIX) +if (APPLE) + set(MARACLUSTER_BIN_DESTINATION maracluster-gui.app/Contents/MacOS) +elseif (UNIX) set(CMAKE_INSTALL_RPATH "$ORIGIN") set(MARACLUSTER_BIN_DESTINATION lib/maracluster) -elseif (APPLE) - set(MARACLUSTER_BIN_DESTINATION maracluster-gui.app/Contents/MacOS) elseif (MSVC) set(MARACLUSTER_BIN_DESTINATION bin) -endif (UNIX) +endif (APPLE) # get the maracluster executable set(SKIP_MAIN_CPACK ON)