Setting up dedicated build PC - suggestions needed - hardware

we are thinking about buying and setting up a new PC to use as a nightly build PC. We are planning to install Visual C++ 2005/2008, SVN etc. However we need to compile our app:
for 32 and 64 bit
on 2 different linux distros
so we think we can setup a Windows Xp/7 and use VMWare to run linuxes.
But how to build for 32 and 64 build targets on the same Windows ? Should we rather install a 64bit windows from the beginning ?
Do you have any other suggestions/best practices for dedicated build computers ?
Thanks,
Paul

First, separate 2 logical parts: build system architecture and physical implementation.
For example, architecture may be based on hudson: One server runs hudson and hudson manages builds on any number of other servers (running any OS'es you may need).
Now it doesn't matter if you have multiple PCs running single OS or have everything virtualized or a mix of both.
For physical implementation, I would recommend complete virtualization: it has several pros while the list of cons is basically one item - performance penalty.

I'm not sure about 2005, but 2008 can compile for both x86 and x64 on a 32bit system.
Not sure what you planning on using to do the builds, but if you configure a x86 and x64 configuration in your project MSBuild works just fine.
msbuild /property:Platform=<platform target> <project or solution file>

I would be tempted to install 64-bit Windows, not necessarily so you can build 64-bit executables but because it'll allow you to use more RAM without jumping through unnecessary hoops. And being able to use more RAM means you can give the Linux build VMs more RAM, run them in parallel etc.

I personally would go with x64 so u can test... Plus it will obviously be faster

Related

Wsl2 why develop in this environment

I understand the principal of having Linux on your windows box over using a VM.
I have seen articles on using vscode in wsl with the vscode wsl extension.
My question is why would I do this over just using vscode on Windows.
Might sound like a silly question and I hear people saying I can now develop on Linux where my company is is windows, I just don't understand what the benefits are
It all depends on what you are developing, if its C# with the target operating system being windows or azure there is little benefit.
Personally I work in nodejs, our target deployment OS is centos running in AWS-EC2, so it makes total sense. There is a lot of tooling that runs better in a linux environment than in a dos/powershell environment. Also when testing we are running the code in an environment that is close to our target env which reduces the chances of unforeseen issues further.
Does this make sense? what are you developing day to day and what is your target environment?

Are libraries built using the Linux subsystem in Windows 10 accessible to a Windows development environment?

I'm currently trying to connect MongoDB to a Windows QT C++ application and am following the tutorial here. While there Windows installation instructions are presented, to avoid having to install Visual Studio or other tools, I'm wondering if I can follow the package-manager or Linux instructions on the inbuilt Linux/ Ubuntu subsystem of Windows 10 and build the libraries in my Linux environment, later somehow accessing them from my Windows development environment.
I don't fully understand how compilation/ byte-code works in the Linux subsystem on Windows, so I haven't been able to piece together an answer for this myself based on my understanding of the various systems involved. Any explanation or assistance would be appreciated.
You can run a Windows executable from a WSL console window or a Linux executable from Windows command line / power shell. And capture the output, pipe between applications etc. But the application must run entirely on one platform; you cannot mix a Windows executable with Linux libraries or vice-versa.
I don't know how you will connect to MongoDB but, if it has a socket interface like MySql, you could create a bash script on WSL which runs your QT application to access the database, wherever it is.
But if you're using QT as a GUI you're going to struggle. People have been able to get a Linux desktop running on WSL by installing an X server on the Windows host but you might find that more trouble than it's worth.

Apart from "bitness", are .dll files specific to machine/processor type in some way?

I am working on the development of a Java application that loads native library files to perform some calculations. The application uses JNI to load the libraries. This application should work on Windows and Linux environments (on both 32-bit and 64-bit).
During the compilation process, we compile C code to library files (32-bit and 64-bit dlls for Windows, and 32-bit and 64-bit .so files for Linux environments). These .dlls and .so files are included in the distribution file, and are referenced when Java is called by using the -Djava.library.path parameter.
I am now testing the application on a few different machines. I am initially focused on 64-bit Windows environments. The strange thing that I have encountered is that on some 64-bit machines the application loads the correct .dll files successfully, but on some other machines it does not load the .dlls.
I thought that the problem might because of a difference in the processor type between the machines (ie. that the dlls were compiled for one processor type and other processors types cannot use them).
However, it works on one machine, and does not work on another machine that has the SAME processor:
It works on a HP laptop running Windows 7 64-bit, with this processor:
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 37 Stepping 5, GenuineIntel
It does not work on a Lenovo laptop running Window 7 64-bit, with this processor:
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
My question is: apart from the bitness are .dlls machine/processor type specific in some other way? (I know that the .dll files have to match the bitness of the machine, and that the JVM must also match the bitness of the .dll files)
Or in theory, if a .dll is 64-bit should it run on EVERY 64-bit machine that is using a 64-bit JVM?
apart from the bitness are .dlls machine/processor type specific in some other way?
Very much so. Any compiled binary meant to run under an operating system is both processor and operating system specific, sometimes even down to specific versions of each.
Different processors - even in the same family, such as "x86" - can offer different instruction sets and capabilities. See https://en.wikipedia.org/wiki/X86_instruction_listings for the listing of different variations of just x86 instruction sets and capabilities. If a compiled binary uses a specific instruction, it won't run on a processor that doesn't implement that instruction. For example, if a binary is compiled to use SSE3 instructions, it won't run on processors that don't implement SSE3.
And it's not just limited to hardware, either. Operating system specifics matter, too, literally for starters because the operating system is what starts the running process. So the binary needs to work under the conditions and in the environment of the operating system that started it. A binary designed to work under an operating system will also need to make calls to that operating system to interact with data, devices, or other processes. Different operating systems provide these capabilities in vastly different ways, even to the point of different versions of the same basic operating system doing so in incompatible ways.
And binaries that aren't designed to run under an operating system have to provide very hardware-specific capabilities - ever notice how many device drivers any operating system has? And this excludes any shared object or DLL because by definition they are already designed to run under an operating system.
Or in theory, if a .dll is 64-bit should it run on EVERY 64-bit
machine that is using a 64-bit JVM?
It should be clear by now that the answer is "Not even close".

Suggestions on Setting up Development Environment

After referring to many posts, opinions and feedback from SO, I have just bought a Lenovo Thinkpad T410 . x64 Win 7 Prof, 500 GB # 7200 RPM , Core i7 620M processor, 4GB DDR3 RAM.
I am now setting up my development environment on the new machine. I need your suggestions in setting up a clean, structured and risk-free Development Environment.
Something about what I intend to do on this machine:
I am Entrepreneur bootstrapping my Startup. So I will have business related purposes (presentations) other than Coding.
I do coding on Microsoft stack currently for some of my other projects. But will start coding in other technologies such as RoR. So I need to have MS products (VS, IIS) and other OSS'
This machine also doubles up as production environment on top of Development Environment.
I don't have a separate Desktop for doing heavy lifting. This is my whole and sole workstation.
I have read a lot about VMwares here and how they help to keep the machine clean and ordered which you can just wipe out clean and have reinstalled as you wish. Is it a good thing to have VMs each for Microsoft stact, RoR stact and so on or have all of them installed on my main machine itself.
Also, apart from this, it would be great if someone can suggest some good options for Firewall+Antivirus+Malware stack (considering that this is a Win 7 machine)
ThanQ
This machine also doubles up as
production environment on top of
Development Environment.
You are setting yourself up for a world of hurt.
Aside from that, it is just common sense that you should use some form of VCS (I recommend Git) and store all your code NOT on your development machine. You should be able to checkout out your code, run a script, and be up and running. You are bootstrapping a startup; pay the $12/month to keep your code safe.
VMs are a good idea if you need to support different environments, for example Win7, Win Vista, and perhaps some flavor of linux. If you take my suggestion and use a remote VCS setup, you can checkout from the remote source onto your VMs.
Another benefit of VMs is you can set up a base install, with all the software you need, and create an image of it, so from that point on you can pass the image around, and you won't need to install the baseline software again.

Best setup for Linux development from Windows? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
What's the best setup for developing Linux apps from a Windows workstation? Right now I'm connected via SSH to our Linux development server and am using Eclipse, forwarded over SSH via PuTTY, to the public domain version of Xming running on my Windows workstation. It works, but it's not great; Eclipse's response times are far from snappy (noticeably worse than Eclipse running natively on my much slower Windows workstation), I can't resize some dialog boxes, and I haven't figured out a good way to reconfigure my fonts.
Is there a better setup available?
Edit: This is for C/C++ development.
Options for Linux on Windows:
Tools Only
Given you're using Eclipse I'm going to assume you want a full IDE, but if you can get by with just the GNU/Linux tools, there are a few choices.
cygwin gives you a bash shell with lots of tools, including an X11 server. This has been around awhile and is mature.
msys is a smaller, lightweight alternative to cygwin.
GNU utilities for Win32 is another lightweight alternative. These are native versions of the tools, as opposed to cygwin which requires a cygwin DLL to fake out its tools into thinking they are running on Linux.
Linux in a Windows Process
There are several packages that will run Linux as a Windows process, without simulating an entire PC as virtualization does. They use Cooperative Linux, a.k.a. coLinux, which is limited to 32-bit systems. These don't have the overhead of virtualizing, and they start up faster since you're not booting a virtual PC. This is a little more on the experimental side and may not be as stable as some of the virtualization options.
Portable Ubuntu
andLinux
Virtualization
Virtualization software lets you boot up another OS in a virtual PC, one that shares hardware with the host OS. This is pretty tried-and-true. There are nice options here for taking snapshots of your Virtual PC in a particular state, suspend/resume a virtual PC, etc. It's nice to be able to experiment with a virtual PC, add a few packages, then revert to a previous snapshot and "start clean".
VMWare
VirtualBox
VirtualPC
In my case...
Sounds like your environment has different performance characteristics, but here's my situation: I started out with Eclipse on my Windows laptop (doing Rails development), found this sluggish, and switched to using putty to ssh into a fast Linux box. I do my editing via an emacs running on the Linux server, displayed on Windows using Xming. Or I use native emacs on Windows, editing the files shared via NFS. The latter is slower in my environment due to sluggish saves.
When working from home, I ditch X because it is too slow with remote clients, and just run emacs -nw within a putty window. I then use GNU screen so that I have multiple "windows", and so that I can easily resume where I left off if my network connection flakes out.
The best approach that I've found is to:
keep your code portable
develop natively on your desktop
verify any OS dependencies (minimize these as much as possible)
deploy to your target regularly, test & debug there
I know that this isn't a direct answer, but using an IDE for development through X is painful with most of the free tools. The only way that I've been productive doing work this way was when I was running a UNIX-like on my desktop so X was native. If you are going to use this approach, try a commercial X solution on the desktop.
Other than that, consider ditching the IDE and doing your development and debugging via SSH, a terminal editor (e.g., vi, pico, ee, emacs), make/ant, and gdb.
The best approach for you is going to be driven by your programming language and the type of application you're developing. If you are doing GUI applications, then using X might be the only approach that is acceptable. If you are doing back-office/daemon development, then the SSH and terminal approach will probably work though you probably want to get really comfortable with either vi or emacs.
EDIT: just noticed that you are doing C/C++ development. Consider using a cross platform framework if you aren't already. Using something like Qt, APR, ACE, or Poco should make it possible to natively develop under Windows with a deploy/debug step to your Linux environment.
For development I usually use a Linux virtual machine on my Windows box. It will probably send Linux users running to the bathroom to wash their hands, but I do all of my development in Visual Studio, and I have a custom Visual Studio plugin that invokes G++ through the virtual machine and pipes the output into the VS output window. With a quick change of a Combo box I can build and test for Windows or Linux.
An easy to setup option would be to run Eclipse natively in windows but deploy the code via a Samba share on the Linux machine (which you can mount as another drive) (or SSH/SCP if SMB is not an option) and then run it there via SSH console.
Another easy to setup option is to simply develop on Linux via freenx or a similar tool instead of a full blown X session, check this answer: https://serverfault.com/questions/11367/remote-desktopping-from-windows-to-linux/11372#11372
The other options (Virtualization, Linux running inside windows, Cygwin) are indeed valid but have their drawbacks, like being more machine demanding, harder to setup, or not equivalent enough to the actual linux environment, but may very well be worth your while if you have the machine and the scenario justifies their use.
Doing everything on the Linux side will always have some drawbacks
if your machine is Windows.
I personally have a Linux box where everybody else has Windows and
do Windows dev inside a VM, but it has costed me a lot of RAM and some network setup pains.
I find coLinux tremendously helpful when developing on Windows for Linux, it's basically a linux system running in parallel to your Windows OS (i.e. as a service) and can be configured to simply show up on your LAN, basically like a virtual machine does. Also, it's much more full featured than CygWin, and its performance is really remarkable - I can easily run non-trivial stuff under coLinux, and still run simulators at 90+ fps.
Also, coLinux can be easily set up to run X11 and window managers like gnome/KDE, so that you can for example use something like vnc to access your linux desktop.
Cooperative Linux is the first working free and open source method for optimally running Linux on Microsoft Windows natively. More generally, Cooperative Linux (short-named coLinux) is a port of the Linux kernel that allows it to run cooperatively alongside another operating system on a single machine
. For instance, it allows one to freely run Linux on Windows 2000/XP, without using a commercial PC virtualization software
such as VMware, in a way which is much more optimal than using any general purpose PC virtualization software.
(source: colinux.org)
There are multiple solutions, I'd recommend No. 1
A VM (Virtual Machine) running a flavor of linux as a guest operating system inside Windows. Start with VirtualBox which is free.
To make managing it easier you can use a tool like Vagrant. Vagrant is a tool for building and managing virtual machine environments in a single workflow. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases production parity. So you code in your Windows PC and compile/run the application on a Linux system using Vagrant. Vagrant is free! Similar tool: Docker can be used too. For this setup you can use any IDE, I'd recommend VSCode its quite handy for C/C++ with intellisense but Eclipse should work too.
Web based tool like Nitrous.io which is discontinued, but you can host your own open-source version of the Nitrous IDE called Nitrous Solo which lets you host your own instance of the Nitrous IDE on your preferred cloud provider.
Windows 10 provides provides Windows Subsystem for Linux, try using that to compile and run your project. This requires a 64-bit version of Windows 10 Anniversary Update or later (build 1607+).
Cygwin / MinGW are popular bash tools for Windows, they might be able to compile and/or run your application.
Cygwin might be helpful.
I've done what you want to do for exactly the same reason: full control over the output (you're having font issues with your current solution) and much slower Windows machine than the remote Linux development box.
Most answers are bogus: having a "Linux development environment" is not just "having an IDE". It's about having the whole Un*x power at your fingertips.
Is it a local or remote Linux server? bandwith issues? Because on a LAN, even an old 100 MBit/s LAN, FreeNX flies. How's the load on that Linux server?
Setup the free FreeNX on the Linux system, install the free FreeNX client on the Windows machine and bingo, you've got your Linux development environment at your fingertips.
FreeNX is much more efficient than VNC, it's night day (VNC is actually pretty bad perfs wise, even compare to Windows's Remote Desktop... But FreeNX flies).
Regarding speed, a long time ago, I set up my main Linux workstation (it was a Pentium 4 / 2GB of memory back in the days) on which I was developing full-time using IntelliJ IDEA (another IDE), to serve a full X session (complete with a window manager etc.) that another developer was displaying remotely to... run another IntelliJ instance (and access all the Un*x niceties). It was on a LAN 100 Mbit/s and it was as if the app was local for the other developer.
Anyway, on today's hardware I cannot imagine how this could not work: I now have here a Core 2 Duo / 4GB of ram as my main desktop and a Gigabit LAN.
Such a setup was working perfectly 4 years ago, it would work perfectly today.
Now if you tell me you have bandwith issues or that the Linux machine you've got your account on is under heavy load or that it's not on the LAN, then things may be different...
How the younger developers who want a powerful Un*x system do it at the company I'm consulting for nowadays (that only has Windows desktops)? Most of them bring their shiny MacBook Pro and use that to develop ;)
I'm using xming as well and suffer from the same problems with Eclipse. Apparently, neither switching to cygwin makes it fast enough. Eventually I switched to developing in vim via xming. It doesn't take as much time as I feared to get used to all the key combinations, and the performance is absolutely smooth. Actually, now sometimes I use vim even when working natively.
Either a Virtual Machine with a Linux-based dev environment, or a local copy of some toolchain-agnostic IDE (e.g. Notepad++, with testing done via MinGW or CygWin as far as you can), or just write in Notepad++ and keep uploading to your dev machine and testing there, which is what I do.
You might try other X servers on Windows such as xwin32 and hummingbird. Note that these are commercial implementations.
Another solution is to install a VM server on your Windows box and install Linux on the VM. Options include VMware (non-free) and Microsoft Virtual PC (free download). VMware is much nicer than VirtualPC (64-bit support, more incentive to support Linux client OSes, etc.).
EDIT: In the last 13 years since this post was originally made, Cygwin/X (and Xming) has gotten a lot better. It's worth trying again. I now use it for my everyday work again.
You could take a look at setting up a svn server on the linux box and then using something like TeamCity todo a build on commit. You could write your code locally and do a commit when you want it to be compiled.
I don't know if there's a more modern route, but the standard way in my time was to run X Windows in Microsoft Windows, that way you can run any number of applications on your Ubuntu machine and control them and display them in Microsoft Windows
Check Check out.
You could try using any of the linux distros for windows, even windows-store have ubuntu, SUSE etc for windows and this could help reduce your coding efforts. This linux distros contain linux shell, kernel etc so you won't be needing linux system everytime debugging or testing your code.
You could also use Visual Studio Code which is far better and fast compared to eclipse and is even supported in linux and mac.
Check this for ubuntu distro on windows store.
Linux distros can also be downloaded from other sources but microsoft urges to use the one from Windows-Store.
Use Linux! I usually have the other problem: developing win under linux.
There is no reason for not doing so: I have win running on a virtual box now almost all the time.
Linux comes with a lot of development tools.
The problem is:
is it a graphical interface?
If no you will have no problems as soon as your code STD/portable.
(X allows you simple stuff too but for an nice application today you need a bit more.)
If Yes then you will have a lot of problems when you actually port the code
on the running platform.
Is it supposed to be portable/exchangeable between linux and windows?
if not, just develop on the native OS. Way less pain. You have Eclipse for both
platforms. Even if you think to port the code on a later stage,
just do the work for one first.
I developed a couple of graphical application under linux which are actually right now
used only under windows. My recipe is: GTK/GNOME. I made it running with cygwin and mingw.
But I guess that Qt has the same usable environment too.
My code went on win with no changes!
[ok.. a couple of touching on file paths... but was a bug..]
There is no way to develop under win and hope to be running on linux unless you are sure
not to use any win libs. That is: in a graphical application almost no chance. Or a lot of
checking... Or you will not be using any win facility. Forget Visual Studio.
Check indeed wine and the winehq pages.
Unless the problem is another, like: using team sharing facilities, or svn or whatever.
Which is not a code development problem but a bit more on the organizational side.
Bottom line:
It is way easier to port a free code on win then a proprietary code on the free market.