Compiling third-party source code that came without Makefile


I would like to compile some scientific third-party program under Linux using the GNU compiler suite. The problem is, that the source code in the ZIP I downloaded does not contain a README or any instructions on how to compile the source, there also is no Makefile of course. In short, I have nothing but a bunch of .cpp and .h files.

Question 1:
I know which cpp file contains the main class. Is there any way to have a program figure out how to build the software? E.g., run some program that will then create the Makefile for make or the file for automake? (I guess this program would need information on the file containing the proper main function and on the used libraries at least.)

Question 2:
If this cannot be done automatically, what is the best way to figure it out manually? How would you do it?


give us a link so we can look at this zip file.
Start with

g++ file1.cpp file2.cpp file3.cpp ..... lastfile.cpp

and see the compiler says.
The ZIP archive is here:

It contains the source code of RAGE, a graphlet enumerator by D. Marcus and Y. Shavitt.

The output of g++ *.cpp is too long, the forum software doesn't allow me to post it. So I put it here:
Last edited on
It looks like the code was written for windows because it uses functions like _mkdir and localtime_s, and have backslashes in the include paths. You will have to go through the code and change a few things to make it compile on Linux.
The site also has this to say -( quoted as found)
Currently only a Windows executable exist, work is done to create a unix executable. The source for this software is openly available on this web page, and should be easily converted for unix.
DirectedMotifResults.h has
#include "cmsparse\\sysTypes.h"

It'll need some weaks before it runs on POSIX.

Do you have a Microsoft Development Environment? I could knock up an nmake Makefile for you.
Last edited on
I usually write Java software under Linux and know little about Compiling C stuff under Windows, but I could download the Express edition of VisualStudio and install it on my Windows 7 box at home I guess.

Having an nmake file would be great. I'm also considering to email the authors and ask them for the project files for their IDE (or some other method to get this to compile). I'd prefer Linux but when I get it done under Windows I could work from there to replace the non-POSIX stuff.

If it's not much of a hassle for you, I would really appreciate an nmake file.
Last edited on
Topic archived. No new replies allowed.