aboutsummaryrefslogtreecommitdiffstats
path: root/devel/flang/Makefile
blob: cfee5a61e7fa9eaaa0a0c3dd3ed1c9ef85e7415f (plain) (blame)
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
# Created by: Johannes M Dieterich <jmd@FreeBSD.org>
# $FreeBSD$

PORTNAME=   flang
DISTVERSION=    4.0-20171019
PORTREVISION=   1
CATEGORIES= devel

MAINTAINER= jmd@FreeBSD.org
COMMENT=    Fortran compiler targeting LLVM

LICENSE=    APACHE20
LICENSE_FILE=   ${WRKSRC}/LICENSE.txt

BUILD_DEPENDS=  llvm40>=0:devel/llvm40 \
        flang-clang>=0:devel/flang-clang
RUN_DEPENDS=    llvm40>=0:devel/llvm40 \
        flang-clang>=0:devel/flang-clang

ONLY_FOR_ARCHS= amd64
ONLY_FOR_ARCHS_REASON_amd64=    for now only builds and is supported on amd64

OPTIONS_DEFINE= TESTS
TESTS_DESC= build unit tests for flang

USE_LDCONFIG=   ${PREFIX}/flang/lib
USES=       cmake:outsource,noninja compiler:c++11-lib libedit perl5 tar:xz \
        shebangfix
_USES_PYTHON?=  python:build
USES+=      ${_USES_PYTHON}

USE_GITHUB= yes
GH_ACCOUNT= flang-compiler
GH_TAGNAME= e68c31f

CMAKE_ARGS+=    -DLLVM_CONFIG=${LOCALBASE}/bin/llvm-config40 \
        -DCMAKE_CXX_COMPILER=${LOCALBASE}flang/bin/clang++ \
        -DCMAKE_C_COMPILER=${LOCALBASE}/flang/bin/clang \
        -DCMAKE_Fortran_COMPILER=${LOCALBASE}/flang/bin/flang \
        -DFLANG_LIBOMP=${LOCALBASE}/llvm40/lib/libomp.so

CMAKE_INSTALL_PREFIX=   ${PREFIX}/flang

.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MTESTS}
CMAKE_ARGS+=    -DFLANG_INCLUDE_TESTS=ON
.endif

MAKE_JOBS_UNSAFE=   yes

post-patch:
    @${CP} -r  ${WRKSRC}/tools/flang2/flang2exe/x86_64-Linux ${WRKSRC}/tools/flang2/flang2exe/x86_64-FreeBSD

post-install:
    @${SED} -e 's|%%PREFIX%%|${PREFIX}|g' \
        < ${FILESDIR}/flang.in > \
        ${WRKDIR}/flang
    ${INSTALL_SCRIPT} ${WRKDIR}/flang ${STAGEDIR}/${PREFIX}/bin/flang

.include <bsd.port.mk>