Skip to content
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

flang bug about cbind #1423

Closed
renren7111 opened this issue Sep 26, 2023 · 2 comments
Closed

flang bug about cbind #1423

renren7111 opened this issue Sep 26, 2023 · 2 comments
Assignees

Comments

@renren7111
Copy link

there is an error when compiling XIOS (lib of NEMO ocean model):
##############################
mpifort -o iduration.o -I/model/LLVM/NEMO/XIOS/inc -Mbyteswapio -Mfreeform -D__NONE__ -O3 -I /netcdf/include -I/model/LLVM/NEMO/XIOS/extern/boost -I/model/LLVM/NEMO/XIOS/extern/blitz -c /model/LLVM/NEMO/XIOS/ppsrc/xios/interface/fortran/iduration.f90
/tmp/iduration-cc5294.ll:1399:63: error: expected '('
declare void @cxios_duration_neg(%struct.xios_duration.5* sret, %struct.xios_duration.5* noalias byval (%struct.xios_duration.5 ))
^
1 error generated.
fcm_internal compile failed (256)
gmake: *** [iduration.o] Error 1
gmake -f /model/LLVM/NEMO/XIOS/Makefile -j 1 -s all failed (2) at /model/LLVM/NEMO/XIOS/tools/FCM_NEW/bin/../lib/FCM1/Build.pm line 611.
->Make: 2 seconds
->TOTAL: 6 seconds
Build failed on Tue Sep 26 09:14:51 2023.
##############################

iduration.f90:
FUNCTION xios_duration_neg(dur) RESULT(res)
USE DURATION_INTERFACE, only : xios_duration
IMPLICIT NONE
TYPE(xios_duration), INTENT(IN) :: dur
TYPE(xios_duration) :: res
res = cxios_duration_neg(dur)
END FUNCTION xios_duration_neg

duration_interface.f90:
TYPE(xios_duration) FUNCTION cxios_duration_neg(dur) BIND(C)
USE ISO_C_BINDING
IMPORT :: xios_duration
TYPE(xios_duration), VALUE :: dur
END FUNCTION cxios_duration_neg

icduration.cpp:
cxios_duration cxios_duration_neg(cxios_duration dur_c)
TRY
{
xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep );
xios::CDuration res = -dur;
return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep };
}
CATCH_DUMP_STACK

@bryanpkc bryanpkc self-assigned this Sep 28, 2023
@bryanpkc
Copy link
Collaborator

@renren7111 This should have been fixed by #1420. Can you rebuild the compiler from the master branch and try again?

@renren7111
Copy link
Author

Thanks,it has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants