-
Notifications
You must be signed in to change notification settings - Fork 739
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
linking sc-ide fails with system boost 1.68, if bundled boost is still there #4096
Comments
For 3.9.3 and the boost 1.68.0 rebuild the external_libraries/boost had to be explicitely removed to make sure those headers were not used. |
Can you please open a second issue for that if there isn't one already? It is irrelevant to this ticket. |
I noticed this the other day while checking out whether we could upgrade locally. The problem (which I'm actually surprised wasn't an issue earlier) is that because of supernova using C++14, we are attempting to link a C++14 build of the library with code using the headers in C++11 mode. Arch Linux requires that you use the latest boost libraries and don't use anything bundled here right? I think the easiest thing to do would be for us to move to C++14 for the entire project. Some of the devs have discussed this before and I've heard no strong opposition, but it is something that needs more discussion. For now, if using older releases of boost is not an option, you could force compilation of the entire project in C++14. Not sure off the top of my head how, you might have to patch the main CMakeLists.txt. I don't think passing it as a flag on the command line would work as I'm pretty sure the C++11 flag will come later and take precedence. |
This should be enough. I don't have 1.68 on my machine anymore (Homebrew hasn't updated their formula yet) so I can't test: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0de34a5a2..4e9520b6e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -297,7 +297,7 @@ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -stdlib=libc++")
endif()
else()
- set( CMAKE_CXX_STANDARD 11 )
+ set( CMAKE_CXX_STANDARD 14 )
if(CMAKE_COMPILER_IS_CLANG)
# workaround |
|
Eh... sorry, please disregard (parts of) my last comment (I broke my build script with a bunch of tests leading to flaky behavior - I striked through what doesn't apply!). I narrowed this down to the following behavior (by selectively rebuilding with different approaches):
Therefore I assume that my experienced behavior is unrelated to setting C++14, but is solely triggered by having the bundled boost around, which is then (also?) linked against. |
@dvzrv If you could supply verbose build logs, including configuration phase and the output of Are the sytem boost libraries you're linking with prebuilt? Are you required to use them? |
Alright. I did the following:
Build log: |
And to answer the remaining questions: Yes, pristine build environment every time (containered build, using systemd-nspawn). Yes, the boost libraries are pre-built and yes, ideally I link against what my distribution offers, because shared lib reusability ftw! :) |
I think I know why this happens: |
@dvzrv good catch. :) Does this do anything for you? diff --git a/editors/sc-ide/CMakeLists.txt b/editors/sc-ide/CMakeLists.txt
index 50059bc2f..60d984333 100644
--- a/editors/sc-ide/CMakeLists.txt
+++ b/editors/sc-ide/CMakeLists.txt
@@ -216,10 +216,15 @@ elseif(WIN32)
list(APPEND ide_src ${CMAKE_SOURCE_DIR}/common/SC_Win32Utils.cpp)
endif()
+if (Boost_FOUND)
+ include_directories(${Boost_INCLUDE_DIRS})
+else()
+ include_directories(${CMAKE_SOURCE_DIR}/external_libraries/boost)
+endif()
+
include_directories(${CMAKE_SOURCE_DIR}/include/common)
include_directories(${CMAKE_SOURCE_DIR}/common)
include_directories(${CMAKE_SOURCE_DIR}/include/plugin_interface)
-include_directories(${CMAKE_SOURCE_DIR}/external_libraries/boost)
include_directories(${YAMLCPP_INCLUDE_DIR})
# For QtCollider headers:
include_directories(${CMAKE_SOURCE_DIR})
diff --git a/external_libraries/CMakeLists.txt b/external_libraries/CMakeLists.txt
index df33dc6f1..e1f28b670 100644
--- a/external_libraries/CMakeLists.txt
+++ b/external_libraries/CMakeLists.txt
@@ -84,7 +84,13 @@ set_property(TARGET tlsf PROPERTY POSITION_INDEPENDENT_CODE TRUE)
#oscpack
add_library(oscpack STATIC EXCLUDE_FROM_ALL "oscpack_build.cpp")
-target_include_directories(oscpack PRIVATE boost)
+
+if (Boost_FOUND)
+ target_include_directories(oscpack PRIVATE ${Boost_INCLUDE_DIRS})
+else()
+ target_include_directories(oscpack PRIVATE boost)
+endif()
+
target_include_directories(oscpack INTERFACE oscpack_1_1_0 ) This is a hasty patch, ideally we should switch on |
@brianlheim thanks for the fast response. I'll try asap. |
Hm, no, seems we have some more dangling references here and there. This is what happens with you proposed patch:
|
@dvzrv I'm fairly certain this is due to the C++11/14 mismatch I mentioned above. |
having the same problems with 3.9.3 and 3.10 beta2 on Ubuntu 18.04. when I apply all patches from above, also the C++11/14 mismatch one, I get
|
Sorry for the long delay! I have now fixed this for my packaging use-case with the following patch (will open a pull request shortly) for 3.10.0 (as I have to update the package):
Multiple components are (additionally) explicitely linking against |
I have now based my changes on the develop branch (as that's what I build supercollider-git in the AUR from). I'm not sure it makes sense to only hotfix this in 3.10.1 and I think my fix is potentially not complete yet. |
Environment
Your SuperCollider version: current (as of writing)
develop
HEADf27885f74
Your operating system and version: Arch Linux
boost 1.68.0
Qt 5.11.2
Steps to reproduce (for bugs)
AUR build script
Error message (for bugs)
Full build log:
supercollider-boost1.68.0.txt
Expected Behavior
Linking for sc-ide executable succeeds.
Current Behavior
Linking fails with above output.
The text was updated successfully, but these errors were encountered: