- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
10 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'
upto the program statement.
Thanks once again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot Steve!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes. I have rc.exe in that folder too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot Steve. The problem is solved!
Siva
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page