gmum / gmum.r

GMUM machine learning group R package
http://r.gmum.net
Other
33 stars 10 forks source link

Investigate and prepare general purpose Makefile #163

Closed kudkudak closed 9 years ago

kudkudak commented 10 years ago

If possible should include Makevars so that we don't get desynchronized

If possible should be able to build tests so that we can remove tests/cpp/Makefile

Could be CMake, not necessarily Makefile

ktalik commented 10 years ago

More info: #162

ktalik commented 9 years ago

GMUM.R compilation is OK but CPP tests are failing... Can someone take look at this? I don't know why it can't find Rcpp headers:

https://gist.github.com/ktalik/a69c12942740227fab33

(branch task-163, 4b393b3)

kudkudak commented 9 years ago

Those are R headers, not Rcpp header. Make sure makevars flags are being used in Makefile (I think this works on my branch so make sure you copied correctly Makevars).

R headers are pretty easy to get using R, so you can call Rscript to retrieve them (as in Makevars)

ktalik commented 9 years ago

As in commit message, 1 of 2 GNG tests is passing. @kudkudak is investigating error output: http://pastebin.com/eALr91vn (segmentation fault)

Starting CEC tests now.

kudkudak commented 9 years ago

Please merge GNG as if this error didn't exist. I will look into it over the weekend, but this failure is not connected to the tests themselves

ktalik commented 9 years ago

As in commits, tests part of Makefile is ready.

Meanwhile I started to think about library compilation. Why we want to do this? Since library compilation is provided by devtools I really don't see a point of doing this. Please explain me your needs so that I would know what to do and in what purpose.

kudkudak commented 9 years ago

I don't want to do this now as we have more pressing issues (SVMLight for instance), but:

So we can close this issue today (just give me a moment to look at the test compilation)

kudkudak commented 9 years ago

Comments to the makefile itself

EDIT: I forgot gtest_all is GoogleTest binary. Cool - so if you can add comment somewhere that you can execute single tests. Usage is given by

./test_all -h

I think it might be non-obvious as it was to me ;)

Maybe rename it to test_runner - as it suggests it has some options

Btw: GNG is fixed, it can be pulled from GNG@dev

ktalik commented 9 years ago

All overrides seem redundant

You were right about libraries. Only GTest's are needed. O1 and O2 too, they were just a copy-pastes of the previous Makefile. Same as -g and -s but I'm leaving -g, becouse maybe someone will need it (@sacherus?).

Maybe rename it to test_runner - as it suggests it has some options

I allowed myself to rename it to run_tests since it is more command-style (what a funny word).

All changes are in commit and are tested. Heading to GNG.

PS:

there are some long running tests in the suite

I think long tests should be separated from unit tests. We should have some ./run_unit_tests executable that will tests possibly largest code coverage in one execution and should last reasonable time.

kudkudak commented 9 years ago

Unfortunately for exactly unit testing machine learning algorithms sometimes need longer running tests, and this still unit tests its correctness.

We can compile everything into one binary, because it has many options for running tests. So makefile can create a script that uses this run_tests to select simple unit tests and I would suggest doing that

ktalik commented 9 years ago

OK, so lets have some convention in naming test cases and tests itself in order to filter them. For example in TwoESVMTest.TestPreprocessor we have TwoESVMTest which is a test case and TestPreprocessor which is a test (via GTest Documentation).

Most common convention is to name a tests case from a tested object (below example: Factorial -> FactorialTest). I think we could do it in transparent way by naming tests according to they type (in this case: Factorial -> FactorialUnitTest and e.g. Factorial -> FactorialIntegrationTest) but I'm not sure what are our test types and maybe we should disscuss that later.

kudkudak commented 9 years ago

I wouldnt care too much about this we can just have a script that will have baked in all the names. But you can enforce a convention if you have a complete idea (maybe on wiki page).

kudkudak commented 9 years ago

If everything is fine we can close it. We should move to next tasks asap

Sorry forgot to reference issue from commits

ktalik commented 9 years ago

I have changed that on this branch already.

Why are you requesting from them a change that you've already done?

We can change it later if we end up with hundreds of tests :D

... You of course meant that we should do that from beginning until we end up with that number.

I made few minor changes, for instance cleaning was cleaning also gmum.R package objects which is kind of not expected from test Makefile

We must revert that since, as you requested, this Makefile will also build a gmum.r library...

I tried to add CEC tests, but turned out that the tests are not ready :(

Yes, I dealt with that las week.

kudkudak commented 9 years ago

If they change that on their branch it will be easy to merge.

This makefile is not building gmum.R library and won't be building before release, so let's keep it this way..

We have to deal with more important issues now (for instance repository size) so we will come back to this disucssion after release if that's ok :), so let's close this issue

ktalik commented 9 years ago

Tests division fixes and improvements:

I think thats it.

ktalik commented 9 years ago

@marcinMarcin, @kjurek , please checkout and pull branch task-163 and take a look at the current stage:

  1. CEC tests are compiling and linking into main executable
  2. If we run them separatedly e.g. ./run_tests --gtest_filter=Simple_1* they are doing OK
  3. If we run all tests together: ./run_primary_tests.sh, there is a... yes, segfault (only few last lines output included).

Please guys (or someone) take a look at this...

ktalik commented 9 years ago

Done with the help of @kjurek