LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-06-2013, 09:52 PM   #1
DrVonBraun
LQ Newbie
 
Registered: Jul 2013
Posts: 9

Rep: Reputation: Disabled
How Should I organize a larger program on disk?


Hi,
I'm new to Linux, having programmed in visual Studio for many years. I am now faced with the task to migrate a library and some other tools to Linux.

Now the first problem I'm facing is how should I organize this on disk? I read about the standard Linux directory tree organization and what those directories are supposed to hold, so I'm pretty sure that in the end, when my task is done, they will end up in the /usr tree somewhere.

But what in the meantime? I could create some setup in my home directory but in the end this library is meant to be worked on by other people as well.

So my question is: Is it common to place such a project in the /user tree while it is being worked on? Or does a working version go somewhere else and only when a release is made are the files copied to the /usr directory? And if so, where should such a project go while it is work in progress?

Thanks for any tips
 
Old 08-06-2013, 10:03 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,981

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
The best would be to create a real or virtual machine that has only this program running and placed in some common place. Not that it really matters a whole lot where they are placed only that it has to be in some path. Or the path needs to be edited either globally in OS or in application.

A lot of examples suggest that you simply make a directory and put stuff in it. For example /tempwork/bin and /tempwork/usr and so on. You'd have to watch for lib's in any case. Could go wild and set some other environment issues like chroot to some kernel but I'd still work on a virtual machine image for all testing if you don't have a real computer to spare.
 
Old 08-06-2013, 10:58 PM   #3
DrVonBraun
LQ Newbie
 
Registered: Jul 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Ok, thanks, I didnt really want to set up a virtual machine though. Some other suggestions I got was to use a shared git repository for instance and then just download and work in my home directory and when I have a release to put that into the final location
 
Old 08-07-2013, 09:57 AM   #4
NeoMetal
Member
 
Registered: Aug 2004
Location: MD
Distribution: Slackware
Posts: 114

Rep: Reputation: 24
A git repository would certainly be ideal if multiple people are gonna be working on the project and merging back changes.

Otherwise I don't think theres a hard and fast rule for a shared directory, you could create a /home/projectname or something and create a group for project members which would have permissions on that directory, people could create symlinks to that directory within their own home directories or something if it made it more convenient.

Last edited by NeoMetal; 08-07-2013 at 09:58 AM.
 
Old 08-07-2013, 04:58 PM   #5
DrVonBraun
LQ Newbie
 
Registered: Jul 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Ok thanks,m I was just wondering if there was commonly accepted standard for such a situation, but I think the git thing is the best way to share a project during the working phase and then simply keep the local copies in the home directory, thanks everyone
 
Old 08-07-2013, 07:37 PM   #6
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quote:
Originally Posted by DrVonBraun View Post
Ok thanks,m I was just wondering if there was commonly accepted standard for such a situation, but I think the git thing is the best way to share a project during the working phase and then simply keep the local copies in the home directory, thanks everyone
Make sure you shop around for the right version control system for your project. git is appropriate for some projects, svn for others, among many other choices. It doesn't really work to just "use this one for now" and figure it out later. Also, look into using an automatic build system, such as cmake or autotools.

Kevin Barry
 
Old 08-07-2013, 08:24 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
"Friend, welcome aboard, but ... you need to be a lot more specific!"

... if you want to get meaningful answers, that is! ...

Let's face it: "Windows/Visual-Studio is 'different', yes-it-is, but (and you know it, too...) not 'that, i.e. impossibly' different!

rest easy ... you are among friends ...

Step back, therefore, and tell us a little more about your project. Go ahead and describe it in Visual Studio terms ... that would be "easier," isn't it? ... and, trust me on this, all of us really are(!) "on the same page."
 
Old 08-07-2013, 08:58 PM   #8
DrVonBraun
LQ Newbie
 
Registered: Jul 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Well it consists of several separate projects. There are two server applications, the maincode of each is in a DLL and the EXE is mostly used to load the DLL and execute the code in it, the reason is that I can create several servers of the same type and debug them in parallel which would be a difficult setup with the same EXE. Then there is the client which will most likely remain Windows because of the target audience. Finally there are several tool libraries which are used in all of the main programs. Currently I have all in one VS Solution with several projects. At the moment it's only me working on it so I have it all in a directory tree on my C: drive, but in the future others may join the team and would work with some of the codes, that's basically the main picture
 
Old 08-07-2013, 09:46 PM   #9
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 722
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
Quote:
Originally Posted by DrVonBraun View Post
I am now faced with the task to migrate a library and some other tools to Linux.
Most libraries end up on /usr/lib or /usr/lib64 (at least on Slackware they do).
 
Old 08-08-2013, 07:14 AM   #10
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quote:
Originally Posted by psionl0 View Post
Most libraries end up on /usr/lib or /usr/lib64 (at least on Slackware they do).
This is where the build systems come in handy. cmake and autotools will generally put libraries and programs in the correct spots, and they allow you to treat an alternate directory as the root of the filesystem for creating binary packages, etc.

Kevin Barry
 
Old 08-15-2013, 03:40 PM   #11
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
Personally I don't put my code, libraries etc in /usr/lib /lib and such I keep them separate from system libs and directories.
You (and others) may end up confused as what is what and there is danger messing about in system directories, mistakes can happen.
You can keep tabs on stuff easier on it's own partition or directory structure and it won't be effected by
upgrades and what not.

If you develop a world-beating library that will be used by thousands of people maybe you can think about it then!
That's what I do anyway.
 
1 members found this post helpful.
Old 08-15-2013, 06:30 PM   #12
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
You might also find the Mono development system interesting: It offeres multi-platform development support for C# and .NET stuff.

(Note: I do not now, nor have I ever, used C# or .NET)
 
Old 08-15-2013, 07:53 PM   #13
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
I keep all my personal code and projects VERY separate from the OS
the OS's opensuse12.3 or ScientificLinux 6.4 use /lib and /usr/lib64 for the .so's ( *.dll)

i place all the code i am working on in a "src" folder on a different drive and install them in there OWN directory tree (/DATA/SUSE123/src/ProjectName )
Warning:
a word of WARNING !!!
Linux dose NOT , i repeat NOT like "blank spaces" in names
do NOT use folders with a space in the name ,nor ,c and .h files ( or .cc and .hh ) with blank spaces in the names

the OS is
/usr/bin
/usr/lib64
/usr/include
-- and so on --

i install them in
/DATA/SUSE123/bin
/DATA/SUSE123/lib64
/DATA/SUSE123/include

then add these to the system $PATH AFTER !!! the STD /usr/bin,/usr/lib64


this keeps things all in one place BUT separate from the OS
 
Old 08-16-2013, 12:50 AM   #14
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 722
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
Quote:
Originally Posted by bigearsbilly View Post
Personally I don't put my code, libraries etc in /usr/lib /lib and such I keep them separate from system libs and directories.
You (and others) may end up confused as what is what and there is danger messing about in system directories, mistakes can happen.
You can keep tabs on stuff easier on it's own partition or directory structure and it won't be effected by
upgrades and what not.
This is not the case if you stick to package management tools only.

/usr/local is often the best place for individual files that are not part of a package but a large collection of random files in your own directory structure is still subject to mistakes.
 
Old 08-16-2013, 01:21 AM   #15
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
I don't know how it works from the developer side of things but I know as a user a great many third party applications are provided in their own directory structure to be unpacked wherever the user wants. In my case I use /opt/ but I know others simply place these in their home directories.
Google Earth when provided as a .deb for Debian and derivatives installs into /opt/google/ and places simlinks in /usr/bin so it's in the executable path and somewhere else [I can't check right now] so that it appears in the menu system.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copying to a larger disk wcboyd Linux - Newbie 2 12-12-2012 07:52 PM
Need more details on how to clone a larger disk to smaller with cp Mountain Linux - General 27 07-13-2010 11:04 PM
Matrix determinant program in C++ and C. Executable 25 times larger than the other. gregorian Programming 11 06-17-2008 06:52 PM
backup a failing disk to a larger disk gfem Linux - General 8 07-13-2007 07:19 PM
dd cloning to a larger disk partition question ciarlatano Linux - General 1 04-23-2007 03:23 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration