Linux build problems and travis-ci

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Linux build problems and travis-ci

Postby godlike » Mon Jan 09, 2017 5:16 pm

Currently Newton fails to build with CMake.

The first problem is that newton is now using C++11 libraries and that requires -std=c++11 in older GCC and clang compilers. Easy fix.

The next problem is a bit weird:
Code: Select all
/home/godlike/src/more/newton-panos/coreLibrary_300/source/meshUtil/dgMeshEffect.h: In member function ‘void dgMeshEffect::dgChannel<T, type>::Reserve(dgInt32)’:
/home/godlike/src/more/newton-panos/coreLibrary_300/source/meshUtil/dgMeshEffect.h:145:15: error: there are no arguments to ‘Resize’ that depend on a template parameter, so a declaration of ‘Resize’ must be available [-fpermissive]
    Resize(size);


To avoid linux and OSX build issues in the future I think we can hook up Newton with travis-ci build bot service.

Julio, if you are interested I can make a pull request with the .travis.yml (the configuration file of travis-ci). Then you can create an account in travis-ci.com and that's it. After every commit you make travis-ci will automatically build newton in multiple configurations (debug, release, linux, OSX) and if there is a build failure it will notify you via email.

Just to take a glimpse of the output:

https://travis-ci.org/godlikepanos/newton-dynamics
User avatar
godlike
 
Posts: 58
Joined: Sun Mar 16, 2014 3:48 am

Re: Linux build problems and travis-ci

Postby Julio Jerez » Mon Jan 09, 2017 6:02 pm

ok I fixed the syntax error in dgMeshEffect
of the C++ 11, I was in eth impression that each Linux system will have a way to get the latest C++ compile which I assume will be latest clang?

on that auto build, that sound very good, let me read about so we kwon what we get into before move on.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Linux build problems and travis-ci

Postby godlike » Mon Jan 09, 2017 6:12 pm

Julio Jerez wrote:on that auto build, that sound very good, let me read about so we kwon what we get into before move on.


Ofcourse.

Many projects use travis-ci for continues integration. If you check github many projects have this icon in the readme file Image that is auto-generated by travis.

Example projects:
https://github.com/KhronosGroup/glslang
https://github.com/google/protobuf
User avatar
godlike
 
Posts: 58
Joined: Sun Mar 16, 2014 3:48 am

Re: Linux build problems and travis-ci

Postby godlike » Mon Jan 09, 2017 6:18 pm

Julio Jerez wrote:I was in eth impression that each Linux system will have a way to get the latest C++ compile which I assume will be latest clang.


That depends on the Linux distro. Arch for example will always have the latest and greatest GCC and clang. Ubuntu on the other hand gets updated every 6 months but not everyone updates (I update my ubuntu every 2 years for example).
User avatar
godlike
 
Posts: 58
Joined: Sun Mar 16, 2014 3:48 am

Re: Linux build problems and travis-ci

Postby d.l.i.w » Tue Jan 10, 2017 7:22 am

First of all: travis-ci indeed would be a good way to improve the quality of the Linux and Mac version.

of the C++ 11, I was in eth impression that each Linux system will have a way to get the latest C++ compile which I assume will be latest clang?

On my Linux system (openSUSE Leap 42.2) I can compile Newton with gcc 4.8.5 using -std=c++11. gcc6 should work without any changes.


I have modified CMake files to include the latest changes, like the option to use pthreads or not. But as things are WIP, I did not bother to issue a pull request.


