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

Fix build on Ubuntu caused by incorrect order of libraries #1926

Merged
merged 4 commits into from
Dec 25, 2018

Conversation

ninomp
Copy link
Contributor

@ninomp ninomp commented Nov 29, 2018

This fixes https://bugs.launchpad.net/mixxx/+bug/1804411

The solution is to specify -ldl after -lvamp-hostsdk. However, I couldn't find a way to remove the first -ldl, so -ldl is currently duplicated.

@ninomp
Copy link
Contributor Author

ninomp commented Nov 30, 2018

Should I squash these two commits into one?

@daschuer
Copy link
Member

I don't mind in this case. Normally you should not rewrite the history in a pending PR.

@daschuer
Copy link
Member

Is the 2.1 branch also effected?
If yes, we should reabse (and squash) it to it.

@daschuer
Copy link
Member

The first dl is added here:

if build.platform_is_linux:

Can we remove it?

@Be-ing
Copy link
Contributor

Be-ing commented Nov 30, 2018

Is the 2.1 branch also effected?

No, this bug was caused by #1841 which was merged to master.

@ninomp
Copy link
Contributor Author

ninomp commented Dec 18, 2018

@daschuer Hmm, if we remove conf.CheckLib(['dl', 'libdl'])' from configure(), scons will no longer check if this library is available/installed during its configuration step.

@ninomp
Copy link
Contributor Author

ninomp commented Dec 18, 2018

I tested these changes on Linux Mint 18.3 and Fedora 29 and it seems that duplicate -ldl isn't causing any problems.

@daschuer
Copy link
Member

Please check if the original issue was caused by a double -lvamp-hostsdk
fixed in:
#1959

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conf.CheckLib(['dl', 'libdl']) already adds -ldl.
The double -ldl should be fixed before merge.

@nopeppermint
Copy link
Contributor

I can confirm that this fix error https://bugs.launchpad.net/mixxx/+bug/1804411 on Linux Mint 19 x64

But if I remove the line suggested by @daschuer in #1959 I get the following error:

ValueError: list.remove(x): x not in list:
  File "/home/stefan/mixxx_develop/mixxx/SConstruct", line 101:
    duplicate=0, exports=['build'])
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 256:
    call_stack[-1].globals)
  File "/home/stefan/mixxx_develop/mixxx/vamp-plugins/SConscript", line 62:
    env['LIBS'].remove('vamp-hostsdk')

but If I remove env['LIBS'].remove('vamp-hostsdk') on line 62 in the file /mixxx/vamp-plugins/SConscript I get other errors:

/home/stefan/mixxx_develop/mixxx/src/analyzer/vamp/vamppluginadapter.cpp:149: Warnung: undefinierter Verweis auf »_VampHost::Vamp::HostExt::PluginLoader::getInstance()«
lin64_build/libmixxx.a(vamppluginadapter.o): In Funktion »mixxx::VampPluginAdapter::listPlugins[abi:cxx11]()«:
/home/stefan/mixxx_develop/mixxx/src/analyzer/vamp/vamppluginadapter.cpp:184: Warnung: undefinierter Verweis auf »_VampHost::Vamp::HostExt::PluginLoader::listPlugins[abi:cxx11]()«
lin64_build/libmixxx.a(vamppluginadapter.o): In Funktion »mixxx::VampPluginAdapter::composePluginKey(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)«:
/home/stefan/mixxx_develop/mixxx/src/analyzer/vamp/vamppluginadapter.cpp:198: Warnung: undefinierter Verweis auf »_VampHost::Vamp::HostExt::PluginLoader::composePluginKey(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)«
lin64_build/libmixxx.a(vamppluginadapter.o): In Funktion »mixxx::VampPluginAdapter::loadPlugin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, float, int)«:
/home/stefan/mixxx_develop/mixxx/src/analyzer/vamp/vamppluginadapter.cpp:165: Warnung: undefinierter Verweis auf »_VampHost::Vamp::HostExt::PluginLoader::loadPlugin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, float, int)«
lin64_build/libmixxx.a(vampanalyzer.o): In Funktion »VampAnalyzer::Init(QString, QString, int, int, bool)«:
/home/stefan/mixxx_develop/mixxx/src/analyzer/vamp/vampanalyzer.cpp:60: Warnung: undefinierter Verweis auf »_VampHost::Vamp::PluginHostAdapter::getPluginPath[abi:cxx11]()«
lin64_build/libmixxx.a(vampanalyzer.o): In Funktion »VampAnalyzer::GetInitFramesVector()«:
/home/stefan/mixxx_develop/mixxx/src/analyzer/vamp/vampanalyzer.cpp:247: Warnung: undefinierter Verweis auf »_VampHost::Vamp::RealTime::realTime2Frame(_VampHost::Vamp::RealTime const&, unsigned int)«
lin64_build/libmixxx.a(vampanalyzer.o): In Funktion »VampAnalyzer::GetEndFramesVector()«:
/home/stefan/mixxx_develop/mixxx/lib/vamp/vamp-sdk/RealTime.h:92: Warnung: undefinierter Verweis auf »_VampHost::Vamp::RealTime::RealTime(int, int)«
lin64_build/libmixxx.a(vampanalyzer.o): In Funktion »VampAnalyzer::GetEndFramesVector()«:
/home/stefan/mixxx_develop/mixxx/src/analyzer/vamp/vampanalyzer.cpp:263: Warnung: undefinierter Verweis auf »_VampHost::Vamp::RealTime::realTime2Frame(_VampHost::Vamp::RealTime const&, unsigned int)«
lin64_build/libmixxx.a(vampanalyzer.o): In Funktion »VampAnalyzer::Process(float const*, int)«:
/home/stefan/mixxx_develop/mixxx/src/analyzer/vamp/vampanalyzer.cpp:175: Warnung: undefinierter Verweis auf »_VampHost::Vamp::RealTime::frame2RealTime(long, unsigned int)«
collect2: error: ld returned 1 exit status
scons: *** [lin64_build/mixxx] Error 1
scons: building terminated because of errors.

so there might be more to do..

@nopeppermint
Copy link
Contributor

thanks!
now compiling current master with this pr on top is working again on Linux Mint 19 x64

@ninomp
Copy link
Contributor Author

ninomp commented Dec 24, 2018

OK I have managed to resolve duplicates. They were caused by having two VAMP SDKs: one installed on system and the other bundled with Mixxx. I have tested this only on my Linux Mint 18.3 system, on which Mixxx is always taking the bundled VAMP SDK. Can you test this on Linux Mint 19 as well as other distros?

@ninomp
Copy link
Contributor Author

ninomp commented Dec 24, 2018

@nopeppermint Glad to hear it 😄

@daschuer
Copy link
Member

Greate, no it is fine, Thank you. I think just need to comment why we need a special treatment here.

conf.CheckLib(['dl', 'libdl'])
# Note: We are adding -ldl to LIBS in sources(), so
# don't add it now in order to prevent duplication.
conf.CheckLib(['dl', 'libdl'], autoadd=False)
Copy link
Member

@daschuer daschuer Dec 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# we cant add it here,because it need to be added after vamp-hostsdk. See https://bugs.launchpad.net/mixxx/+bug/1804411

@@ -383,7 +387,12 @@ def sources(self, build):
env.SConscript(env.File('SConscript', vamp_dir))

build.env.Append(LIBPATH=self.INTERNAL_VAMP_PATH)
build.env.Append(LIBS=['vamp-hostsdk'])

build.env.Append(LIBS=['vamp-hostsdk'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this:
# we add this here unconditionally because it is expected by vamp-plugins/SConscript which does further adjustments

@daschuer
Copy link
Member

Thank you, for your patience. LGTM.

@daschuer daschuer merged commit 0c9845b into mixxxdj:master Dec 25, 2018
@ninomp ninomp deleted the ubuntubuildfix branch December 25, 2018 21:38
@ninomp
Copy link
Contributor Author

ninomp commented Dec 25, 2018

Thank you for merging.

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

Successfully merging this pull request may close these issues.

4 participants