Operating System - HP-UX
1752598 Members
5550 Online
108788 Solutions
New Discussion юеВ

Re: What is compile and recompile?

 
SOLVED
Go to solution
Torsten.
Acclaimed Contributor
Solution

Re: What is compile and recompile?

Maybe we really need to start at the beginning ...


If you want to write a program, you open a text editor and write



* HelloWorld.c */

#include

main()
{
printf("Hello World \n");

/* "\n" - new line */
}



You can probably read and understand this (hopefully), but your computer cannot.

You need to "translate" this into "computer binary language" by *compiling".

For example

# gcc -o HelloWorld HelloWorld.c

Now you can start your program

#./HelloWorld

and it will should you a very kind message.


So understand "compile" as translate into a language *your* computer understands.




If you have done this on your hp-ux machine, the result cannot run on let's say a linux.



If you want to run this on linux, you need to transfer your text file (the source code) to the linux machine and compile again (re-compile) for this system, because it understands its own language only.




I try to keep this simple as possible, I hope you understand.





But I have some doubts if somebody who is not familiar with terms like "compile" will be able to migrate something from 10.20 to 11.31 ... sorry, might be impossible.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
dirk dierickx
Honored Contributor

Re: What is compile and recompile?

more then you probably want to know and understand on compilers can be found on wikipedia:

http://en.wikipedia.org/wiki/Compiler
senthil_kumar_1
Super Advisor

Re: What is compile and recompile?

Hi Torsten,

I knew that, but what i want to know is

1) Normally one software is comming with lot of files, so do we need to compile each file?


2) For some softwares they are giving one install.sh file to install, here install.sh is taking care of compile, am i correct?


3)In our environment, unigraphics and synergy is coming with only only file or multiple files, if multilple files do we need to compile each file or is there any script like install.sh that will do compiling.


Torsten.
Acclaimed Contributor

Re: What is compile and recompile?

As said earlier by others, I doubt if you have sources at all.


A script can do what an admin writes into that script - no idea what is in yours.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Dennis Handly
Acclaimed Contributor

Re: What is compile and recompile?

>1) Normally one software is coming with lot of files, so do we need to compile each file?

Most likely. You could have an application composed of multiple executables and shlibs.
Some executables aren't performance critical, so maybe you don't have to recompile it.

>2) For some softwares they are giving one install.sh file to install, here install.sh is taking care of compile, am i correct?

It depends. HP-UX ships it's software already compiled. In most cases it is already linked. So, swinstall, just copies the bits.

Oracle's could do links.

3) In our environment, unigraphics and synergy is coming with only file or multiple files, if multiple files do we need to compile each file or is there any script like install.sh that will do compiling.

Again it depends. If they distribute source, there should be a "make" system for compiling and linking.

Re: What is compile and recompile?

senthil,

time to go back to IT school methinks... I don't want to be rude, but these are really some very basic principles of computing and IT - if you don't understand this sort of thing, you really need to go take a basic computing course of some kind...

compiling is what _developers_ do - you know, Microsoft Developers compile apps like word and excel, Oracle developers compile apps like oracle database server... etc

if your company has a customised (bespoke) application, then you might have some developers in your own company that compile applications as well.

these developers compile applications from source code (like the examples Torsten posted) and create _binaries_ - which are usually made up of _executables_ and _libraries_ (libraries being extra bits of exceutable code which might be used by many different executables). the binaries are what are usually distributed to customers... not the source code

as a rule sysadmins don't compile applications - although sometimes we might get the source code for some open source software and compile something ourselves - but for most sysadmins this is the exception not the rule.

so for your applications, I seriously doubt that you have the source code as they sound like commercial applications - the "install.sh" script that you see do excatly that - just install the application (you know like clicking setup.exe in windows??)

One thing I can tell you - if you don't understand these concepts, don't worry too much as I can be 99.9% sure you _won't_ be doing any compiling.

HTH

Duncan

I am an HPE Employee
Accept or Kudo
senthil_kumar_1
Super Advisor

Re: What is compile and recompile?

Hi Dennis Handly,

you are telling that "make" is doing compile of the source code, am i correct?

So "make" is installing (compiling - making binary) the software in HPUX, then we can use the software.
Torsten.
Acclaimed Contributor

Re: What is compile and recompile?

"make" is not necessarily doing compile or install - make does what the Makefile says.





If you have the source of your apps, you certainly have a README too.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
senthil_kumar_1
Super Advisor

Re: What is compile and recompile?

Hi Duncan Edmonstone,

I have understand some thing about install.sh that for example in lab of HPUX they are compiling the source code to binary, if one software have lot of binaries then they are selling software with lot of binaries and libraries with install.sh, now when we execute install.sh it will copy all the binaries and libraries in corresponding location.
Dennis Handly
Acclaimed Contributor

Re: What is compile and recompile?

>you are telling that "make" is doing compile of the source code, am I correct?

make would just be invoking the compiler, archiver, lex/yacc and linker to build the application.

>now when we execute install.sh it will copy all the binaries and libraries in corresponding location.

It can also do customization.