- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HPC->pwd
/home/micro/compphys/y/mod
HPC->cat mod.f90
module datad
real:: x
endmodule datad
HPC->ifort -c mod.f90
HPC->ls
datad.mod mod.f90 mod.o
HPC->cd ../
HPC->ls
main.f90 mod
HPC->cat main.f90
PROGRAM MAIN
use datad
implicit none
x=1.0
print*,x
end PROGRAM MAIN
HPC->ifort main.f90 -I/home/micro/compphys/y/mod
/tmp/ifortCCs17A.o(.text+0x52): In function `MAIN__':
: undefined reference to `datad_mp_x_'
HPC->ifort -V
Intel Fortran Itanium Compiler for Itanium-based applications
Version 9.0 Build 20050624 Package ID: l_fc_c_9.0.024
But the PGI fortran compiler can do.
Can you help me? Thanks.
/home/micro/compphys/y/mod
HPC->cat mod.f90
module datad
real:: x
endmodule datad
HPC->ifort -c mod.f90
HPC->ls
datad.mod mod.f90 mod.o
HPC->cd ../
HPC->ls
main.f90 mod
HPC->cat main.f90
PROGRAM MAIN
use datad
implicit none
x=1.0
print*,x
end PROGRAM MAIN
HPC->ifort main.f90 -I/home/micro/compphys/y/mod
/tmp/ifortCCs17A.o(.text+0x52): In function `MAIN__':
: undefined reference to `datad_mp_x_'
HPC->ifort -V
Intel Fortran Itanium Compiler for Itanium-based applications
Version 9.0 Build 20050624 Package ID: l_fc_c_9.0.024
But the PGI fortran compiler can do.
Can you help me? Thanks.
Message Edited by flyglede on 11-30-2005 03:52 PM
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to include on the command that does the link the .o file(s) from the separate module compilations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, but I don't see such limitation from intel fortran online help:
---------------------------------------------------------------------------------------------------
1. From: /opt/intel/fc/9.0/doc/main_for/mergedProjects/copts_for/fortran_options/option_i_ucase_f.htm
I: Specifies a directory to add to the include path.
Description
This option specifies a directory to add to the include path, which is searched for module files referenced in USE statements and include files referenced in INCLUDE statements.
---------------------------------------------------------------------------------------------------
2. From: /opt/intel/fc/9.0/doc/main_for/mergedProjects/bldaps_for/fced_mod.htm
---------------------------------------------------------------------------------------------------
Working with Multi-Directory Module Files
For an example of managing modules when the .mod files could be produced in different directories, assume that the program mod_def.f90 resides in directory /usr/yourdir/test/t, and this program contains a module defined as follows:
file: mod_def.f90
module definedmod
.
.
.
end module
The compiler command:
ifort -c mod_def.f90
produces two files: mod_def.o and definedmod.mod in directory /usr/yourdir/test/t.
If you need to use the above .mod file in another directory, for example, in directory /usr/yourdir/test/t2, where the program usemod uses the definedmod.mod file, do the following:
file: use_mod_def.f90
program usemod
use definedmod
.
.
.
end program
To compile the above program, use this command:
ifort -c use_mod_def.f90 -I/usr/yourdir/test/t
where the -Idir option provides the compiler with the path to search and locate the definedmod.mod file.
---------------------------------------------------------------------------------------------------
But if I use the codes from
/opt/intel/fc/9.0/doc/main_for/mergedProjects/bldaps_for/ug1l_mod_prog.htm
it works! The difference is no variables out of interface.
---------------------------------------------------------------------------------------------------
HPC->pwd
/home/micro/compphys/in
HPC->ls
array_calc.f90
HPC->ifort -c array_calc.f90
HPC->ls
array_calc.f90 array_calc.o array_calculator.mod
HPC->cd ..
HPC->ls
calc_aver.f90 in main.f90
HPC->ifort main.f90 calc_aver.f90 -I/home/micro/compphys/in/
HPC->ls
a.out calc_aver.f90 in main.f90
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
1. From: /opt/intel/fc/9.0/doc/main_for/mergedProjects/copts_for/fortran_options/option_i_ucase_f.htm
I: Specifies a directory to add to the include path.
Description
This option specifies a directory to add to the include path, which is searched for module files referenced in USE statements and include files referenced in INCLUDE statements.
---------------------------------------------------------------------------------------------------
2. From: /opt/intel/fc/9.0/doc/main_for/mergedProjects/bldaps_for/fced_mod.htm
---------------------------------------------------------------------------------------------------
Working with Multi-Directory Module Files
For an example of managing modules when the .mod files could be produced in different directories, assume that the program mod_def.f90 resides in directory /usr/yourdir/test/t, and this program contains a module defined as follows:
file: mod_def.f90
module definedmod
.
.
.
end module
The compiler command:
ifort -c mod_def.f90
produces two files: mod_def.o and definedmod.mod in directory /usr/yourdir/test/t.
If you need to use the above .mod file in another directory, for example, in directory /usr/yourdir/test/t2, where the program usemod uses the definedmod.mod file, do the following:
file: use_mod_def.f90
program usemod
use definedmod
.
.
.
end program
To compile the above program, use this command:
ifort -c use_mod_def.f90 -I/usr/yourdir/test/t
where the -Idir option provides the compiler with the path to search and locate the definedmod.mod file.
---------------------------------------------------------------------------------------------------
But if I use the codes from
/opt/intel/fc/9.0/doc/main_for/mergedProjects/bldaps_for/ug1l_mod_prog.htm
it works! The difference is no variables out of interface.
---------------------------------------------------------------------------------------------------
HPC->pwd
/home/micro/compphys/in
HPC->ls
array_calc.f90
HPC->ifort -c array_calc.f90
HPC->ls
array_calc.f90 array_calc.o array_calculator.mod
HPC->cd ..
HPC->ls
calc_aver.f90 in main.f90
HPC->ifort main.f90 calc_aver.f90 -I/home/micro/compphys/in/
HPC->ls
a.out calc_aver.f90 in main.f90
---------------------------------------------------------------------------------------------------
Message Edited by flyglede on 12-06-2005 11:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much!
But I don't see such limitation from intel fortran online help:
---------------------------------------------------------------------------------------------------
1. From: /opt/intel/fc/9.0/doc/main_for/mergedProjects/copts_for/fortran_options/option_i_ucase_f.htm
I: Specifies a directory to add to the include path.
Description
This option specifies a directory to add to the include path, which is searched for module files referenced in USE statements and include files referenced in INCLUDE statements.
---------------------------------------------------------------------------------------------------
2. From: /opt/intel/fc/9.0/doc/main_for/mergedProjects/bldaps_for/fced_mod.htm
---------------------------------------------------------------------------------------------------
Working with Multi-Directory Module Files
For an example of managing modules when the .mod files could be produced in different directories, assume that the program mod_def.f90 resides in directory /usr/yourdir/test/t, and this program contains a module defined as follows:
file: mod_def.f90
module definedmod
.
.
.
end module
The compiler command:
ifort -c mod_def.f90
produces two files: mod_def.o and definedmod.mod in directory /usr/yourdir/test/t.
If you need to use the above .mod file in another directory, for example, in directory /usr/yourdir/test/t2, where the program usemod uses the definedmod.mod file, do the following:
file: use_mod_def.f90
program usemod
use definedmod
.
.
.
end program
To compile the above program, use this command:
ifort -c use_mod_def.f90 -I/usr/yourdir/test/t
where the -Idir option provides the compiler with the path to search and locate the definedmod.mod file.
---------------------------------------------------------------------------------------------------
But if I use the codes from /opt/intel/fc/9.0/doc/main_for/mergedProjects/bldaps_for/ug1l_mod_prog.htm
it works! The difference is no variables out of interface.
---------------------------------------------------------------------------------------------------
HPC->pwd
/home/micro/compphys/in
HPC->ls
array_calc.f90
HPC->ifort -c array_calc.f90
HPC->ls
array_calc.f90 array_calc.o array_calculator.mod
HPC->cd ..
HPC->ls
calc_aver.f90 in main.f90
HPC->ifort main.f90 calc_aver.f90 -I/home/micro/compphys/in/
HPC->ls
a.out calc_aver.f90 in main.f90
But I don't see such limitation from intel fortran online help:
---------------------------------------------------------------------------------------------------
1. From: /opt/intel/fc/9.0/doc/main_for/mergedProjects/copts_for/fortran_options/option_i_ucase_f.htm
I: Specifies a directory to add to the include path.
Description
This option specifies a directory to add to the include path, which is searched for module files referenced in USE statements and include files referenced in INCLUDE statements.
---------------------------------------------------------------------------------------------------
2. From: /opt/intel/fc/9.0/doc/main_for/mergedProjects/bldaps_for/fced_mod.htm
---------------------------------------------------------------------------------------------------
Working with Multi-Directory Module Files
For an example of managing modules when the .mod files could be produced in different directories, assume that the program mod_def.f90 resides in directory /usr/yourdir/test/t, and this program contains a module defined as follows:
file: mod_def.f90
module definedmod
.
.
.
end module
The compiler command:
ifort -c mod_def.f90
produces two files: mod_def.o and definedmod.mod in directory /usr/yourdir/test/t.
If you need to use the above .mod file in another directory, for example, in directory /usr/yourdir/test/t2, where the program usemod uses the definedmod.mod file, do the following:
file: use_mod_def.f90
program usemod
use definedmod
.
.
.
end program
To compile the above program, use this command:
ifort -c use_mod_def.f90 -I/usr/yourdir/test/t
where the -Idir option provides the compiler with the path to search and locate the definedmod.mod file.
---------------------------------------------------------------------------------------------------
But if I use the codes from /opt/intel/fc/9.0/doc/main_for/mergedProjects/bldaps_for/ug1l_mod_prog.htm
it works! The difference is no variables out of interface.
---------------------------------------------------------------------------------------------------
HPC->pwd
/home/micro/compphys/in
HPC->ls
array_calc.f90
HPC->ifort -c array_calc.f90
HPC->ls
array_calc.f90 array_calc.o array_calculator.mod
HPC->cd ..
HPC->ls
calc_aver.f90 in main.f90
HPC->ifort main.f90 calc_aver.f90 -I/home/micro/compphys/in/
HPC->ls
a.out calc_aver.f90 in main.f90
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