Long time ago, I had this kind of error, but this time, I can not understand the reason.
Compile any fortran code and run executable file gives error: Segmentation fault (core dumped)
I assume something is wrong with my environment vars or ...
Any suggestion would be helpful.
Intel fortran compiler Version 8
Even this code gives above error.
First of all, in your program the value of a is never set, so what comes out is processor (compiler-) dependent, but in general it should not segfault. With intel Fortran Compiler Version 8, you really mean Version 8, or Version 18? Because Version 8 is ten years old! In any case what is your OS, and exact compiler version?
Thanks for a comment. Yes, compiler the version 8.
I am using Centos 7.
Some more info: We were using this compiler for long time.
Last week, my workstation was upgraded to Centos 7 (from 5). Then, our IT guy built
intel fortran compiler from source (they have only this old version, was obtained when it was free for non-commercial use).
When I compile and run the code above, it prints '0', that is expected.
When you didn't assign, depending from your OS, compiler, ... very often it automatically will be assigned to zero.
My problem is why the newly built compiler compiles the code, no warnings or errors, but when I run I get "seg.. core dumped".
Could it be related to building of compiler from the source or any non-proper system upgrade,...
Again, the output '0' is quite likely but not necessarily expected. Does a "Hello, world!" program work?
program main print *, "Hello, world!" end program main
What happens if you run your code in a debugger? What does the backtrace say? i.e. running ifort with the -traceback option?
CentOS 5 was a 32bit OS, (for which CentOS 7.1+ is again available). Actually I am puzzled by the fact that you say that you built the Intel compiler from source as I am not aware that the source for the Intel Compiler is available. In any case this is most likely an incompatibility with modern system libraries like (g)libc or libstdc++ etc.
No, same "Segmentation fault (core dumped)" error.
That was words of out IT guy. Usually we don't have root passwords, and very far from sys administration.
Centos 5 was 64 bit.
Hello world compiled in other centos-5 machine (and executable file copied to my centos-7 machine) works fine.
You are right, most likely library dependencies or something to do to my new OS.