ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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
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.
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
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.
"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."
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
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.
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.
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
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.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.