Error compiling in Fortran (Ubuntu)

In summary, the conversation is about a new forum member who is completing their master's degree in physics and is running a simulation using Minuit from CERN. They recently changed their computer from a Mac to one with Ubuntu 10.10 and are encountering an error when trying to compile their Fortran 77 code. Despite trying various solutions, they are still unable to compile their code and suspect it may be due to using a 64-bit Ubuntu with 32-bit CERN libraries. They are currently working on finding a solution.
  • #1
meredithvl
2
0
Hello all, I'm new to this forum, but not to Physics, I'm completing my master degree. :)

I'm currently running a simulation using Minuit from CERN. I recently changed the computer I'm working on, the new computer has Ubuntu 10.10 installed (I was working on my director's Mac before). All my coding is written in Fortran 77. I installed Minuit libs, gfortran, fort77 and gcc in the computer with Ubuntu, but when I try to compile, I get this error:"I/O error on c_file".

I did a search on this error, and all I found is that this is a C or C++ error. I'm puzzled, because I'm not using C coding or C compilers. Everything I tried, like creating alias, or using makefile, failed. I changed nothing in the program itself, and it compiled just fine in the Mac. I really don't know what is wrong.

Any thoughts will be greatly appreciated!
 
Technology news on Phys.org
  • #2
Is this still a problem?
If so, which of the above compilers did you use? If it was gfortran that would be extremely odd, but if you were using gcc I could see why a C/C++ error would occur.

I use gfortran to compile my f90 programs on UBUNTU. The most used compile line for me is

gfortran -o test [your file name].f90

(or .f77 in your case). 'test' is the name of the compiled file.
 
  • #3
I get this error when compiling with fort77, anyway I installed Intel compiler, and this still doesn't work, but it's probably perhaps I'm running Ubuntu 64 bits, and CERN libraries are compiled for 32 bits. I'm still working on the problem, to see if I can compile CERN libraries myself.
Thank you for your reply.
 

1. What is Fortran?

Fortran, short for Formula Translation, is a high-level programming language used for scientific and numerical computing. It was first created in the 1950s and has since been updated and revised multiple times to accommodate for modern computing capabilities.

2. Why am I getting an "Error compiling in Fortran" message?

This message usually appears when there is an issue with the code syntax or structure in your Fortran program. It means that the compiler was unable to translate your code into a machine-readable format. Common reasons for this error include missing semicolons, incorrectly defined variables, or mismatched data types.

3. How do I fix a compilation error in Fortran on Ubuntu?

The first step to fixing a compilation error in Fortran is to carefully read the error message. This will often point to the specific line or section of code that is causing the issue. Double check your syntax and make sure all variables and data types are properly defined. If you are still unable to resolve the error, you may need to consult online resources or seek help from a more experienced Fortran programmer.

4. Can I use a different compiler for Fortran on Ubuntu?

Yes, there are multiple compilers available for Fortran on Ubuntu, including GNU Fortran (gfortran), Intel Fortran Compiler, and IBM XL Fortran. Each compiler may have slightly different syntax and capabilities, so it is important to choose one that best suits your needs and programming style.

5. How can I prevent compilation errors in Fortran on Ubuntu?

The best way to prevent compilation errors is to carefully write and test your code. Make sure to follow proper syntax and coding conventions, and thoroughly test your program before attempting to compile it. It may also be helpful to use an integrated development environment (IDE) designed for Fortran programming, which can help catch syntax errors and provide helpful suggestions as you write your code.

Similar threads

  • Programming and Computer Science
Replies
3
Views
983
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
22
Views
2K
  • Programming and Computer Science
Replies
14
Views
1K
  • Programming and Computer Science
Replies
2
Views
795
Replies
6
Views
1K
  • Nuclear Engineering
Replies
6
Views
1K
  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
Replies
4
Views
4K
  • Programming and Computer Science
Replies
2
Views
1K
Back
Top