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

Undefined symbols for architecture x86_64: #5795

Closed
ckeys opened this issue Nov 21, 2017 · 5 comments
Closed

Undefined symbols for architecture x86_64: #5795

ckeys opened this issue Nov 21, 2017 · 5 comments
Labels
iOS User 用于标记用户问题

Comments

@ckeys
Copy link

ckeys commented Nov 21, 2017

Hi All ,

我尝试用cmake在于capi的EXAMPLE 里面的 sequence.

当我用make的时候,出现了以下的问题:

Scanning dependencies of target sequence
[ 50%] Building C object CMakeFiles/sequence.dir/main.c.o
[100%] Linking C executable sequence
Undefined symbols for architecture x86_64:
  "_paddle_arguments_create_none", referenced from:
      _main in main.c.o
  "_paddle_arguments_destroy", referenced from:
      _main in main.c.o
  "_paddle_arguments_get_value", referenced from:
      _main in main.c.o
  "_paddle_arguments_resize", referenced from:
      _main in main.c.o
  "_paddle_arguments_set_ids", referenced from:
      _main in main.c.o
  "_paddle_arguments_set_sequence_start_pos", referenced from:
      _main in main.c.o
  "_paddle_gradient_machine_create_for_inference", referenced from:
      _main in main.c.o
  "_paddle_gradient_machine_destroy", referenced from:
      _main in main.c.o
  "_paddle_gradient_machine_forward", referenced from:
      _main in main.c.o
  "_paddle_gradient_machine_randomize_param", referenced from:
      _main in main.c.o
  "_paddle_init", referenced from:
      _main in main.c.o
  "_paddle_ivector_create", referenced from:
      _main in main.c.o
  "_paddle_ivector_destroy", referenced from:
      _main in main.c.o
  "_paddle_matrix_create_none", referenced from:
      _main in main.c.o
  "_paddle_matrix_destroy", referenced from:
      _main in main.c.o
  "_paddle_matrix_get_row", referenced from:
      _main in main.c.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[2]: *** [sequence] Error 1
make[1]: *** [CMakeFiles/sequence.dir/all] Error 2
make: *** [all] Error 2
@chengduoZH chengduoZH added the User 用于标记用户问题 label Nov 21, 2017
@NHZlX
Copy link
Contributor

NHZlX commented Nov 21, 2017

贴一下你的cmake 编译参数

@ckeys
Copy link
Author

ckeys commented Nov 21, 2017

编译环境:MacOS 10.13.1
xcode版本:9.1
cmake 版本:3.9.6
我尝试搭建IOS平台编译paddle paddle.
首先我先
首先,我先根据以下网站配置cmake,
http://www.paddlepaddle.org/docs/develop/documentation/zh/mobile/cross_compiling_for_ios_cn.html 的cmake指令。然后make install
然后在cd到sequence文件夹,
用以下命令行进行cmake编译
mkdir build
cd build
cmake ..
-DIOS_ARCH="x86_64"
-DCMAKE_TOOLCHAIN_FILE=path/to/Paddle/cmake/cross_compiling/ios.cmake
-DPADDLE_ROOT=/your/path/to/install
-DCMAKE_BUILD_TYPE=MinSizeRel

make
然后就出现上面的错误了。

@NHZlX
Copy link
Contributor

NHZlX commented Nov 21, 2017

嗯, 那再贴一下你的交叉编译的cmake 参数

@ckeys
Copy link
Author

ckeys commented Nov 21, 2017

你说的是cmake配置参数吗?
cmake -DCMAKE_SYSTEM_NAME=iOS
-DIOS_PLATFORM=SIMULATOR
-DIOS_ARCH="x86_64"
-DIOS_USE_VECLIB_FOR_BLAS=ON
-DCMAKE_INSTALL_PREFIX=your/path/to/install
-DWITH_C_API=ON
-DWITH_TESTING=OFF
-DWITH_SWIG_PY=OFF \

@Xreki
Copy link
Contributor

Xreki commented Nov 21, 2017

@ckeys 你好。 capi/example里面的CMakelist.txt里面设定的是链接Paddle的动态库。但是iOS版Paddle只生成了静态库。
另外,提供一些参考链接:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iOS User 用于标记用户问题
Projects
None yet
Development

No branches or pull requests

4 participants