Running or modifying the source code(binaries) that are available under GNU General public license - compilation

Dear stackoverflow members,
I have a question that might sound silly to most of the members here, but it is bothering me for quite a while now and couldn't find any appropriate answer for it, yet.
My question is, how can we run a source code or binary of a open source project which is distributed under GNU license.
When I download the project, all I get is a .tar file, when unzipped, I get a folder containing many sub-folders, like src, build and etc. This folder looks similar to the project folder created by an IDE like netbeans. But how can I compile and modify these source file?
Is there an application that does it? or do i have to switch to linux to do it?
I am currently using a copy of windows 7 and also have a copy of windows xp at disposal.
Any help would be very much appreciated.
Thank you very much in advance.
cheers
Kishore.

Under GNU and GNU/Linux distros the packages are installed by the package manager (e.g. no need to build or download anything). Some programmers distribuite (along with the source code) binary versions of the program (which you run by clicking on them, or by invoking them from the command line). You can compile source code on Windows thanks to MinGW. For the istructions to run read the `README' file that you find in the unpacked dir. Most programs can be build with:
./configure; make; make install
If you post the link to the project I could help you with the building process.

Related

how do I compile cURL with openSSL and nghttp2 on Windows x64?

first question ever on here, so bear with me :) I've been on the web for the past 3 days trying to find a way to get the following result on my windows machine.
example of 'cURL -V' output I need
I've found a lot of stuff for macOS and unix, but only bits and pieces for Windows. I'm running xampp, and ultimately I'm trying to get it to send http/2 requests through cURL/PHP. What I've gathered so far is that I need cURL to be compiled with some libraries, like openssl (at least 1.0.2), libcurl with http/2 enabled, and nghttp2. I feel like I'm very close but I'm just missing some steps.
What I've done so far:
installed things like mingw32, cmake, and Build Tools for Visual Studio 2017
downloaded nghttp2-1.27.0, and used 'cmake' and 'cmake --build' to get the 5 files: nghttp2.dll, .exp, .lik, .lib, and .pdb
downloaded curl-7.56.1.tar.gz (the very first one on https://curl.haxx.se/download.html)
downloaded libssh2-1.8.0
downloaded openssl-1.0.2l
downloaded zlib-1.2.11
followed instructions for Mingw32 on https://curl.haxx.se/docs/install.html (but it keeps giving me the error 'cannot find openSSL package')
I read somewhere that I need to compile cURL with the '--with-nghttp2 --prefix-[LOCATION OF NGHTTP2 FOLDER HERE]' flag, so I tried something that I thought would work, but I don't think it did: 'cmake --with-nghttp2 --prefix-[LOCATION OF NGHTTP2 FOLDER HERE] . ', then 'cmake install . ' and it looked like it did something, but the cURL.exe that was built inside curl-7.56.1/src/ did not have anything else but libcurl.
Any suggestions or pointers will be greatly appreciated! Thank you guys :)
Ok, I was finally able to build Curl on Windows with http/2 support.
This is what worked for me, step by step:
Downloaded "Build Tools for Visual Studio 2017" to be able to build from the command line (provides nmake and required Windows SDK libraries and header filtes)
downloaded the latest version of curl, like stated above (curl-7.56.1.tar.gz, aka for me the very first one on https://curl.haxx.se/download.html)
extracted it inside c:/curl, so I ended up with c:/curl/curl-7.56.1
read instructions BUILD.WINDOWS.txt inside c:/curl/curl-7.56.1/winbuild and proceeded to http://windows.php.net/downloads/php-sdk/deps/ to download the 4 libraries that I needed. I just grabbed the VC15/x86 versions.
created a new folder named "deps" inside c:/curl/curl-7.56.1
created the following 3 folders inside c:/curl/curl-7.56.1/deps: bin, lib, and include
extracted each library I just downloaded in the corresponding 3 folders
opened Developer Command Prompt for VS 2017
cd c:/curl/curl-7.56.1/winbuild
nmake -f Makefile.vc mode=dll WITH_DEVEL=c:/curl/curl-7.56.1/deps WITH_SSL=dll WITH_NGHTTP2=dll WITH_ZLIB=static WITH_SSH2=dll
this builds a CURL executable inside one of the subfolders in c:\curl\curl-7.56.1\builds
when I first tried running CURL, it showed an error saying missing libssl-1_1.dll and libcrypto-1_1.dll, so I had to copy them from c:\curl\curl-7.56.1\deps\bin to the same directory where the newly built curl.exe is
Note: since zlib didn't come with a bin folder containing any .dll's, I understand why I had to mark zlib as static with the WITH_ZLIB=static flag. What I don't get is why I had to manually move the openssl .dll's in the new directory. Any thoughts?
PS: thank you Daniel for pointing me in the right direction. I didn't even notice the /winbuild directory.
PPS: As you can probably tell, I had no idea what I've been doing 90% of the time. Probably why it took me 5 days to figure it out ;)

Installing Primer3

I need to install Primer3 for my research in Windows, and I really have no idea of how to go about it. I was following the instructions mentioned here.
I'm getting to the part where I need to run
mingw32-make TESTOPTS=--windows
and I keep getting an error saying:
'mingw32-make' is not recognized as an internal or external command,
operable program or batch file.
Just for reference, I went into the minGW Installation manager and got the ming32-make packages, including the bin, doc, lang, and lic ones, because I really had no idea which one was the correct one.
If someone could help me, I would be very grateful! Installing these niche programs without an installation wizard is a challenge!
You will need to install mingw32-make. This is a
Windows of port of GNU Make,
a software-build tool that is supported on all operating systems,
indeed the daddy of such tools.
But make alone will not suffice. To build primer3 you will
need a Windows port of the whole GNU toolchain for building software
from source code. Without that, running make by itself will
just expose the absence of the GCC compiler and linker that it
expects to do its bidding.
This is quite a lot of software, but it is easy and quick to install and there
are several open-source offerings. I suggest you go to TDM GCC
and download the TDM64 bundle. This will give you an executable installer.
Just run it and you will end up with the complete GNU toolchain, including,
mingw32-make, in your chosen installation directory.
It will also install in your Windows launch menu the MinGW command prompt.
Launch this and you will be presented with a Windows commandline console
with its environment set up to find and run any of the GNU tools.
In this console change directory to your primer3-X.Y.Z/test directory
and then run mingw32-make TESTOPTS=--windows as per documentation.
Be forwarned that the self-tests of primer3 that are executed to
verify the build may take 1/2 hr. to 1 hr. to run, depending on your
hardware, but they will finish successfully with the steps I've
described, barring problems specific to your machine. It is a foolproof-simple build.
All the built executables are deposited in the primer3-X.Y.Z/src
directory. You may want to move them somewhere more convenient
in in your PATH.
It does seem oddly amateurish that the documentation simply
directs you to run mingw32-make with no preliminary account of
what that is or how to install it, while on the other hand it
advises that you must install perl and strongly recommends a
specific perl distribution; but evidently primer3 is open-source
scientfic software and its documentation is not bad by the standard
of that genre.

freeswitch noob cant build solution

im just starting out with FreeSwitch, i downloaded via git, and am trying to build in VS
all i need i believe are the dlls of mod_managed, as my goal is to manage FS via .net
but i get 248 errors, most look something like this:
Error 5 error C1083: Cannot open source file: '....\jpeg-8d\jaricom.c': No such file or directory D:\FreeSwitch\freeswitch\libs\win32\libjpeg\c1 libjpeg
btw, i searched windows and cannot find any such file anywhere on my pc.
I tried
cleaning the solution first, but it did not help
moving the file to a path without spaces
downloading with autocrlf=false
building on another machine
but none of these steps helped
anybody have any idea?
if i can just download the dlls i need, i wouldnt mind skipping this step altogether
environment
win 8 64bit
visual studio 2012
thanks a million
The libjpeg sources are not in the git sources but are normally downloaded during the build process. If you build the entire solution that should not be a problem since it has the project dependencies set: libjpeg.2012 depends on Download libjpg.2012, which means the latter gets built before the first. All Download libjpg.2012 is run a cscript which downloads libjpeg from http://www.ijg.org/files/jpegsrc.v8d.tar.gz (see inside the project file).
So if you do not have the sources, either you are building incorrectly (not in VS for instance, or with a broken solution file) or the download script is broken. In that case, you should inspect the output: I assume it shows errors when it can not download the libs.

Creation of Windows executable file (*.exe) with PyDev-Eclipse and CDT-Eclipse --- How?

Is it possible to create Windows executable files for Python and C/C++ code within the Eclipse workbench? If yes, then how can this be done?
This is how I create .exe files from eclipse, in windows. Is not within the eclipse workbench but it might help you. To avoid problems, I would recommend to download everything for 32 bit even if you use 64 bit computer.
Install python 2.6
Install Eclipse
Install py2exe
In eclipse go to Help > Install new software and install pydev plugin from http://pydev.org/updates/
In windows preferences point the python interpreter to the location of your python.exe in your computer (C:/Python26)
you might need to add py2exe to the libraries
create a python module called setup.py with a code similar to this one:
from distutils.core import setup
import py2exe
setup(windows=['H:/yourworkspace/YourPythonProject/src/yourprogram.py'])
open windows console and type
python H:/yourworkspace/YourPythonProject/src/setup.py py2exe
this will create a .exe located in C:/Python26/dist folder. It should work if you double click it but you cannot take it to a computer without python or any of the libraries that you´ve used. To do that, you can use Inno Setup.
It's very easy to use, basically it will ask for the location of the .exe, the dlls and folders that you want to add (I don't know about this so I add most of the things inside my C:/Python26/dist and it works). Inno setup will create an script and generate a .exe that you can install in any computer. You might need to edit the [Icons] part of the script, I had problems with that before to add an icon to the application.
That should hopefully work,
good luck.
Not sure I understand what you're asking as you're mixing Python/C++ in your question...
If you want to embed Python in some library, Google for 'embed python in c++'
If you just want to package Python to run Python code with extension modules, search for py2exe or cx-Freeze (personally, I like cx-Freeze better).
I don't think any of this is PyDev/Eclipse dependent (this should be IDE agnostic).
In addition to Fabio's answer:
In terms of C/C++, if you compile it on windows, eclipse does create yourprog.exe file automaticaly in order to be executed (in case if you have your main function written in C/C++). Look for your executable in bin folder of your project.
In terms of compiler: I use Cygwin. It simulates Linux environment. It contains (not by default though) g++ compiler, which, because of cygwin, compiles it in binary that can be launched in Windows (i.e. .exe file). I am not sure exactly about whether Linux binary is then converted to Windows binary or it is directly compiled for windows, but I know that this .exe file alone works if you run it.
Let me know if you need help installing Cygwin.

Configuring Bison to compile an input file under Visual C 6

I'm trying to get Bison to do it's thing in VC6. I'm sure this must be a problem with my configuration. At the moment I have a Custom Build step as follows.
<Commands>
echo Start parser generation
"C:\GnuWin32\bin\bison.exe" $(InputPath)
echo Finish parser generation
<Outputs>
$(ProjDir)\$(InputName).c
$(ProjDir)\$(InputName).h
The error I get is "C:\GnuWin32\bin\bison.exe: m4: No such file or directory", which makes me think the m4.exe doesn't exist or isn't on the path, but I can run the exact same command from CMD in the same directory with no errors.
This thought process makes me think it's a problem with the output options, but I've tried various configurations with no luck.
Any help would be great, thanks in advance.
Edit: I've added some more visual studio versions to the tag list to try to get some more exposure for the question. Hopefully someone will have done this in a later version and I can work backwards.
Okay, I've managed to slove this in a very round-about way but I will try my best to document it here.
It seems that VC6 Custom build options will only look in the project directory for the m4.exe, even when you specify where the calling exe (bison) is explicitly. To solve this I did a bit of a hack and did a full cd command in the custom build window to get to the gnuwin32 directory (where both bison and m4 live) before trying to call the parser generator.
This works fine but is a bit of a hassle for trying to distribute it to other people when they may have installed GNU tools to a different location.

Resources