1 |
commit: 66309136017aaee0f626ed99323389372a549abe |
2 |
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun Apr 8 00:50:53 2012 +0000 |
4 |
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com> |
5 |
CommitDate: Sun Apr 8 00:50:53 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=66309136 |
7 |
|
8 |
[sci-libs/trilinos] Initial ebuild. |
9 |
|
10 |
--- |
11 |
sci-libs/trilinos/ChangeLog | 10 ++ |
12 |
sci-libs/trilinos/metadata.xml | 13 +++ |
13 |
sci-libs/trilinos/trilinos-10.10.1.ebuild | 156 +++++++++++++++++++++++++++++ |
14 |
3 files changed, 179 insertions(+), 0 deletions(-) |
15 |
|
16 |
diff --git a/sci-libs/trilinos/ChangeLog b/sci-libs/trilinos/ChangeLog |
17 |
new file mode 100644 |
18 |
index 0000000..ad9f45d |
19 |
--- /dev/null |
20 |
+++ b/sci-libs/trilinos/ChangeLog |
21 |
@@ -0,0 +1,10 @@ |
22 |
+# ChangeLog for sci-libs/trilinos |
23 |
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 |
24 |
+# $Header: $ |
25 |
+ |
26 |
+*trilinos-10.10.1 (8 Apr 2012) |
27 |
+ |
28 |
+ 8 Apr 2012; Andrea Arteaga <andyspiros@×××××.com> |
29 |
+ +trilinos-10.10.1.ebuild +metadata.xml: |
30 |
+ Initial ebuild. |
31 |
+ |
32 |
|
33 |
diff --git a/sci-libs/trilinos/metadata.xml b/sci-libs/trilinos/metadata.xml |
34 |
new file mode 100644 |
35 |
index 0000000..ae613ca |
36 |
--- /dev/null |
37 |
+++ b/sci-libs/trilinos/metadata.xml |
38 |
@@ -0,0 +1,13 @@ |
39 |
+<?xml version="1.0" encoding="UTF-8"?> |
40 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
41 |
+<pkgmetadata> |
42 |
+ <herd>sci</herd> |
43 |
+ <maintainer> |
44 |
+ <email>andyspiros@×××××.com</email> |
45 |
+ </maintainer> |
46 |
+ <longdescription lang="en"> |
47 |
+ The Trilinos Project is an effort to develop algorithms and enabling |
48 |
+ technologies within an object-oriented software framework for the solution |
49 |
+ of large-scale, complex multi-physics engineering and scientific problems. |
50 |
+ </longdescription> |
51 |
+</pkgmetadata> |
52 |
|
53 |
diff --git a/sci-libs/trilinos/trilinos-10.10.1.ebuild b/sci-libs/trilinos/trilinos-10.10.1.ebuild |
54 |
new file mode 100644 |
55 |
index 0000000..9cae14b |
56 |
--- /dev/null |
57 |
+++ b/sci-libs/trilinos/trilinos-10.10.1.ebuild |
58 |
@@ -0,0 +1,156 @@ |
59 |
+# Copyright 1999-2012 Gentoo Foundation |
60 |
+# Distributed under the terms of the GNU General Public License v2 |
61 |
+# $Header: $ |
62 |
+ |
63 |
+EAPI="2" |
64 |
+inherit cmake-utils |
65 |
+ |
66 |
+DESCRIPTION="Scientific library collection for large scale problems" |
67 |
+HOMEPAGE="http://trilinos.sandia.gov/" |
68 |
+SRC_URI="${P}-Source.tar.gz" |
69 |
+SRC_PAGE="10.10" |
70 |
+ |
71 |
+KEYWORDS="~amd64 ~x86" |
72 |
+RESTRICT="fetch" |
73 |
+ |
74 |
+LICENSE="BSD LGPL-2.1" |
75 |
+SLOT="0" |
76 |
+ |
77 |
+IUSE="arprec boost cuda hdf5 netcdf qd qt taucs tbb umfpack zlib" |
78 |
+ |
79 |
+RDEPEND="virtual/blas |
80 |
+ virtual/lapack |
81 |
+ virtual/mpi |
82 |
+ >=sci-libs/scalapack-2 |
83 |
+ arprec? ( sci-libs/arprec ) |
84 |
+ boost? ( dev-libs/boost ) |
85 |
+ cuda? ( >=dev-util/nvidia-cuda-toolkit-3.2 ) |
86 |
+ hdf5? ( sci-libs/hdf5[mpi] ) |
87 |
+ netcdf? ( sci-libs/netcdf ) |
88 |
+ qd? ( sci-libs/qd ) |
89 |
+ qt? ( >=x11-libs/qt-gui-4.5 ) |
90 |
+ taucs? ( sci-libs/taucs ) |
91 |
+ tbb? ( dev-cpp/tbb ) |
92 |
+ umfpack? ( sci-libs/umfpack )" |
93 |
+DEPEND="${RDEPEND}" |
94 |
+ |
95 |
+S="${WORKDIR}/${P}-Source" |
96 |
+ |
97 |
+pkg_nofetch() { |
98 |
+ einfo "Sandia requires that you register to the site in order to download Trilinos." |
99 |
+ einfo "Please download ${SRC_URI} from:" |
100 |
+ einfo "http://trilinos.sandia.gov/download/trilinos-${SRC_PAGE}.html" |
101 |
+ einfo "and move it to ${DISTDIR}" |
102 |
+} |
103 |
+ |
104 |
+function trilinos_alternatives { |
105 |
+ alt_dirs="" |
106 |
+ for d in $(pkg-config --libs-only-L $1); do |
107 |
+ alt_dirs="${alt_dirs};${d:2}" |
108 |
+ done |
109 |
+ arg="-D${2}_LIBRARY_DIRS=${alt_dirs:1}" |
110 |
+ mycmakeargs+=( |
111 |
+ $arg |
112 |
+ ) |
113 |
+ |
114 |
+ alt_libs="" |
115 |
+ for d in $(pkg-config --libs-only-l $1); do |
116 |
+ alt_libs="${alt_libs};${d:2}" |
117 |
+ done |
118 |
+ arg="-D${2}_LIBRARY_NAMES=${alt_libs:1}" |
119 |
+ mycmakeargs+=( |
120 |
+ $arg |
121 |
+ ) |
122 |
+} |
123 |
+ |
124 |
+src_configure() { |
125 |
+ CMAKE_BUILD_TYPE="release" |
126 |
+ mycmakeargs=( |
127 |
+ -DBUILD_SHARED_LIBS=ON |
128 |
+ -DTrilinos_ENABLE_ALL_PACKAGES=ON |
129 |
+ |
130 |
+ # Tests |
131 |
+ $(cmake-utils_use test Trilinos_ENABLE_TESTS) |
132 |
+ |
133 |
+ # Mandatory dependencies |
134 |
+ -DTPL_ENABLE_MPI=ON |
135 |
+ -DTPL_ENABLE_BLAS=ON |
136 |
+ -DTPL_ENABLE_LAPACK=ON |
137 |
+ -DTPL_ENABLE_BLACS=ON |
138 |
+ -DTPL_ENABLE_SCALAPACK=ON |
139 |
+ -DTrilinos_EXTRA_LINK_FLAGS="-lmpi -lmpi_cxx" |
140 |
+ |
141 |
+ # Optional dependencies |
142 |
+ $(cmake-utils_use arprec TPL_ENABLE_ARPREC) |
143 |
+ $(cmake-utils_use boost TPL_ENABLE_Boost) |
144 |
+ $(cmake-utils_use cuda TPL_ENABLE_CUDA) |
145 |
+ $(cmake-utils_use hdf5 TPL_ENABLE_HDF5) |
146 |
+ $(cmake-utils_use netcdf TPL_ENABLE_Netcdf) |
147 |
+ $(cmake-utils_use qd TPL_ENABLE_QD) |
148 |
+ $(cmake-utils_use qt TPL_ENABLE_QT) |
149 |
+ $(cmake-utils_use taucs TPL_ENABLE_TAUCS) |
150 |
+ $(cmake-utils_use tbb TPL_ENABLE_TBB) |
151 |
+ $(cmake-utils_use umfpack TPL_ENABLE_UMFPACK) |
152 |
+ $(cmake-utils_use zlib TPL_ENABLE_Zlib) |
153 |
+ ) |
154 |
+ |
155 |
+ # Add BLAS libraries |
156 |
+ trilinos_alternatives blas BLAS |
157 |
+ trilinos_alternatives lapack LAPACK |
158 |
+ trilinos_alternatives scalapack SCALAPACK |
159 |
+ trilinos_alternatives scalapack BLACS |
160 |
+ |
161 |
+ mycmakeargs+=( -DBLACS_INCLUDE_DIRS="/usr/include/blacs" ) |
162 |
+ |
163 |
+ cmake-utils_src_configure |
164 |
+} |
165 |
+ |
166 |
+src_compile() { |
167 |
+ cmake-utils_src_compile |
168 |
+} |
169 |
+ |
170 |
+src_install() { |
171 |
+ cmake-utils_src_install |
172 |
+ |
173 |
+ local k |
174 |
+ local fname |
175 |
+ local libpath |
176 |
+ local tpkg |
177 |
+ |
178 |
+ # Edit cmake files |
179 |
+ libpath="/usr/$(get_libdir)/Trilinos" |
180 |
+ pushd "${D}/usr/lib/cmake" |
181 |
+ for i in *; do |
182 |
+ fname="${i}/${i}Config.cmake" |
183 |
+ |
184 |
+ k=$(grep -n "${i}_INCLUDE_DIRS" "${fname}" | sed 's/\([0-9]*\):.*/\1/') |
185 |
+ sed "${k}s|/usr/include|/usr/include/Trilinos|" < "${fname}" > "${fname}.temp" |
186 |
+ |
187 |
+ k=$(grep -n "${i}_LIBRARY_DIRS" "${fname}" | sed 's/\([0-9]*\):.*/\1/') |
188 |
+ sed "${k}s|/usr/lib|${libpath}|" < "${fname}.temp" > "${fname}" |
189 |
+ |
190 |
+ rm "${fname}.temp" |
191 |
+ done |
192 |
+ popd |
193 |
+ |
194 |
+ # Edit Makefiles |
195 |
+ pushd "${D}/usr/include" |
196 |
+ for i in Makefile.export.*; do |
197 |
+ tpkg="$(echo ${i} | sed 's/Makefile.export.//')" |
198 |
+ |
199 |
+ sed "s|${tpkg}_INCLUDE_DIRS= -I/usr/include|${tpkg}_INCLUDE_DIRS= -I/usr/include/Trilinos|" < "Makefile.export.${tpkg}" > "Makefile.export.${tpkg}.temp" |
200 |
+ sed "s|${tpkg}_LIBRARY_DIRS= -L/usr/lib|${tpkg}_LIBRARY_DIRS= -L${libpath}|" < "Makefile.export.${tpkg}.temp" > "Makefile.export.${tpkg}" |
201 |
+ rm "Makefile.export.${tpkg}.temp" |
202 |
+ done |
203 |
+ popd |
204 |
+ |
205 |
+ |
206 |
+ # Move libraries |
207 |
+ mkdir -p "${D}/${libpath}" |
208 |
+ mv ${D}usr/lib/*.so "${D}/${libpath}" |
209 |
+ |
210 |
+ # Move headers |
211 |
+ mkdir "${T}/headers" |
212 |
+ mv ${D}usr/include/* "${T}/headers" |
213 |
+ mv "${T}/headers" "${D}/usr/include/Trilinos" |
214 |
+} |