sourcey / libsourcey

C++14 evented IO libraries for high performance networking and media based applications
https://sourcey.com/libsourcey
GNU Lesser General Public License v2.1
1.32k stars 349 forks source link

Can't build libsourcey with enabled webrtc #147

Closed tair-rhyme closed 7 years ago

tair-rhyme commented 7 years ago

Hi. I can't build libsourcey with enabled webrtc. After the week of fighting i decided to ask here. I've downloaded webrtc builds from this repo and successfully built. But when i wanted to build libsourcey, it failed with message:Could NOT find WEBRTC (missing: WEBRTC_LIBRARIES)

Built with this params:

cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_SHARED_LIBS=ON \
         -DBUILD_APPLICATIONS=ON -DBUILD_MODULES=ON \
         -DBUILD_SAMPLES=ON -DBUILD_SAMPLES_webrtc=ON -DBUILD_TESTS=ON \
         -DWITH_FFMPEG=ON -DWITH_OPENCV=OFF \
         -DWITH_WEBRTC=ON -DBUILD_MODULE_archo=ON \
         -DBUILD_MODULE_base=ON -DBUILD_MODULE_crypto=ON \
         -DBUILD_MODULE_http=ON -DBUILD_MODULE_json=ON \
         -DBUILD_MODULE_av=ON -DBUILD_MODULE_net=ON \
         -DBUILD_MODULE_pacm=ON -DBUILD_MODULE_pluga=ON \
         -DBUILD_MODULE_sked=ON -DBUILD_MODULE_socketio=ON \
         -DBUILD_MODULE_stun=ON -DBUILD_MODULE_symple=ON \
         -DBUILD_MODULE_turn=ON -DBUILD_MODULE_util=ON \
         -DBUILD_MODULE_uv=ON -DBUILD_MODULE_webrtc=ON \
         -DWEBRTC_ROOT_DIR=/home/rhyme/tmp/webrtc-18172-98e186c-linux-x64

Then i've tried to set folders path manually in FindWebRTC.cmake. I think i've true files and true structure of folders. Is there a way to set webrtcs' paths manually? How to check what's wrong with my folders and files. Thank you.

auscaster commented 7 years ago

Hi Tair,

Sorry you're having troubles. The best bet is to have a look at the circle.yml file in the libsourcey root directory, it shows all the necessary steps to build with WebRTC.

The CI script uses a precompiled archive: https://github.com/sourcey/webrtc-precompiled-builds/raw/master/webrtc-17657-02ba69d-linux-x64.tar.gz

You should try to use that first, and if it works then build WebRTC yourself.

Good luck

On 18 May 2017 at 11:34, TAIR RAIYMBEK notifications@github.com wrote:

Hi. I can't build libsourcey with enabled webrtc. After the week of fighting i decided to ask here. I've downloaded webrtc builds from this repo https://github.com/sourcey/webrtc-builds and successfully built. But when i wanted to build libsourcey, it failed with message:Could NOT find WEBRTC (missing: WEBRTC_LIBRARIES)

Built with this params:

cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_SHARED_LIBS=ON \ -DBUILD_APPLICATIONS=ON -DBUILD_MODULES=ON \ -DBUILD_SAMPLES=ON -DBUILD_SAMPLES_webrtc=ON -DBUILD_TESTS=ON \ -DWITH_FFMPEG=ON -DWITH_OPENCV=OFF \ -DWITH_WEBRTC=ON -DBUILD_MODULE_archo=ON \ -DBUILD_MODULE_base=ON -DBUILD_MODULE_crypto=ON \ -DBUILD_MODULE_http=ON -DBUILD_MODULE_json=ON \ -DBUILD_MODULE_av=ON -DBUILD_MODULE_net=ON \ -DBUILD_MODULE_pacm=ON -DBUILD_MODULE_pluga=ON \ -DBUILD_MODULE_sked=ON -DBUILD_MODULE_socketio=ON \ -DBUILD_MODULE_stun=ON -DBUILD_MODULE_symple=ON \ -DBUILD_MODULE_turn=ON -DBUILD_MODULE_util=ON \ -DBUILD_MODULE_uv=ON -DBUILD_MODULE_webrtc=ON \ -DWEBRTC_ROOT_DIR=/home/rhyme/tmp/webrtc-18172-98e186c-linux-x64

Then i've tried to set folders path manually in FindWebRTC.cmake. I think i've true files and true structure of folders. Is there a way to set webrtcs' paths manually? How to check what's wrong with my folders and files. Thank you.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sourcey/libsourcey/issues/147, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGKDKOD-KfvCKOwX1vz2zzve3qUuCvsks5r7BCWgaJpZM4Ne9sU .

tair-rhyme commented 7 years ago

It works. Thank you Mr. @auscaster !

jordansnyder commented 6 years ago

@auscaster Hi there, I'm having the same problem, but I'm on a Mac so I can't use any of the pre-built WebRTC builds that you have available. I've been all over the place ... your webrtcbuilds project has a bad merge in one of the shell scripts, so it won't run out of the box. I removed the git merge stuff (<<<<< HEAD, etc) and it runs, but it gives me other errors on a find operation (in the package method of util.sh) so it's just been unusable. I've also spent close to a week on this and have almost nothing to show for it, just a lot of failures 💯 I'm doubtful that your WebRTC build pushes all the correct .a and .h file into a lib and include directory, because even after "successfully" building and packaging, libsourcey still can't figure out where to find WebRTC, even when I pass in WEBRTC_ROOT, WEBRTC_INCLUDE and WEBRTC_LIBRARIES. The latest variation I've tried is the following cmake -DWITH_WEBRTC=ON -DWEBRTC_ROOT_DIR=~/tmp/webrtc-builds/out/webrtc-21647-0f17f9c-mac-x64/ -DBUILD_SAMPLES=ON -DWITH_FFMPEG=ON ..

Do you have any advice that might help me get unstuck? I've tried A LOAD of variations to try and get it to build, but I'm just pulling my hair out.

auscaster commented 6 years ago

Hey there Jordan, sorry to hear you're having issues! I'll get that merge issues sorted out right away.

We use the build scripts internally with frequency, so I can confirm they work, although we are compiling for linux so your mileage may vary on mac. We use currently use branch_heads/61 just in case you have any issues during compilation.

As for the CMake command you're using, it looks correct. You can always add a couple of debug messages to /cmake/FindWebRTC.cmake to see exactly whats being/not being set.

Note the following subdirectories are searched for the debug libs:

      ${WEBRTC_ROOT_DIR}/lib/x64/Debug
      ${WEBRTC_ROOT_DIR}/out/x64/Debug
      ${WEBRTC_ROOT_DIR}/out/Debug_x64
      ${WEBRTC_ROOT_DIR}/out/Debug-x64
      ${WEBRTC_ROOT_DIR}/out/Debug

Does that match your directory structure? Can you tell me the exact location of your webrtc library file? Is it failing because of a missing library, or headers (you can debug the cmake output to find this out)?

jordansnyder commented 6 years ago

Thank you that's really helpful! I'm new to cmake (I don't do C++ full time) so your descriptions helped, and I hadn't really looked in the cmake/ directory, so I'm glad I know where that is now.

But ok, I'm still having issues. After removing the git merge stuff, the script gets really far, but then it would error out on a find command. I believe it was this one

find webrtc -name *.h -exec $CP --parents '{}' $outdir/$label/include ';' . because there is no webrtc directory. Where is that supposed to be? It looks like it expects it to be in the WEBRTC_ROOT. I actually changed webrtc to I think out because again there's no directory named webrtc.

Then I had to fix another issue with the find commands, and all I did was add single quotes around the *.h in the command, and got past that issue.

find third_party -name '*.h' -o -name README -o -name LICENSE -o -name COPYING

Anyway, after all this tweaking to get it to run on my Mac, libsourcey still can't find what it wants. I'm doing another fresh build of webrtc on the branch_heads/61 to see if the directory structure is different. That of course takes a while so I'll report back. Running this command from the webrtc-builds repo: ./build.sh -e -l jsoncpp -c x64 -b branch-heads/61

In the meantime -what's the difference between your repos webrtc-builds and webrtcbuilds?

auscaster commented 6 years ago

We forked their repo about a year back to add some missing features we needed, such aspackage generation. By the way please make a pr with your updates when you succeed, it might save some others time also

On 18 Jan 2018 22:29, "Jordan Snyder" notifications@github.com wrote:

Thank you that's really helpful! I'm new to cmake (I don't do C++ full time) so your descriptions helped, and I hadn't really looked in the cmake/ directory, so I'm glad I know where that is now.

But ok, I'm still having issues. After removing the git merge stuff, the script gets really far, but then it would error out on a find command. I believe it was this one

find webrtc -name *.h -exec $CP --parents '{}' $outdir/$label/include ';' . because there is no webrtc directory. Where is that supposed to be? It looks like it expects it to be in the WEBRTC_ROOT. I actually changed webrtc to I think out because again there's no directory named webrtc.

Then I had to fix another issue with the find commands, and all I did was add single quotes around the *.h in the command, and got past that issue.

find third_party -name '*.h' -o -name README -o -name LICENSE -o -name COPYING

Anyway, after all this tweaking to get it to run on my Mac, libsourcey still can't find what it wants. I'm doing another fresh build of webrtc on the branch_heads/61 to see if the directory structure is different. That of course takes a while so I'll report back.

In the meantime -what's the difference between your repos webrtc-builds and webrtcbuilds?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sourcey/libsourcey/issues/147#issuecomment-358787663, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGKDNFls8onKb5KOrNrnu3NddMRWcv7ks5tL7fEgaJpZM4Ne9sU .

jordansnyder commented 6 years ago

This is the directory structure that is produced by webrtc-builds in the out/webrtc-21686-23b5cc9-mac-x64 directory.

screen shot 2018-01-18 at 3 19 29 pm

Still no luck when I set the WEBRTC_ROOT_DIR to the out/webrtc-21686-23b5cc9-mac-x64 directory and try to cmake