FreeBSD Bugzilla – Attachment 182261 Details for
Bug 210337
[exp-run] allow libiomp for openmp when using clang on amd64
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
latest patch from D6362
jmd_bapt_openmp.diff (text/plain), 12.60 KB, created by
Johannes M Dieterich
on 2017-05-03 03:28:30 UTC
(
hide
)
Description:
latest patch from D6362
Filename:
MIME Type:
Creator:
Johannes M Dieterich
Created:
2017-05-03 03:28:30 UTC
Size:
12.60 KB
patch
obsolete
>Index: Mk/Uses/compiler.mk >=================================================================== >--- Mk/Uses/compiler.mk (revision 439963) >+++ Mk/Uses/compiler.mk (working copy) >@@ -1,245 +1,254 @@ > # $FreeBSD$ > # > # Allows to determine the compiler being used > # > # Feature: compiler > # Usage: USES=compiler or USES=compiler:ARGS > # Valid ARGS: env (default, implicit) c++0x c++11-lib c++11-lang c11 openmp nestedfct features > # > # c++0x: The port needs a compiler understanding C++0X > # c++11-lang: The port needs a compiler understanding C++11 > # c++14-lang: The port needs a compiler understanding C++14 > # gcc-c++11-lib:The port needs g++ compiler with a C++11 library > # c++11-lib: The port needs a compiler understanding C++11 and with a C++11 ready standard library > # c11: The port needs a compiler understanding C11 > # openmp: The port needs a compiler understanding openmp > # nestedfct: The port needs a compiler understanding nested functions > # features: The port will determine the features supported by the default compiler > # > # Variable to test after <bsd.port.pre.mk> > # > # COMPILER_TYPE: can be gcc or clang > # ALT_COMPILER_TYPE: can be gcc or clang depending on COMPILER_TYPE, only set if the base system has 2 compilers > # COMPILER_VERSION: first 2 digits of the version: 33 for clang 3.3.*, 47 for gcc 4.7.* > # ALT_COMPILER_VERSION: first 2 digits of the version: 33 for clang 3.3.*, 47 for gcc 4.7.* of the ALT_COMPILER_TYPE > # > # COMPILER_FEATURES: the list of features supported by the compiler includes the standard C++ library. > # CHOSEN_COMPILER_TYPE: can be gcc or clang (type of compiler chosen by the framework) > # > # MAINTAINER: portmgr@FreeBSD.org > > .if !defined(_INCLUDE_USES_COMPILER_MK) > _INCLUDE_USES_COMPILER_MK= yes > > .if empty(compiler_ARGS) > compiler_ARGS= env > .endif > > VALID_ARGS= c++11-lib c++11-lang c++14-lang c11 features openmp env nestedfct c++0x gcc-c++11-lib > > .if ${compiler_ARGS} == gcc-c++11-lib > _COMPILER_ARGS+= features gcc-c++11-lib > .elif ${compiler_ARGS} == c++11-lib > _COMPILER_ARGS+= features c++11-lib > .elif ${compiler_ARGS} == c++0x > _COMPILER_ARGS+= features c++0x > .elif ${compiler_ARGS} == c++11-lang > _COMPILER_ARGS+= features c++11-lang > .elif ${compiler_ARGS} == c++14-lang > _COMPILER_ARGS+= features c++14-lang > .elif ${compiler_ARGS} == c11 > _COMPILER_ARGS+= features c11 > .elif ${compiler_ARGS} == features > _COMPILER_ARGS+= features > .elif ${compiler_ARGS} == env > _COMPILER_ARGS+= env > .elif ${compiler_ARGS} == openmp > _COMPILER_ARGS+= env openmp > .elif ${compiler_ARGS} == nestedfct > _COMPILER_ARGS+= env nestedfct > .else > IGNORE= Invalid argument "${compiler_ARGS}", valid arguments are: ${VALID_ARGS} > _COMPILER_ARGS= # > .endif > > .if ${_COMPILER_ARGS:Mc++*} || ${_COMPILER_ARGS:Mc11} > _COMPILER_ARGS+= features > .endif > > _CCVERSION!= ${CC} --version > COMPILER_VERSION= ${_CCVERSION:M[0-9].[0-9]*:tW:C/([0-9]).([0-9]).*/\1\2/g} > .if ${_CCVERSION:Mclang} > COMPILER_TYPE= clang > .else > COMPILER_TYPE= gcc > .endif > > ALT_COMPILER_VERSION= 0 > ALT_COMPILER_TYPE= none > _ALTCCVERSION= > .if ${COMPILER_TYPE} == gcc && exists(/usr/bin/clang) > .if ${ARCH} == amd64 || ${ARCH} == i386 # clang often non-default for a reason > _ALTCCVERSION!= /usr/bin/clang --version > .endif > .elif ${COMPILER_TYPE} == clang && exists(/usr/bin/gcc) > _ALTCCVERSION!= /usr/bin/gcc --version > .endif > > ALT_COMPILER_VERSION= ${_ALTCCVERSION:M[0-9].[0-9]*:tW:C/([0-9]).([0-9]).*/\1\2/g} > .if ${_ALTCCVERSION:Mclang} > ALT_COMPILER_TYPE= clang > .elif !empty(_ALTCCVERSION) > ALT_COMPILER_TYPE= gcc > .endif > > CHOSEN_COMPILER_TYPE= ${COMPILER_TYPE} > > .if ${_COMPILER_ARGS:Mopenmp} > .if ${COMPILER_TYPE} == clang >-USE_GCC= yes >+.if ${ARCH} == amd64 >+.include "${USESDIR}/localbase.mk" >+.if ${COMPILER_VERSION} < 38 >+CFLAGS+= -D_OPENMP >+.endif >+LDFLAGS+= -lomp -lm >+LIB_DEPENDS+= libomp.so.0:devel/openmp >+.else >+USE_GCC= yes > CHOSEN_COMPILER_TYPE= gcc >+.endif > .endif > .endif > > .if ${_COMPILER_ARGS:Mnestedfct} > .if ${COMPILER_TYPE} == clang > USE_GCC= any > CHOSEN_COMPILER_TYPE= gcc > .endif > .endif > > .if ${_COMPILER_ARGS:Mfeatures} > _CXXINTERNAL!= ${CXX} -\#\#\# /dev/null 2>&1 > .if ${_CXXINTERNAL:M\"-lc++\"} > COMPILER_FEATURES= libc++ > .else > COMPILER_FEATURES= libstdc++ > .endif > > CSTD= c89 c99 c11 gnu89 gnu99 gnu11 > CXXSTD= c++98 c++0x c++11 c++14 gnu++98 gnu++11 > > .for std in ${CSTD} ${CXXSTD} > _LANG=c > .if ${CXXSTD:M${std}} > _LANG=c++ > .endif > OUTPUT_${std}!= echo | ${CC} -std=${std} -c -x ${_LANG} /dev/null -o /dev/null 2>&1; echo > .if !${OUTPUT_${std}:M*error*} > COMPILER_FEATURES+= ${std} > .endif > .endfor > .endif > > .if ${_COMPILER_ARGS:Mc++11-lib} > .if !${COMPILER_FEATURES:Mc++11} > USE_GCC= yes > CHOSEN_COMPILER_TYPE= gcc > .elif ${COMPILER_TYPE} == clang && ${COMPILER_FEATURES:Mlibstdc++} > USE_GCC= yes > CHOSEN_COMPILER_TYPE= gcc > .endif > .endif > > .if ${_COMPILER_ARGS:Mc++14-lang} > .if !${COMPILER_FEATURES:Mc++14} > .if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 > USE_GCC= 5+ > CHOSEN_COMPILER_TYPE= gcc > .elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 35) || ${COMPILER_TYPE} == gcc > .if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 35 > CPP= clang-cpp > CC= clang > CXX= clang++ > CHOSEN_COMPILER_TYPE= clang > .else > BUILD_DEPENDS+= ${LOCALBASE}/bin/clang40:devel/llvm40 > CPP= ${LOCALBASE}/bin/clang-cpp40 > CC= ${LOCALBASE}/bin/clang40 > CXX= ${LOCALBASE}/bin/clang++40 > CHOSEN_COMPILER_TYPE= clang > .endif > .endif > .endif > .endif > > .if ${_COMPILER_ARGS:Mc++11-lang} > .if !${COMPILER_FEATURES:Mc++11} > .if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 > USE_GCC= yes > CHOSEN_COMPILER_TYPE= gcc > .elif ${COMPILER_TYPE} == gcc > .if ${ALT_COMPILER_TYPE} == clang > CPP= clang-cpp > CC= clang > CXX= clang++ > CHOSEN_COMPILER_TYPE= clang > .else > BUILD_DEPENDS+= ${LOCALBASE}/bin/clang34:lang/clang34 > CPP= ${LOCALBASE}/bin/clang-cpp34 > CC= ${LOCALBASE}/bin/clang34 > CXX= ${LOCALBASE}/bin/clang++34 > CHOSEN_COMPILER_TYPE= clang > .endif > .endif > .endif > .endif > > .if ${_COMPILER_ARGS:Mc++0x} > .if !${COMPILER_FEATURES:Mc++0x} > .if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 > USE_GCC= yes > CHOSEN_COMPILER_TYPE= gcc > .elif ${COMPILER_TYPE} == gcc > .if ${ALT_COMPILER_TYPE} == clang > CPP= clang-cpp > CC= clang > CXX= clang++ > CHOSEN_COMPILER_TYPE= clang > .else > BUILD_DEPENDS+= ${LOCALBASE}/bin/clang34:lang/clang34 > CHOSEN_COMPILER_TYPE= clang > CPP= ${LOCALBASE}/bin/clang-cpp34 > CC= ${LOCALBASE}/bin/clang34 > CXX= ${LOCALBASE}/bin/clang++34 > .endif > .endif > .endif > .endif > > .if ${_COMPILER_ARGS:Mc11} > .if !${COMPILER_FEATURES:Mc11} > .if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 > USE_GCC= yes > CHOSEN_COMPILER_TYPE= gcc > .elif ${COMPILER_TYPE} == gcc > .if ${ALT_COMPILER_TYPE} == clang > CPP= clang-cpp > CC= clang > CXX= clang++ > CHOSEN_COMPILER_TYPE= clang > .else > BUILD_DEPENDS+= ${LOCALBASE}/bin/clang34:lang/clang34 > CHOSEN_COMPILER_TYPE= clang > CPP= ${LOCALBASE}/bin/clang-cpp34 > CC= ${LOCALBASE}/bin/clang34 > CXX= ${LOCALBASE}/bin/clang++34 > .endif > .endif > .endif > .endif > > .if ${_COMPILER_ARGS:Mgcc-c++11-lib} > USE_GCC= yes > CHOSEN_COMPILER_TYPE= gcc > .if ${COMPILER_FEATURES:Mlibc++} > CXXFLAGS+= -nostdinc++ -isystem /usr/include/c++/v1 > LDFLAGS+= -L${WRKDIR} > > _USES_configure+= 200:gcc-libc++-configure > gcc-libc++-configure: > @${LN} -fs /usr/lib/libc++.so ${WRKDIR}/libstdc++.so > .endif > .endif > > .endif >Index: math/openblas/Makefile >=================================================================== >--- math/openblas/Makefile (revision 439963) >+++ math/openblas/Makefile (working copy) >@@ -1,162 +1,163 @@ > # Created by: Eijiro Shibusawa <ej-sib@ice.uec.ac.jp> > # $FreeBSD$ > > PORTNAME= openblas > PORTVERSION= 0.2.19 > PORTREVISION= 1 > DISTVERSIONPREFIX= v > PORTEPOCH= 1 > CATEGORIES= math > MASTER_SITES= NL/lapack/timing/:lapack_tmg > DISTFILES= large.tgz:lapack_tmg timing.tgz:lapack_tmg > DIST_SUBDIR= openblas > > MAINTAINER= phd_kimberlite@yahoo.co.jp > COMMENT= Optimized BLAS library based on GotoBLAS2 > > LICENSE= BSD3CLAUSE > LICENSE_FILE= ${WRKSRC}/LICENSE > > USE_GITHUB= yes > GH_ACCOUNT= xianyi > GH_PROJECT= OpenBLAS > LARGE_FILE= large.tgz > TIMING_FILE= timing.tgz > > USES= fortran gmake perl5 > USE_LDCONFIG= yes > USE_PERL5= build > > OPENBLAS_SUFX= r${PORTVERSION} > OPENBLAS_LIBS= libopenblas libopenblasp > OPENBLAS_SVER= 0 > OPENBLAS_FILES= ${OPENBLAS_LIBS:S|$|.so|} ${OPENBLAS_LIBS:S|$|.so.${OPENBLAS_SVER}|} ${OPENBLAS_LIBS:S|$|.a|} > PLIST_FILES= ${OPENBLAS_FILES:S|^|lib/|} > > OPTIONS_DEFINE= DYNAMIC_ARCH INTERFACE64 OPENMP AVX AVX2 > > DYNAMIC_ARCH_DESC= Support multiple CPU types on i386 and amd64 > INTERFACE64_DESC= Use 8 byte integers on 64-bit architectures > OPENMP_DESC= Use OpenMP for threading > AVX_DESC= Support Advanced Vector Extensions (AVX) > AVX2_DESC= Support Advanced Vector Extensions 2 (AVX2) > > .if defined(BATCH) || defined(PACKAGE_BUILDING) > OPTIONS_DEFAULT= DYNAMIC_ARCH > .endif > > .include <bsd.port.options.mk> > > .if defined(TARGET_CPU_ARCH) > BUILDFLAGS+= TARGET=${TARGET_CPU_ARCH} > .endif > > MAXTHREADS?= 8 > BUILDFLAGS_THREAD+= NUM_THREADS=${MAXTHREADS} USE_THREAD=1 > > .if ${ARCH:M*64} == "" > BUILDFLAGS+= BINARY32=1 > .else > BUILDFLAGS+= BINARY64=1 > .endif > > .if ! ( ${PORT_OPTIONS:MDYNAMIC_ARCH} && ( ${ARCH} == "amd64" || ${ARCH} == "i386" ) ) > MANUAL_PACKAGE_BUILD= Optimizes for the build machine. > .endif > > .if ${PORT_OPTIONS:MDYNAMIC_ARCH} > BUILDFLAGS+= DYNAMIC_ARCH=1 > .endif > > .if ${PORT_OPTIONS:MINTERFACE64} > BUILDFLAGS+= INTERFACE64=1 > .endif > > .if ${PORT_OPTIONS:MOPENMP} >+USE_GCC= yes > USES+= compiler:openmp > BUILDFLAGS_THREAD+= USE_OPENMP=1 > .endif > > .if ! ${PORT_OPTIONS:MAVX} > BUILDFLAGS+= NO_AVX=1 > .endif > > .if ! ${PORT_OPTIONS:MAVX2} > BUILDFLAGS+= NO_AVX2=1 > .endif > > post-extract: > cd ${DISTDIR}/${DIST_SUBDIR} ; \ > ${CP} ${LARGE_FILE} ${TIMING_FILE} ${WRKSRC} > ${MKDIR} ${WRKDIR}/lib > > post-patch: > ${REINPLACE_CMD} -e "s+%%FIND%%+${FIND}+" \ > -e "s+%%XARGS%%+${XARGS}+" \ > -e "s+%%REINPLACE_CMD%%+${REINPLACE_CMD}+" \ > ${WRKSRC}/Makefile > ${REINPLACE_CMD} -e "s+%%FC%%+${FC}+" -e "s+%%CC%%+${CC}+" \ > ${WRKSRC}/Makefile.rule > ${REINPLACE_CMD} -e "s+(ARCH)+(ARCH_)+" \ > ${WRKSRC}/Makefile.rule \ > ${WRKSRC}/Makefile.tail \ > ${WRKSRC}/driver/level3/Makefile \ > ${WRKSRC}/driver/others/Makefile \ > ${WRKSRC}/exports/Makefile \ > ${WRKSRC}/interface/Makefile \ > ${WRKSRC}/kernel/Makefile \ > ${WRKSRC}/kernel/Makefile.L3 \ > ${WRKSRC}/lapack/laswp/Makefile \ > ${WRKSRC}/lapack-netlib/SRC/Makefile \ > ${WRKSRC}/lapack-netlib/SRC/VARIANTS/Makefile \ > ${WRKSRC}/lapack-netlib/TESTING/MATGEN/Makefile \ > ${WRKSRC}/lapack-netlib/LAPACKE/src/Makefile \ > ${WRKSRC}/lapack-netlib/LAPACKE/utils/Makefile \ > ${WRKSRC}/reference/Makefile > ${REINPLACE_CMD} -e "s+(ARCH)+(ARCH_)+" \ > -e 's+%%LDFLAGS%%+${LDFLAGS}+' \ > -e 's+%%LOCALBASE%%+${LOCALBASE}+' \ > -e 's+%%FIND%%+${FIND}+' \ > -e 's+%%XARGS%%+${XARGS}+' \ > -e 's+%%REINPLACE_CMD%%+${REINPLACE_CMD}+' \ > -e 's+$${CROSS_SUFFIX}+${LOCALBASE}/bin/+' \ > -e '/Clang.*OpenMP/g' \ > ${WRKSRC}/Makefile.system > .if ${PORT_OPTIONS:MOPENMP} > ${REINPLACE_CMD} -e "s+OPENBLAS_NUM_THREADS+OMP_NUM_THREADS+g" \ > ${WRKSRC}/test/Makefile \ > ${WRKSRC}/ctest/Makefile > .endif > > do-build: > cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=1 USE_THREAD=0 \ > ${MAKE_CMD} ${MAKE_ARGS} > ${CP} ${WRKSRC}/libopenblas-${OPENBLAS_SUFX}.a ${WRKDIR}/lib/libopenblas.a > ${CP} ${WRKSRC}/libopenblas-${OPENBLAS_SUFX}.so ${WRKDIR}/lib/libopenblas.so.${OPENBLAS_SVER} > cd ${WRKSRC} ; ${MAKE_CMD} ${MAKE_ARGS} clean > cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} ${BUILDFLAGS_THREAD} \ > ${MAKE_CMD} ${MAKE_ARGS} > ${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.a ${WRKDIR}/lib/libopenblasp.a > ${CP} ${WRKSRC}/libopenblasp-${OPENBLAS_SUFX}.so ${WRKDIR}/lib/libopenblasp.so.${OPENBLAS_SVER} > > BENCHMARK_MAXTHREADS?= ${MAXTHREADS} > .if ${PORT_OPTIONS:MOPENMP} > BENCHMARK_THREADS_FLAG= OMP_NUM_THREADS=${BENCHMARK_MAXTHREADS} > .else > BENCHMARK_THREADS_FLAG= OPENBLAS_NUM_THREADS=${BENCHMARK_MAXTHREADS} > .endif > > benchmark: build > cd ${WRKSRC} ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \ > USE_THREAD=1 ${MAKE_CMD} ${MAKE_ARGS} hpl > cd ${WRKSRC}/benchmark ; ${SETENV} ${BUILDFLAGS} NUM_THREADS=${MAXTHREADS} \ > USE_THREAD=1 ${BENCHMARK_THREADS_FLAG} ${MAKE_CMD} ${MAKE_ARGS} > > do-install: > .for L in ${OPENBLAS_LIBS} > ${INSTALL_DATA} ${WRKDIR}/lib/${L}.a ${STAGEDIR}${PREFIX}/lib > ${INSTALL_LIB} ${WRKDIR}/lib/${L}.so.${OPENBLAS_SVER} ${STAGEDIR}${PREFIX}/lib > ${LN} -sf ${L}.so.${OPENBLAS_SVER} ${STAGEDIR}${PREFIX}/lib/${L}.so > .endfor > > .include <bsd.port.mk>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 210337
:
182261
|
182547
|
186836
|
190744
|
190857
|
194147