Install libssh fail due to cmake error - cmake

So I was trying to install libssh base on instruction from https://github.com/substack/libssh/blob/master/INSTALL
Then when I was trying to build using cmake I have run into problems. I have cmake module on my linux server "cmake/3.7.2-1"
When I have executed command
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..
I got following errors:
CMake Error at /afs/.../RHEL6-x86_64/cmake/3.7.2-1/share/cmake-3.7/Modules/CMakeTestCXXCompiler.cmake:44 (message):
The C++ compiler ".../4.9.1/Linux_x86_64_compiled/bin/gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /local/efrimaz/libSSH/v0-6/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTC_e97bb/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_e97bb.dir/build.make
CMakeFiles/cmTC_e97bb.dir/build
gmake[1]: Entering directory
`/local/efrimaz/libSSH/v0-6/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_e97bb.dir/testCXXCompiler.cxx.o
/.../4.9.1/Linux_x86_64_compiled/bin/gcc -o
CMakeFiles/cmTC_e97bb.dir/testCXXCompiler.cxx.o -c
/local/efrimaz/libSSH/v0-6/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_e97bb
/afs/.../cmake/3.7.2-1/bin/cmake
-E cmake_link_script CMakeFiles/cmTC_e97bb.dir/link.txt --verbose=1
/.../4.9.1/Linux_x86_64_compiled/bin/gcc
CMakeFiles/cmTC_e97bb.dir/testCXXCompiler.cxx.o -o cmTC_e97bb -rdynamic
/usr/bin/ld: unrecognized option '-plugin'
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTC_e97bb] Error 1
gmake[1]: Leaving directory
`/local/efrimaz/libSSH/v0-6/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_e97bb/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
examples/CMakeLists.txt:1 (project)
-- Configuring incomplete, errors occurred!
Google didnt help. Any adivse appreciate.

Related

Errors in p4est and cmake when install dealii

Can anyone help me with this issue?
In order to use dealii, I tried to install p4est using the command
./configure && make && make install
and
cmake .. -DP4EST_DIR=/usr/local -DDEAL_II_WITH_P4EST=ON -DDEAL_II_WITH_MPI=ON -DCMAKE_INSTALL_PREFIX=/usr/local
under "build" folder, but some error occurs.
I also opened the file dealii-9.0.0/build/CMakeFiles/CMakeError.log, it says:
Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test rt_LIBRARY failed with the following output:
Change Dir: /Users/chuxiaoyun/Downloads/dealii-9.0.0/build/CMakeFiles/CMakeScratch/TryCompile-Fscvq9
Run Build Command(s):/usr/bin/make -f Makefile cmTC_bc7f9/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_bc7f9.dir/build.make CMakeFiles/cmTC_bc7f9.dir/build
Building CXX object CMakeFiles/cmTC_bc7f9.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Drt_LIBRARY -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -mmacosx-version-min=11.6 -MD -MT CMakeFiles/cmTC_bc7f9.dir/src.cxx.o -MF CMakeFiles/cmTC_bc7f9.dir/src.cxx.o.d -o CMakeFiles/cmTC_bc7f9.dir/src.cxx.o -c /Users/chuxiaoyun/Downloads/dealii-9.0.0/build/CMakeFiles/CMakeScratch/TryCompile-Fscvq9/src.cxx
Linking CXX executable cmTC_bc7f9
/opt/homebrew/Cellar/cmake/3.25.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bc7f9.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -mmacosx-version-min=11.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_bc7f9.dir/src.cxx.o -o cmTC_bc7f9 -lrt
ld: library not found for -lrt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTC_bc7f9] Error 1
make: *** [cmTC_bc7f9/fast] Error 2
CMake Error at cmake/macros/macro_configure_feature.cmake:112 (MESSAGE):
Could not find the p4est library!
Insufficient p4est installation found!
p4est has to be configured with MPI enabled.
Please ensure that a suitable p4est library is installed on your computer.
If the library is not at a default location, either provide some hints for
autodetection,
$ P4EST_DIR="..." cmake <...>
$ cmake -DP4EST_DIR="..." <...>
or set the relevant variables by hand in ccmake.
Call Stack (most recent call first):
cmake/macros/macro_configure_feature.cmake:269 (FEATURE_ERROR_MESSAGE)
cmake/configure/configure_p4est.cmake:78 (CONFIGURE_FEATURE)
cmake/macros/macro_verbose_include.cmake:19 (INCLUDE)
CMakeLists.txt:124 (VERBOSE_INCLUDE)
I guess I haven't installed p4est correctly, so I configure it again.
# p4est-2.8 ./configure --enable-mpi.
( Here shows we are using MPI. I also tried p4est-2.8 ./configure --enable-mpi --prefix=/usr/local)
Then I tried to build and install p4est, but it gives me an error during installation:
# make
# ➜ p4est-2.8 make install
/Applications/Xcode.app/Contents/Developer/usr/bin/make install-recursive
Making install in sc
/Applications/Xcode.app/Contents/Developer/usr/bin/make install-am
build-aux/install-sh -c -d '/Users/xiaoyun/Downloads/p4est-2.8/local/lib'
/bin/sh ./libtool --mode=install /usr/bin/install -c src/libsc.la '/Users/xiaoyun/Downloads/p4est-2.8/local/lib'
libtool: install: /usr/bin/install -c src/.libs/libsc.0.dylib /Users/xiaoyun/Downloads/p4est-2.8/local/lib/libsc.0.dylib
install: /Users/xiaoyun/Downloads/p4est-2.8/local/lib/libsc.0.dylib: Permission denied
make[4]: *** [install-libLTLIBRARIES] Error 71
make[3]: *** [install-am] Error 2
make[2]: *** [install] Error 2
make[1]: *** [install-recursive] Error 1
I have no idea why the permission is denied, I also tried sudo make install:
objc[71909]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x20230f7e8) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10c9082c8). One of the two will be used. Which one is undefined.
objc[71909]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x20230f838) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10c908318). One of the two will be used. Which one is undefined.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Operation not permitted
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Operation not permitted
make: getcwd: Operation not permitted
make: Nothing to be done for `install'.

Cmake Configuring incomplete, error occurred | Box2d / Linux

I am not able to configure cmake.
The issue is as described below about I am unable to make most of it:
CMake error at /snap/cmake/936/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake230 (message):Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB)
Call Stack (most recent call first):
/snap/cmake/936/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake594 (_FPHSA_FAILURE_MESSAGE)
/snap/cmake/936/share/cmake-3.21/Modules/FindXII.camke:457 (find_package_handle_Standard_args)
extern/glfx/CMakeLists.txt:27 (find package)
Below is the error log (CmakeErrorLog):
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_81640/fast && /usr/bin/make -f CMakeFiles/cmTC_81640.dir/build.make CMakeFiles/cmTC_81640.dir/build
make[1]: Entering directory '/home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_81640.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_81640.dir/src.c.o -c /home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_81640
/snap/cmake/936/bin/cmake -E cmake_link_script CMakeFiles/cmTC_81640.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_81640.dir/src.c.o -o cmTC_81640
/usr/bin/ld: CMakeFiles/cmTC_81640.dir/src.c.o: in function `main':
src.c:(.text+0x46): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x52): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x5e): undefined reference to `pthread_cancel'
/usr/bin/ld: src.c:(.text+0x6f): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_81640.dir/build.make:99: cmTC_81640] Error 1
make[1]: Leaving directory '/home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_81640/fast] Error 2
Source file was:
#include <pthread.h>
static void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);
return 0;
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_f6423/fast && /usr/bin/make -f CMakeFiles/cmTC_f6423.dir/build.make CMakeFiles/cmTC_f6423.dir/build
make[1]: Entering directory '/home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f6423.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_f6423.dir/CheckFunctionExists.c.o -c /snap/cmake/936/share/cmake-3.21/Modules/CheckFunctionExists.c
Linking C executable cmTC_f6423
/snap/cmake/936/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f6423.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_f6423.dir/CheckFunctionExists.c.o -o cmTC_f6423 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_f6423.dir/build.make:99: cmTC_f6423] Error 1
make[1]: Leaving directory '/home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_f6423/fast] Error 2
The output log is too big and I cannot post it (maybe can post parts of it).
I am positive that I have all needed libraries installed. The issue must lie with the cmake implementation.
What is did is the following
Basically I was at the CMake master file and I wanted to run it at the testbed folder of box2d.
Can anyone help me out please?
If more information is needed let me know
Eventually was able to configure cmake without error
Initially the problem was because the following library was not installed: x11-dev
Then another error came up, as noted in the above comment.
After installing the following xorg-dev libglu1-mesa-dev the configuration was completed without any errors.
Thank you both for the help!

CMake: ''Error in configuration process, project files may be invalid" ; OpenPose

I'm trying to build OpenPose from the source code, but however I get this error message. Please help me.
Here is the log from CMake-GUI:
Building with CUDA.
CUDA detected: 9.1
Added CUDA NVCC flags for: sm_61
cuDNN not found
Could NOT find GFlags (missing: GFLAGS_INCLUDE_DIR GFLAGS_LIBRARY)
Could NOT find Glog (missing: GLOG_INCLUDE_DIR GLOG_LIBRARY)
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.10/Modules/FindProtobuf.cmake:543 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:431 (find_package)
Here are the last few lines from CMakeErrorLog
Linking C executable cmTC_54d83
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_54d83.dir/link.txt --verbose=1
/usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_54d83.dir/CheckFunctionExists.c.o -o $
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_54d83.dir/build.make:97: recipe for target 'cmTC_54d83' failed
make[1]: *** [cmTC_54d83] Error 1
make[1]: Leaving directory '/home/idl/PycharmProjects/openpose/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_54d83/fast' failed
make: *** [cmTC_54d83/fast] Error 2
I have installed the required dependencies- CUDA, CuDNN, CAFFE, CV2...

Trying to use JetBrains CLion, but Cmake - c++ compiler broken after cygwin install

I have been trying to get JetBrains CLion IDE working, but I am running into a problem with Cmake and none of my research online has been helpful. I installed cygwin with the necessary packages (as stated here - gcc/g++, cmake, make, gdb). When I open up CLion and go into Settings (I'm running Windows 10) under Build>Toolchains>Debugger everything has a check next to it, so it seems like CLion has found everything alright, but when I look in the Debugger window I get the following error:
"C:\Users\Lucas Lofaro\.CLion2016.3\system\cygwin_cmake\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" "/cygdrive/c/Users/Lucas Lofaro/ClionProjects/cracking_the_coding_interview"
-- The CXX compiler identification is GNU 5.3.0
-- Check for working CXX compiler: /usr/bin/c++.exe
-- Check for working CXX compiler: /usr/bin/c++.exe -- broken
CMake Error at /cygdrive/c/Users/Lucas Lofaro/.CLion2016.3/system/cygwin_cmake/share/cmake-3.6.2/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/Lucas Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_96921/fast"
/usr/bin/make -f CMakeFiles/cmTC_96921.dir/build.make
CMakeFiles/cmTC_96921.dir/build
make[1]: Entering directory '/cygdrive/c/Users/Lucas
Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_96921.dir/testCXXCompiler.cxx.o
/usr/bin/c++.exe -o CMakeFiles/cmTC_96921.dir/testCXXCompiler.cxx.o -c
"/cygdrive/c/Users/Lucas
Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeTmp/testCXXCompiler.cxx"
Linking CXX executable cmTC_96921.exe
"/cygdrive/c/Users/Lucas
Lofaro/.CLion2016.3/system/cygwin_cmake/bin/cmake.exe" -E cmake_link_script
CMakeFiles/cmTC_96921.dir/link.txt --verbose=1
/usr/bin/c++.exe -Wl,--enable-auto-import
CMakeFiles/cmTC_96921.dir/testCXXCompiler.cxx.o -o cmTC_96921.exe
-Wl,--out-implib,libcmTC_96921.dll.a
-Wl,--major-image-version,0,--minor-image-version,0
c++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.
CMakeFiles/cmTC_96921.dir/build.make:97: recipe for target 'cmTC_96921.exe'
failed
make[1]: *** [cmTC_96921.exe] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/Lucas
Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_96921/fast' failed
make: *** [cmTC_96921/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "/cygdrive/c/Users/Lucas Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/cygdrive/c/Users/Lucas Lofaro/ClionProjects/cracking_the_coding_interview/cmake-build-debug/CMakeFiles/CMakeError.log".
I've also added the cygwin bin directory to my Path environment variable, but I am really at a loss as to what to do next. Something isn't linking up and I don't want to start digging around in Cmake files without a better understanding of what's going on. Any guidance would be much appreciated. Please let me know if I can provide any additional information.
It turns out that the cmake, make, and g++ packages were installed but not updated to their most recent versions. Rerunning cygwin installer solved my problem and everything now compiles fine.

The C compiler identification is unknown

I want to compile a C program. When I run cmake
build]$ cmake ../
-- The C compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/usr/bin/cc" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec3431547622/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3431547622.dir/build.make
CMakeFiles/cmTryCompileExec3431547622.dir/build
make[1]: Entering directory
'/home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report
/home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object
CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o
/usr/bin/cc -o CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o
-c /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp/testCCompiler.c
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1: error while loading shared
libraries: libisl.so.13: cannot open shared object file: No such file or
directory
CMakeFiles/cmTryCompileExec3431547622.dir/build.make:57: recipe for target
'CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o' failed
make[1]: *** [CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o]
Error 1
make[1]: Leaving directory
'/home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp'
Makefile:118: recipe for target 'cmTryCompileExec3431547622/fast' failed
make: *** [cmTryCompileExec3431547622/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "/home/vahid/dev/Indexer/build/CMakeFiles/CMakeOutput.log".
See also "/home/vahid/dev/Indexer/build/CMakeFiles/CMakeError.log".
why did this error occur? How can I fix it?
why this error occured?
According to this error message:
/usr/bin/cc -o CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o -c /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp/testCCompiler.c
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1: error while loading shared libraries: libisl.so.13: cannot open shared object file: No such file or directory
It looks like your compiler does not work.
how i can fix it?
Reinstall toolchain should be the simplest way to fix it.
How to do that depends on your operating system, if you are using Linux distribution like Debian, you can use something like apt-get install build-essential to install it; if you are using Fedora or CentOS, you could use yum group install c-development.