-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation fails on Ubuntu #12
Comments
I tried to compile with Intel's ifort compiler, and the code compiles correctly. Seems like, the compilation error is only in gfortran, possibly due to some missing Fortran 2018 feature. Since gfortran is the most widely used Fortran compiler, could it be supported? Here is the log, Log
|
I fixed the issue by modifying the code. Kindly add this git diff patch to fmetis, if it seems correct to you. The code compiles correctly now, but there are some warnings regarding uninitialized values. In future, they can potentially cause bugs. git diffdiff --git a/src/lib/metis_oo_interface.f90 b/src/lib/metis_oo_interface.f90
index d81d7e9..65d7e5e 100644
--- a/src/lib/metis_oo_interface.f90
+++ b/src/lib/metis_oo_interface.f90
@@ -119,38 +119,38 @@ contains
select case(fmt)
- case(b'000')
+ case(int(b'000'))
do i = 1, nvxts
! v1 v2 v3 ...
write(unit,fstring) (adjncy(j),j=xadj(i),xadj(i+1)-1)
end do
- case(b'001') ! edge weights
+ case(int(b'001')) ! edge weights
do i = 1, nvxts
! v1 e1 v2 e2 ...
write(unit,fstring) (adjncy(j),adjwgt(j),j=xadj(i),xadj(i+1)-1)
end do
- case(b'010') ! vertex weights
+ case(int(b'010')) ! vertex weights
do i = 1, nvxts
! w1 w2 ... wncon v1 v2 v3 ...
write(unit,fstring) vwgt((i-1)*ncon+1:(i-1)*ncon+ncon),(adjncy(j),j=xadj(i),xadj(i+1)-1)
end do
- case(b'100') ! vertex sizes
+ case(int(b'100')) ! vertex sizes
do i = 1, nvxts
write(unit,fstring) vsize(i), (adjncy(j),j=xadj(i),xadj(i+1)-1)
end do
- case(b'011')
+ case(int(b'011'))
do i = 1, nvxts
write(unit,fstring) vwgt((i-1)*ncon+1:(i-1)*ncon+ncon), (adjncy(j),adjwgt(j),j=xadj(i),xadj(i+1)-1)
end do
- case(b'110')
+ case(int(b'110'))
do i = 1, nvxts
write(unit,fstring) vsize(i), vwgt((i-1)*ncon+1:(i-1)*ncon+ncon),(adjncy(j),j=xadj(i),xadj(i+1)-1)
end do
- case(b'101')
+ case(int(b'101'))
do i = 1, nvxts
write(unit,fstring) vsize(i), (adjncy(j),adjwgt(j),j=xadj(i),xadj(i+1)-1)
end do
- case(b'111')
+ case(int(b'111'))
do i = 1, nvxts
write(unit,fstring) vsize(i), vwgt((i-1)*ncon+1:(i-1)*ncon+ncon), (adjncy(j),adjwgt(j),j=xadj(i),xadj(i+1)-1)
end do
@@ -270,49 +270,49 @@ contains
xadj(1) = 0
select case(fmt)
- case (b'000')
+ case(int(b'000'))
do i = 1, nvtxs
rowcol = count_columns(unit,stat=ios)
xadj(i+1) = xadj(i) + rowcol
read(unit,*) adjncy(xadj(i)+1:xadj(i+1))
end do
- case(b'001')
+ case(int(b'001'))
do i = 1, nvtxs
rowcol = count_columns(unit,stat=ios)/2
xadj(i+1) = xadj(i) + rowcol
read(unit,*) (adjncy(j),adjwgt(j),j=xadj(i)+1,xadj(i+1))
end do
- case(b'010')
+ case(int(b'010'))
do i = 1, nvtxs
rowcol = count_columns(unit,stat=ios) - ncon
xadj(i+1) = xadj(i) + rowcol
read(unit,*) vwgt((i-1)*ncon+1:(i-1)*ncon+ncon), adjncy(xadj(i)+1:xadj(i+1))
end do
- case(b'100')
+ case(int(b'100'))
do i = 1, nvtxs
rowcol = count_columns(unit,stat=ios) - 1
xadj(i+1) = xadj(i) + rowcol
read(unit,*) vsize(i), adjncy(xadj(i)+1:xadj(i+1))
end do
- case(b'011')
+ case(int(b'011'))
do i = 1, nvtxs
rowcol = (count_columns(unit,stat=ios) - ncon)/2
xadj(i+1) = xadj(i) + rowcol
read(unit,*) vwgt((i-1)*ncon+1:(i-1)*ncon+ncon), (adjncy(j),adjwgt(j),j=xadj(i)+1,xadj(i+1))
end do
- case(b'110')
+ case(int(b'110'))
do i = 1, nvtxs
rowcol = count_columns(unit,stat=ios) - 1 - ncon
xadj(i+1) = xadj(i) + rowcol
read(unit,*) vsize(i), vwgt((i-1)*ncon+1:(i-1)*ncon+ncon), adjncy(xadj(i)+1:xadj(i+1))
end do
- case(b'101')
+ case(int(b'101'))
do i = 1, nvtxs
rowcol = (count_columns(unit,stat=ios) - 1)/2
xadj(i+1) = xadj(i) + rowcol
read(unit,*) vsize(i), (adjncy(j),adjwgt(j),j=xadj(i)+1,xadj(i+1))
end do
- case(b'111')
+ case(int(b'111'))
do i = 1, nvtxs
rowcol = (count_columns(unit,stat=ios) - 1 - ncon)/2
xadj(i+1) = xadj(i) + rowcol Successful Compilation Log
|
See issue #2. Strictly speaking, you can just ditch the |
Those are false positives that have to do with allocation on assignment (a F2018 feature). You can turn the warnings off with |
I noticed that the issue has been fixed with your recent commits. Thanks! I will close this issue then, since it's resolved. |
Hello,
I'm trying to compile fmetis using gfortran 13.2.0, but the code doesn't compile for some reason.
The first compilation error happens in
metis_oo_interface.f90
, for expressioncase(b'000')
on line 122.Here is the error log ...
Error Log (after running cmake and make)
The text was updated successfully, but these errors were encountered: