summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2015-12-09 13:06:39 +0100
committeralalazo <massimiliano.culpo@googlemail.com>2015-12-09 17:15:26 +0100
commit20e67bc5e6c4a4ac759bb068ff78c13bfc17fb0f (patch)
treedfa48a18cf929b91610f563594fd6ed0650c8241 /var
parent50bd4d2e4ed3fed83afa30e7796eaa99989bc3ce (diff)
downloadspack-20e67bc5e6c4a4ac759bb068ff78c13bfc17fb0f.tar.gz
spack-20e67bc5e6c4a4ac759bb068ff78c13bfc17fb0f.tar.bz2
spack-20e67bc5e6c4a4ac759bb068ff78c13bfc17fb0f.tar.xz
spack-20e67bc5e6c4a4ac759bb068ff78c13bfc17fb0f.zip
clang : solve the issue with missing default include paths for OpenMP and libc++
resource : support for finer grained linking of resources
Diffstat (limited to 'var')
-rw-r--r--var/spack/packages/clang/package.py31
-rw-r--r--var/spack/packages/llvm/package.py4
2 files changed, 33 insertions, 2 deletions
diff --git a/var/spack/packages/clang/package.py b/var/spack/packages/clang/package.py
index eac1863b97..ca368b3074 100644
--- a/var/spack/packages/clang/package.py
+++ b/var/spack/packages/clang/package.py
@@ -22,8 +22,13 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
+
+
from spack import *
+import os
+import os.path
+
class Clang(Package):
"""The goal of the Clang project is to create a new C, C++,
Objective C and Objective C++ front-end for the LLVM compiler.
@@ -62,3 +67,29 @@ class Clang(Package):
*options)
make()
make("install")
+ # CLang doesn't look in llvm folders for system headers...
+ self.link_llvm_directories(spec)
+
+ def link_llvm_directories(self, spec):
+
+ def clang_include_dir_at(root):
+ return join_path(root, 'include')
+
+ def clang_lib_dir_at(root):
+ return join_path(root, 'lib/clang/', str(self.version), 'include')
+
+ def do_link(source_dir, destination_dir):
+ if os.path.exists(source_dir):
+ for name in os.listdir(source_dir):
+ source = join_path(source_dir, name)
+ link = join_path(destination_dir, name)
+ os.symlink(source, link)
+
+ # Link folder and files in include
+ llvm_dir = clang_include_dir_at(spec['llvm'].prefix)
+ clang_dir = clang_include_dir_at(self.prefix)
+ do_link(llvm_dir, clang_dir)
+ # Link folder and files in lib
+ llvm_dir = clang_lib_dir_at(spec['llvm'].prefix)
+ clang_dir = clang_lib_dir_at(self.prefix)
+ do_link(llvm_dir, clang_dir) \ No newline at end of file
diff --git a/var/spack/packages/llvm/package.py b/var/spack/packages/llvm/package.py
index 872a6c082b..d7ae3390be 100644
--- a/var/spack/packages/llvm/package.py
+++ b/var/spack/packages/llvm/package.py
@@ -53,10 +53,10 @@ class Llvm(Package):
destination='projects', when='@3.7.0')
resource(name='libcxx',
url='http://llvm.org/releases/3.7.0/libcxx-3.7.0.src.tar.xz', md5='46aa5175cbe1ad42d6e9c995968e56dd',
- destination='projects', basename='libcxx', when='+libcxx@3.7.0')
+ destination='projects', placement='libcxx', when='+libcxx@3.7.0')
resource(name='libcxxabi',
url='http://llvm.org/releases/3.7.0/libcxxabi-3.7.0.src.tar.xz', md5='5aa769e2fca79fa5335cfae8f6258772',
- destination='projects', basename='libcxxabi', when='+libcxx@3.7.0')
+ destination='projects', placement='libcxxabi', when='+libcxx@3.7.0')
##########
def install(self, spec, prefix):