On 2022/05/14 10:34, [email protected] wrote:
> This includes static and dynamic libs.
>
> The cc and c++ compilers support -fopenmp but base omits this library.
>
>
> John
>
: ONLY_FOR_ARCHS = amd64 arm64 armv7 i386 mips64 mips64el
:
: V = 13.0.0
: COMMENT = LLVM OpenMP runtime, static library
there's also a shared library
: DISTNAME = openmp-${V}.src
: PKGNAME = libomp-${V}
: EXTRACT_SUFX = .tar.xz
: CATEGORIES = lang devel
:
: # needed for .h files
: RUN_DEPENDS = lang/libomp
:
: HOMEPAGE = https://openmp.llvm.org/
:
: GH_ACCOUNT = llvm
: GH_PROJECT = llvm-project
: DISTFILES+= ${DISTNAME}${EXTRACT_SUFX}:0
use of GH_* variables here is invalid, GH_ACCOUNT and GH_PROJECT require
also setting one of GH_TAGNAME or GH_COMMIT.
This is a normal distfile hosted in github releases as an artefact
rather than their on-the-fly git archives. Just use DISTNAME and set
MASTER_SITES.
: SHARED_LIBS += omp 1.0 # 13.0.0
start with 0.0
:
: # Dual MIT/UIUC
: PERMIT_PACKAGE = Yes
:
: WANTLIB += ${COMPILER_LIBCXX} m pthread
:
: MASTER_SITES0 =
https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/releases/download/llvmorg-${V}/
:
: # C++11
: COMPILER = base-clang
:
: MODULES = devel/cmake
:
: NO_TEST = Yes
:
: # we make our own shared lib:
: CONFIGURE_ARGS = -DLIBOMP_ENABLE_SHARED:BOOL=No \
: -DOPENMP_ENABLE_LIBOMPTARGET:BOOL=No \
: -DLIBOMP_CXXFLAGS=-fPIC
:
: post-build:
: # extract the .o files
: cd ${WRKBUILD}/runtime/src && \
: ${AR} x libomp.a
: # build shared library
: cd ${WRKBUILD} && \
: ${CC} -shared -o \
: libomp.so.${LIBomp_VERSION} \
: runtime/src/*.o -lm -lpthread
:
: post-install:
: ${INSTALL_DATA} ${WRKBUILD}/lib*.so.?.? ${PREFIX}/lib/
Either be more specific (libomp.so.${LIBomp_VERSION}) or less
(libomp.so.* maybe) rather than something that breaks if the lib
version changes to multiple digits.
: if(${LIBOMP_ENABLE_SHARED})
: - set(LIBOMP_LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
: + set(LIBOMP_LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBomp_VERSION})
but you aren't using the shared library gen in upstream's build infrastructure?