problem with compiling a 32bit executable file

problem with compiling a 32bit executable file

Hi,all

I am a beginner on this and I need to compile a f90 file. The executable file is 64 bit by default. Is there any way or any options to compile a 32bit executable file? I am trying to compile in ia32, using "source /opt/intel/Compiler/11.1/059/bin/ifortvars.sh ia32". Then I compile the file "ifort xxx.f90" . Finally, the executable file is still 64 bit. Can anyone help me with that?

Thank you 

13 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Does your Linux version have 32-bit gcc support installed? What you show should work. Are you on a 64-bit system? (I assume you are on Linux and no OS X.)

Please show the output of:

ifort -dryrun xxx.f90

Steve - Intel Developer Support

I am working on a 64-bit system and I am working Linux. The following is the output:

/opt/intel/Compiler/11.1/059/bin/intel64/fortcom  \
    -D__INTEL_COMPILER=1110 \
    -D_MT \
    -D__ELF__ \
    -D__INTEL_COMPILER_BUILD_DATE=20091012 \
    -D__unix__ \
    -D__unix \
    -D__linux__ \
    -D__linux \
    -D__gnu_linux__ \
    -Dunix \
    -Dlinux \
    -D__x86_64 \
    -D__x86_64__ \
    -mGLOB_pack_sort_init_list \
    -I. \
    -I/opt/intel/Compiler/11.1/059/include/intel64 \
    -I/opt/intel/Compiler/11.1/059/mkl/include \
    -I/opt/intel/Compiler/11.1/059/mkl/include \
    -I/opt/intel/Compiler/11.1/059/mkl/include \
    -I/opt/intel/Compiler/11.1/059/include/intel64 \
    -I/opt/intel/Compiler/11.1/059/include \
    -I/usr/local/include \
    -I/usr/include \
    -I/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include \
    -O2 \
    -mP1OPT_version=11.1-intel64 \
    -mGLOB_diag_file=/tmp/ifortVSRMER.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=-dryrun \
    -mGLOB_cxx_limited_range=FALSE \
    -mGLOB_as_output_backup_file_name=/tmp/ifortNCIHb2as_.s \
    -mIPOPT_activate \
    -mIPOPT_lite \
    -mGLOB_machine_model=GLOB_MACHINE_MODEL_EFI2 \
    -mGLOB_extended_instructions=0x8 \
    -mP2OPT_subs_out_of_bound=FALSE \
    -mGLOB_ansi_alias \
    -mIPOPT_args_in_regs=0 \
    -mPGOPTI_value_profile_use=T \
    -mP2OPT_hlo_level=2 \
    -mP2OPT_hlo \
    -mIPOPT_obj_output_file_name=/tmp/ifortVSRMER.o \
    "-mGLOB_linker_version=2.17.50.0.6-20.el5_8.3 20061020" \
    -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS \
    -mGLOB_obj_output_file=/tmp/ifortVSRMER.o \
    -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_FORTRAN \
    -mP1OPT_source_file_name=test00.f90 \
    test00.f90

ld  \
    /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o \
    /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crti.o \
    /usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtbegin.o \
    --eh-frame-hdr \
    -dynamic-linker \
    /lib64/ld-linux-x86-64.so.2 \
    -o \
    a.out \
    /opt/intel/Compiler/11.1/059/lib/intel64/for_main.o \
    /tmp/ifortVSRMER.o \
    -L/opt/intel/Compiler/11.1/059/mkl/lib/32 \
    -L/opt/intel/Compiler/11.1/059/tbb/ia32/cc4.1.0_libc2.4_kernel2.6.16.21/lib \
    -L/opt/intel/Compiler/11.1/059/lib/intel64 \
    -L/opt/intel/Compiler/11.1/059/ipp/em64t/lib \
    -L/opt/intel/Compiler/11.1/059/mkl/lib/em64t \
    -L/opt/intel/Compiler/11.1/059/tbb/intel64/cc4.1.0_libc2.4_kernel2.6.16.21/lib \
    -L/opt/intel/Compiler/11.1/059/lib/intel64 \
    -L/opt/intel/Compiler/11.1/059/ipp/em64t/lib \
    -L/opt/intel/Compiler/11.1/059/mkl/lib/em64t \
    -L/opt/intel/Compiler/11.1/059/tbb/intel64/cc4.1.0_libc2.4_kernel2.6.16.21/lib \
    -L/opt/intel/Compiler/11.1/059/lib/intel64 \
    -L/opt/intel/Compiler/11.1/059/tbb/ia32/cc4.1.0_libc2.4_kernel2.6.16.21/lib \
    -L/opt/intel/Compiler/11.1/059/lib/intel64 \
    -L/opt/intel/Compiler/11.1/059/ipp/em64t/lib \
    -L/opt/intel/Compiler/11.1/059/mkl/lib/em64t \
    -L/opt/intel/Compiler/11.1/059/tbb/intel64/cc4.1.0_libc2.4_kernel2.6.16.21/lib \
    -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 \
    -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64 \
    -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../.. \
    -L/lib64 \
    -L/lib \
    -L/usr/lib64 \
    -L/usr/lib \
    -Bstatic \
    -lifport \
    -lifcore \
    -limf \
    -lsvml \
    -Bdynamic \
    -lm \
    -Bstatic \
    -lipgo \
    -lirc \
    -u \
    __pthread_once \
    -Bdynamic \
    -lpthread \
    -lc \
    -lgcc_s \
    -lgcc \
    -Bstatic \
    -lirc_s \
    -Bdynamic \
    -ldl \
    -lc \
    /usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtend.o \
    /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crtn.o

rm /tmp/ifort9uqp8Glibgcc

rm /tmp/iforteEXroMgnudirs

rm /tmp/ifortUjU8UWgas

rm /tmp/ifortNCIHb2as_.s

rm /tmp/ifortAhohs7ldashv

rm /tmp/ifortH0Y6Icarg

rm /tmp/ifortsRmYZhgnudirs

rm /tmp/ifortVSRMER.o

How can I check if gcc 32-bit is installed?

Thank you.

--------------------------------------

Emily

It's pretty clear then that you're using the 64-bit compiler, based on the paths. Please show the source command and after that the value of the path environment variable (echo $path).

Steve - Intel Developer Support

I use the source command and (echo $path), but there is nothing return. 

In certain command shells, you may need the command to be echo $PATH instead of echo $path.

Thank you so much. I use echo $PATH and the output is here

/usr/lib/openmpi/1.3.2-gcc/bin:/usr/kerberos/bin:/opt/intel/Compiler/11.1/059/bin/intel64:/opt/intel/Compiler/11.1/059/bin/intel64:/usr/local/bin:/bin:/usr/bin:/home/students/yyry2/bin

Do you have the 32-bit Intel Fortran compiler package installed? If you did, and you used "ia32" as the argument to the "source ifortvars.sh" command, you should have seen "ia32" in place of "intel64" in $PATH, and the directory /opt/intel/Compiler/11.1/059/bin/ia32 should exist on your system. Please check if this is true.

Thank you so much. I use the "source" command, and there is still "intel64" in $PATH. The 32-bit Compiler does not exist. I think this is the reason. 

In that case, you can try the -m32 flag with the 64-bit compiler. If that works and produces a 32-bit a.out file, you may not need to install the 32-bit ia32-target compiler package.

I add the flag like this "ifort -m32 xxx.f90 -o a.out" and it produces this error

catastrophic error: Compiler configuration problem encountered.  The expected target architecture compiler is missing (11.1-ia32 != 11.1-intel64)

compilation aborted for test00.f90 (code 1)

You need to install the 32-bit compiler. Please go to https://registrationcenter.intel.com/ and get it. You may need to install 32-bit gcc libraries since many 64-bit distros omit them.

I'd also recommend installing the latest compiler your license is eligible for.

Steve - Intel Developer Support

Thank you to Steve. I am going to install that.

Leave a Comment

Please sign in to add a comment. Not a member? Join today