Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Same Code...different platforms

Intel_C_Intel
Employee
957 Views
Dear friends,
I'm working on a Fortran90 code under Windows platform and now I'm trying to use the same code under Linux SUSE 9.0 with intel fortran compiler 8.0.
There is a crash in a routine that is rather simple and smoothly under Windows.
Before putting the code, I just want to remember the Makefile options
under Linux
1) code compliation
ifc -cm -w5 -autodouble -quiet -03 -xw -tpp6 -align
2) Linking
-lguide -lpthread -lg2c -Vaxlib
I'm not a big expert in makefiles so I'm using some templates developed
for different projects. I just added the -lg2c option in order to create the
executable.
Here is the function. The bold instruction give a crash.
If I create a character variable ( e.g. tmpChar) and write
tmpChar = adjustl(Sym) there is no crash.
So I see a crash everytime I try to write the Sym variable put in the
declaration.
Thanks for your kind help!
Salvatore
integer function mapel(Sym)

character (len = *) Sym
character c1, c2
integer i

if (len(Sym) == 0) return

Sym = adjustl(Sym)
c1 = Sym(1:1)
Sym(1:1) = ToUpper (c1)
if (len(Sym) > 1 ) then
c2 = Sym(2:2)
Sym(2:2) = ToLower (c2)
end if
do i = 1, NELE
if (PeriodicTable(i) == Sym) mapel = i
end do

return
end function mapel
0 Kudos
4 Replies
TimP
Honored Contributor III
957 Views

In order to narrow down the problem, I suggest that you remove certain options, unless you know they are required for your problem. If you didn't use equivalent options on Windows, chances are they don't belong in your linux build.

-tpp6 may be inconsistent with -xW

I don't know what -w5 would do.

-lg2c could be incompatible with ifc, since g77 and ifc have incompatible library calls.

Unless you have specifically invoked threading which requires them, or are calling some package which is documented to require them, you shouldn't need -lpthread -lguide.

Also, many bug fixes have come in, as recently as last weekend, so you should keep your compiler installation up to date. When you don't say how old yours is, that raises questions.

0 Kudos
Intel_C_Intel
Employee
957 Views
Dear tcprince,
thanks for your kind answer the helped me in solving the problem.

1) In the previuos e-mail i wrote w5 but that was w95

2) As you told -xw was incompatible with -lpp6

3) Under your suggestion I cancelled the -lguide and -lpthread likn options.

4) I can't cancel -lg2c because of the following linking error:
/usr/lib/liblapack.so: undefined reference to 'e_wsfe'

/usr/lib/liblapack.so: undefined reference to 'z_abs'

and so on....

Thanks again!

Salvatore
0 Kudos
TimP
Honored Contributor III
957 Views
It's difficult to use an lapack library built with g77 with Intel Fortran. The usual alternatives are to link against the Intel MKL performance library, or to use the Intel compiler to build the lapack functions you need from public source code.This would avoid the conflictingreferences to libg2c functions.
0 Kudos
Intel_C_Intel
Employee
957 Views
Yes,
probably the best thing is to compile the LAPACK source code with the Intel compiler (if I succeed in writing a correct makefile!

Thanks again!

Salvatore
0 Kudos
Reply