awslabs / amazon-kinesis-video-streams-webrtc-sdk-c

Amazon Kinesis Video Streams Webrtc SDK is for developers to install and customize realtime communication between devices and enable secure streaming of video, audio to Kinesis Video Streams.
https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-c/group__PublicMemberFunctions.html
Apache License 2.0
1.04k stars 313 forks source link

[QUESTION] Build help #547

Closed suggestedfixes closed 4 years ago

suggestedfixes commented 4 years ago

I'm trying to build this commit f0ff7e6d58a9218ff829f22f99a296832eaf681a

Right now I'm stuck at this message, any idea how to solve it? [ 26%] Building C object CMakeFiles/kvsCommonLws.dir/src/source/Common/Auth.c.o In file included from /root/project/arm/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/src/source/Common/Auth.c:5:0: /root/project/arm/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/src/source/Common/Include_i.h:41:27: fatal error: libwebsockets.h: No such file or directory

include

                       ^

compilation terminated. CMakeFiles/kvsCommonLws.dir/build.make:62: recipe for target 'CMakeFiles/kvsCommonLws.dir/src/source/Common/Auth.c.o' failed make[5]: [CMakeFiles/kvsCommonLws.dir/src/source/Common/Auth.c.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/kvsCommonLws.dir/all' failed make[4]: [CMakeFiles/kvsCommonLws.dir/all] Error 2 Makefile:129: recipe for target 'all' failed CMakeFiles/libkvsCommonLws-download.dir/build.make:111: recipe for target 'build/src/libkvsCommonLws-download-stamp/libkvsCommonLws-download-build' failed make[3]: [all] Error 2 make[2]: [build/src/libkvsCommonLws-download-stamp/libkvsCommonLws-download-build] Error 2 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/libkvsCommonLws-download.dir/all' failed make[1]: [CMakeFiles/libkvsCommonLws-download.dir/all] Error 2 make: [all] Error 2 Makefile:83: recipe for target 'all' failed CMake Error at CMake/Utilities.cmake:61 (message): CMake step for libkvsCommonLws failed: 2 Call Stack (most recent call first): CMakeLists.txt:78 (build_dependency)

suggestedfixes commented 4 years ago

My environment is similar to this in the travis file

lherman-cs commented 4 years ago

@suggestedfixes the issue is related to a typo within our CMakeLists.txt. We already have a PR in progress to fix this exact problem, https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c/pull/546. We'll merge it as soon as it passes all the CI checks.

suggestedfixes commented 4 years ago

Weird, did CI cache previous open-source folder?

MushMal commented 4 years ago

This is indeed weird. We are not yet entirely sure of the root cause why this build clean on Linux subsystems and some MacOS-es

disa6302 commented 4 years ago

@suggestedfixes ,

The fix is in. Please checkout the new commit. Thank you!

suggestedfixes commented 4 years ago

Great!!

suggestedfixes commented 4 years ago

I cloned the newest commit, still not working. I did a search for libwebsockets.h and it is located at ./open-source/include/, I think this folder was included before but got removed. Trying to include this rule.

suggestedfixes commented 4 years ago

Nvm it is still there include_directories(${OPEN_SRC_INSTALL_PREFIX}/include)

disa6302 commented 4 years ago

@suggestedfixes ,

If the build is working fine, can you close this ticket? Thanks!

disa6302 commented 4 years ago

Closing this. Feel free to open a new ticket if you face any issues.

suggestedfixes commented 4 years ago

@disa6302 Was not able to make a new build, still building.

disa6302 commented 4 years ago

@suggestedfixes ,

Can we help with any of your build issues?

suggestedfixes commented 4 years ago

I think it is because newly added dependency libkvsCommonLws needs libwebsockets. And include files are specified after installing libkvsCommonLws

suggestedfixes commented 4 years ago

So I'm currently shuffling include_directories() around and make libkvsCommonLws to build dependencies. Am I on the right track?

MushMal commented 4 years ago

@suggestedfixes could you please do git clean -ddfx to get rid of all directories and start anew. For some reason, git clean -ddfx doesn't remove open-source directory and you might need to manually remove it. Try to build it again afterwards. It should build LWS first before it attempts to build common library so the installed library and the includes should already be present.

suggestedfixes commented 4 years ago

It is likely due to one of the previous commits was installing libwebsocksets.pc into system PKG_CONFIG_PATH. Now there are two versions of libwebsockets.pc, pkg-config got confused on which version to grab.

suggestedfixes commented 4 years ago

Yep, pkgconfig got confused and loaded the directory of my global one.