conda-forge / clapack-feedstock

A conda-smithy repository for clapack.
BSD 3-Clause "New" or "Revised" License
2 stars 5 forks source link

undefined references linking to clapack #2

Closed erwindassen closed 6 years ago

erwindassen commented 6 years ago

Hi there,

I'm having an issue linking the library to my executable:

 [ 25%] Linking C executable wccsukf
/home/erwindassen/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/173.3727.114/bin/cmake/bin/cmake -E cmake_link_script CMakeFiles/wccsukf.dir/link.txt --verbose=True
/usr/bin/cc -g   CMakeFiles/wccsukf.dir/cUKF.c.o CMakeFiles/wccsukf.dir/wccsukf.c.o CMakeFiles/wccsukf.dir/main.c.o  -o wccsukf /home/erwindassen/.conda/envs/wccs-dev/lib/liblapack.a /home/erwindassen/.conda/envs/wccs-dev/lib/libblas.a 
/home/erwindassen/.conda/envs/wccs-dev/lib/liblapack.a(dtrtri.c.o): In function `dtrtri_':
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/dtrtri.c:169: undefined reference to `s_cat'
/home/erwindassen/.conda/envs/wccs-dev/lib/liblapack.a(ilaenv.c.o): In function `ilaenv_':
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:188: undefined reference to `s_copy'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:429: undefined reference to `s_cmp'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:430: undefined reference to `s_cmp'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:430: undefined reference to `s_cmp'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:431: undefined reference to `s_cmp'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:432: undefined reference to `s_cmp'
/home/erwindassen/.conda/envs/wccs-dev/lib/liblapack.a(ilaenv.c.o):/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:439: more undefined references to `s_cmp' follow
/home/erwindassen/.conda/envs/wccs-dev/lib/liblapack.a(ilaenv.c.o): In function `ilaenv_':
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:245: undefined reference to `s_copy'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:246: undefined reference to `s_copy'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:247: undefined reference to `s_copy'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:265: undefined reference to `s_cmp'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:266: undefined reference to `s_cmp'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:521: undefined reference to `s_cmp'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:522: undefined reference to `s_cmp'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:300: undefined reference to `s_cmp'
/home/erwindassen/.conda/envs/wccs-dev/lib/liblapack.a(ilaenv.c.o):/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/ilaenv.c:301: more undefined references to `s_cmp' follow
/home/erwindassen/.conda/envs/wccs-dev/lib/liblapack.a(iparmq.c.o): In function `iparmq_':
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/iparmq.c:205: undefined reference to `log'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/iparmq.c:206: undefined reference to `i_nint'
/home/erwindassen/.conda/envs/wccs-dev/lib/liblapack.a(dpotf2.c.o): In function `dpotf2_':
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/dpotf2.c:163: undefined reference to `sqrt'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/SRC/dpotf2.c:196: undefined reference to `sqrt'
/home/erwindassen/.conda/envs/wccs-dev/lib/liblapack.a(dlamch.c.o): In function `dlamc2_':
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/INSTALL/dlamch.c:525: undefined reference to `pow_di'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/INSTALL/dlamch.c:643: undefined reference to `s_wsfe'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/INSTALL/dlamch.c:644: undefined reference to `do_fio'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/INSTALL/dlamch.c:645: undefined reference to `e_wsfe'
/home/erwindassen/.conda/envs/wccs-dev/lib/liblapack.a(dlamch.c.o): In function `dlamch_':
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/INSTALL/dlamch.c:119: undefined reference to `pow_di'
/feedstock_root/build_artefacts/recipe_root_1486418675549/work/clapack-3.2.1-CMAKE/INSTALL/dlamch.c:115: undefined reference to `pow_di'
collect2: error: ld returned 1 exit status
CMakeFiles/wccsukf.dir/build.make:148: recipe for target 'wccsukf' failed

This might well be an issue on my side but I have no clue. Any dependencies I'm not ware of? The library is compiled into a static library right?

Help is very much appreciated.

Kind regards,

Erwin

dnadeau4 commented 6 years ago

Erwin, I recompiled the feedstock conda-forge recipe and was successful to create the library.

git clone git@github.com:conda-forge/clapack-feedstock.git 
cd clapack-feedstock
conda build recipe -c conda-forge

Looking at your error message, it seems that you are missing F2CLIBS. This is where s_cat, s_copy, s_cmp,... are defined.

F2CLIBS comes with the clapack library. cmake and then make will compile it.

erwindassen commented 6 years ago

Thank you that fixed... I knew it was on my end ;)