Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling on Amazon Linux #489

Closed
florisporro opened this issue Nov 6, 2018 · 3 comments
Closed

Compiling on Amazon Linux #489

florisporro opened this issue Nov 6, 2018 · 3 comments

Comments

@florisporro
Copy link

Building on totally clean Amazon Linux EC2 instance fails, where this previously worked without issue:

[ec2-user@ip ~]$ git clone https://github.com/Haivision/srt.git
Cloning into 'srt'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 2238 (delta 0), reused 0 (delta 0), pack-reused 2235
Receiving objects: 100% (2238/2238), 2.29 MiB | 1.30 MiB/s, done.
Resolving deltas: 100% (1572/1572), done.
[ec2-user@ip ~]$ cd srt/
[ec2-user@ip srt]$ ./configure
Running: cmake .
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- 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.27.1")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- BUILD TYPE: Release
-- BINARY_DIR: /home/ec2-user/srt
-- EXECUTABLE_OUTPUT_PATH: /home/ec2-user/srt/bin
-- LOGGING: ENABLED
-- No WITH_COMPILER_PREFIX - using C++ compiler /bin/c++
-- Looking for inet_pton
-- Looking for inet_pton - found
-- SSL Dependency: using OpenSSL (default)
-- checking for module 'openssl libcrypto'
--   found openssl libcrypto, version 1.0.2k;1.0.2k
-- SSL via pkg-config: -L  -I  -l;ssl;crypto
-- SSL libraries: ssl;crypto
-- COMPILER: GNU compat: /bin/c++
-- DETECTED SYSTEM: LINUX;  LINUX=1
-- ADDING TRANSITIVE LINK DEP to:srt_shared : -lpthread
-- ADDING TRANSITIVE LINK DEP to:srt_static : -lpthread
-- INSTALL DIRS: bin=bin lib=lib64 shlib=lib64 include=include
-- C++ VERSION: Setting C++11 compat flag for gnu compiler
-- BACKWARD COMPATIBLE 'stransmit': will use symbolic link
-- Found Git: /bin/git (found version "2.14.5")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ec2-user/srt/googletest
Scanning dependencies of target googletest
[ 11%] Creating directories for 'googletest'
[ 22%] Performing download step (git clone) for 'googletest'
Cloning into 'googletest-src'...
Note: checking out 'release-1.8.1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 2fe3bd9... Merge pull request #1433 from dsacre/fix-clang-warnings
[ 33%] No patch step for 'googletest'
[ 44%] Performing update step for 'googletest'
[ 55%] No configure step for 'googletest'
[ 66%] No build step for 'googletest'
[ 77%] No install step for 'googletest'
[ 88%] No test step for 'googletest'
[100%] Completed 'googletest'
[100%] Built target googletest
-- Found PythonInterp: /bin/python (found version "2.7.14")
CMake Error at /usr/share/cmake/Modules/WriteBasicConfigVersionFile.cmake:39 (message):
  No VERSION specified for WRITE_BASIC_CONFIG_VERSION_FILE()
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CMakePackageConfigHelpers.cmake:152 (write_basic_config_version_file)
  googletest/googletest-src/googletest/CMakeLists.txt:96 (write_basic_package_version_file)


-- Configuring incomplete, errors occurred!
See also "/home/ec2-user/srt/CMakeFiles/CMakeOutput.log".
See also "/home/ec2-user/srt/CMakeFiles/CMakeError.log".
CONFIGURE: cmake reported error: child process exited abnormally

Could this be related to Python version 2.7.14?

@florisporro
Copy link
Author

Fixed it by getting the binaries from the previously working Amazon Linux instance and installing on the new server. If anyone comes across this in the future and needs a static build, here are the binaries:

srtransmit.zip

@maxsharabayko
Copy link
Collaborator

@florisporro Please run
./configure --ENABLE_UNITTESTS=OFF
It should disable google test framework, which should solve the issue on your system while we are investigating it.
It looks like Python is found (found version "2.7.14"). So the version should be parsed too.
Could you please share the CMakeError.log file as well?

@florisporro
Copy link
Author

This fixed the issue! 👍

Contents of CMakeError.log:

[ec2-user@ip CMakeFiles]$ cat CMakeError.log
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/ec2-user/srt/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec3532095201/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec3532095201.dir/build.make CMakeFiles/cmTryCompileExec3532095201.dir/build
gmake[1]: Entering directory `/home/ec2-user/srt/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/ec2-user/srt/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3532095201.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTryCompileExec3532095201.dir/CheckSymbolExists.c.o   -c /home/ec2-user/srt/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec3532095201
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3532095201.dir/link.txt --verbose=1
/usr/bin/cc       CMakeFiles/cmTryCompileExec3532095201.dir/CheckSymbolExists.c.o  -o cmTryCompileExec3532095201 -rdynamic
CMakeFiles/cmTryCompileExec3532095201.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
gmake[1]: Leaving directory `/home/ec2-user/srt/CMakeFiles/CMakeTmp'
gmake[1]: *** [cmTryCompileExec3532095201] Error 1
gmake: *** [cmTryCompileExec3532095201/fast] Error 2

File /home/ec2-user/srt/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/ec2-user/srt/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec2808319286/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec2808319286.dir/build.make CMakeFiles/cmTryCompileExec2808319286.dir/build
gmake[1]: Entering directory `/home/ec2-user/srt/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/ec2-user/srt/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2808319286.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTryCompileExec2808319286.dir/CheckFunctionExists.c.o   -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec2808319286
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2808319286.dir/link.txt --verbose=1
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTryCompileExec2808319286.dir/CheckFunctionExists.c.o  -o cmTryCompileExec2808319286 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: Leaving directory `/home/ec2-user/srt/CMakeFiles/CMakeTmp'
gmake[1]: *** [cmTryCompileExec2808319286] Error 1
gmake: *** [cmTryCompileExec2808319286/fast] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants