Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

fortran code compilation problem

cylab123
Beginner
426 Views
Hi !
I am using 'Intel Fortran compiler Professional Edition 11.0 for Linux' on my Fedora6 linux machine. I am trying to compile one Fortran code, but doing so getting the message as -
'ld: cannot find -lgcc_s '
I tried to locate this file into my system using the command -
find /usr/lib -name *libgcc_s*

and it shows that the file is there as -
/usr/lib/gcc/i386-redhat-linux/4.1.1/libgcc_s.so

Then I looked for the gcc installation in my system using the command -
g++ -print-search-dirs

and it gives the following OUTPUT on the screen -
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
install: /usr/local//lib/gcc-lib/i686-pc-linux-gnu/2.8.1/
programs: /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/:/usr/local/lib/gcc-lib/i686-pc-linux-gnu/:/usr/lib/gcc/i686-pc-linux-gnu/2.8.1/:/usr/lib/gcc/i686-pc-linux-gnu/:/usr/local/i686-pc-linux-gnu/bin/i686-pc-linux-gnu/2.8.1/:/usr/local/i686-pc-linux-gnu/bin/
libraries: /opt/intel/Compiler/11.0/081/mkl/lib/32/i686-pc-linux-gnu/2.8.1/:/opt/intel/Compiler/11.0/081/mkl/lib/32/:/opt/intel/Compiler/11.0/081/mkl/lib/32/i686-pc-linux-gnu/2.8.1/:/opt/intel/Compiler/11.0/081/mkl/lib/32/:/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/:/usr/lib/gcc/i686-pc-linux-gnu/2.8.1/:/usr/local/i686-pc-linux-gnu/lib/i686-pc-linux-gnu/2.8.1/:/usr/local/i686-pc-linux-gnu/lib/:/usr/local/lib/i686-pc-linux-gnu/2.8.1/:/usr/local/lib/:/lib/i686-pc-linux-gnu/2.8.1/:/lib/:/usr/lib/i686-pc-linux-gnu/2.8.1/:/usr/lib/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

While the comilation of the code with the following command -
ifort -v -vec-report0 gkinb.for

gives the following output -
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Version 11.0
/opt/intel/Compiler/11.0/081/bin/ia32/fortcom -D__INTEL_COMPILER=1100 -D__ELF__ -D__INTEL_COMPILER_BUILD_DATE=20090131 -D__unix__ -D__unix -D__linux__ -D__linux -D__gnu_linux__ -Dunix -Dlinux -D__i386 -D__i386__ -Di386 -mGLOB_pack_sort_init_list -I. -I/opt/intel/Compiler/11.0/081/mkl/include -I/opt/intel/Compiler/11.0/081/mkl/include -I/opt/intel/Compiler/11.0/081/include/ia32 -I/opt/intel/Compiler/11.0/081/include -I/usr/local/include -I/usr/include -I/usr/local//lib/gcc-lib/i686-pc-linux-gnu/2.8.1/include -O2 -mP1OPT_version=1100 -mGLOB_diag_file=/tmp/ifort9uPZ1T.diag -mGLOB_source_language=GLOB_SOURCE_LANGUAGE_F90 -mGLOB_tune_for_fort -mGLOB_use_fort_dope_vector -mP2OPT_static_promotion -mP1OPT_print_version=FALSE -mP3OPT_use_mspp_call_convention -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE "-mGLOB_options_string=-v -vec-report0" -mGLOB_cxx_limited_range=FALSE -mP2OPT_eh_nirvana -mGLOB_as_output_backup_file_name=/tmp/ifortTZsU5sas_.s -mGLOB_lp64=FALSE -mIPOPT_activate -mIPOPT_lite -mGLOB_machine_model=GLOB_MACHINE_MODEL_PW -mGLOB_extended_instructions=0x8 -mP2OPT_subs_out_of_bound=FALSE -mGLOB_ansi_alias -mP2OPT_hlo_level=2 -mP2OPT_hlo -mPAROPT_par_report=1 -mP2OPT_vec_verbose=0 -mIPOPT_obj_output_file_name=/tmp/ifort9uPZ1T.o "-mGLOB_linker_version=2.17.50.0.6-5.fc6 20061020" -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_obj_output_file=/tmp/ifort9uPZ1T.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_FORTRAN -mP1OPT_source_file_name=gkinb.for gkinb.for
gkinb.for(211): remark #7000: Two-digit year return value may cause problems with the year 2000. Use DATE_AND_TIME instead [DATE]
call date(DAY)
-------------^
ld /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/crtbegin.o --eh-frame-hdr -dynamic-linker /lib/ld-linux.so.2 -m elf_i386 -o a.out /opt/intel/Compiler/11.0/081/lib/ia32/for_main.o /tmp/ifort9uPZ1T.o -L/opt/intel/Compiler/11.0/081/mkl/lib/32 -L/opt/intel/Compiler/11.0/081/mkl/lib/32 -L/opt/intel/Compiler/11.0/081/lib/ia32 -L/opt/intel/Compiler/11.0/081/mkl/lib/32/ -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/ -L/usr/local/lib/ -L/lib/ -L/usr/lib -Bstatic -lifport -lifcore -limf -lsvml -Bdynamic -lm -Bstatic -lipgo -lirc -Bdynamic -lc -lgcc_s -lgcc -Bstatic -lirc_s -Bdynamic -ldl -lc /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/crtend.o /usr/lib/crtn.o
ld: cannot find -lgcc_s
rm /tmp/ifortuAxRu3libgcc

rm /tmp/ifort1xvDZkgnudirs

rm /tmp/ifortypqlvCdashv

rm /tmp/ifortO8GGybgas

rm /tmp/ifortTZsU5sas_.s

rm /tmp/ifortOtR9CKldashv

rm /tmp/ifortJbDhb2arg

rm /tmp/ifortwxoH2xgnudirs

rm /tmp/ifort9uPZ1T.o

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

And the program did not compile.

As can be seen from the above discussion that the missing gcc file reported by the compilation is there in the system at -
/usr/lib/gcc/i386-redhat-linux/4.1.1/libgcc_s.so

I don't know whay the ifort command is unable to detect this .
Any help to fix it ????
Thanks in advance.
cylab123

0 Kudos
1 Reply
TimP
Honored Contributor III
426 Views
If you wish ifort to use the gcc4.1.1 libraries, you must set up PATH so that g++ 4.1.1 is active. ifort isn't likely to work when a g++ older than the supported range is active. For example, if you want /usr/bin/g++, but your PATH gives priority to /usr/local/bin/g++, you would set
PATH=/usr/bin:$PATH
in addition to setting the ifort PATH in accordance with the ifortvars script.
0 Kudos
Reply