Community
cancel
Showing results for 
Search instead for 
Did you mean: 
vfuka
Beginner
94 Views

Compiler bug with derived types imported from a module with derived constructors

This code


module m1
type t
integer i
end type

interface t
procedure t_init
end interface

contains

function t_init() result(res)
type(t) :: res
res%i = 0
end function

end module m1

 

module m2

use m1

private

public t
public t_init
end module m2


subroutine sub(fname)
use m2

type(t) :: obj

end subroutine sub

 

 

```

> ifort initial.f90 -c -v ifort version 2021.1.2 /opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/../../bin/intel64/fortcom -D__INTEL_COMPILER=2021 -D__INTEL_COMPILER_UPDATE=1 -D__unix__ -D__unix -D__linux__ -D__linux -D__gnu_linux__ -Dunix -Dlinux -D__ELF__ -D__x86_64 -D__x86_64__ -D__amd64 -D__amd64__ -D__INTEL_COMPILER_BUILD_DATE=20201208 -D__INTEL_OFFLOAD -D__MMX__ -D__SSE__ -D__SSE_MATH__ -D__SSE2__ -D__SSE2_MATH__ -D__pentium4 -D__pentium4__ -D__tune_pentium4__ -I. -I/opt/intel/oneapi/dnnl/2021.1.1/cpu_dpcpp_gpu_dpcpp/lib -I/opt/intel/oneapi/ccl/2021.1.1/include/cpu_gpu_dpcpp -I/opt/intel/oneapi/mpi/2021.1.1//include -I/opt/intel/oneapi/dev-utilities/2021.1.1/include -I/opt/intel/oneapi/dpcpp-ct/2021.1.1/include -I/opt/intel/oneapi/dal/2021.1.1/include -I/opt/intel/oneapi/ipp/2021.1.1/include -I/opt/intel/oneapi/ippcp/2021.1.1/include -I/opt/intel/oneapi/dpl/2021.1.2/linux/include -I/opt/intel/oneapi/mkl/latest/include -I/opt/intel/oneapi/vpl/2021.1.1/include -I/opt/intel/oneapi/compiler/2021.1.2/linux/include -I/opt/intel/oneapi/tbb/2021.1.1/env/../include -I/usr/lib/hpc/gnu7/openmpi4/fftw3/3.3.8/include -I/opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/../../compiler/include/intel64 -I/opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/../../compiler/include/icc -I/opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/../../compiler/include -I/usr/local/include -I/usr/lib64/gcc/x86_64-suse-linux/7/include -I/usr/lib64/gcc/x86_64-suse-linux/7/include-fixed -I/usr/include/ -I/usr/include -omp_simd -O2 "-reentrancy threaded" -simd -offload_host -mGLOB_em64t=TRUE -mP1OPT_version=2021.1.2-intel64 -mGLOB_diag_file=initial.diag -mGLOB_long_size_64 -mGLOB_routine_pointer_size_64 -mGLOB_source_language=GLOB_SOURCE_LANGUAGE_F90 -mP2OPT_static_promotion -mGLOB_pack_sort_init_list -mP1OPT_print_version=FALSE -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE -mGLOB_gcc_version=750 "-mGLOB_options_string=-c -v" -mGLOB_cxx_limited_range=FALSE -mCG_extend_parms=FALSE -mGLOB_compiler_bin_directory=/opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/../../bin/intel64 -mGLOB_as_output_backup_file_name=/tmp/ifortqK3akDas_.s -mIPOPT_activate -mIPOPT_lite -mGLOB_uarch_tuning=0x0 -mGLOB_product_id_code=0x22006d91 -mCG_bnl_movbe=T -mP3OPT_use_mspp_call_convention -mP2OPT_subs_out_of_bound=FALSE -mP2OPT_disam_type_based_disam=2 -mGLOB_ansi_alias -mPGOPTI_value_profile_use=T -mGLOB_offload_mode=1 -mGLOB_offload_no_openmp=TRUE -mP2OPT_offload_unique_var_string=ifort1698318546flu6hp -mP2OPT_hlo_level=2 -mP2OPT_hlo -mP2OPT_hpo_rtt_control=0 -mIPOPT_args_in_regs=0 -mP2OPT_disam_assume_nonstd_intent_in=FALSE -mGLOB_imf_mapping_library=/opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/../../bin/intel64/libiml_attr.so -mPGOPTI_gen_threadsafe_level=0 -mIPOPT_lto_object_enabled -mIPOPT_lto_object_value=1 -mIPOPT_obj_output_file_name=initial.o -mIPOPT_whole_archive_fixup_file_name=/tmp/ifortwarch6pMA6r -mGLOB_linker_version=2.36.1.20210326 -mGLOB_linker=/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld -mGLOB_driver_tempfile_name=/tmp/iforttempfilezduYwR -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_async_unwind_tables=TRUE -mGLOB_obj_output_file=initial.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_FORTRAN -mP1OPT_source_file_name=initial.f90 -mP1OPT_full_source_file_name=/home/lada/f/testy/intel/initial.f90 -mP2OPT_symtab_type_copy=true initial.f90 #include "..." search starts here: #include <...> search starts here: . /opt/intel/oneapi/dnnl/2021.1.1/cpu_dpcpp_gpu_dpcpp/lib /opt/intel/oneapi/ccl/2021.1.1/include/cpu_gpu_dpcpp /opt/intel/oneapi/mpi/2021.1.1//include /opt/intel/oneapi/dev-utilities/2021.1.1/include /opt/intel/oneapi/dpcpp-ct/2021.1.1/include /opt/intel/oneapi/dal/2021.1.1/include /opt/intel/oneapi/ipp/2021.1.1/include /opt/intel/oneapi/ippcp/2021.1.1/include /opt/intel/oneapi/dpl/2021.1.2/linux/include /opt/intel/oneapi/mkl/latest/include /opt/intel/oneapi/vpl/2021.1.1/include /opt/intel/oneapi/compiler/2021.1.2/linux/include /opt/intel/oneapi/tbb/2021.1.1/env/../include /usr/lib/hpc/gnu7/openmpi4/fftw3/3.3.8/include /opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/../../compiler/include/intel64 /opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/../../compiler/include/icc /opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/../../compiler/include /usr/local/include /usr/lib64/gcc/x86_64-suse-linux/7/include /usr/lib64/gcc/x86_64-suse-linux/7/include-fixed /usr/include/ /usr/include End of search list. initial.f90(36): error #6457: This derived type name has not been declared. [T] type(t) :: obj -------^ compilation aborted for initial.f90 (code 1) ```

0 Kudos
2 Replies
vfuka
Beginner
91 Views

One cannot even enter code markup here? Code is attached. Compile yourself if you cannot decypher the error output.

 

initial.f90(36): error #6457: This derived type name has not been declared.   [T]
 type(t) :: obj
-------^

Steve_Lionel
Black Belt Retired Employee
68 Views

There isn't "code markup", but there is a "paste code" option. It's hidden initially - click the ... in the editor toolbar, then a second row of controls will appear. The </> is the code button. Then choose your language and paste your code in the box.

The error you're getting is triggered by having a generic interface of the same name as the type. This is perfectly fine (used for type constructors), but the compiler is getting confused. It's a bug. Perhaps one of the Intel folk will see this and escalate it.

Reply