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

Compilation Aborted (code 1)

sivatt
初学者
8,837 次查看
Hi,
I'm new to Fortran. I kept getting error "Compilation Aborted (code 1)". My code is as follows. Can anyone give me some suggestions on where I did it wrong? Thanks a lot!
Siva
program l1l2
implicit none
integer, parameter :: n = 10, p = 20, q = 4, s = 15, iter = 10
real, dimension(:,:), allocatable :: estb
real :: x(n, p), y(n, s), xx(n*p), yy(n*s)
call rand_gen(xx)
x = reshape(xx, (/n, p/))
call rand_gen(yy)
y = reshape(yy, (/n, s/))
estb = group_lasso(x, y, q, iter)
contains
function group_lasso(x, y, q, iter) result(b)
include 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'
use imsl_libraries
use rand_gen_int
implicit none
real, intent(in), dimension(:,:) :: x, y
integer, intent(in) :: iter, q
integer :: n, p, s, i, j
real, dimension(:,:), allocatable :: u, v, ystar, bstar, b
real, allocatable :: cross(:), tmp(:), d(:)
real :: lambda
n = size(x, 1)
p = size(x, 2)
s = size(y, 2)
bstar = 0.0
call lsvrr(y, ipath = 11, s = d, u = u, v = v)
ystar = matmul(u(:, 1:q), diag(d(1:q)))
do i = 1, iter
do j = 1, p
cross = matmul(x(:, j), ystar - matmul(x(:, (/ 1:(j-1), (j+1):p /)), bstar((/ 1:(j-1), (j+1):p /), :)))
tmp(:) = max(0.0, 1-lambda/sqrt(sum(bstar(j, :)**2)))
bstar(j, :) = tmp*cross
end do
end do
b = matmul(bstar, transpose(v(:, 1:q)))
end function
end program
0 项奖励
1 解答
Steven_L_Intel1
8,837 次查看
Add that path to the list for executable files. I have seen some customers report similar problems but I don't know what causes it.

在原帖中查看解决方案

0 项奖励
10 回复数
Steven_L_Intel1
8,837 次查看
I don't get any error when compiling this source with the current compiler (12.0.4), but you may be using options I am not. Are you building this from Visual Studio? If you see no other errors, open the build log (buildlog.htm in your Debug or Release folder) and see if it says something like "Internal Compiler Error".

Please tell us the exact compiler version you are using and which compiler options/switches you use to compile. If you are using Visual Studio, attach the buildlog.htm to a reply here.

One curious thing I noticed while testing this - the lines:

include 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'

have no effect where they are. This surprises me. Move them to after the PROGRAM statement and they will work there. This should have no effect on the error.
0 项奖励
sivatt
初学者
8,837 次查看
Thanks a lot Steve for your quick response. Yes in the log it says:
Compiling with Intel Visual Fortran 11.1.072 [Intel 64]...
ifort /nologo /debug:full /Od /gen-interfaces /warn:interfaces /module:"x64\Debug\" /object:"x64\Debug\" /traceback /check:bounds /libs:static /threads /dbglibs /c /Qvc9 /Qlocation,link,"d:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64" "D:\Fortran\Projects\MEG Inverse\L1L2\Source1.f90"
fortcom: Fatal: There has been an internal compiler error (C0000094).
compilation aborted for D:\Fortran\Projects\MEG Inverse\L1L2\Source1.f90 (code 1)
L1L2 - 1 error(s), 0 warning(s)
I'm using version 11.1.072 with 64-bit compiler. I have moved lines
include 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'
upto the program statement.

Thanks once again!
0 项奖励
Steven_L_Intel1
8,838 次查看
Thanks. I can reproduce the problem in 11.1, but it is fixed in 12.0. Unfortunately, we don't yet have version 12 with IMSL, but we should soon. I will see if I can find a workaround for you.

Also, move the line:

USE RAND_GEN_INT

to the main program (just before IMPLICIT NONE) as you call RAND_GEN from there and not from the subroutine.
0 项奖励
sivatt
初学者
8,838 次查看
Thanks a lot Steve!
0 项奖励
Steven_L_Intel1
8,838 次查看
Ok, here's a workaround for the compiler bug.

Replace:

use imsl_libraries

with:

use lsvrr_int
use diag_int

This builds. However, when run it gets errors from IMSL which, I think, are because you have not allocated U or V.

[plain]*** TERMINAL ERROR 3 from L2VRR.  The leading dimension of U must be greater
***          than zero.  LDU = 0 is given.
    Here is a traceback of subprogram calls in reverse order:
    Routine name                    Error type  Error code
    ------------                    ----------  ----------
    L2VRR                                5           3    (Called internally)
    LSVRR                                0           0
    USER                                 0           0

*** TERMINAL ERROR 4 from L2VRR.  The leading dimension of V must be greater
***          than zero.  LDV = 0 is given.
    Here is a traceback of subprogram calls in reverse order:
    Routine name                    Error type  Error code
    ------------                    ----------  ----------
    L2VRR                                5           4    (Called internally)
    LSVRR                                0           0
    USER                                 0           0[/plain]


0 项奖励
sivatt
初学者
8,838 次查看
Thanks a lot Steve. Now there raises another problem. "rc.exe not found". I searched previous posts and I made sure the rc.exe file is in folderC:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64
And in tools-options-intel visual fortran-compilers-executables I have:
$(IFortInstallDir)bin\Intel64
$(CommonProgramFiles)\Intel\Shared Files\Ia32\Bin
$(VSInstallDir)Common7\ide
$(VCInstallDir)bin\amd64
$(VCInstallDir)bin
$(VSInstallDir)Common7\Tools
$(VSInstallDir)Common7\Tools\bin
$(FrameworkDir)$(FrameworkVersion)
$(WindowsSdkDir)bin
$(PATH)
Any more suggestions?
Thanks
0 项奖励
Steven_L_Intel1
8,838 次查看
The folder you found rc.exe in is for 64-bit builds only. rc.exe should also be in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin
0 项奖励
sivatt
初学者
8,838 次查看
Yes. I have rc.exe in that folder too.
0 项奖励
Steven_L_Intel1
8,838 次查看
Add that path to the list for executable files. I have seen some customers report similar problems but I don't know what causes it.
0 项奖励
sivatt
初学者
8,838 次查看
Thanks a lot Steve. The problem is solved!
Siva
0 项奖励
回复