Struggling to Compile a Program in Unix? Here's What You Need to Know

In summary, the conversation is about a person who needs help with a climate modelling program on a Unix system. They are trying to compile the program using the 'make' command, but are getting an error that says it can't find the Fortran compiler, f90. They are using Putty to access the university system, but it may not have the necessary compiler. The expert suggests seeking help from a local expert to properly set up 'make' for their local software development tools.
  • #1
Arjani
21
1
I have a climate modelling program that I need to somehow get to work. I have no experience with Unix whatsoever, so for me this is not a trivial task. I attached a screenshot of what I have. I need to compile the program and since there is a Makefile in my directory, I guess I have to use the command 'make', but that gives me an error. Any ideas?

putty.jpg
 
Technology news on Phys.org
  • #2
It says it can't find f90, which is a Fortran compiler. Do you have f90 installed on your system?
 
  • #3
No, I don't. I am using Putty, which I thought would give me remote access to the university system, which has everything installed. But it doesn't work like that?
 
  • #4
The uni system may well have a Fortran 90 compiler, but it might not be called "f90".

We can't give you much specific advice about your local computer network, for the obvious reason! It's easy enough set up "make" to use the names of your local software development tools, but I think your best option is persuade a local expert to spend a few minutes helping you do that, rather than trying to do it "blind" from this forum.
 
  • #5


Compiling a program in Unix can be a complex task, especially if you have no prior experience with the operating system. The first step would be to make sure that you have all the necessary software and libraries installed on your system to successfully compile the program. Once that is confirmed, you can then proceed with using the 'make' command to compile the program. However, if you are encountering an error, it is important to carefully read and understand the error message to determine the cause of the issue. It could be due to a missing dependency or an incorrect command. You may also want to consult the program's documentation or seek assistance from someone with experience in compiling programs on Unix. With patience and perseverance, you will be able to successfully compile your climate modelling program and utilize it for your research.
 

What is the process of compiling a program in Unix?

The process of compiling a program in Unix involves converting the human-readable source code into machine-executable code. This is done by using a compiler, which checks for errors and translates the code into a format that the computer can understand.

What are the necessary steps to compile a program in Unix?

The steps to compile a program in Unix are as follows:

  • Write the program in a text editor
  • Save the file with a .c extension
  • Open the terminal and navigate to the directory where the program is saved
  • Use the command "gcc" followed by the name of the program file to compile it
  • If there are no errors, an executable file will be created

What is the difference between compiling and running a program in Unix?

Compiling a program in Unix involves converting the source code into machine-executable code, while running a program executes the compiled code. Compiling is a one-time process, while running can be done multiple times.

What are the common errors encountered while compiling a program in Unix?

Some common errors encountered while compiling a program in Unix are:

  • Syntax errors, such as missing semicolons or parentheses
  • Undefined variables or functions
  • Missing header files
  • Incorrect use of data types

How can I optimize the process of compiling a program in Unix?

To optimize the process of compiling a program in Unix, you can:

  • Use the "make" command to only compile the files that have been modified since the last compilation
  • Use the "-O" flag to enable compiler optimizations
  • Use the "-Wall" flag to enable all compiler warnings
  • Break the program into smaller, modular files to make compilation faster

Similar threads

  • Programming and Computer Science
Replies
14
Views
2K
Replies
6
Views
1K
Replies
7
Views
1K
  • Programming and Computer Science
Replies
13
Views
2K
  • Programming and Computer Science
Replies
32
Views
2K
  • Programming and Computer Science
Replies
10
Views
3K
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
27
Views
4K
  • Programming and Computer Science
Replies
12
Views
1K
  • Programming and Computer Science
Replies
1
Views
3K
Back
Top