Developing for Linux?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

My pleasure man! let me know if you succeeded on compiling the sources; otherwise to give you a hand on that. :wink:
Guest

Post by Guest »

Getting into trouble again GFX? :Wink:
you know me .. :D
Irrlicht_Rocks
Posts: 25
Joined: Sun Aug 14, 2005 4:35 am

Developing for Linux?

Post by Irrlicht_Rocks »

Hey afecelis.

I haven't gotten the source for scintilla or scite to compile on Linux. I always get lots of errors. "./configure" comes up with "bash: ./configure: No such file or directory".

When I run make I get lots of errors. If you want I can post the errors here if you need to see them.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

no, don't worry.I think I know what your problem is. First you need to download the source of GTK+ and compile it. Grab and compile a copy compatible with your distro; this will install the required libs in the system.

If everything went fine then we're ready to dl and compile the Scintilla sources; get them here:
http://scintilla.sourceforge.net/SciTEDownload.html
grab latest release; 1.66
do the same, but check the readme carefully. When you uncompress the source, 2 folders will be created: "scintilla" and "scite".

now , this info comes from the readme:
To build SciTE, Scintilla must first be built.


*** GTK+/Linux version ***

You must first have GTK+ 1.2 or later and GCC (3.1 or better) installed.
GTK+ 1.0x will not work and when it did it was very slow.
Other C++ compilers may work but may require tweaking the make file.

To build Scintilla, use the makefile located in the scintilla/gtk directory
cd scintilla/gtk
make
cd ../..

To build and install SciTE, use the makefile located in the scite/gtk directory
cd scite/gtk
make
make install
So, if you achieve to compile-install GTK+ libs, then you just have to build the scintilla libraries and finally build-install scite. It will work tightly with your system. :D

ps. Remember to do all this compiling as root, so su - for these tasks.
hybrid

Post by hybrid »

afecelis wrote:ps. Remember to do all this compiling as root, so su - for these tasks.
:shock: Whoa, I don't think that this is a good advice! You should compile everything as user, remember that compiling won't write system files, it will only read header files and write to the build directory. Just imagine the zillion of tools that are used throughout the compilation process. This is a major risk. Even worse, just imagine a path is set wrong and a "make clean" starts to work on / :!:
Installation is the only task that should be done as root, and only if you want to have these tools installed to somewhere in system path (which is of course a good advice for these large tools).
Guest

Post by Guest »

afecelis is right - Just compile as root -- otherwise you're going to have more trouble compiling than it's worth. It's highly likely that if you try using a "user" account, that you won't have sufficient privileges to run the necessary programs as Linux distros install everything with the root user permissions. That's what the "su" command is for...

In 10+ years of using Linux, I've never screwed up an install by compiling source code as the root user. AAMOF, I usually log in as root to do most of my development work...
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

if worse comes to worse then simply do a:

Code: Select all

make uninstall
make clean
and no harm done!!! :wink:

Compiling as root ensures stuff will be placed in the proper folders and the system will find them. Compiling as user will get into reading-writing problems because of permissions.
hybrid

Post by hybrid »

There is virtually no program which is just executable by root. There are some tools which have to be setuid or will only produce useful result if run as root, but there are definitely no user world tools of this kind. If you find a user tool which is only accessible for root you might have a broken distribution, though. I just checked my system and only found a hand full of daemons in /usr/sbin beyond the /usr tree. And why in the world should any compilation tool be executable by root only :?:
This is a typical windows style of system use, and it spreads to Linux since many people think that they should use root as the only account. But it's weird and damn wrong. If you do it's not my problem, but you shouldn't give it as an advice.

what kind of systems are you all using?! You can't read files on your system? Of course you'll have to become root as soon as installation to anything else than your home directory is done (btw: configure --prefix=... can help you to do that), but that's the only moment you should be root on your system. I'm just wondering what our technical staff would say if everyone here would work as root :lol:
There's indeed a problem with access rights if you've a large network and lots of groups you participate. Getting the directory permissions such that everyone can access those files correctly is a pain and you got to know something about Linux. But hey, think of large companies which have Linux on their productive systems. Could you imagine that they have all their developers working as root?
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Hey man take it easy!!! :wink: I'm not saying to log in as root, only to compile stuff as such. I don't do that myself. I have a user account. I'm only saying that he might not have the rights to access some folders (i.e. /usr/local/lib) where stuff is placed after compilation. Some linux distros remove access rights to users, so all I'm saying is to su - in a shell window and then cd to the source and compile there. This way the compiled libs will have no problems getting to the folders they must go. It happened to me, when I was compiling as user my make process would stop with folder access errosrs. Just remember most ppl don't know how to manage users or give them certain rights, they just use the default user linux creates for them (usually with a lot of limitations); it took me quite some time to learn and understand this. I know you are an uber linux guru but I don't think you should scare users from using linux, on the contrary, encourage them to use it!!! The only way to learn is by doing things; I screwed up my gentoo installs lke 256 times till I learned what to touch and what not to, and remember gentoo is a system that must be compiled from scartch up. Now I use Suse which is totally binary and makes life much simpler. Suse is great for windows users. But I still had to DL some extra packages and compile them since they don't come with the distro because of legal matters.

anyway, it's either that or doing a chmod to every single folder you need to have access to.
hybrid

Post by hybrid »

afecelis wrote:I screwed up my gentoo installs lke 256 times till I learned what to touch and what not to, and remember gentoo is a system that must be compiled from scartch up. Now I use Suse which is totally binary and makes life much simpler. Suse is great for windows users. But I still had to DL some extra packages and compile them since they don't come with the distro because of legal matters.

anyway, it's either that or doing a chmod to every single folder you need to have access to.
I never tried to create my own distro (or use one that I have to compile myself), indeed I'm using SuSE for some years now. But I doubt that you ever screw your system if not working as root. Thus, try to reduce the time you're working as root as much as possible.
I think you can safely assume that either you system or the tool you're compiling is awfully screwed if you need root privileges during compilation. Upon installation you're right as long as installing to either /usr or /opt. But of course this is often not needed. I have no access to any Linux system where Irrlicht is installed to a system directory. Everything stays in my home directory or space partitions - even on my private notebook.
As said, this is behaviour which any user may choose to do, but everyone should be aware of the risks and propose better behaviour. I know I might be insisting, but I teach computer scientists and I'm quite often faced with similar problems.
Irrlicht_Rocks
Posts: 25
Joined: Sun Aug 14, 2005 4:35 am

Developing for Linux?

Post by Irrlicht_Rocks »

Thanks for all of the advice.
I have to compile as root just like afecelis said. Otherwise it doesn't work.

I have still not been able to build Scite because I have no internet connection for my Linux machine. My distribution has a little manager where I can choose to install compatible packages from the internet. I installed the drivers for my wireless card and everything and it seemed to be working(the lights on the card were flashing). Then when I went to set up the networking the comp froze. When I restarted Linux wouldn't boot succesfully because it was unstable. Removing my wireless card fixed this... I'll have to go out and buy an Ethernet adapter soon.

For now I am just using a text editor and the shell.
I compiled an Irrlicht example and ran it in OpenGL. It showed up as black with a white square in 3D space. I am guessing that this is because of my video card. I also tryed installing my Radeon 9200 but on bootup it said that the system was unstable and couldn't boot normally. So I removed it.

BTW why isn't my avatar working? It's 80x80 pixels, .jpg and a low filesize.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

You can download the sources on your win machine, burn them to a cd and then copy and uncompress them in your linux folders.

don't give up!!! :wink:
Guest

Post by Guest »

There's indeed a problem with access rights if you've a large network and lots of groups you participate.
hello... it's one guy on a development box... and it's using the su command, perfectly fine for the level of work he needs to accomplish.
If you do it's not my problem, but you shouldn't give it as an advice.
Somehow, after 15+ years of IT/MIS on UNIX and LINUX systems as a SysAdmin, I feel pretty comfortable giving out my advice thank you... :wink:
Irrlicht_Rocks
Posts: 25
Joined: Sun Aug 14, 2005 4:35 am

Post by Irrlicht_Rocks »

You can download the sources on your win machine, burn them to a cd and then copy and uncompress them in your linux folders.
I have already tryed doing this. I got the source on my Windows machine, burnt it to a cd and then tryed to make/install on my Linux machine but it came with stuff like Makefile.in and Makefile.(am or some other extension.. not quite sure). It didn't come with just a normal Makefile... so that confused me.
don't give up!!!
Thanks for the encouragment. I really need it right now after my wireless card failing and such. It's also frustrating using my current Linux machine as it's pretty outdated and slow.
Guest

Post by Guest »

why dont you just download the package file for your linux distribution?

for debian/ubuntu etc. its .deb, for gentoo its "emerge scite", for fedora/redhat/mandrake its .rpm. then you do not have to compile it yourself.
Post Reply