Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
171 lines (147 sloc) 6.26 KB
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup cmake 1.0
if {${os.major} <= 17} {
PortGroup muniversal 1.0
}
PortGroup compiler_blacklist_versions 1.0
PortGroup github 1.0
name libomp
maintainers {eborisch @eborisch} openmaintainer
homepage http://openmp.llvm.org
description The OpenMP subproject of LLVM
long_description ${description} is intended to contain all of the\
components required to build an executing OpenMP\
program that are outside the compiler itself. \
This port works with MacPorts' clang-3.7+ (optionally \
with +openmp variant for clang-3.7.)
categories lang
platforms darwin
supported_archs i386 x86_64
license {MIT NCSA}
subport libomp-devel {}
if { ${subport} eq "libomp-devel" } {
if {${os.platform} eq "darwin" && ${configure.cxx_stdlib} eq "libstdc++"} {
version 291764
replaced_by libomp
} else {
conflicts libomp
github.setup llvm-mirror openmp 7a5b758
worksrcdir openmp-${version}
version 349521
revision 0
name ${subport}
checksums \
rmd160 e311b1ca106aa80a391921e1cef8a1fd6b5bbbfa \
sha256 35b4662c6f61ac6261fef4ab35955a69cb2dfba570c1abd96733ccab52bd27e4 \
size 1471884
livecheck.url \
https://llvm.org/viewvc/llvm-project/openmp/trunk/?view=log
livecheck.version ${version}
livecheck.regex revision=(\[0-9\]+)
set rtpath "runtime/"
}
} else {
conflicts libomp-devel
if {${os.platform} eq "darwin" && ${configure.cxx_stdlib} ne "libstdc++"} {
if {${os.major} <= 12} {
# kmp_alloc.c includes <atomic> but libc++ is not the default on
# these systems. https://trac.macports.org/ticket/52554
configure.cflags-append -stdlib=libc++
}
version 8.0.0
revision 0
master_sites https://releases.llvm.org/${version}
distname openmp-${version}.src
use_xz yes
dist_subdir openmp-release
checksums \
rmd160 81bdf0098bf04b41008e04d258ab708300f2e082 \
sha256 f7b1705d2f16c4fc23d6531f67d2dd6fb78a077dd346b02fed64f4b8df65c9d5 \
size 934384
worksrcdir ${distname}
set rtpath "runtime/"
} else {
# Last version working on libstdc++
github.setup llvm-mirror openmp 381 svn-tags/RELEASE_
worksrcdir openmp-${version}/final/runtime
version 3.8.1
revision 3
checksums \
rmd160 a41054068a127ef84610afef8090109078cb6c46 \
sha256 4c46b5946fe9b2a701661746d11c7c85c51a7f18673194a7ebd2a43470948a34
set rtpath "./"
}
# Moved to epoch 1 for svn # -> version # change.
epoch 1
name libomp
livecheck.version [strsed ${version} {g/\.//}]
livecheck.url https://github.com/llvm-mirror/openmp/branches
livecheck.regex svn-tags/RELEASE_(\[0-9\]+)
}
depends_build-append port:perl5
cmake.out_of_source yes
# According to documentation builds with clang >= 3.3
compiler.blacklist-append {clang < 500} *gcc*
# Avoid dependency cycle
# https://trac.macports.org/ticket/53110
foreach ver {3.8 3.9 4.0 5.0 6.0 7.0 devel} {
if {![file exists ${prefix}/bin/clang-mp-${ver}]} {
compiler.blacklist-append macports-clang-${ver}
}
}
if {${os.major} <= 17} {
default_variants +universal
} else {
universal_variant no
}
# Do actual install into ${prefix}/(install|lib)/libomp
# A little unorthodox, but to have clang automatically find the includes and
# lib, with -fopenmp, it is nice to have them their own directories. Not
# exactly a config cmake supports directly; install into dummy location and
# move post-install
configure.pre_args -DCMAKE_INSTALL_PREFIX=${prefix}/tmp
configure.args-delete -DCMAKE_INSTALL_RPATH=${prefix}/lib \
-DCMAKE_INSTALL_NAME_DIR=${prefix}/lib
# With this, cmake sets the correct library name in the dylibs for the
# final destination we move them to
configure.args-append -DCMAKE_INSTALL_RPATH=${prefix}/lib/libomp \
-DCMAKE_INSTALL_NAME_DIR=${prefix}/lib/libomp \
-DLIBOMP_OMPT_SUPPORT=FALSE
variant top_level description \
"Install (links to) omp.h and libs into ${prefix}/(include|lib)" {}
post-extract {
# Patch tool for build with CMAKE_INSTALL_PREFIX
reinplace "/bulk.*compatibility/s/s\+/s+.*/" \
${rtpath}tools/check-depends.pl
}
post-destroot {
set instdest ${destroot}${prefix}
xinstall -d ${instdest}/share/doc/libomp
xinstall -d ${instdest}/include/libomp
move ${instdest}/tmp/include/omp.h ${instdest}/include/libomp/
xinstall -d ${instdest}/lib/libomp
foreach p {libiomp5.dylib libomp.dylib libgomp.dylib} {
move ${instdest}/tmp/lib/${p} ${instdest}/lib/libomp/
}
if [variant_isset top_level] {
system -W ${instdest}/include \
"ln -s libomp/omp.h"
foreach p {libiomp5.dylib libomp.dylib libgomp.dylib} {
system -W ${instdest}/lib/ \
"ln -s libomp/${p}"
}
}
set fpath ${worksrcpath}/${rtpath}
file copy ${fpath}/README.txt ${fpath}/../LICENSE.txt \
${fpath}/../www ${instdest}/share/doc/libomp/
}
notes "
To use this OpenMP library:
* For clang-3.8+, or clang-3.7 with +openmp variant:
add \"-fopenmp\" during compilation / linking.
* For clang-3.7 without +openmp variant, use:
\"-I${prefix}/include/libomp -L${prefix}/lib/libomp -fopenmp\"
"
test.run yes
test.target libomp-micro-tests
You can’t perform that action at this time.