Open sbellem opened 4 years ago
when using already patched openmp:
make[6]: Leaving directory '/tmp/nix-build-sgx.drv-0/source/external/openmp/openmp_code/final/build'
[ 5%] Built target libomp-needed-headers
make[6]: Entering directory '/tmp/nix-build-sgx.drv-0/source/external/openmp/openmp_code/final/build'
Scanning dependencies of target omp
make[6]: Leaving directory '/tmp/nix-build-sgx.drv-0/source/external/openmp/openmp_code/final/build'
make[6]: Entering directory '/tmp/nix-build-sgx.drv-0/source/external/openmp/openmp_code/final/build'
[ 8%] Building C object runtime/src/CMakeFiles/omp.dir/thirdparty/ittnotify/ittnotify_static.c.o
[ 11%] Building CXX object runtime/src/CMakeFiles/omp.dir/kmp_alloc.cpp.o
In file included from /tmp/nix-build-sgx.drv-0/source/external/openmp/openmp_code/final/runtime/src/kmp.h:62,
from /tmp/nix-build-sgx.drv-0/source/external/openmp/openmp_code/final/runtime/src/kmp_alloc.cpp:14:
/nix/store/7b67hqgxavm47qizrkya55qvyp1f65s4-glibc-2.27-dev/include/signal.h:301:11: fatal error: stddef.h: No such file or directory
# include <stddef.h>
^~~~~~~~~~
compilation terminated.
make[6]: *** [runtime/src/CMakeFiles/omp.dir/build.make:76: runtime/src/CMakeFiles/omp.dir/kmp_alloc.cpp.o] Error 1
make[6]: Leaving directory '/tmp/nix-build-sgx.drv-0/source/external/openmp/openmp_code/final/build'
make[5]: *** [CMakeFiles/Makefile2:234: runtime/src/CMakeFiles/omp.dir/all] Error 2
make[5]: Leaving directory '/tmp/nix-build-sgx.drv-0/source/external/openmp/openmp_code/final/build'
make[4]: *** [Makefile:130: all] Error 2
make[4]: Leaving directory '/tmp/nix-build-sgx.drv-0/source/external/openmp/openmp_code/final/build'
make[3]: *** [Makefile:73: openmp_code/final/build/runtime/src/libomp.a] Error 2
make[3]: Leaving directory '/tmp/nix-build-sgx.drv-0/source/external/openmp'
make[2]: *** [Makefile.source:201: openmp] Error 2
make[2]: Leaving directory '/tmp/nix-build-sgx.drv-0/source/sdk'
make[1]: *** [Makefile:50: all] Error 2
make[1]: Leaving directory '/tmp/nix-build-sgx.drv-0/source/sdk'
make: *** [Makefile:70: sdk] Error 2
builder for '/nix/store/0640jh4gs8fm1x16hfps5dss3mpc7nja-sgx.drv' failed with exit code 2
error: build of '/nix/store/0640jh4gs8fm1x16hfps5dss3mpc7nja-sgx.drv' failed
In the nix shell, the patch is applied:
make[3]: Leaving directory '/usr/src/source/sdk/pthread' [146/32369]
make -C /usr/src/source/external/openmp
make[3]: Entering directory '/usr/src/source/external/openmp'
cd openmp_code && git apply ../0001-Enable-OpenMP-in-SGX.patch && cd ..
../0001-Enable-OpenMP-in-SGX.patch:239: trailing whitespace.
#define KMP_NOW() get_timestamp()
../0001-Enable-OpenMP-in-SGX.patch:341: trailing whitespace.
#ifndef _OPENMP_SGX
../0001-Enable-OpenMP-in-SGX.patch:748: trailing whitespace.
#ifdef _OPENMP_SGX
../0001-Enable-OpenMP-in-SGX.patch:1043: trailing whitespace.
return __sync_add_and_fetch(&__kmp_global_count, 20*KMP_USEC_PER_SEC);
../0001-Enable-OpenMP-in-SGX.patch:1123: trailing whitespace.
#endif // _OPENMP_SGX
warning: squelched 3 whitespace errors
warning: 8 lines add whitespace errors.
mkdir -p openmp_code/final/build && cd openmp_code/final/build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_WORKS=TRUE -DCMAKE_CXX_COMPILER_WORKS=TRUE -DCMAKE_CXX_FLAGS=" -ffreestanding -nostdinc -fvisi
bility=hidden -fpic -fno-strict-overflow -fno-delete-null-pointer-checks -B/usr/src/source/external/toolset/nix -mindirect-branch-register -fcf-protection=none -mfunction-return=thunk-extern -fno-plt -Wa,-mlfenc
e-after-load=yes -Wa,-mlfence-before-indirect-branch=memory -Wa,-mlfence-before-ret=shl -nostdinc++" .. && make
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test OPENMP_HAVE_WERROR_FLAG
-- Performing Test OPENMP_HAVE_WERROR_FLAG - Success
-- Performing Test OPENMP_HAVE_STD_GNUPP11_FLAG
-- Performing Test OPENMP_HAVE_STD_GNUPP11_FLAG - Failed
-- Performing Test OPENMP_HAVE_STD_CPP11_FLAG
-- Performing Test OPENMP_HAVE_STD_CPP11_FLAG - Failed
-- Found PythonInterp: /nix/store/k0igqpz995nmxwf6piyd5jjpcc7gcnyc-python3-3.7.4/bin/python (found version "3.7.4")
-- Cannot find llvm-lit.
-- Please put llvm-lit in your PATH, set OPENMP_LLVM_LIT_EXECUTABLE to its full path, or point OPENMP_LLVM_TOOLS_DIR to its directory.
CMake Warning at cmake/OpenMPTesting.cmake:22 (message):
The check targets will not be available!
Call Stack (most recent call first):
cmake/OpenMPTesting.cmake:40 (find_standalone_test_dependencies)
CMakeLists.txt:49 (include)
...
Building and installing the SGX SDK works in a
nix-shell
session, including when using the--pure
option, but when building withnix-build
it fails as it tries to apply an OpenMP patch withgit
, which is not available.Thing to look for:
nix-build
,nix-shell
andnix-shell --pure
. Why is--pure
not "pure enough"?For use an already patched version of openmp and disable the check and
git apply
command invocation.