-
Notifications
You must be signed in to change notification settings - Fork 90
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
CMake cleanup & MinGW support #121
Conversation
Do you know why the FindBoost.cmake is there? It would be nice to get rid of it totally. I do not know the reason for its existence, and therefore am hesitant to remove it. Another note: Your comment says you moved it to another directory, but it seems as if it is gone completely. Perhaps you need to include that directory in a commit? |
I would also like to remove the custom What is does, is that it overrides the functionality that is bundled with your current version of CMake, effectively using Boost searching routines from an older CMake version regardless of your current version. It brings only trouble when used on Windows and with newer Boost versions. Why is it there ? I have looked into it, and probably found the For convinience a comparison between the original file from CMake and our file in bitshares/fc is here: The interesting changes are:
So,
Yes @jmjatlanta, it seems like I have forgotten to include the commit with the Additionally, I will rework the CMake script to include the standalone |
f7d1b73
to
ebc9340
Compare
It seems the travis build needs libpthread... |
We've discussed this within the Core Team and agreed to bump CMake minimum to 3.2. |
Can we get rid of FindBoost completely? If it's only required on APPLE and can be worked around by setting BOOST_LIBRARYDIR we should remove it and update the documentation. @jmjatlanta what do you think? |
Thanks @pmconrad for the review. I have just compiled the whole project under Windows. I do not have a Mac which I can experiment on, but you can see from the diff crypto-ape/find-boost-compare@4075201 that the custom FindBoost is not doing anything special compared to the default FindBoost. Just to be sure, someone with a Mac should verify the compilation with default system libraries and |
I have a mac. I will test to figure out what is needed for getting rid of FindBoost.cmake. I believe we always need pthread on platforms that have it. Is there a reason to not simply add it to our CMakeLists.txt file? |
Please try compile it with the custom
I would not force this. If Boost requires |
Please rebase on master to get rid of the conflict |
24ea060
to
f375d7f
Compare
Rebased & tested. Compiles with MinGW on Linux and Windows hosts. |
# - this is here to fix some older CMake + Boost configurations | ||
set(Boost_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../Boost" PARENT_SCOPE) | ||
|
||
if (APPLE OR USE_LEGACY_FIND_BOOST) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed on apple or can we remote the old FindBoost
? @jmjatlanta
CMakeLists.txt
Outdated
@@ -22,6 +22,8 @@ INCLUDE(GetGitRevisionDescription) | |||
INCLUDE(CheckLibraryExists) | |||
INCLUDE(CheckLibcxxAtomic) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm experimenting with cross-compiling core using gitian. It seems that the CheckLibcxxAtomic
include must be moved further down, after FIND_PACKAGE(Boost...
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried compiling it recently, with current codebase ?
I successfully compiled the the main project's develop
branch with fc
being this branch, using Gitian through Docker, without the need to move CheckLibcxxAtomic
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, yes, seems to be working now.
I wonder why - CheckLibcxxAtomic
compiles a test program that uses boost::lockfree
- how can that work before boost has been detected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you were right.
I have moved CheckLibcxxAtomic
after find_package(Boost...)
, because in some cases it did not work, specifically when working with MinGW compiler.
Still, I can't explain the behaviour. I thought that CMake might do some multi-pass magic, but it has probably something to do with default compiler paths and also with the fact that the main project runs find_package(Boost...)
before CheckLibcxxAtomic
.
@crypto-ape please check https://github.com/pmconrad/bitshares-gitian/pull/6 and the cross-build instructions contained therein. |
More precisely, I'm unsure which of these hacks are generally applicable and which ones are only due to the way I'm building this and the 3rd party libs. |
@pmconrad, I looked into this |
Checked both my native Linux build and Gitian cross-build for windows with latest develop plus merging this. Thanks @crypto-ape ! |
Hey Monkeys!
I have cleaned up the CMake build a little bit:
FindBoost.cmake
is evil_mm_crc32_u64
to_mm_crc32_u64_impl
Hopefully this helps.
Related: bitshares/bitshares-core#1706
Ape out!