intel / dps-for-iot

Other
61 stars 23 forks source link

Does not build on ubuntu 20.04 #127

Closed maldata closed 4 years ago

maldata commented 4 years ago

I tried building this on a standard x86_64 ubuntu 20.04 machine, and it seems to choke when linking to libuv. I installed libuv1 and libuv1-dev through apt, then ran

scons -Q variant=debug transport=tcp bindings=none

It failed at the linking step, so I figured it was because libuv gets installed in /usr/lib/x86_64-linux-gnu. I'm not very familiar with scons, so I just did a quick & dirty change to SConstruct:

@@ -267,7 +267,7 @@ elif env['PLATFORM'] == 'posix':
     # Data relocation and protection (RELRO):
     env.Append(LINKFLAGS = ['-z', 'relro', '-z', 'now'])

-env.Append(LIBPATH=['./ext'])
+env.Append(LIBPATH=['./ext','/usr/lib/x86_64-linux-gnu'])

It still failed, and it appears to be because of the linking order, so I also changed:

@@ -125,7 +125,7 @@ elif env['PLATFORM'] == 'posix':
             env['PY_CPPPATH'] = [inc[2:] for inc in py_cpppath]
             env['PY_LIBPATH'] = []

-    env['DPS_LIBS'] = ['pthread', 'dl']
+    env['DPS_LIBS'] = ['uv', 'pthread', 'dl']

Definitely not the right way to fix it, but it builds now.

malsbat commented 4 years ago

Can you give https://github.com/intel/dps-for-iot/pull/128 a shot and report back? I checked it on both an Ubuntu 20.04 VM and a Fedora 31 machine. The CI won't catch the issue as it uses the builtin libuv.

maldata commented 4 years ago

Yep, that does it. The fix-ubuntu-20.04-build branch builds just fine. Thanks!

malsbat commented 4 years ago

Thanks, I just merged the fix.