One more thing: wxWidgets
On my Linux system I cannot install the header files of different wxWidget versions at the same time with the package manager (I don't know if this is the case for e.g. Ubuntu, too). Other projects are switching to wxWidgets 3.x, so I need to change back to the older wxWidgets every time I want to compile the Newton sandbox.
One could rewrite the CMake files to use wxWidget from thirdParty, but I don't think that's a good idea.

TLTR: It would be good, if the Newton sandbox would use wxWidgets 3.x in the next release - or even better IMO use a more lightweight toolkit like imgui.
d.l.i.w
 
Posts: 81
Joined: Mon Sep 26, 2011 4:35 am

Re: Linux build problems and travis-ci

Postby Julio Jerez » Tue Jan 10, 2017 8:09 am

yes I will update to wxwidgex 3.x some time
it would be nice if some one what to do as a contribution.

what O really want is to replace with another guy that joe shoe me, which is really cool.
it use OGL, and also vulkan and I believe direct x ,
I have not switch completely yet because I has other tool that still use wxWidget.

but as soon as I am done with the soft body and some important feature of 3.14 I will turn my attention to the GUI stuff. This library is very lightweight and seem a perfect fix for newton demos.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Linux build problems and travis-ci

Postby d.l.i.w » Tue Jan 10, 2017 8:18 am

it would be nice if some one what to do as a contribution.

I could try, although I have almost zero experience with wxWidgets.
But first Newton core must be compilable on Linux again...

what O really want is to replace with another guy that joe shoe me, which is really cool.

Do you mean imgui?
Is it worth the effort to migrate the sandbox to wxWidgets 3.x, if you want to get rid of it anyway?

I have not switch completely yet because I has other tool that still use wxWidget.

For Linux only the sandbox is relevant. At least in the CMake project no other tool is included.
d.l.i.w
 
Posts: 81
Joined: Mon Sep 26, 2011 4:35 am

Re: Linux build problems and travis-ci

Postby Julio Jerez » Tue Jan 10, 2017 8:53 am

d.l.i.w wrote:Do you mean imgui?
Is it worth the effort to migrate the sandbox to wxWidgets 3.x, if you want to get rid of it anyway?


yes imgui, I have about 50% of the conversion already, I only need to complete the rest of demos stuff.
you are right, maybe is no worth trying wxwidget, I get the shill just to think on dealing with such a huge code base like wxWidget. that is no some you do in one evening. is a long term project.

if you like you can probably try to get imgui in the linux CMAKE ditch wxwidget from the linux demos.

I do not have my computer yet, by this weekend I can see if finally remove it and switch to teh smaller imgui.
it actually does anything we need for the demos, an dI can keep widget for mesh visualizer.

eventually I will rewrite the visualize using window form, and forget about wxwidget.
for some of the new feature we will need a visualizer tool to inspect the assets. right now is just a loader of fbx and other format files and expert them to the newton file format.

all in all imgui is an awesome little GUI and I pan to use for next newtons version whi will deal a lot more with high performance computing, and what I saw I loved it. best of all has not dependencies.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Linux build problems and travis-ci

Postby d.l.i.w » Tue Jan 10, 2017 9:30 am

if you like you can probably try to get imgui in the linux CMAKE ditch wxwidget from the linux demos.

I have already done that a while ago, no big changes were necessary. The modified version uses the new sdkDemos___ folder instead of sdkDemos and there is no wxWidgets.

I can create a pull request for it, but I'd rather test again with the latest changes in Newton.

EDIT: error was already fixed

Personally I don't need a new version right now and maybe it makes sense to first complete all the Newton core stuff and then polish the CMake and Linux part just before the next release.
Last edited by d.l.i.w on Tue Jan 10, 2017 12:37 pm, edited 1 time in total.
d.l.i.w
 
Posts: 81
Joined: Mon Sep 26, 2011 4:35 am

Re: Linux build problems and travis-ci

Postby Julio Jerez » Tue Jan 10, 2017 11:22 am

I think I fixed that error yesterday but maybe I forget to check it.

I will get may machine today let me, do a check and commit what O got before you do the pool request.
maybe is time to rename the sdkdemo___ to sdkDemo. and we move for there.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Linux build problems and travis-ci

Postby d.l.i.w » Tue Jan 10, 2017 12:36 pm

Sorry, you are right, this error is already fixed.

I created a pull request with all my changes so far: https://github.com/MADEAPPS/newton-dynamics/pull/56

maybe is time to rename the sdkdemo___ to sdkDemo. and we move for there.

Yes, this would make sense.

EDIT:
I just found out, that the Newton sandbox compiles fine with wxWidgets 3.0. There are only a few warnings about deprecated stuff. I don't know, if there is a compatibility layer now and where I got the idea from, that it wouldn't work.
So I'm very sorry for the noise...
d.l.i.w
 
Posts: 81
Joined: Mon Sep 26, 2011 4:35 am

Re: Linux build problems and travis-ci

Postby godlike » Wed Jan 11, 2017 4:27 am

Pulled the latest commit that includes d.l.i.w fixes. There is still a minor build issue still. Maybe in GCC 6.2 only. Patch here:

Code: Select all
diff --git a/coreLibrary_300/source/meshUtil/dgMeshEffect3.cpp b/coreLibrary_300/source/meshUtil/dgMeshEffect3.cpp
index 9a1126b..46a0576 100644
--- a/coreLibrary_300/source/meshUtil/dgMeshEffect3.cpp
+++ b/coreLibrary_300/source/meshUtil/dgMeshEffect3.cpp
@@ -561,7 +561,7 @@ class dgHACDClusterGraph: public dgGraph<dgHACDCluster, dgHACDEdge>
 
          dgFloat64 param = dgFloat32 (100.0f);
          if (clusterFace->m_color != m_clusterA->m_color) {
-            param = dgMeshEffect::dgMeshBVH::RayFaceIntersect (face, p1, p0, false);
+            param = dgMeshEffect::dgMeshBVH::RayFaceIntersect (face, p1, p0, nullptr);
             if ((param >= dgFloat32 (0.0f)) && (param <= dgFloat32(1.0f))) {
                param = dgFloat32 (1.0f) - param;
             }


I've also tried to build wxWidgets (2.9) myself and use that to build Newton. Build works fine but when running demosSandbox there is a crash.

The crash happens in packages/dScene/dScene.cpp:176 because in the line above:
Code: Select all
dScene::dTreeNode* const cacheNode = scene->FindGetGeometryCacheNode();

the FindGetGeometryCacheNode() returns null.
User avatar
godlike
 
Posts: 58
Joined: Sun Mar 16, 2014 3:48 am

Re: Linux build problems and travis-ci

Postby godlike » Mon Jan 16, 2017 4:37 am

So Julio should I make the pull request that will include the .travis.yml?
User avatar
godlike
 
Posts: 58
Joined: Sun Mar 16, 2014 3:48 am

Re: Linux build problems and travis-ci

Postby Julio Jerez » Mon Jan 16, 2017 4:54 pm

I though I answered this.
I have to make a big change form last week. I took a break because my machine broke down before I committed. This change affect some project files, two more days.

Let me get that up to date, and them you make the pull request. It will be cool to have auto build for all platform yes.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Linux build problems and travis-ci

Postby Julio Jerez » Tue Jan 17, 2017 10:06 am

al right, now all the project are up to date, you can make the pull request.
Julio Jerez
Moderator
Moderator
 
Posts: 11040
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 1 guest