forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhyphy.rb
112 lines (96 loc) · 3.24 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
103
104
105
106
107
108
109
110
111
class Hyphy < Formula
homepage "http://www.hyphy.org/"
url "https://github.com/veg/hyphy/archive/2.2.4.tar.gz"
sha256 "09bc43973d83118ade168177ccebfd393cffa110a96da9b52905d3a4a99afa18"
head "https://github.com/veg/hyphy.git"
bottle do
sha256 "304df11448ff772a079ceb130b0612187571cd8dbf429f9d85518ef08cf4188a" => :yosemite
sha256 "6c8eb43061e74cf4a7f05c88ca703e0703793daf4d3f040e9fd620d3e8ac1396" => :mavericks
sha256 "614db017773d9ea1c82ec1345f323dcb11316103ea0e10c5e7fa38a328f4b700" => :mountain_lion
end
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 "openssl"
depends_on "cmake" => :build
depends_on :mpi => :optional
fails_with :clang do
build 77
cause "cmake gets passed the wrong flags"
end
patch :DATA # single-threaded builds
def install
system "cmake", "-DINSTALL_PREFIX=#{prefix}", ".", *std_cmake_args
system "make", "SP" if build.with? "single-threaded"
system "make", "MP2" if build.with? "multi-threaded"
system "make", "MPI" if build.with? "mpi"
system "make", "OCL" if build.with? "opencl"
system "make", "GTEST"
system "make", "install"
libexec.install "HYPHYGTEST"
doc.install("help")
end
def caveats; <<-EOS.undent
The help has been installed to #{HOMEBREW_PREFIX}/share/hyphy.
EOS
end
test do
system libexec/"HYPHYGTEST"
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}"