A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by Auradrummer » Sun Feb 01, 2009 9:25 am
Hello guys,
This thread is not to ask, but a guide to someone that have problems running Newton Archmedia at Linux.
My distro is Ubuntu 7.10, but I think this will work for another distros.
1. Activate 'restricted drivers', normally at administration tab.
1.a DON'T INSTALL YOUR VIDEO CARD DRIVERS MANUALLY. Is only to turn on the restricted driver. If your machine doesn't have it installed yet, your Linux will download the last one and install.
1.b Now, check if your machine have the Direct Rendering working. Type 'glxinfo' at terminal and look to the first lines. Is between the 1 and 5 lines the information 'Direct Rendering: Yes (or no)'. Don't forget to reboot your machine after driver installation.
2. Install the gcc compiler. Some distros already have it, other no (like Ubuntu).
2.a. 'sudo apt-get install gcc' and see if installation goes right.
3. Install the required libraries (here I spent ours first time)
3.a. 'sudo apt-get install libglut-dev'
3.b. 'sudo apt-get install libxxf86vm-dev' *
3.c. 'sudo apt-get install libglew-dev'
3.d. 'sudo apt-get install libglui-dev'
* I'm not sure about the need of 'libxxf86vm-dev'. As I'm integrating with Irrlicht, I needed it.
4. Add the '-pthread' reference in makefile.
In the makefile of the Newton Samples, you'll need to add at the end of the 'LIBS=... ' line the '-pthread' reference.
5. In some cases, specially when you are doing your own project, you'll need to comment some #ifdef _LINUX_VER lines in the codes. To compile the Samples, I didn't had to worry about it, but to compile my own project I needed. There is another thread in this forum talking about it, check it if you have some doubt.
6. If the textures are blank when run samples, check the location of the bin folder.
Some samples (the most impressive of them) won't work if your bin folder are misplaced. In my case I needed to create a copy of newtonsdk folder one level upper the 'Documents' folder. I deleted everything on this folder, except the bin, that is where is all resources needed in runtime. Don't forget to keep the directory structure of bin.
That's it, I hope it helps someone else to run this incredible engine at Linux. I spent hours in first time I tried to set it up. Yesterday, I made it in a few minutes.
-
Auradrummer
-
- Posts: 132
- Joined: Sat May 17, 2008 9:17 am
by hpesoj » Mon Feb 02, 2009 9:11 pm
In my case I needed to create a copy of newtonsdk folder one level upper the 'Documents' folder.
I don't understand what you mean. No matter where I try to put the bin folder, the textures never appear.
-
hpesoj
-
- Posts: 90
- Joined: Sun Jan 09, 2005 4:36 pm
- Location: Cambridge/Bristol, UK
by Auradrummer » Tue Feb 03, 2009 8:28 am
The Linux structure is something like this (I'm at windows right now):
/home/hpesoj/Documents/newtonSDK/samples/bin
the NewtonSDK folder have to be one level upper the 'Documents' folder, at 'hpesoj' folder, like:
/home/hpesoj/Documents/newtonSDK/samples/bin
If you are already using the Newton in your project, I think will be bad to move the whole folder. So, you can create a copy of the bin one, this way, the samples will run and your project doesn't suffer any changes.
Developing a racing game.
-
Auradrummer
-
- Posts: 132
- Joined: Sat May 17, 2008 9:17 am
by Tobiwan » Tue Feb 10, 2009 11:20 am
Texture paths of the samples in linux are hardcoded (see newtonSDK/samples/sdkDemos/toolBox/toolbox_stdafx.cpp:58) to ~/newtonSDK/samples/bin. Just create a symbolic link in your home directory named "newtonSDK" pointing to whereever you have extracted the tarball and textures should work.
-
Tobiwan
-
by Julio Jerez » Tue Feb 10, 2009 11:30 am
is there a way to solve that?
It is a problem that bothers me a lot but I do not knwo how to read relative path in linux.
-
Julio Jerez
- Moderator

-
- Posts: 12452
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by hpesoj » Tue Feb 10, 2009 2:55 pm
Relative paths are defined just like in windows, though sometimes you do have to specify an extra "." at the start. I fixed the code by changing the
env variable.
- Code: Select all
#ifdef _LINUX_VER
// Linux user assets path
#define ASSETS_PATH "bin"
void GetWorkingFileName (const char* name, char* outPathName)
{
char *env;
//env = getenv("HOME");
env = ".";
sprintf (outPathName, "%s/%s/%s", env, ASSETS_PATH, name);
}
#endif
-
hpesoj
-
- Posts: 90
- Joined: Sun Jan 09, 2005 4:36 pm
- Location: Cambridge/Bristol, UK
by shybovycha » Fri Jan 01, 2010 5:44 am
How should i link libNewton.a to my project? g++ [source] -lGL -lGLU [etc.] -lNewton raises an exception (my /usr/lib dir contains libNewton.a and libNewton.so files). I've tried many different ways and no one gived result... What should i do?
-

shybovycha
-
- Posts: 52
- Joined: Fri Oct 23, 2009 6:15 am
- Location: Poland
-
by Julio Jerez » Fri Jan 01, 2010 8:55 am
there is a .a and a .so for both kind of linking. you do not need glu or any other library to use newton. (only pthreads whis is a system library)
see the make file in the demos it should help you out.
-
Julio Jerez
- Moderator

-
- Posts: 12452
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by shybovycha » Sat Jan 02, 2010 10:18 am
The problem was simplified to "How to cofigure easyEclipse to compile projects using Newton". Solved =)
-

shybovycha
-
- Posts: 52
- Joined: Fri Oct 23, 2009 6:15 am
- Location: Poland
-
by Adaon » Sat Jan 02, 2010 11:54 am
shybovycha wrote:How should i link libNewton.a to my project? g++ [source] -lGL -lGLU [etc.] -lNewton raises an exception (my /usr/lib dir contains libNewton.a and libNewton.so files). I've tried many different ways and no one gived result... What should i do?
I have the same problem when compiling with CodeLite. Specified linker option -lNewton (/usr/lib contains both libNewton.a and libNewton.so), but the log output says:
- Code: Select all
/usr/bin/ld: cannot find -lNewton
EDIT:The solution was to change library file permissions to something like 774:
- Code: Select all
~$ sudo chmod 774 /usr/lib/libNewton.*
-
Adaon
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 679 guests