Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No matching function for call to 'gesdd' when building with Xcode #119

Closed
Yue-Zhengyuan opened this issue May 13, 2019 · 10 comments
Closed

Comments

@Yue-Zhengyuan
Copy link

Yue-Zhengyuan commented May 13, 2019

I installed xtl, xtensor and xtensor-blas via conda. Versions:

libblas            conda-forge/osx-64::libblas-3.8.0-9_openblas
libcblas           conda-forge/osx-64::libcblas-3.8.0-9_openblas
liblapack          conda-forge/osx-64::liblapack-3.8.0-9_openblas
liblapacke         conda-forge/osx-64::liblapacke-3.8.0-9_openblas
openblas           conda-forge/osx-64::openblas-0.3.6-hd44dcd8_2
xtensor            conda-forge/osx-64::xtensor-0.20.5-h770b8ee_0
xtensor-blas       conda-forge/osx-64::xtensor-blas-0.16.1-h7f1c7fb_0
xtl                conda-forge/osx-64::xtl-0.6.4-h770b8ee_0

I use the following settings to build by Xcode project with xtensor:

Project type: command line tool

  1. Project - Build settings -

Search Paths:

  • Header search paths: /Users/[username]/anaconda3/include
  • Library search paths: /Users/[username]/anaconda3/lib

Apple Clang - Language - C++:

  • C++ language dialect: GNU++14 [-std=gnu++14]
  • C++ standard library: libc++ (LLVM C++ standard library with C++ 11 support)
  1. Target - Build phases

Link binary with libraries

  • libopenblasp-r0.3.6.a
  • libopenblasp-r0.3.6.dylib

(both these libraries are in the directory /Users/[username]/anaconda3/lib)

When building my project, Xcode raises the error No matching function for call to 'gesdd' in the file /Users/[username]/anaconda3/include/xtensor-blas/xlapack.hpp. Is there any solution to this problem?

I'm using Xcode 10.2.1 on macOS Mojave 10.14.4.

@wolfv
Copy link
Member

wolfv commented May 13, 2019

I think it might be that you additionally need to link to the lapack library.

@Yue-Zhengyuan
Copy link
Author

I installed lapack by the command conda install -c conda-forge lapack. Installed version

lapack             conda-forge/osx-64::lapack-3.6.1-ha44fe06_2

And I added the installed /Users/[username]/anaconda3/lib/liblapack.3.6.1.dylib to "Link binary with libraries". But it doesn't work.

@wolfv
Copy link
Member

wolfv commented May 13, 2019

otool -TV your.dylib
Can you use the command line and cmake to configure your project? since I am not an XCode user, I can't give you any XCode specific help here ...

you shoudl be able to see if gesdd is in the library with this command line instruction:

otool -TV liblapack.3.6.1.dylib

and

otool -TV liblapack.3.6.1.dylib | grep gesdd

@Yue-Zhengyuan
Copy link
Author

Yue-Zhengyuan commented May 13, 2019

otool -TV liblapack.3.6.1.dylib gives the following result:

warning: /Library/Developer/CommandLineTools/usr/bin/otool: -T functionality obsolete
OVERVIEW: llvm object file dumper

USAGE: objdump [options] <input object files>

OPTIONS:
  -aarch64-neon-syntax     - Choose style of NEON code to emit from AArch64 backend:
    =generic               -   Emit generic NEON assembly
    =apple                 -   Emit Apple-style NEON assembly
  -all-headers             - Display all available header information
  -arch=<string>           - architecture(s) from a Mach-O file to dump
  -arch-name=<string>      - Target arch to disassemble for, see -version for available targets
  -archive-headers         - Display archive header information
  -archive-member-offsets  - Print the offset to each archive member for Mach-O archives (requires -macho and -archive-headers)
  -bind                    - Display mach-o binding info
  -color                   - Use colors in output (default=autodetect)
  -data-in-code            - Print the data in code table for Mach-O objects (requires -macho)
  -demangle=<string>       - Demangle symbols names
  -df=<string>             - List of functions to disassemble
  -dis-symname=<string>    - disassemble just this symbol's instructions (requires -macho)
  -disassemble             - Display assembler mnemonics for the machine instructions
  -disassemble-all         - Display assembler mnemonics for the machine instructions
  -dsym=<string>           - Use .dSYM file for debug info
  -dwarf                   - Dump of dwarf debug sections:
    =frames                -   .debug_frame
  -dylib-id                - Print the shared library's id for the dylib Mach-O file (requires -macho)
  -dylibs-used             - Print the shared libraries used for linked Mach-O files (requires -macho)
  -dynamic-reloc           - Display the dynamic relocation entries in the file
  -exports-trie            - Display mach-o exported symbols
  -fault-map-section       - Display contents of faultmap section
  -file-headers            - Display the contents of the overall file header
  -full-leading-addr       - Print full leading address
  -g                       - Print line information from debug info if available
  -help                    - Display available options (-help-hidden for more)
  -indirect-symbols        - Print indirect symbol table for Mach-O objects (requires -macho)
  -info-plist              - Print the info plist section as strings for Mach-O objects (requires -macho)
  -lazy-bind               - Display mach-o lazy binding info
  -line-numbers            - Display source line numbers with disassembly. Implies disassemble object
  -link-opt-hints          - Print the linker optimization hints for Mach-O objects (requires -macho)
  -macho                   - Use MachO specific object file parser
  -mattr=<a1,+a2,-a3,...>  - Target specific attributes
  -mcpu=<cpu-name>         - Target a specific cpu type (-mcpu=help for details)
  -no-leading-addr         - Print no leading address
  -no-leading-headers      - Print no leading headers
  -no-show-raw-insn        - When disassembling instructions, do not print the instruction bytes.
  -no-symbolic-operands    - do not symbolic operands when disassembling (requires -macho)
  -non-verbose             - Print the info for Mach-O objects in non-verbose or numeric form (requires -macho)
  -objc-meta-data          - Print the Objective-C runtime meta data for Mach-O files (requires -macho)
  -print-imm-hex           - Use hex format for immediate values
  -private-header          - Display only the first format specific file header
  -private-headers         - Display format specific file headers
  -r                       - Display the relocation entries in the file
  -raw-clang-ast           - Dump the raw binary contents of the clang AST section
  -rebase                  - Display mach-o rebasing info
  -s                       - Display the content of each section
  -section=<string>        - Operate on the specified sections only. With -macho dump segment,section
  -section-headers         - Display summaries of the headers for each section.
  -source                  - Display source inlined with disassembly. Implies disassemble object
  -start-address=<address> - Disassemble beginning at address
  -stop-address=<address>  - Stop disassembly at address
  -t                       - Display the symbol table
  -triple=<string>         - Target triple to disassemble for, see -version for available targets
  -universal-headers       - Print Mach-O universal headers (requires -macho)
  -unwind-info             - Display unwind information
  -version                 - Display the version of this program
  -weak-bind               - Display mach-o weak binding info

And otool -TV liblapack.3.6.1.dylib | grep gesdd gives nothing but a deprecation warning

warning: /Library/Developer/CommandLineTools/usr/bin/otool: -T functionality obsolete

What do these messages mean?

@wolfv
Copy link
Member

wolfv commented May 13, 2019

sorry, as the message says the -T flag doesn't work anymore.

Try this one instead: nm -gU thelib.dylib

@Yue-Zhengyuan
Copy link
Author

Yue-Zhengyuan commented May 14, 2019

nm -gU liblapack.3.6.1.dylib | grep gesdd gives

00000000003bdf96 T _cgesdd_
00000000001ed89c T _dgesdd_
00000000000260ba T _sgesdd_
000000000059a8f6 T _zgesdd_

nm -gU libopenblasp-r0.3.6.dylib | grep gesdd gives

00000000037a8340 T _LAPACKE_cgesdd
00000000037a8590 T _LAPACKE_cgesdd_work
00000000037f9a40 T _LAPACKE_dgesdd
00000000037f9bf0 T _LAPACKE_dgesdd_work
00000000038445d0 T _LAPACKE_sgesdd
0000000003844780 T _LAPACKE_sgesdd_work
000000000388ec00 T _LAPACKE_zgesdd
000000000388ee50 T _LAPACKE_zgesdd_work
000000000335faf0 T _cgesdd_
00000000031e7e80 T _dgesdd_
000000000306b5a0 T _sgesdd_
0000000003513330 T _zgesdd_

So the package does include gesdd and I should try using the command line directly to configure my program?

@wolfv
Copy link
Member

wolfv commented May 14, 2019

@Yue-Zhengyuan
Copy link
Author

Unfortunately, I have already modified those entries in Xcode. Maybe I'll try using the command line later, but I am a little bit busy right now. Now I close this issue, but I still welcome anyone who succeeds in configuring xtensor with Xcode telling me how to do it.

@xiaonengmiao
Copy link

I encountered this when I try to xt::linalg::norm(array, 2) where array is of type xt::xarray<int>.

@xiaonengmiao
Copy link

I encountered this when I try to xt::linalg::norm(array, 2) where array is of type xt::xarray<int>.

I found that if I change array to be xt::array<double>, this error will disappear. So only double is accepted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants