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

Initial commit of CMake build system #992

Merged
merged 1 commit into from
Apr 25, 2017

Conversation

dnakamura
Copy link
Contributor

@dnakamura dnakamura commented Apr 7, 2017

Adds experimental support for building with cmake

Issue: #933
Signed-off-by: Robert Young [email protected]
Signed-off-by: Devin Nakamura [email protected]

@dnakamura dnakamura force-pushed the cmake-final branch 3 times, most recently from 67fa8cb to e9e2cc8 Compare April 7, 2017 21:21
@rwy7
Copy link
Contributor

rwy7 commented Apr 7, 2017

If you take a look at the CI, you'll see some changes to the way things are being built. The big one is an experimental build with CMake on x86-64, which is allowed to fail. We've also moved to the "Trusty" Ubuntu distribution. Since the OMRChecker isn't building on Trusty (yet), there is a new build on Precise for running the linter.

As well, there is a new Appveyor configuration using CMake.

@mgaudet
Copy link

mgaudet commented Apr 8, 2017

Would you be able to send me a link to one of the logs that failed with the linter on Trusty so I can get a fix in?

add_subdirectory(omrGtestGlue)
add_subdirectory(algotest)
# add_subdirectory(compilertest)
add_subdirectory(gctest)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to also add jitbuildertest to the list?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep! We can't build the test yet, but we can leave a note.

@rwy7
Copy link
Contributor

rwy7 commented Apr 8, 2017

@mgaudet here is a link to a failed Trusty linter build.

The clang and llvm versions are output in the build-on-travis.sh script:

