forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hyphy.rb
103 lines (88 loc) · 2.84 KB
/
hyphy.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
require 'formula'
class Hyphy < Formula
homepage 'http://www.hyphy.org/'
url 'https://github.com/veg/hyphy/archive/2.2.tar.gz'
sha1 '9ff285a71a51f4699947a162fe46c3eb3458425e'
head 'https://github.com/veg/hyphy.git'
option 'with-opencl', "Build a version with OpenCL GPU/CPU acceleration"
option 'without-multi-threaded', "Don't build a multi-threaded version"
option 'without-single-threaded', "Don't build a single-threaded version"
depends_on 'cmake' => :build
depends_on :mpi => :optional
fails_with :clang do
build 77
cause "cmake gets passed the wrong flags"
end
def patches
DATA # single-threaded builds
end
def install
system "cmake", "-DINSTALL_PREFIX=#{prefix}", ".", *std_cmake_args
system "make SP" unless build.without? "single-threaded"
system "make MP2" unless build.without? "multi-threaded"
system "make MPI" if build.with? :mpi
system "make OCL" if build.with? "opencl"
system "make install"
(share/'hyphy').install('help')
end
def caveats; <<-EOS.undent
The help has been installed to #{HOMEBREW_PREFIX}/share/hyphy.
EOS
end
end
__END__
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76228a8..ee4bb80 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -299,6 +299,23 @@ add_custom_target(MP2 DEPENDS HYPHYMP)
#-------------------------------------------------------------------------------
+# hyphy sp target
+#-------------------------------------------------------------------------------
+add_executable(
+ HYPHYSP
+ EXCLUDE_FROM_ALL
+ ${SRC_COMMON} ${SRC_UNIXMAIN}
+)
+target_link_libraries(HYPHYSP ${DEFAULT_LIBRARIES})
+install(
+ TARGETS HYPHYSP
+ RUNTIME DESTINATION bin
+ OPTIONAL
+)
+add_custom_target(SP DEPENDS HYPHYSP)
+
+
+#-------------------------------------------------------------------------------
# hyphy OpenCL target
#-------------------------------------------------------------------------------
find_package(OpenCL)
@@ -546,7 +563,7 @@ endif((${QT4_FOUND}))
#-------------------------------------------------------------------------------
if(UNIX)
set_property(
- TARGET HYPHYMP hyphy_mp HYPHYGTEST HYPHYDEBUG
+ TARGET HYPHYMP hyphy_mp HYPHYGTEST HYPHYDEBUG HYPHYSP
APPEND PROPERTY COMPILE_DEFINITIONS __UNIX__
)
endif(UNIX)
@@ -557,7 +574,7 @@ set_property(
)
set_property(
- TARGET hyphy_mp HYPHYMP HYPHYGTEST HYPHYDEBUG
+ TARGET hyphy_mp HYPHYMP HYPHYGTEST HYPHYDEBUG HYPHYSP
APPEND PROPERTY COMPILE_DEFINITIONS _HYPHY_LIBDIRECTORY_="${CMAKE_INSTALL_PREFIX}/lib/hyphy"
)
@@ -567,6 +584,13 @@ set_property(
)
set_target_properties(
+ HYPHYSP
+ PROPERTIES
+ COMPILE_FLAGS "${DEFAULT_COMPILE_FLAGS}"
+ LINK_FLAGS "${DEFAULT_LINK_FLAGS}"
+)
+
+set_target_properties(
hyphy_mp HYPHYMP
PROPERTIES
COMPILE_FLAGS "${DEFAULT_COMPILE_FLAGS} ${OpenMP_CXX_FLAGS}"