Running cmake while building Docker alpine container, get error: "make: /usr/bin/make: Operation not permitted ... Error 127" - c++

While attempting to update a Docker container for alpine:3.17, cmake reports the following when building the container from its Dockerfile:
[build 8/8] RUN cmake -DCMAKE_BUILD_TYPE=Release ../examples/server && make:
#13 0.549 -- The C compiler identification is GNU 12.2.1
#13 0.592 -- The CXX compiler identification is GNU 12.2.1
#13 0.602 -- Detecting C compiler ABI info
#13 0.613 -- Detecting C compiler ABI info - failed
#13 0.614 -- Check for working C compiler: /usr/bin/cc
#13 0.625 -- Check for working C compiler: /usr/bin/cc - broken
#13 0.625 CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
#13 0.625 The C compiler
#13 0.625
#13 0.625 "/usr/bin/cc"
#13 0.625
#13 0.625 is not able to compile a simple test program.
#13 0.625
#13 0.625 It fails with the following output:
#13 0.625
#13 0.625 Change Dir: /opt/via-httplib/build/CMakeFiles/CMakeTmp
#13 0.625
#13 0.625 Run Build Command(s):/usr/bin/make -f Makefile cmTC_9cb53/fast && /usr/bin/make -f CMakeFiles/cmTC_9cb53.dir/build.make CMakeFiles/cmTC_9cb53.dir/build
#13 0.625 make: /usr/bin/make: Operation not permitted
#13 0.625 make: *** [Makefile:127: cmTC_9cb53/fast] Error 127
I found: make: /bin/sh: Operation not permitted which indicates that it's an alpine issue: faccessat2 introduced in release 3.14.
I am using Docker Desktop for Windows, how can I fix this without reverting to alpine:3.13?

Related

Makefile Errors while building megasdk python in Alpine Edge Docker

I recently am facing problems on building MegaSdkC+ python wheel on alpine edge Linux docker ...I currently tried to port it via the Ubuntu Dockerfile
Error:
#8 184.6 In file included from /usr/include/openssl/bio.h:20,
#8 184.6 from /usr/include/openssl/ssl.h:18,
#8 184.6 from ./include/mega/posix/meganet.h:28,
#8 184.6 from ./include/mega.h:74,
#8 184.6 from src/posix/net.cpp:22:
#8 184.6 src/posix/net.cpp: In constructor 'mega::CurlHttpIO::CurlHttpIO()':
#8 184.6 src/posix/net.cpp:272:10: error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization [-fpermissive]
#8 184.6 272 | if (!CRYPTO_get_locking_callback()
#8 184.6 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#8 184.6 src/posix/net.cpp:274:13: error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization [-fpermissive]
#8 184.6 274 | && !CRYPTO_THREADID_get_callback())
#8 184.6 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#8 185.1 make[2]: *** [Makefile:2767: src/posix/libmega_la-net.lo] Error 1
#8 185.1 make[2]: *** Waiting for unfinished jobs....
#8 187.0 mv -f src/posix/.deps/libmega_la-waiter.Tpo src/posix/.deps/libmega_la-waiter.Plo
#8 187.0 make[2]: Leaving directory '/root/home/sdk'
#8 187.0 make[1]: *** [Makefile:3347: all-recursive] Error 1
#8 187.0 make[1]: Leaving directory '/root/home/sdk'
#8 187.0 make: *** [Makefile:1517: all] Error 2
Here is the direct logs of the errors of which is built via github actions:
https://github.com/AmirulAndalib/MLTB-ALPINE-DOCKER/runs/7592589121?check_suite_focus=true#step:9:995
Tried to port from Ubuntu .. Dockerfile and Github Actions build logs are given below
Logs
https://github.com/AmirulAndalib/slumtoolkit0-docker/runs/7595322451?check_suite_focus=true
Dockerfile
https://github.com/AmirulAndalib/slumtoolkit0-docker/blob/master/Dockerfile
For alpine Build
Dockerfile
https://github.com/AmirulAndalib/MLTB-ALPINE-DOCKER/blob/master/Dockerfile%20Base/Dockerfile
Gitflow Logs
https://github.com/AmirulAndalib/MLTB-ALPINE-DOCKER/runs/7592589121?check_suite_focus=true
MegaSdkC Repository
https://github.com/meganz/sdk
Thank you #mpb I had added the -fpermissive flag as you told and the errors were actually downgraded to warnings also my built code is working very well
Fix :
https://github.com/AmirulAndalib/MLTB-ALPINE-DOCKER/blob/master/Dockerfile%20Base/Dockerfile#L45
thank you very much for helping

CLion - can't run a program on apple m1

I ran clion a month ago and it worked perfectly. Now when I run a program I get:
/bin/sh: /Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion-ARM/ch-0/203.7717.62/CLion.app/Contents/bin/cmake/mac/bin/cmake: No such file or directory
make: *** [cmake_check_build_system] Error 127
Also, on clion startup, the cmake tool window shows me an error:
CMake Warning at /Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-1/211.7142.21/CLion.app/Contents/bin/cmake/mac/share/cmake-3.19/Modules/Platform/Darwin-Initialize.cmake:303 (message):
Ignoring CMAKE_OSX_SYSROOT value:
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
because the directory does not exist.
Call Stack (most recent call first):
/Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-1/211.7142.21/CLion.app/Contents/bin/cmake/mac/share/cmake-3.19/Modules/CMakeSystemSpecificInitialize.cmake:21 (include)
CMakeLists.txt:2 (project)
-- The C compiler identification is AppleClang 12.0.5.12050022
-- The CXX compiler identification is AppleClang 12.0.5.12050022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - broken
CMake Error at /Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-1/211.7142.21/CLion.app/Contents/bin/cmake/mac/share/cmake-3.19/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"/Library/Developer/CommandLineTools/usr/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/a/CLionProjects/untitled1/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_e3f61/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_e3f61.dir/build.make CMakeFiles/cmTC_e3f61.dir/build
Building C object CMakeFiles/cmTC_e3f61.dir/testCCompiler.c.o
/Library/Developer/CommandLineTools/usr/bin/cc -arch arm64 -o CMakeFiles/cmTC_e3f61.dir/testCCompiler.c.o -c /Users/a/CLionProjects/untitled1/cmake-build-debug/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_e3f61
"/Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-1/211.7142.21/CLion.app/Contents/bin/cmake/mac/bin/cmake" -E cmake_link_script CMakeFiles/cmTC_e3f61.dir/link.txt --verbose=1
/Library/Developer/CommandLineTools/usr/bin/cc -arch arm64 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_e3f61.dir/testCCompiler.c.o -o cmTC_e3f61
ld: library not found for -lSystem
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTC_e3f61] Error 1
make: *** [cmTC_e3f61/fast] Error 2
I have xcode command line tools installed. What should I do?
Erase cmake-build-... directory manually and reload a CMake project.

How to fix grpc compilation error for protoc mismatch?

What are you supposed to do to fix this grpc compilation error?
#10 629.8 [ 64%] Building CXX object CMakeFiles/grpc++_reflection.dir/gens/src/proto/grpc/reflection/v1alpha/reflection.pb.cc.o
#10 629.8 /usr/bin/x86_64-linux-gnu-g++ -DCARES_STATICLIB -D__CLANG_SUPPORT_DYN_ANNOTATION__ -I/home/src/third_party/zlib -I/home/src/include -I/home/src -I/home/src/third_party/address_sorting/include -I/home/src/third_party/boringssl-with-bazel/src/include -I/home/src/src/core/ext/upb-generated -I/home/i
nfinera/src/third_party/upb -I/home/src/build/x86_64/third_party/zlib -I/home/src/build/x86_64/gens -I/home/src/third_party/protobuf/src -I/home/src/build/x86_64/third_party/cares/cares -I/home/src/third_party/cares/cares -I/home/src/third_party/abseil-cpp -fPIC -std=c++11 -o CMakeFiles/grpc++_reflection
.dir/gens/src/proto/grpc/reflection/v1alpha/reflection.pb.cc.o -c /home/src/build/x86_64/gens/src/proto/grpc/reflection/v1alpha/reflection.pb.cc
#10 629.8 In file included from /home/src/build/x86_64/gens/src/proto/grpc/reflection/v1alpha/reflection.pb.cc:4:
#10 629.8 /home/src/build/x86_64/gens/src/proto/grpc/reflection/v1alpha/reflection.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
#10 629.8 #error This file was generated by a newer version of protoc which is
#10 629.8 ^~~~~
#10 629.8 /home/src/build/x86_64/gens/src/proto/grpc/reflection/v1alpha/reflection.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
#10 629.8 #error incompatible with your Protocol Buffer headers. Please update
#10 629.8 ^~~~~
#10 629.8 /home/src/build/x86_64/gens/src/proto/grpc/reflection/v1alpha/reflection.pb.h:14:2: error: #error your headers.
#10 629.8 #error your headers.
#10 629.8 ^~~~~
The timestamp prefixes are 'cuz this is running in a docker build.
I don't really understand what the pragma error is trying to tell me.
This file was generated by a newer version of protoc
Ok.
which is incompatible with your Protocol Buffer headers.
That sucks.
Please update your headers.
Umm...isn't the arrangement that I just run cmake and make to build your project? What exactly do I need to do to grpc's header files to "update" them?
How I build (paraphrased from a Dockerfile):
mkdir -p /home/src && cd /home/src
git clone --branch v1.30.0 https://github.com/grpc/grpc.git ./
git submodule update --init --recursive
mkdir -p /home/src/build/x86_64 && cd /home/src/build/x86_64
cmake ../..
make
Just run make with the grpc project root Makefile.
https://chromium.googlesource.com/external/github.com/grpc/grpc/+/v1.14.0/BUILDING.md
Notably, among the combinations of build systems and OSes, the combination of cmake and Unix/Linux is not listed.
Not an answer for how to fix the CMake-based build, which is what I'd have liked ideally, but maybe sometimes just take the damn path of least resistance.

compiler seems cannot find boost/shared_ptr.hpp

I am using Mac with OS 10.11.6
I am trying to install OpenGV on my Mac. This is a part of dependencies that will be needed to build the OpenSfM library. So, what I did is:
brew install homebrew/science/ceres-solver
brew install boost-python
brew install eigen
git clone https://github.com/paulinus/opengv.git
cd opengv
mkdir build
cd build
cmake .. -DBUILD_TESTS=OFF -DBUILD_PYTHON=ON
make install
But I got this error:
In file included from /Users/hilman_dayo/opengv/src/relative_pose/modules/main.cpp:47:
/Users/hilman_dayo/opengv/include/opengv/math/Sturm.hpp:43:10: fatal error: 'boost/shared_ptr.hpp' file not found
#include <boost/shared_ptr.hpp>
^
1 error generated.
make[2]: *** [CMakeFiles/opengv.dir/src/relative_pose/modules/main.o] Error 1
make[1]: *** [CMakeFiles/opengv.dir/all] Error 2
make: *** [all] Error 2
How can I solve this? Already checked, and the file is there at /usr/local/include/boost/shared_ptr.hpp.
If it is ever needed, this is the output during cmake:
-- The C compiler identification is AppleClang 7.3.0.7030031
-- The CXX compiler identification is AppleClang 7.3.0.7030031
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking for C++11 compiler
-- Checking for C++11 compiler - available
-- Performing Test SUPPORTS_STD_CXX11
-- Performing Test SUPPORTS_STD_CXX11 - Success
-- Performing Test SUPPORTS_STD_CXX01
-- Performing Test SUPPORTS_STD_CXX01 - Success
-- Found Eigen: /usr/local/include/eigen3 (Required is at least version "2.91.0")
CMake Warning at /usr/local/Cellar/cmake/3.6.3/share/cmake/Modules/FindBoost.cmake:743 (message):
Imported targets not available for Boost version 106200
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.6.3/share/cmake/Modules/FindBoost.cmake:842 (_Boost_COMPONENT_DEPENDENCIES)
/usr/local/Cellar/cmake/3.6.3/share/cmake/Modules/FindBoost.cmake:1395 (_Boost_MISSING_DEPENDENCIES)
python/CMakeLists.txt:2 (find_package)
-- Boost version: 1.62.0
-- Found the following Boost libraries:
-- python
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found version "2.7.10")
-- Found PythonInterp: /Users/hilman_dayo/.virtualenvs/cv/bin/python2.7 (found version "2.7.12")
-- Found NumPy: version "1.11.1" /Users/hilman_dayo/.virtualenvs/cv/lib/python2.7/site-packages/numpy/core/include
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
pyopengv
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /Users/hilman_dayo/opengv/build
OK. Comment by #usr1234567 give me a hint to find the answer. After a quick search, all I need to do is just execute this on the command line:
xcode-select --install

Coin3D library using cmake on Fedora 20 - fatal error: Inventor/Qt/SoQt.h: No such file or directory

I have create a project that uses Cmake and Coin3D libraries: https://github.com/tuxdna/phyloviz
I am getting a fatal error: Inventor/Qt/SoQt.h: No such file or directory. This is what I am doing:
$ sudo yum install cmake SoQt-devel
$ cd path/to/phyloviz
[phyloviz] $ mkdir build
[phyloviz] $ cd build/
[phyloviz/build] $ cmake ../ -DCOIN3D_INCLUDE_DIRS=/usr/include/Coin2/
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /bin/c++
-- Check for working CXX compiler: /bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PkgConfig: /bin/pkg-config (found version "0.28")
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /bin/qmake-qt4 (found version "4.8.5")
-- Found Coin3D: /usr/lib64/libCoin.so
-- Configuring done
-- Generating done
-- Build files have been written to: .../phyloviz/build
Now lets compile the code
[phyloviz/build] $ make
Scanning dependencies of target ev-iv
[ 50%] Building CXX object CMakeFiles/ev-iv.dir/src/ev-iv/ev-iv.cc.o
.../phyloviz/src/ev-iv/ev-iv.cc:1:30: fatal error: Inventor/Qt/SoQt.h: No such file or directory
#include <Inventor/Qt/SoQt.h>
^
compilation terminated.
make[2]: *** [CMakeFiles/ev-iv.dir/src/ev-iv/ev-iv.cc.o] Error 1
make[1]: *** [CMakeFiles/ev-iv.dir/all] Error 2
make: *** [all] Error 2
[phyloviz/build]$
Even though I have specified the include directory using cmake ../ -DCOIN3D_INCLUDE_DIRS=/usr/include/Coin2/, I am getting the fatal error above.
This works fine on Ubuntu 14.04. How can I resolve this?