+llvm-config --version
3.5.0
+clang++ --version
clang version 3.5.0 (tags/RELEASE_350/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
+make lint

@@ -0,0 +1,29 @@
/*******************************************************************************
*
* (c) Copyright IBM Corp. 2015
Copy link
Contributor

@fjeremic fjeremic Apr 10, 2017

Choose a reason for hiding this comment

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

This needs a copyright update. Is this a tool-generated file?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a written file that is used to generate omrversionstrings.h. Will update the copyright.

@rwy7
Copy link
Contributor

rwy7 commented Apr 12, 2017

This is good to go.

@fjeremic
Copy link
Contributor

General question: Are the two build systems going to be running concurrently for a while?

Copy link
Contributor

@charliegracie charliegracie left a comment

Choose a reason for hiding this comment

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

I think this is a great starting point. Thanks! This will likely need an Eclipse CQ before it gets merged.

@dnakamura
Copy link
Contributor Author

@fjeremic Yes the two build systems will run side by side for the time being. This pr adds an allowed failure cmake build to the travis config.

@fjeremic
Copy link
Contributor

Anything blocking this to be merged? Are we waiting for additional reviews from @youngar and @mstoodle?

@dnakamura
Copy link
Contributor Author

@fjeremic It's my understanding that we are waiting on @mstoodle and the eclipse CQ process

@mstoodle
Copy link
Contributor

Thanks for the extra @ mention, I had missed the original request to review. Will review by EOD.

@mstoodle
Copy link
Contributor

First observation: the commit message is pretty terse :) .

Copy link
Contributor

@mstoodle mstoodle left a comment

Choose a reason for hiding this comment

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

Two general comments (which you'll find embedded in the review comments as well):

  1. Please make sure every file has a correct copyright header. Please make sure every new file is marked copyright 2017, and please update the "rightmost" copyright date in every existing file to 2017.

  2. There are many blocks of commented out statements in this commit. Some have clear TODO comments, some have unclear TODO comments, and many have no comment to explain why the statements are commented out. You'll probably never understand these blocks of statements better than you do right now, so please write reminders to yourself/informative descriptions for future developers who happen across it. If the code is just vestigial stuff from trying to get this working, then please remove those statements completely to avoid confusion.

It seems like a lot of comments to work through, but those two categories probably capture at least 95% of the spots I marked.

.appveyor.yml Outdated
@@ -0,0 +1,36 @@
###############################################################################
#
# (c) Copyright IBM Corp. 2016
Copy link
Contributor

Choose a reason for hiding this comment

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

new file, we're 4 months into 2017 already :)

@@ -16,6 +16,15 @@
# Multiple authors (IBM Corp.) - initial implementation and documentation
###############################################################################
Copy link
Contributor

Choose a reason for hiding this comment

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

general comment: modified files should have their "rightmost" copyright date updated to the current year

CMakeLists.txt Outdated
@@ -0,0 +1,115 @@
###############################################################################
#
# (c) Copyright IBM Corp. 2016
Copy link
Contributor

Choose a reason for hiding this comment

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

should be 2017

CMakeLists.txt Outdated

cmake_minimum_required(VERSION 3.2 FATAL_ERROR)

set(OMR_VERSION_MAJOR 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be better for this version identification piece to live in a separate file, isolated from the rest of the cmake machinery?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would appear this is how LLVM does it. I find they are usually a good standard for accepted practice.
https://github.com/llvm-mirror/llvm/blob/master/CMakeLists.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, now that I think about it, this is really more of a place holder. Ideally we need figure out a system where we can store version information once and consume in both build systems

@@ -0,0 +1,102 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

is this a generated file? is that why there is no copyright header?


set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${linker_common} /INCREMENTAL:NO /NOLOGO /LARGEADDRESSAWARE wsetargv.obj")
if(OMR_ENV_DATA64)
#TODO: makefile has this but it seems to break shit
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove the profanity

else()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -entry:_DllMainCRTStartup@12")
endif()
#set(CMAKE_C_FLAGS "${common_flags}")
Copy link
Contributor

Choose a reason for hiding this comment

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

please document why commented out


# # This is the first option applied to the C++ linking command.
# # It is not applied to the C linking command.
# OMR_MK_CXXLINKFLAGS=-Wc,"langlvl(extended)" -+
Copy link
Contributor

Choose a reason for hiding this comment

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

please document why commented out

omrutil
omrglue
)
# ./omrgctest -configListFile=fvtest/gctest/configuration/fvConfigListFile.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

please document why these lines are commented out


target_link_libraries(omrGtestGlue INTERFACE omrGtest)

#TODO there is platform specific stuff here
Copy link
Contributor

Choose a reason for hiding this comment

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

doesn't sound like an action to me, could you please make this comment more clear?

@mstoodle
Copy link
Contributor

Lest it be lost in the massive dump of review comments, I think this PR represents some amazing work, and I'm really happy to see it. Thanks @dnakamura and @rwy0717 for putting it all together!

@mstoodle
Copy link
Contributor

Just curious, what motivated the switch to use Ubuntu Trusty?

@dnakamura
Copy link
Contributor Author

@mstoodle thanks for the feedback

  • Most of the commented out blocks are chunks of the source makefile which have not yet been ported over (will update to reflect this)

  • If I recall correctly the main reason to move to trusty was that precise has some horridly out of date version of cmake (2.8.7)

@dnakamura
Copy link
Contributor Author

@mstoodle I've addressed the comments you have made. I've left it as a separate commit in order to make it easier to track changes, but will squash it done before we merge in

@0xdaryl
Copy link
Contributor

0xdaryl commented Apr 18, 2017

@marti4d : FYI, you may want to take a peek at this

Copy link
Contributor

@mstoodle mstoodle left a comment

Choose a reason for hiding this comment

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

much better, thanks @dnakamura ! only one remaining comment to fix, please.

@@ -42,6 +42,7 @@ list(APPEND OBJECTS
rwmutex.c
)

#TODO need to add te
Copy link
Contributor

Choose a reason for hiding this comment

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

te? either a typo or please explain a bit more

@dnakamura
Copy link
Contributor Author

@mstoodle should be good to go

@youngar
Copy link
Contributor

youngar commented Apr 19, 2017

I opened an Eclipse CQ for this pull request here. I'll update here with any CQ status updates.

Adds experimental support for building with cmake.

To test the cmake build system:
```sh
mkdir -p build/ && cd build
cmake ..
cmake --build .
ctest
```

The cmake build system is incomplete. Currently building:
* gc
* omr (core/misc)
* fvtest
* thread
* port

Not yet done:
* jitbuilder
* Compiler

Issue: eclipse-omr#933
Also-by: Robert Young <[email protected]>
Signed-off-by: Robert Young <[email protected]>
Signed-off-by: Devin Nakamura <[email protected]>
@rwy7
Copy link
Contributor

rwy7 commented Apr 19, 2017

I've rebased against latest, and added a new tracegen definition file, j9hook.tdf, to the build. The cmake build should be passing again.

@youngar
Copy link
Contributor

youngar commented Apr 20, 2017

The Eclipse CQ has received "PMC approval", but we are still waiting for a preliminary legal review before we can check in this code. I'm guessing the review will be completed sometime tomorrow. You can read more about this process here.

@charliegracie
Copy link
Contributor

The CQ has not been approved for release yet. I will keep monitoring it

@charliegracie
Copy link
Contributor

CQ has been completely approved :).

@charliegracie charliegracie self-assigned this Apr 25, 2017
@charliegracie
Copy link
Contributor

Discussed with @youngar that if it got approved while he was away I would handle merging.

@charliegracie charliegracie merged commit 17ef73f into eclipse-omr:master Apr 25, 2017
@dnakamura dnakamura deleted the cmake-final branch August 2, 2017 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants