Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

undefined symbol

mtw125
Beginner
457 Views
Please excuse my lack of understanding of the big picture here. I'm not very experienced with all of this, but while trying to compile the mcnpx code I obtain a runtime error such as the following.

../mcnpx/mcnpx: symbol lookup error: ../mcnpx/mcnpx: undefined symbol: __svml_cbrt2
I believe this is related to one of the vector math library functions. My compile line looks like this:
/tools/intel/fce/11.1.046/bin/intel64/ifort f77main/f77main.o mcnpf.a mcnpf/GLOBAL1_zc.o mcnpf/GLOBAL2_vv.o mcnpf/GLOBAL3_st.o mcnpf/GLOBAL4_cg.o mcnpf/GLOBAL4_mb.o mcnpf/GLOBAL4_lk.o mcnpf/GLOBAL5_cm.o mcnpf/GLOBAL6_ht.o mcnpf/IMCN_jc.o mcnpf/GKSSIM_gs.o mcnpf/LAMBDA_lm.o mcnpf/LAMBDA_lt.o mcnpf/MCPLOT_mp.o mcnpf/PLOT_pc.o mcnpf/GLOBAL6_mc.o mcnpf/cemmod.o mcnpf/laqmod31.o mcnpc.a utils.a gvaviv.a lcs.a lcs/btbd.o lcs/cabd.o lcs/e0bd.o lcs/elbd.o lcs/h1bd.o lcs/hebd.o lcs/inbd.o lcs/isbd.o lcs/phbd.o lcs/pqbd.o dedx.a dedx/atmdat.o meshtal.a histp.a spabi.a spabi/bdincl1.o spabi/bdincl2.o fluka89.a fluka89/bdnopt.o fluka89/blkdt1.o fluka89/blkdt2.o fluka89/blkdt3.o fluka89/blkdt4.o fluka89/blkdt5.o fluka89/blkdt6.o fluka89/blkdt7.o fluka89/f2bd.o hexs.a hexs/nebd.o hexs/xsbd.o -L/usr/X11R6/lib64 -lX11 -L/tools/intel/fce/11.1.046/lib/intel64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.. -L/lib64 -L/lib -L/usr/lib64 -L/usr/lib -lifport -lifcore -limf -lsvml -lipgo -lirc -u -U __pthread_once -lpthread -lgcc_s -lirc_s -ldl -lm -o mcnpx
It compiles if I use -U -lsvml. From what I understand though, this is removing the predefined macro svml. I have several questions here. First, as svml is a library to my understanding, what does this mean in the macro context? Any macro associated with the library svml will not be utilized? Second, is this the same as removing -lsvml from the compile line (if not, what is the difference). I believe using "ifort -# A.out" I can see the following
/tools/intel/fce/11.1.046/bin/intel64/fortcom \\
-mP1OPT_version=11.1-intel64 \\
-mGLOB_diag_file=A.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=-# \\
-mGLOB_cxx_limited_range=FALSE \\
-mGLOB_as_output_backup_file_name=/home/myuserid/TMPDIR/ifortOywIDSas_.s \\
-mIPOPT_activate \\
-mGLOB_machine_model=GLOB_MACHINE_MODEL_EFI2 \\
-mP2OPT_subs_out_of_bound=FALSE \\
-mGLOB_ansi_alias \\
-mIPOPT_args_in_regs=0 \\
-mPGOPTI_value_profile_use=T \\
-mP2OPT_hlo \\
-mIPOPT_link \\
-mIPOPT_ipo_activate \\
-mIPOPT_ipo_mo_activate \\
-mIPOPT_ipo_mo_nfiles=1 \\
-mIPOPT_source_files_list=/home/myuserid/TMPDIR/ifortadzb4Vlst \\
-mIPOPT_global_data \\
-mIPOPT_link_script_file=/home/myuserid/TMPDIR/ifortCYOczfscript \\
"-mIPOPT_link_version=2.16.91.0.5 20051219 (SUSE Linux)" \\
"-mIPOPT_link_version=2.16.91.0.5 20051219 (SUSE Linux)" \\
"-mIPOPT_cmdline_link="/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crt1.o" "/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crti.o" "/usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbegin.o" "--eh-frame-hdr" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "a.out" "/tools/intel/fce/11.1.046/lib/intel64/for_main.o" "A.out" "-L/tools/intel/fce/11.1.046/lib/intel64" "-L/usr/lib64/gcc/x86_64-suse-linux/4.1.2" "-L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64" "-L/lib/../lib64" "-L/usr/lib/../lib64" "-L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib" "-L/usr/lib64/gcc/x86_64-suse-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/lib64/gcc/x86_64-suse-linux/4.1.2/crtend.o" "/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crtn.o"" \\
-mIPOPT_il_in_obj \\
-mIPOPT_ipo_activate_warn=FALSE \\
-mIPOPT_obj_output_file_name=/home/myuserid/TMPDIR/ipo_ifortgqpKeG.o \\
"-mGLOB_linker_version=2.16.91.0.5 20051219 (SUSE Linux)" \\
-mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS \\
-mGLOB_obj_output_file=/home/myuserid/TMPDIR/ipo_ifortgqpKeG.o \\
-mP1OPT_source_file_name=/home/myuserid/TMPDIR/ipo_ifortgqpKeG.f \\
A.out \\
-mIPOPT_object_files=/home/myuserid/TMPDIR/ifortCUUwFZtxt \\
-mIPOPT_assembly_files=/home/myuserid/TMPDIR/ifortAHIl7itxt \\
-mIPOPT_cmdline_link_new=/home/myuserid/TMPDIR/ifort4pAfACtxt
ifort: warning #10017: couldn't open multi-file optimizations object list
ifort: warning #10017: couldn't open multi-file optimizations object list
ld \\
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crt1.o \\
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crti.o \\
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbegin.o \\
--eh-frame-hdr \\
-dynamic-linker \\
/lib64/ld-linux-x86-64.so.2 \\
-o \\
a.out \\
/tools/intel/fce/11.1.046/lib/intel64/for_main.o \\
-L/tools/intel/fce/11.1.046/lib/intel64 \\
-L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 \\
-L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 \\
-L/lib/../lib64 \\
-L/usr/lib/../lib64 \\
-L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib \\
-L/usr/lib64/gcc/x86_64-suse-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/lib64/gcc/x86_64-suse-linux/4.1.2/crtend.o \\
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crtn.o
Exactly what is the result of this command telling me? I believe it has to do with some defaults with both the compiler (ifort) and linker (ld). If this is the case why then is -svml not working as they are listed here?
I have another error that I have bypassed as well. My other error was the "__pthread_once" option caused problems at compile time. if I don't include "-U __pthread_once", but just "__pthread_once", compilation fails with the following:
ifort: error #10236: File not found: '__pthread_once'
It thinks __pthread_once is the source file or something? How do I get it to understand it is not as I see others have used this option and my limited research has indicated it is POSIX related. As a secondary question just for my understanding, why is it separate from the -lpthread option (as this is for POSIX routines correct?)?
Any help from anyone would be greatly appreciated as I not only want this to compile with the Short Vector Math Library and the proper Threading capability, but I want to expand my knowledge of how this all ties together with the compiler/liker etc.
0 Kudos
2 Replies
TimP
Honored Contributor III
457 Views
ifort 11.1 should always specify the svml library for link step; you shouldn't require any options for it. You must assure that the library directory installed with ifort 11.1 is on path, rather than some earlier one, such as might be active in a 10.0 installation. As you appear to have installed the 11.1 compiler in a location different from default, you will need to check this yourself.
0 Kudos
mtw125
Beginner
457 Views
Thanks for the info you gave. I am not the admin of the system and while I'm free to do these installs, I am on my own there. This helps as I believe there are older compilers and this may be a problem.
0 Kudos
Reply