[mesa-users] compiling issues when calling mesa module in C++ program

Robert Farmer rjfarmer at asu.edu
Wed Oct 28 13:24:30 EDT 2015


As you have a minimal amount of code at the moment, can you try with the
sdk gfortran/gcc and not with the mpi compilers? basically try moving one
step at a time though things that might be working/not working.

Rob

On Wed, Oct 28, 2015 at 10:04 AM, Jean-Claude Passy <jcpassy at gmail.com>
wrote:

> Hi Rob,
>
> *>  *
>
> *"_GOMP_critical_end", referenced from:*
> You need to link openmp in
>
>
> You were right. I had forgotten the flag -fopenmp
>
>
> *>**    ___mtx_support_MOD_do_quad_band_multiply_xa in
> libmtx.a(mtx_support.o)  *(and other lines)
>
> Have you initialized the sdk before compiling?
>
>
> Yes, it is initialized.
>
> Thanks,
>
> JC
>
> On Wed, Oct 28, 2015 at 5:21 AM, Jean-Claude Passy <jcpassy at gmail.com>
> wrote:
>
>> Hi everyone,
>>
>> I am trying to use the eos module in an external C++ program, and I have
>> some linking issues. I would be glad if someone could help me to sort this
>> out. Below is a description of what is happening:
>>
>> - module_eos.f is a module based on sample_eos.f
>> - main_fortran.f is a simple program that calls this module. It was just
>> a test to see whether I could use the module externally. When I build with
>> ‘make fortran’, compilation is smooth and the executable works perfectly
>> well.
>> - main_cpp.C is also supposed to only call the module. At compilation, I
>> get the warnings and errors at the bottom.
>>
>> So it looks like some links are missing (or have the wrong order), but it
>> is not obvious to me how to fix this.
>>
>> I must add that I compile using MPI compilers (required by the external
>> code) but I made sure that the MPi compilers were build using the SDK
>> distribution. Also, I added some includes/libs/defines in the command line
>> required by the external code (see Makefile).
>>
>> All the files can be found below. Happy to hear your suggestions.
>>
>> Thanks a lot,
>>
>>
>> JC
>>
>>
>>
>>
>>
>>
>>
>> *#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
>> *[12:24:46] Obiwan:$ make*
>> *…*
>> */Users/jcpassy/Work/Tools/openmpi-1.6.5/build/bin/mpic++  -DLINUX
>> -DH5_USE_16_API   -D__max_subgrids=100000 -D__max_baryons=30
>> -D__max_cpu_per_node=8 -D__memory_pool_size=100000 -DINITS64 -DLARGE_INTS
>> -DCONFIG_PINT_8 -DIO_32    -DUSE_MPI   -DCONFIG_PFLOAT_8 -DCONFIG_BFLOAT_8
>> -DUSE_HDF5_GROUPS   -DTRANSFER   -DNEW_GRID_IO -DFAST_SIB
>> -DENZO_PERFORMANCE   -DSAB -o  bin/main_cpp.exe -g \*
>> * -L/Users/jcpassy/Work/MESA/mesa_7503/lib -lstar -lionization -latm
>> -lcolors -lmlt -lnse -lnet -leos -lkap -lrates -lneu -lchem -linterp_2d
>> -linterp_1d -lnum -lf2crlibm -lcrlibm -lmtx -lconst -lutils -lmesaklu
>> `mesasdk_lapack_link` `mesasdk_blas_link` `mesasdk_pgplot_link`
>> `mesasdk_se_link`  -L/Users/jcpassy/Work/yt-x86_64/lib -lhdf5
>> -L/Applications/mesasdk/lib -lgfortran
>> -I/Users/jcpassy/Work/yt-x86_64/include -I/usr/include
>> -I/Users/jcpassy/Work/Enzo/enzo-dev/src/enzo module_eos.o main_cpp.C*
>> *…*
>> *ld: warning: could not create compact unwind for
>> ___eos_lib_MOD_eosdt_ideal_gas_get: stack subq instruction is too different
>> from dwarf stack size*
>> *ld: warning: could not create compact unwind for
>> ___eosde_eval_MOD_get_de_opal_scvh_for_x: stack subq instruction is too
>> different from dwarf stack size*
>> *ld: warning: could not create compact unwind for
>> ___eosdt_eval_MOD_get_helm_pc_results: stack subq instruction is too
>> different from dwarf stack size*
>> *ld: warning: could not create compact unwind for
>> ___eosdt_eval_MOD_get_opal_scvh_results: stack subq instruction is too
>> different from dwarf stack size*
>> *ld: warning: could not create compact unwind for
>> ___eosdt_eval_MOD_get_eosdt_results: stack subq instruction is too
>> different from dwarf stack size*
>> *ld: warning: could not create compact unwind for
>> ___eospt_eval_MOD_get_pt_opal_scvh_results: stack subq instruction is too
>> different from dwarf stack size*
>> *ld: warning: could not create compact unwind for
>> ___eosde_load_tables_MOD_load1_eosde_table: stack subq instruction is too
>> different from dwarf stack size*
>> *ld: warning: could not create compact unwind for
>> ___eosdt_load_tables_MOD_load1_eosdt_table: stack subq instruction is too
>> different from dwarf stack size*
>> *ld: warning: could not create compact unwind for
>> ___eospt_load_tables_MOD_load1_eospt_table: stack subq instruction is too
>> different from dwarf stack size*
>> *ld: warning: could not create compact unwind for ___helm_MOD_helmeos2:
>> stack subq instruction is too different from dwarf stack size*
>> *ld: warning: could not create compact unwind for
>> ___mebdfi_stiff_MOD_stiff: stack subq instruction is too different from
>> dwarf stack size*
>> *ld: warning: could not create compact unwind for
>> ___mod_newton_MOD_do_newton: stack subq instruction is too different from
>> dwarf stack size*
>> *ld: warning: could not create compact unwind for
>> ___mod_rosenbrock_MOD_roscor: stack subq instruction is too different from
>> dwarf stack size*
>> *ld: warning: could not create compact unwind for _dgbtrf_: stack subq
>> instruction is too different from dwarf stack size*
>> *ld: warning: could not create compact unwind for _zgbtrf_: stack subq
>> instruction is too different from dwarf stack size*
>> *Undefined symbols for architecture x86_64:*
>> *  "_GOMP_critical_end", referenced from:*
>> *      ___eosde_load_tables_MOD_load_eosde_table in
>> libeos.a(eosde_load_tables.o)*
>> *      ___eosdt_load_tables_MOD_load_eosdt_table in
>> libeos.a(eosdt_load_tables.o)*
>> *      ___eospt_load_tables_MOD_load_eospt_table in
>> libeos.a(eospt_load_tables.o)*
>> *  "_GOMP_critical_name_end", referenced from:*
>> *      ___eos_def_MOD_do_alloc_eos in libeos.a(eos_def.o)*
>> *      ___utils_lib_MOD_free_iounit in libutils.a(utils_lib.o)*
>> *      ___utils_lib_MOD_number_iounits_allocated in
>> libutils.a(utils_lib.o)*
>> *      ___utils_lib_MOD_alloc_iounit in libutils.a(utils_lib.o)*
>> *      ___utils_dict_MOD_do_integer_dict_create_hash in
>> libutils.a(utils_dict.o)*
>> *      ___utils_dict_MOD_do_integer_dict_define in
>> libutils.a(utils_dict.o)*
>> *      ___utils_idict_MOD_do_integer_idict_create_hash in
>> libutils.a(utils_idict.o)*
>> *      ...*
>> *  "_GOMP_critical_name_start", referenced from:*
>> *      ___eos_def_MOD_do_alloc_eos in libeos.a(eos_def.o)*
>> *      ___utils_lib_MOD_free_iounit in libutils.a(utils_lib.o)*
>> *      ___utils_lib_MOD_number_iounits_allocated in
>> libutils.a(utils_lib.o)*
>> *      ___utils_lib_MOD_alloc_iounit in libutils.a(utils_lib.o)*
>> *      ___utils_dict_MOD_do_integer_dict_create_hash in
>> libutils.a(utils_dict.o)*
>> *      ___utils_dict_MOD_do_integer_dict_define in
>> libutils.a(utils_dict.o)*
>> *      ___utils_idict_MOD_do_integer_idict_create_hash in
>> libutils.a(utils_idict.o)*
>> *      ...*
>> *  "_GOMP_critical_start", referenced from:*
>> *      ___eosde_load_tables_MOD_load_eosde_table in
>> libeos.a(eosde_load_tables.o)*
>> *      ___eosdt_load_tables_MOD_load_eosdt_table in
>> libeos.a(eosdt_load_tables.o)*
>> *      ___eospt_load_tables_MOD_load_eospt_table in
>> libeos.a(eospt_load_tables.o)*
>> *  "_GOMP_parallel", referenced from:*
>> *      ___bcyclic_MOD_cycle_solve in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_rhs in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_onestep in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_bcyclic_solve in libmtx.a(bcyclic.o)*
>> *      ___mtx_support_MOD_do_quad_block_multiply_xa in
>> libmtx.a(mtx_support.o)*
>> *      ___mtx_support_MOD_do_block_multiply_xa in libmtx.a(mtx_support.o)*
>> *      ___mtx_support_MOD_do_lu_factored_block_dble_mv in
>> libmtx.a(mtx_support.o)*
>> *      ...*
>> *  "_Sample_", referenced from:*
>> *      _main in main_cpp-0e7b04.o*
>> *  "___addtf3", referenced from:*
>> *      _qdgemv.4521 in libmtx.a(mtx_support.o)*
>> *      ___mtx_support_MOD_do_quad_band_multiply_xa in
>> libmtx.a(mtx_support.o)*
>> *      ___mtx_support_MOD_do_quad_multiply_xa_plus_c in
>> libmtx.a(mtx_support.o)*
>> *      ___mtx_support_MOD_do_quad_multiply_xa in libmtx.a(mtx_support.o)*
>> *      ___my_lapack95_quad_MOD_my_gemm_plus_mm in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_gemm_p1 in libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_gemv_p_mv in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ...*
>> *  "___divtf3", referenced from:*
>> *      ___my_lapack95_quad_MOD_my_getrs_dbg in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs_5_by_5 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs_4_by_4 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs_5_by_1 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs_4_by_1 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs in libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getf2_5_by_5 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ...*
>> *  "___eqtf2", referenced from:*
>> *      ___mtx_support_MOD_do_quad_dense_to_col_sparse_0_based in
>> libmtx.a(mtx_support.o)*
>> *      _qlamc4_ in libmtx.a(qlamch.o)*
>> *      _qlamc1_ in libmtx.a(qlamch.o)*
>> *      _klu_q_rgrowth in libmesaklu.a(klu_q_diagnostics.o)*
>> *      _klu_q_condest in libmesaklu.a(klu_q_diagnostics.o)*
>> *      _klu_q_rcond in libmesaklu.a(klu_q_diagnostics.o)*
>> *      _klu_q_factor in libmesaklu.a(klu_q_factor.o)*
>> *      ...*
>> *  "___extenddftf2", referenced from:*
>> *      ___utils_nan_MOD_do_fill_quad_with_nans in libutils.a(utils_nan.o)*
>> *      ___mtx_support_MOD_do_dense_to_col_sparse_0_based_qp in
>> libmtx.a(mtx_support.o)*
>> *  "___fixtfsi", referenced from:*
>> *      _qlamc1_ in libmtx.a(qlamch.o)*
>> *      _klu_q_condest in libmesaklu.a(klu_q_diagnostics.o)*
>> *  "___floatsitf", referenced from:*
>> *      _qlamc5_ in libmtx.a(qlamch.o)*
>> *      _qlamc4_ in libmtx.a(qlamch.o)*
>> *      _qlamc1_ in libmtx.a(qlamch.o)*
>> *      _qlamc2_ in libmtx.a(qlamch.o)*
>> *      _qlamch_ in libmtx.a(qlamch.o)*
>> *      _klu_q_condest in libmesaklu.a(klu_q_diagnostics.o)*
>> *  "___getf2", referenced from:*
>> *      ___my_lapack95_quad_MOD_my_getf2_5_by_5 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getf2_4_by_4 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getf2 in libmtx.a(my_lapack95_quad.o)*
>> *      _qlamc5_ in libmtx.a(qlamch.o)*
>> *      _klu_q_condest in libmesaklu.a(klu_q_diagnostics.o)*
>> *      _klu_q_kernel in libmesaklu.a(klu_q_kernel.o)*
>> *  "___gttf2", referenced from:*
>> *      ___my_lapack95_quad_MOD_my_getf2_5_by_5 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getf2_4_by_4 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getf2 in libmtx.a(my_lapack95_quad.o)*
>> *      _qlamc2_ in libmtx.a(qlamch.o)*
>> *      _klu_q_rgrowth in libmesaklu.a(klu_q_diagnostics.o)*
>> *      _klu_q_condest in libmesaklu.a(klu_q_diagnostics.o)*
>> *      _klu_q_rcond in libmesaklu.a(klu_q_diagnostics.o)*
>> *      ...*
>> *  "___letf2", referenced from:*
>> *      _qlamch_ in libmtx.a(qlamch.o)*
>> *      _klu_q_condest in libmesaklu.a(klu_q_diagnostics.o)*
>> *      _klu_q_kernel in libmesaklu.a(klu_q_kernel.o)*
>> *  "___lttf2", referenced from:*
>> *      ___my_lapack95_quad_MOD_my_getf2_5_by_5 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getf2_4_by_4 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      _qlamc5_ in libmtx.a(qlamch.o)*
>> *      _qlamc1_ in libmtx.a(qlamch.o)*
>> *      _qlamc2_ in libmtx.a(qlamch.o)*
>> *      _klu_q_rgrowth in libmesaklu.a(klu_q_diagnostics.o)*
>> *      _klu_q_condest in libmesaklu.a(klu_q_diagnostics.o)*
>> *      ...*
>> *  "___multf3", referenced from:*
>> *      _qdgemv.4521 in libmtx.a(mtx_support.o)*
>> *      ___mtx_support_MOD_do_quad_band_multiply_xa in
>> libmtx.a(mtx_support.o)*
>> *      ___mtx_support_MOD_do_quad_multiply_xa_plus_c in
>> libmtx.a(mtx_support.o)*
>> *      ___mtx_support_MOD_do_quad_multiply_xa in libmtx.a(mtx_support.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs_dbg in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs_5_by_5 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs_4_by_4 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ...*
>> *  "___netf2", referenced from:*
>> *      _qdgemv.4521 in libmtx.a(mtx_support.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs_dbg in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs in libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getf2_5_by_5 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getf2_4_by_4 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getf2 in libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_gemm_plus_mm in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ...*
>> *  "___subtf3", referenced from:*
>> *      ___my_lapack95_quad_MOD_my_getrs_dbg in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs_5_by_5 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs_4_by_4 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs_5_by_1 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs_4_by_1 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getrs in libmtx.a(my_lapack95_quad.o)*
>> *      ___my_lapack95_quad_MOD_my_getf2_5_by_5 in
>> libmtx.a(my_lapack95_quad.o)*
>> *      ...*
>> *  "___trunctfdf2", referenced from:*
>> *      ___utils_isnan_MOD_check_for_bad_quad in
>> libutils.a(utils_isnan_okay.o)*
>> *  "___unordtf2", referenced from:*
>> *      ___utils_isnan_MOD_check_for_bad_quad in
>> libutils.a(utils_isnan_okay.o)*
>> *  "_omp_get_max_threads_", referenced from:*
>> *      ___utils_openmp_MOD_eval_omp_get_max_threads in
>> libutils.a(utils_openmp.o)*
>> *  "_omp_get_num_threads", referenced from:*
>> *      ___bcyclic_MOD_cycle_solve._omp_fn.0 in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_rhs._omp_fn.2 in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_onestep._omp_fn.6 in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_onestep._omp_fn.3 in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_onestep._omp_fn.5 in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_rhs._omp_fn.1 in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_onestep._omp_fn.4 in libmtx.a(bcyclic.o)*
>> *      ...*
>> *  "_omp_get_thread_num", referenced from:*
>> *      ___bcyclic_MOD_cycle_solve._omp_fn.0 in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_rhs._omp_fn.2 in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_onestep._omp_fn.6 in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_onestep._omp_fn.3 in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_onestep._omp_fn.5 in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_rhs._omp_fn.1 in libmtx.a(bcyclic.o)*
>> *      ___bcyclic_MOD_cycle_onestep._omp_fn.4 in libmtx.a(bcyclic.o)*
>> *      ...*
>> *     (maybe you meant: ___utils_openmp_MOD_eval_omp_get_thread_num,
>> ___utils_lib_MOD_utils_omp_get_thread_num )*
>> *  "_omp_get_thread_num_", referenced from:*
>> *      ___utils_openmp_MOD_eval_omp_get_thread_num in
>> libutils.a(utils_openmp.o)*
>> *ld: symbol(s) not found for architecture x86_64*
>> *clang: error: linker command failed with exit code 1 (use -v to see
>> invocation)*
>> *make: *** [all] Error 1*
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> mesa-users mailing list
>> mesa-users at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/mesa-users
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20151028/74e2decb/attachment.html>


More information about the Mesa-users mailing list