0

I am trying to install and run a mathematical library called PDSLin on my ubuntu 16.04 machine but I got the following error. It seems that there is no linking at all to any library I added. I searched on similar problems like this one where adding libraries after object files is suggested but that does not solve my problem since this is the order in the original makefile.

cc  -I/home/afrah/pdslin/include -I/usr/local/include -I/home/afrah/SuperLU_DIST_3.3/SRC -I/usr/local/include -DSCOTCH_ORDER -I/usr/local/include -I/usr/share/parmetis/include   -I/usr/share/mpich-install/include -I/home/afrah/petsc/include -I/home/afrah/petsc/arch-linux2-c-debug/include -c dtest.c -o dtest.o 
dtest.c: In function ‘main’:
dtest.c:54:20: warning: implicit declaration of function ‘pdslin_print_input’ [-Wimplicit-function-declaration]
    if ( !proc_id ) pdslin_print_input(&input);
                    ^
dtest.c:125:39: warning: implicit declaration of function ‘pdslin_print_stat’ [-Wimplicit-function-declaration]
    if( input.verbose == PDSLin_VALL ) pdslin_print_stat( &stat, matrix.pdslin_comm );
                                       ^
cc    dtest.o  /usr/lib/libblas.so /usr/lib/liblapack.so /usr/share/mpich-install/lib/libmpich.so /usr/share/parmetis/lib/libmetis.a  /usr/local/lib/libparmetis.so /usr/local/lib/libscotch.a   /usr/local/lib/libscotchmetis.a /usr/local/lib/libptscotchparmetis.a  /usr/local/lib/libptscotcherr.a /usr/local/lib/libptscotch.a /home/afrah/SuperLU_DIST_3.3/lib/libsuperlu_dist.so  /home/afrah/petsc/arch-linux2-c-debug/lib/libpetsc.so /home/afrah/pdslin/lib/libhybrid.a       -o dtest 
dtest.o: In function `main':
dtest.c:(.text+0xb65): undefined reference to `sqrt'
dtest.c:(.text+0xb88): undefined reference to `sqrt'
dtest.c:(.text+0xbb7): undefined reference to `sqrt'
dtest.c:(.text+0xbda): undefined reference to `sqrt'
dtest.c:(.text+0xc14): undefined reference to `sqrt'
dtest.o:dtest.c:(.text+0xc37): more undefined references to `sqrt' follow
/home/afrah/pdslin/lib/libhybrid.a(pdslin_wrapper.o): In function `pdslin_error_handler':
pdslin_wrapper.c:(.text+0xc9): undefined reference to `floor'
/home/afrah/pdslin/lib/libhybrid.a(pdslin_util.o): In function `pdslin_init_input':
pdslin_util.c:(.text+0x1c48): undefined reference to `log10'
pdslin_util.c:(.text+0x1c61): undefined reference to `floor'
pdslin_util.c:(.text+0x1c8b): undefined reference to `pow'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_io.o): In function `dread_matrix':
dpdslin_io.c:(.text+0x208): undefined reference to `superlu_abort_and_exit_dist'
dpdslin_io.c:(.text+0x2ce): undefined reference to `superlu_abort_and_exit_dist'
dpdslin_io.c:(.text+0x4e4): undefined reference to `superlu_abort_and_exit_dist'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_io.o): In function `dread_ijvt':
dpdslin_io.c:(.text+0x26e3): undefined reference to `dCompRow_to_CompCol_dist'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_io.o): In function `dread_hb':
dpdslin_io.c:(.text+0x2eac): undefined reference to `dallocateA_dist'
dpdslin_io.c:(.text+0x3101): undefined reference to `intMalloc_dist'
dpdslin_io.c:(.text+0x3115): undefined reference to `intMalloc_dist'
dpdslin_io.c:(.text+0x3129): undefined reference to `doubleMalloc_dist'
dpdslin_io.c:(.text+0x3281): undefined reference to `superlu_free_dist'
dpdslin_io.c:(.text+0x3293): undefined reference to `superlu_free_dist'
dpdslin_io.c:(.text+0x32a5): undefined reference to `superlu_free_dist'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_util.o): In function `dsort3':
dpdslin_util.c:(.text+0xcbc): undefined reference to `sswap_'
dpdslin_util.c:(.text+0xd07): undefined reference to `dswap_'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_util.o): In function `dgenerate_dblocks':
dpdslin_util.c:(.text+0xe4c): undefined reference to `floor'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_dist.o): In function `dinit_schur_comm':
dpdslin_dist.c:(.text+0x6fd): undefined reference to `floor'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_dist.o): In function `ddistribute_matrix':
dpdslin_dist.c:(.text+0x10d1): undefined reference to `ceil'
dpdslin_dist.c:(.text+0x136a): undefined reference to `floor'
dpdslin_dist.c:(.text+0x15df): undefined reference to `dCompRow_to_CompCol_dist'
dpdslin_dist.c:(.text+0x1b16): undefined reference to `dcopy_'
dpdslin_dist.c:(.text+0x1ba2): undefined reference to `superlu_free_dist'
dpdslin_dist.c:(.text+0x1bb2): undefined reference to `superlu_free_dist'
dpdslin_dist.c:(.text+0x2554): undefined reference to `ceil'
dpdslin_dist.c:(.text+0x2913): undefined reference to `ceil'
dpdslin_dist.c:(.text+0x2f2e): undefined reference to `ceil'
dpdslin_dist.c:(.text+0x3b6b): undefined reference to `ceil'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_dist.o): In function `dalltoall_matrix':
dpdslin_dist.c:(.text+0x4978): undefined reference to `log10'
dpdslin_dist.c:(.text+0x4991): undefined reference to `floor'
dpdslin_dist.c:(.text+0x49c3): undefined reference to `pow'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_dist.o): In function `dallgather_separator':
dpdslin_dist.c:(.text+0x6ad2): undefined reference to `ceil'
dpdslin_dist.c:(.text+0x6b42): undefined reference to `floor'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_dist.o): In function `dalltoall_interface':
dpdslin_dist.c:(.text+0x8cbd): undefined reference to `floor'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_dist.o): In function `dget_rowdisp_var':
dpdslin_sludist.c:(.text+0x1601): undefined reference to `set_default_options_dist'
dpdslin_sludist.c:(.text+0x16d5): undefined reference to `sqrt'
dpdslin_sludist.c:(.text+0x18a1): undefined reference to `ScalePermstructInit'
dpdslin_sludist.c:(.text+0x18c6): undefined reference to `PStatInit'
dpdslin_sludist.c:(.text+0x19c2): undefined reference to `dCreate_CompRowLoc_Matrix_dist'
dpdslin_sludist.c:(.text+0x19d5): undefined reference to `set_default_options_dist'
dpdslin_sludist.c:(.text+0x1e11): undefined reference to `PStatPrint'
dpdslin_sludist.c:(.text+0x1f63): undefined reference to `Destroy_SuperMatrix_Store_dist'
dpdslin_sludist.c:(.text+0x200b): undefined reference to `PStatFree'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_sludist.o): In function `dsolve_interior_superludist':
dpdslin_sludist.c:(.text+0x2397): undefined reference to `PStatInit'
dpdslin_sludist.c:(.text+0x23f7): undefined reference to `pdgssvx'
dpdslin_sludist.c:(.text+0x240a): undefined reference to `PStatFree'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_sludist.o): In function `dtrisolve_superludist':
dpdslin_sludist.c:(.text+0x262b): undefined reference to `PStatInit'
dpdslin_sludist.c:(.text+0x2691): undefined reference to `PStatFree'
/home/afrah/pdslin/lib/libhybrid.a(dpdslin_hls.o): In function `dsolve_interior_hls':
dpdslin_hls.c:(.text+0x6dd): undefined reference to `ceil'
/home/afrah/pdslin/lib/libhybrid.a(dschur_sludist.o): In function `dcompG_superludist':
dschur_sludist.c:(.text+0x385): undefined reference to `sp_ienv_dist'
dschur_sludist.c:(.text+0xaca): undefined reference to `intMalloc_dist'
dschur_sludist.c:(.text+0xca2): undefined reference to `floor'
dschur_sludist.c:(.text+0xede): undefined reference to `floor'
dschur_sludist.c:(.text+0x2b20): undefined reference to `intMalloc_dist'
dschur_sludist.c:(.text+0x2f2e): undefined reference to `floor'
dschur_sludist.c:(.text+0x316a): undefined reference to `floor'
dschur_sludist.c:(.text+0x40e6): undefined reference to `intMalloc_dist'
dschur_sludist.c:(.text+0x4306): undefined reference to `floor'
dschur_sludist.c:(.text+0x4542): undefined reference to `floor'
/home/afrah/pdslin/lib/libhybrid.a(dschur_sludist.o): In function `dcompW_superludist':
dschur_sludist.c:(.text+0x54a8): undefined reference to `sp_ienv_dist'
/home/afrah/pdslin/lib/libhybrid.a(dpostorderInterface.o): In function `dpostOrderInterface':
dpostorderInterface.c:(.text+0x278): undefined reference to `isort'
/home/afrah/pdslin/lib/libhybrid.a(dpostorderInterface.o): In function `dpostOrderBInterface':
dpostorderInterface.c:(.text+0x4f5): undefined reference to `isort'
/home/afrah/pdslin/lib/libhybrid.a(memory.o): In function `pdslin_symbfact_SubInit':
memory.c:(.text+0x5d): undefined reference to `sp_ienv_dist'
memory.c:(.text+0x81): undefined reference to `superlu_malloc_dist'
memory.c:(.text+0xcc): undefined reference to `superlu_abort_and_exit_dist'
memory.c:(.text+0x1a2): undefined reference to `SetupSpace'
memory.c:(.text+0x1c0): undefined reference to `intMalloc_dist'
memory.c:(.text+0x1d7): undefined reference to `intMalloc_dist'
memory.c:(.text+0x1ee): undefined reference to `intMalloc_dist'
memory.c:(.text+0x205): undefined reference to `intMalloc_dist'
memory.c:(.text+0x22d): undefined reference to `user_malloc_dist'
memory.c:(.text+0x250): undefined reference to `user_malloc_dist'
memory.c:(.text+0x273): undefined reference to `user_malloc_dist'
memory.c:(.text+0x296): undefined reference to `user_malloc_dist'
memory.c:(.text+0x31d): undefined reference to `superlu_free_dist'
memory.c:(.text+0x32c): undefined reference to `superlu_free_dist'
memory.c:(.text+0x354): undefined reference to `user_free_dist'
/home/afrah/pdslin/lib/libhybrid.a(memory.o): In function `pdslin_symbfact_SubXpand':
memory.c:(.text+0x774): undefined reference to `superlu_abort_and_exit_dist'
/home/afrah/pdslin/lib/libhybrid.a(memory.o): In function `pdslin_symbfact_SubFree':
memory.c:(.text+0x7aa): undefined reference to `superlu_free_dist'
memory.c:(.text+0x7ba): undefined reference to `superlu_free_dist'
memory.c:(.text+0x7ca): undefined reference to `superlu_free_dist'
memory.c:(.text+0x7da): undefined reference to `superlu_free_dist'
/home/afrah/pdslin/lib/libhybrid.a(memory.o): In function `pdslin_symbfact_FreeExpanders':
memory.c:(.text+0x7f4): undefined reference to `superlu_free_dist'
/home/afrah/pdslin/lib/libhybrid.a(memory.o): In function `pdslin_expand':
memory.c:(.text+0x898): undefined reference to `superlu_malloc_dist'
memory.c:(.text+0x8b2): undefined reference to `ifill_dist'
memory.c:(.text+0x94d): undefined reference to `superlu_malloc_dist'
memory.c:(.text+0x96e): undefined reference to `ifill_dist'
memory.c:(.text+0x9b1): undefined reference to `superlu_free_dist'
memory.c:(.text+0x9ee): undefined reference to `user_malloc_dist'
/home/afrah/pdslin/lib/libhybrid.a(slu.o): In function `pdslin_slu_gridmap':
slu.c:(.text+0x1b9): undefined reference to `superlu_abort_and_exit_dist'
slu.c:(.text+0x1ed): undefined reference to `superlu_malloc_dist'
slu.c:(.text+0x37e): undefined reference to `superlu_free_dist'
slu.c:(.text+0x4d4): undefined reference to `superlu_free_dist'
/home/afrah/pdslin/lib/libhybrid.a(slu.o): In function `pdslin_destroyU':
slu.c:(.text+0x5cf): undefined reference to `superlu_free_dist'
slu.c:(.text+0x5ef): undefined reference to `superlu_free_dist'
slu.c:(.text+0x60b): undefined reference to `superlu_free_dist'
/home/afrah/pdslin/lib/libhybrid.a(slu.o):slu.c:(.text+0x61b): more undefined references to `superlu_free_dist' follow
/home/afrah/pdslin/lib/libhybrid.a(slu.o): In function `pdslin_allocateUT':
slu.c:(.text+0x829): undefined reference to `intMalloc_dist'
slu.c:(.text+0x885): undefined reference to `superlu_abort_and_exit_dist'
slu.c:(.text+0x892): undefined reference to `intMalloc_dist'
slu.c:(.text+0x8ee): undefined reference to `superlu_abort_and_exit_dist'
slu.c:(.text+0x8fb): undefined reference to `intMalloc_dist'
slu.c:(.text+0x957): undefined reference to `superlu_abort_and_exit_dist'
slu.c:(.text+0x96b): undefined reference to `superlu_malloc_dist'
slu.c:(.text+0x9c7): undefined reference to 
pdgstrsUT.c:(.text+0x309c): undefined reference to `superlu_abort_and_exit_dist'
pdgstrsUT.c:(.text+0x351f): undefined reference to `dtrsm_'
pdgstrsUT.c:(.text+0x3d17): undefined reference to `dtrsm_'
dslu.c:(.text+0xdd7): undefined reference to `superlu_abort_and_exit_dist'
dslu.c:(.text+0xf58): undefined reference to `pdgstrs'
dslu.c:(.text+0x1061): undefined reference to `pdlangs'
dslu.c:(.text+0x1077): undefined reference to `SuperLU_timer_dist_'
dslu.c:(.text+0x10bf): undefined reference to `pdgsmv_finalize'
dslu.c:(.text+0x10ea): undefined reference to `pdgsmv_init'
dslu.c:(.text+0x1103): undefined reference to `superlu_free_dist'
dslu.c:(.text+0x1110): undefined reference to `intMalloc_dist'
dslu.c:(.text+0x1159): undefined reference to `superlu_abort_and_exit_dist'
dslu.c:(.text+0x1405): undefined reference to `superlu_malloc_dist'
dslu.c:(.text+0x144e): undefined reference to `superlu_abort_and_exit_dist'
dslu.c:(.text+0x14ee): undefined reference to `superlu_malloc_dist'
dslu.c:(.text+0x1544): undefined reference to `superlu_abort_and_exit_dist'
dslu.c:(.text+0x158e): undefined reference to `pxgstrs_init'
dslu.c:(.text+0x160e): undefined reference to `pdgsrfs'
dslu.c:(.text+0x162b): undefined reference to `pxgstrs_finalize'
dslu.c:(.text+0x163a): undefined reference to `superlu_free_dist'
dslu.c:(.text+0x1653): undefined reference to `SuperLU_timer_dist_'
dslu.c:(.text+0x16a9): undefined reference to `pdPermute_Dense_Matrix'
dslu.c:(.text+0x1896): undefined reference to `superlu_free_dist'
/home/afrah/pdslin/lib/libhybrid.a(dslu.o): In function `dpdslin_slu_fact':
dslu.c:(.text+0x1ba2): undefined reference to `pxerbla'
dslu.c:(.text+0x1d4a): undefined reference to `doubleMalloc_dist'
dslu.c:(.text+0x1d93): undefined reference to `superlu_abort_and_exit_dist'
dslu.c:(.text+0x1da0): undefined reference to `doubleMalloc_dist'
dslu.c:(.text+0x1de9): undefined reference to `superlu_abort_and_exit_dist'
dslu.c:(.text+0x1e1f): undefined reference to `doubleMalloc_dist'
dslu.c:(.text+0x1e68): undefined reference to `superlu_abort_and_exit_dist'
dslu.c:(.text+0x1e89): undefined reference to `doubleMalloc_dist'
dslu.c:(.text+0x1ed2): undefined reference to `superlu_abort_and_exit_dist'
dslu.c:(.text+0x1efc): undefined reference to `SuperLU_timer_dist_'
dslu.c:(.text+0x22c3): undefined reference to `pdgsequ'
dslu.c:(.text+0x2319): undefined reference to `pdlaqgs'
dslu.c:(.text+0x232d): undefined reference to `lsame_'
dslu.c:(.text+0x235e): undefined reference to `lsame_'
dslu.c:(.text+0x238f): undefined reference to `lsame_'
dslu.c:(.text+0x23df): undefined reference to `SuperLU_timer_dist_'
dslu.c:(.text+0x2452): undefined reference to `pdCompRow_loc_to_CompCol_global'
dslu.c:(.text+0x24f5): undefined reference to `SuperLU_timer_dist_'
dslu.c:(.text+0x25d5): undefined reference to `doubleMalloc_dist'
dslu.c:(.text+0x261e): undefined reference to `superlu_abort_and_exit_dist'
dslu.c:(.text+0x262b): undefined reference to `doubleMalloc_dist'
dslu.c:(.text+0x2674): undefined reference to `superlu_abort_and_exit_dist'
dslu.c:(.text+0x2877): undefined reference to `exp'
dslu.c:(.text+0x28cb): undefined reference to `exp'
dslu.c:(.text+0x2d0d): undefined reference to `superlu_free_dist'
dslu.c:(.text+0x2d1c): undefined reference to `superlu_free_dist'
dslu.c:(.text+0x2e04): undefined reference to `SuperLU_timer_dist_'
dslu.c:(.text+0x2eca): undefined reference to `pdlangs'
dslu.c:(.text+0x2eed): undefined reference to `SuperLU_timer_dist_'
dslu.c:(.text+0x2f66): undefined reference to `log10'
dslu.c:(.text+0x2f7f): undefined reference to `floor'
dslu.c:(.text+0x2fa1): undefined reference to `pow'
dslu.c:(.text+0x3166): undefined reference to `get_perm_c_parmetis'
dslu.c:(.text+0x32bb): undefined reference to `superlu_abort_and_exit_dist'
dslu.c:(.text+0x32fe): undefined reference to `SuperLU_timer_dist_'
dslu.c:(.text+0x3352): undefined reference to `sp_colorder'
dslu.c:(.text+0x3475): undefined reference to `SuperLU_timer_dist_'
dslu.c:(.text+0x348b): undefined reference to `superlu_malloc_dist'
dslu.c:(.text+0x3c11): undefined reference to `superlu_free_dist'
get_perm_c.c:(.text+0x526): undefined reference to `SuperLU_timer_dist_'
get_perm_c.c:(.text+0x562): undefined reference to `superlu_malloc_dist'
get_perm_c.c:(.text+0x5ab): undefined reference to `superlu_abort_and_exit_dist'
get_perm_c.c:(.text+0x5c7): undefined reference to `superlu_malloc_dist'
get_perm_c.c:(.text+0x610): undefined reference to `superlu_abort_and_exit_dist'
get_perm_c.c:(.text+0x62c): undefined reference to `superlu_malloc_dist'
get_perm_c.c:(.text+0x675): undefined reference to `superlu_abort_and_exit_dist'
get_perm_c.c:(.text+0x689): undefined reference to `superlu_malloc_dist'
get_perm_c.c:(.text+0x6d2): undefined reference to `superlu_abort_and_exit_dist'
get_perm_c.c:(.text+0x6e6): undefined reference to `superlu_malloc_dist'
get_perm_c.c:(.text+0x72f): undefined reference to `superlu_abort_and_exit_dist'
get_perm_c.c:(.text+0x80c): undefined reference to `genmmd_dist_'
get_perm_c.c:(.text+0x861): undefined reference to `superlu_free_dist'
get_perm_c.c:(.text+0x870): undefined reference to `superlu_free_dist'
get_perm_c.c:(.text+0x87f): undefined reference to `superlu_free_dist'
get_perm_c.c:(.text+0x88e): undefined reference to `superlu_free_dist'
get_perm_c.c:(.text+0x89d): undefined reference to `superlu_free_dist'
/home/afrah/pdslin/lib/libhybrid.a(get_perm_c.o):get_perm_c.c:(.text+0x8ac): more undefined references to `superlu_free_dist' follow
/home/afrah/pdslin/lib/libhybrid.a(get_perm_c.o): In function `get_perm_c_dist_t':
get_perm_c.c:(.text+0x8b6): undefined reference to `SuperLU_timer_dist_'
get_perm_c.c:(.text+0x91a): undefined reference to `superlu_free_dist'
/home/afrah/pdslin/lib/libhybrid.a(symbolic.o): In function `pdslin_symbfact':
symbolic.c:(.text+0xdb): undefined reference to `intMalloc_dist'
symbolic.c:(.text+0x112): undefined reference to `intMalloc_dist'
symbolic.c:(.text+0x1e5): undefined reference to `intMalloc_dist'
symbolic.c:(.text+0x2fd): undefined reference to `ifill_dist'
symbolic.c:(.text+0x319): undefined reference to `ifill_dist'
symbolic.c:(.text+0x335): undefined reference to `ifill_dist'
symbolic.c:(.text+0x38b): undefined reference to `sp_ienv_dist'
symbolic.c:(.text+0x3ba): undefined reference to `intMalloc_dist'
symbolic.c:(.text+0x403): undefined reference to `superlu_abort_and_exit_dist'
symbolic.c:(.text+0x43d): undefined reference to `superlu_free_dist'
symbolic.c:(.text+0x8fd): undefined reference to `ifill_dist'
symbolic.c:(.text+0x916): undefined reference to `ifill_dist'
/home/afrah/pdslin/lib/libhybrid.a(symbolic.o): In function `pdslin_column_dfs':
symbolic.c:(.text+0x1021): undefined reference to `sp_ienv_dist'
/home/afrah/pdslin/lib/libhybrid.a(symbolic.o): In function `pdslin_pivotL':
symbolic.c:(.text+0x1ae9): undefined reference to `superlu_abort_and_exit_dist'
/home/afrah/pdslin/lib/libhybrid.a(pdgstrs_init.o): In function `dpdslin_pgstrs_init':
pdgstrs_init.c:(.text+0x3f1): undefined reference to `superlu_malloc_dist'
pdgstrs_init.c:(.text+0x43a): undefined reference to
pddistribute.c:(.text+0x1de4): undefined reference to `superlu_abort_and_exit_dist'
pddistribute.c:(.text+0x1e30): undefined reference to `superlu_malloc_dist'
pddistribute.c:(.text+0x1e79): undefined reference to `superlu_abort_and_exit_dist'
pddistribute.c:(.text+0x1e86): undefined reference to `intMalloc_dist'
pddistribute.c:(.text+0x1ecf): undefined reference to `superlu_abort_and_exit_dist'
pddistribute.c:(.text+0x2a31): undefined reference to `intMalloc_dist'
pddistribute.c:(.text+0x2a7a): undefined reference to `superlu_abort_and_exit_dist'
pddistribute.c:(.text+0x2acd): undefined reference to `doubleMalloc_dist'
pddistribute.c:(.text+0x2b2f): undefined reference to `superlu_abort_and_exit_dist'
pddistribute.c:(.text+0x30dc): undefined reference to `superlu_free_dist'
pddistribute.c:(.text+0x30eb): undefined reference to `superlu_free_dist'
pddistribute.c:(.text+0x30fa): undefined reference to `superlu_free_dist'
pddistribute.c:(.text+0x3109): undefined reference to `superlu_free_dist'
pddistribute.c:(.text+0x3118): undefined reference to `superlu_free_dist'
/home/afrah/pdslin/lib/libhybrid.a(pddistribute.o):pddistribute.c:(.text+0x3127): more undefined references to `superlu_free_dist' follow
/home/afrah/pdslin/lib/libhybrid.a(pddistribute.o): In function `dpdslin_pdistribute_base':
pddistribute.c:(.text+0x31e4): undefined reference to `intMalloc_dist'
pddistribute.c:(.text+0x3240): undefined reference to `superlu_abort_and_exit_dist'
pddistribute.c:(.text+0x326f): undefined reference to `superlu_free_dist'
pddistribute.c:(.text+0x327e): undefined reference to `superlu_free_dist'
pddistribute.c:(.text+0x328d): undefined reference to `superlu_free_dist'
collect2: error: ld returned 1 exit status
makefile:10: recipe for target 'dtest' failed
make: *** [dtest] Error 1

This is the content of makefile.inc:

#
# top directory make.inc
# 
# on hopper: % module load cray-petsc which also loads cray-tpsl, including pt-schotch and parmetis.

#-----------------------------------------------------------------------------
# home directory, where the software is located
TOP  = /home/afrah/pdslin

INCLUDEDIR =/usr/local/include
#-----------------------------------------------------------------------------
# hybrid solver library name
LIB  = $(TOP)/lib/libhybrid.a

#-----------------------------------------------------------------------------
# Libraries:
#
# MPI/BLAS libraries
L_MPI =   /usr/share/mpich-install/lib/libmpich.so
I_MPI =  -I/usr/share/mpich-install/include
L_BLAS = /usr/lib/libblas.so /usr/lib/liblapack.so

#-----------------------------------------------------------------------------
# make utility
MAKE = make

#-----------------------------------------------------------------------------
# archiver and flags to build the library
ARCH         = /usr/bin/ar
ARCHFLAGS    = cr
RANLIB       = /usr/bin/ranlib
#-----------------------------------------------------------------------------
# C compiler and flags
CC    = /usr/share/mpich-install/bin/mpicc
FLAGS =  -Wall -Wextra
#-----------------------------------------------------------------------------
# fortran compiler and flags
FC     = mpif90
FLIB   = -pgf90libs
FFLAGS = -g 
#-----------------------------------------------------------------------------
# linker used to link example program with the library
#LINKER = /usr/share/mpich-install/bin/mpicc -Wl,--allow-multiple-definition

LINKER = $(CC) -Wl,--allow-multiple-definition 

#------------------------------------------------------------------
# C++ compiler (this is not needed for your standard compilation)
CPP = mpicxx

#-----------------------------------------------------------------------------
# for Scotch version 6.0 and higher,include both sequential and parallel
PAR_LIB = /usr/local/lib
L_PPART = $(PAR_LIB)/libparmetis.so \
          $(PAR_LIB)/libscotch.a   $(PAR_LIB)/libscotchmetis.a  \
          $(PAR_LIB)/libptscotchparmetis.a  $(PAR_LIB)/libptscotcherr.a $(PAR_LIB)/libptscotch.a

I_PPART = -I/usr/local/include \
           -DSCOTCH_ORDER -I/usr/local/include

#------------------------------------------------------#
# Metis Library, and its header files
L_METIS =  /usr/share/parmetis/lib/libmetis.a 
I_METIS =  -I/usr/share/parmetis/include 


#------------------------------------------------------#
# SuperLU_DIST library, and its header files  (hopper: module load superlu_dist)
# SLUDIST = /global/common/hopper2/acts/SuperLU/SuperLU_DIST/2.5
# L_SLUDIST = -L$(SLUDIST)/craypgi-xe6_O/lib -lsuperlu_dist_2.5
# I_SLUDIST = -I$(SLUDIST)/SRC 

SLUDIST = /home/afrah/SuperLU_DIST_3.3
I_SLUDIST = -I$(SLUDIST)/SRC
L_SLUDIST =  $(SLUDIST)/lib/libsuperlu_dist.so


#------------------------------------------------------#
# Petsc library, and its header files
# double version
I_PETSC = -I/home/afrah/petsc/include \
          -I/home/afrah/petsc/arch-linux2-c-debug/include
L_PETSC = /home/afrah/petsc/arch-linux2-c-debug/lib/libpetsc.so


#------------------------------------------------------#
# Other optional libraries

# serial SuperLU
#L_SLU = /home/afrah/SuperLU_5.2.0/lib/libsuperlu_5.2.a
#I_SLU = -I/home/afrah/SuperLU_5.2.0/SRC

#---------------------------------------------------------------
# accumulate all includes and libraries

INC  = -I$(TOP)/include -I$(INCLUDEDIR) $(I_SLUDIST) $(I_PPART) $(I_METIS)  $(I_MPI) $(I_PETSC)
LIBS = $(L_BLAS) $(L_MPI) $(L_METIS) $(L_PPART) $(L_SLUDIST)  $(L_PETSC) $(LIB)      
ZLIBS = $(L_BLAS) $(L_MPI) $(L_METIS) $(L_PPART) $(L_SLUDIST)  $(L_PETSC) $(LIB)

Some other information:

mpicc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc.

Nawal
  • 97
  • 1
  • 8
  • 1
    Looks like you'll need to link against `-lm`. – user0042 Jul 31 '17 at 21:14
  • `warning: implicit declaration of function...` means that some function declarations were not found by the compiler. Add the missing include directives in your source code and the missing `-I` compilation options. `undefined reference to...` means that the linker could not resolve some symbols (`sqrt`, `superlu_free_dist`...) Add the missing `-l` options or the missing libraries to link. – Renaud Pacalet Aug 02 '17 at 06:17

0 Answers0