forked from ISTI-ansible-roles/ansible-roles
library/roles/quickrank: The role now compiles and installs the binary. Some fixes were needed to compile and install on Ubuntu 12.04.
This commit is contained in:
parent
f9dbb40351
commit
7b396eb51c
|
@ -0,0 +1,12 @@
|
||||||
|
---
|
||||||
|
quickrank_install: False
|
||||||
|
|
||||||
|
quickrank_git_url: 'https://github.com/hpclab/quickrank'
|
||||||
|
quickrank_package_list:
|
||||||
|
- gcc-5
|
||||||
|
- g++-5
|
||||||
|
- libboost1.55-all-dev
|
||||||
|
- git
|
||||||
|
- python-software-properties
|
||||||
|
- cmake
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
--- CMakeLists.txt.orig 2016-09-22 19:35:27.516886715 +0200
|
||||||
|
+++ CMakeLists.txt 2016-09-22 19:36:44.171131969 +0200
|
||||||
|
@@ -2,7 +2,8 @@
|
||||||
|
# GNU C++ COMPILER OPTION (on Mac OS X, brew): -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-5
|
||||||
|
# BUILD TYPE: -DCMAKE_BUILD_TYPE=[Release|Debug]
|
||||||
|
|
||||||
|
-cmake_minimum_required(VERSION 2.8.12)
|
||||||
|
+cmake_minimum_required(VERSION 2.8.7)
|
||||||
|
+set(CMAKE_USER_MAKE_RULES_OVERRIDE "QuickRankMakeRulesOverwrite.cmake")
|
||||||
|
project(QUICKRANK CXX)
|
||||||
|
|
||||||
|
# require support of C++11
|
|
@ -0,0 +1 @@
|
||||||
|
list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS c)
|
|
@ -0,0 +1,43 @@
|
||||||
|
---
|
||||||
|
- block:
|
||||||
|
- name: Add the boost ppa
|
||||||
|
apt_repository: repo='ppa:boost-latest/ppa' update_cache=yes
|
||||||
|
when: is_precise
|
||||||
|
|
||||||
|
- name: Add the devel chain ppa
|
||||||
|
apt_repository: repo='ppa:ubuntu-toolchain-r/test' update_cache=yes
|
||||||
|
|
||||||
|
- name: Install the quickrank dependencies
|
||||||
|
apt: name={{ item }} state=present
|
||||||
|
with_items: '{{ quickrank_package_list | default([]) }}'
|
||||||
|
|
||||||
|
tags: [ 'boost', 'libboost', 'quickrank' ]
|
||||||
|
|
||||||
|
- block:
|
||||||
|
- name: Download the quickrank distribution
|
||||||
|
git: repo={{ quickrank_git_url }} dest=/home/{{ d4science_user }}/quickrank
|
||||||
|
register: quickrank_src
|
||||||
|
|
||||||
|
- name: Copy some needed files if the distribution is Ubuntu 12.04
|
||||||
|
copy: src={{ item }} dest=/home/{{ d4science_user }}/quickrank/{{ item }}
|
||||||
|
with_items:
|
||||||
|
- CMakeLists.txt.12.04.diff
|
||||||
|
- QuickRankMakeRulesOverwrite.cmake
|
||||||
|
when: is_precise
|
||||||
|
|
||||||
|
- name: Apply a patch to the CMakeLists.txt if the distribution is Ubuntu 12.04
|
||||||
|
shell: cd /home/{{ d4science_user }}/quickrank ; patch -p0 < CMakeLists.txt.12.04.diff
|
||||||
|
when: is_precise
|
||||||
|
|
||||||
|
- name: Configure the sources and compile them
|
||||||
|
shell: cd /home/{{ d4science_user }}/quickrank ; rm -fr build ; mkdir build ; cd /home/{{ d4science_user }}/quickrank/build ; cmake .. -DCMAKE_CXX_COMPILER=g++-5 -DCMAKE_BUILD_TYPE=Release ; make
|
||||||
|
when: ( quickrank_src | changed )
|
||||||
|
|
||||||
|
- name: Install the quickrank binaries
|
||||||
|
become: False
|
||||||
|
shell: cd /home/{{ d4science_user }}/quickrank/bin ; install -m 755 quicklearn /usr/local/bin
|
||||||
|
when: ( quickrank_src | changed )
|
||||||
|
|
||||||
|
become: True
|
||||||
|
become_user: '{{ d4science_user }}'
|
||||||
|
tags: [ 'boost', 'libboost', 'quickrank', 'quickrank_bin' ]
|
Loading…
Reference in New Issue