mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 02:25:18 +03:00
openmp.llvm.org (#2260)
* package & test * display-name * maybe find * modified: projects/openmp.llvm.org/package.yml
This commit is contained in:
parent
3103577bed
commit
c9d90972b3
54
projects/openmp.llvm.org/package.yml
Normal file
54
projects/openmp.llvm.org/package.yml
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
distributable:
|
||||||
|
url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{version}}/openmp-{{version}}.src.tar.xz
|
||||||
|
strip-components: 1
|
||||||
|
|
||||||
|
display-name: libomp
|
||||||
|
|
||||||
|
versions:
|
||||||
|
github: llvm/llvm-project
|
||||||
|
strip: /^llvmorg-/
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
linux:
|
||||||
|
python.org: ^3.11
|
||||||
|
perl.org: '*'
|
||||||
|
|
||||||
|
build:
|
||||||
|
dependencies:
|
||||||
|
tea.xyz/gx/cc: c99
|
||||||
|
tea.xyz/gx/make: '*'
|
||||||
|
cmake.org: '*'
|
||||||
|
llvm.org: '*'
|
||||||
|
gnu.org/wget: '*'
|
||||||
|
script: |
|
||||||
|
mkdir -p src
|
||||||
|
find . -maxdepth 1 ! -name '.' ! -name 'src' -exec mv {} ./src/ \;
|
||||||
|
mkdir -p cmake
|
||||||
|
wget $CMAKE_URL && tar -xf cmake-{{version}}.src.tar.xz -C ./cmake --strip-components=1
|
||||||
|
rm cmake-{{version}}.src.tar.xz
|
||||||
|
cmake -S src -B build/shared $ARGS
|
||||||
|
cmake --build build/shared
|
||||||
|
cmake --install build/shared
|
||||||
|
cmake -S src -B build/static -DLIBOMP_ENABLE_SHARED=OFF $ARGS
|
||||||
|
cmake --build build/static
|
||||||
|
cmake --install build/static
|
||||||
|
|
||||||
|
env:
|
||||||
|
CMAKE_URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-{{version}}/cmake-{{version}}.src.tar.xz'
|
||||||
|
ARGS:
|
||||||
|
- -DLIBOMP_INSTALL_ALIASES=OFF
|
||||||
|
- -DCMAKE_INSTALL_PREFIX={{prefix}}
|
||||||
|
- -DCMAKE_BUILD_TYPE=Release
|
||||||
|
- -DCMAKE_VERBOSE_MAKEFILE=ON
|
||||||
|
- -Wno-dev
|
||||||
|
- -DBUILD_TESTING=OFF
|
||||||
|
linux:
|
||||||
|
ARGS:
|
||||||
|
- -DOPENMP_ENABLE_LIBOMPTARGET=OFF
|
||||||
|
|
||||||
|
test:
|
||||||
|
dependencies:
|
||||||
|
tea.xyz/gx/cc: c99
|
||||||
|
script:
|
||||||
|
- g++ -Werror -Xpreprocessor -fopenmp test.cpp -std=c++11 -lomp -o test
|
||||||
|
- ./test
|
14
projects/openmp.llvm.org/test.cpp
Normal file
14
projects/openmp.llvm.org/test.cpp
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#include <omp.h>
|
||||||
|
#include <array>
|
||||||
|
int main (int argc, char** argv) {
|
||||||
|
std::array<size_t,2> arr = {0,0};
|
||||||
|
#pragma omp parallel num_threads(2)
|
||||||
|
{
|
||||||
|
size_t tid = omp_get_thread_num();
|
||||||
|
arr.at(tid) = tid + 1;
|
||||||
|
}
|
||||||
|
if(arr.at(0) == 1 && arr.at(1) == 2)
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
}
|
Loading…
Reference in a new issue