Open Dazzid opened 2 years ago
Hi @Dazzid
How did you install the library? I have to update the docs, because since one of the latest PR, now the library is installed with CMake. You can check that PR here, and follow the instructions.
Hope this helps!
Hi @serizba
Ok, I'm testing with the M1 Pro chip and tried opening the Terminal in Rosseta mode but now I have this error:
ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
The instructions I'm following are this: git clone https://github.com/serizba/cppflow cd cppflow mkdir build cd build cmake -DBUILD_EXAMPLES=ON .. make -j8
So, the error is produced when you do the make -j8
? What else is said in the error message?
yes, after make -j8
ld: symbol(s) not found for architecture arm64 clang: clangclang: : clang: clang: error: error: linker command failed with exit code 1 (use -v to see invocation)linker command failed with exit code 1 (use -v to see invocation)error: error: linker command failed with exit code 1 (use -v to see invocation) linker command failed with exit code 1 (use -v to see invocation) error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [examples/multi_input_output/multi_input_output] Error 1 make[2]: [examples/load_model/load_model] Error 1 make[2]: [examples/efficientnet/efficientnet] Error 1 make[2]: [examples/tensor/tensor] Error 1 make[2]: [examples/eager_op_multithread/eager_op_multithread] Error 1 make[1]: [examples/load_model/CMakeFiles/load_model.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... make[1]: [examples/multi_input_output/CMakeFiles/multi_input_output.dir/all] Error 2 make[1]: [examples/tensor/CMakeFiles/tensor.dir/all] Error 2 make[1]: [examples/efficientnet/CMakeFiles/efficientnet.dir/all] Error 2 make[1]: [examples/eager_op_multithread/CMakeFiles/eager_op_multithread.dir/all] Error 2 make: [all] Error 2
But, doesn't it says what is the symbol that it's not found?
Ah, I copied the last part
[ 9%] Linking CXX executable efficientnet [ 18%] Linking CXX executable load_model [ 27%] Linking CXX executable eager_op_multithread [ 36%] Linking CXX executable tensor [ 45%] Linking CXX executable multi_input_output ld: warning: ld: warning: ld: warning: ld: warning: ignoring file /usr/local/lib/libtensorflow.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64ignoring file /usr/local/lib/libtensorflow.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64 ld: warning: ignoring file /usr/local/lib/libtensorflow.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64ignoring file /usr/local/lib/libtensorflow.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ignoring file /usr/local/lib/libtensorflow.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
"_TFE_DeleteContext", referenced from:
Undefined symbols for architecture arm64:
"_TFE_DeleteContext", referenced from:
Undefined symbols for architecture arm64:
"_TFE_DeleteContext", referenced from:
Undefined symbols for architecture arm64:
"_TFE_DeleteContext", referenced from:
Undefined symbols for architecture arm64:
"_TFE_DeleteContext", referenced from:
cppflow::context::~context() in main.cpp.o
cppflow::context::~context() in main.cpp.o
cppflow::context::~context() in main.cpp.o
cppflow::context::~context() in main.cpp.o
cppflow::context::~context() in main.cpp.o
"_TFE_DeleteContextOptions", referenced from:
"_TFE_DeleteContextOptions", referenced from:
"_TFE_DeleteContextOptions", referenced from:
"_TFE_DeleteContextOptions", referenced from:
"_TFE_DeleteContextOptions", referenced from:
cppflow::context::context(TFE_ContextOptions) in main.cpp.o
cppflow::context::context(TFE_ContextOptions) in main.cpp.o
cppflow::context::context(TFE_ContextOptions) in main.cpp.o
cppflow::context::context(TFE_ContextOptions) in main.cpp.o
"_TFE_DeleteOp", referenced from:
"_TFE_DeleteOp", referenced from:
cppflow::context::context(TFE_ContextOptions) in main.cpp.o
cppflow::mul(cppflow::tensor const&, cppflow::tensor const&) in main.cpp.o
cppflow::fill(cppflow::tensor const&, cppflow::tensor const&, TF_DataType) in main.cpp.o
cppflow::add(cppflow::tensor const&, cppflow::tensor const&) in main.cpp.o
cppflow::tensor::shape() const in main.cpp.o
cppflow::add(cppflow::tensor const&, cppflow::tensor const&) in main.cpp.o
"_TFE_DeleteOp", referenced from:
cppflow::string_format(std::1::vector<cppflow::tensor, std::1::allocator
(...)
ld: symbol(s) not found for architecture arm64
"_TF_SessionRun", referenced from:
cppflow::model::operator()(std::1::vector<std::1::tuple<std::1::basic_string<char, std::__1::char_traits
I see.
What version of TF C API are you using?
I don't know. I only have linux and cpu-linux-x86_64-2.8.0
works fine in my computer. I think is some issue with the MacOS compiler. Have you checked this?
Same error on my ubuntu system too with cpu-linux-x86_64-2.8.0
version of the C API.
I have the same error : git clone https://github.com/serizba/cppflow.git Cloning into 'cppflow'... remote: Enumerating objects: 1011, done. remote: Counting objects: 100% (313/313), done. remote: Compressing objects: 100% (139/139), done. remote: Total 1011 (delta 195), reused 250 (delta 170), pack-reused 698 Receiving objects: 100% (1011/1011), 8.70 MiB | 5.32 MiB/s, done. Resolving deltas: 100% (483/483), done. Checking connectivity... done. root@amax:/data/tenforflow# date 2023年 02月 15日 星期三 17:40:31 CST root@amax:/data/tenforflow# cd cppflow/examples/load_model root@amax:/data/tenforflow/cppflow/examples/load_model# mkdir build root@amax:/data/tenforflow/cppflow/examples/load_model# cd build/ root@amax:/data/tenforflow/cppflow/examples/load_model/build# cmake .. -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done (0.5s) -- Generating done (0.0s) -- Build files have been written to: /data/tenforflow/cppflow/examples/load_model/build root@amax:/data/tenforflow/cppflow/examples/load_model/build# make -j [ 50%] Building CXX object CMakeFiles/load_model.dir/main.cpp.o /data/tenforflow/cppflow/examples/load_model/main.cpp:36:25: fatal error: cppflow/ops.h: No such file or directory compilation terminated. CMakeFiles/load_model.dir/build.make:75: recipe for target 'CMakeFiles/load_model.dir/main.cpp.o' failed make[2]: [CMakeFiles/load_model.dir/main.cpp.o] Error 1 CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/load_model.dir/all' failed make[1]: [CMakeFiles/load_model.dir/all] Error 2 Makefile:90: recipe for target 'all' failed make: *** [all] Error 2
I have the same error : git clone https://github.com/serizba/cppflow.git Cloning into 'cppflow'... remote: Enumerating objects: 1011, done. remote: Counting objects: 100% (313/313), done. remote: Compressing objects: 100% (139/139), done. remote: Total 1011 (delta 195), reused 250 (delta 170), pack-reused 698 Receiving objects: 100% (1011/1011), 8.70 MiB | 5.32 MiB/s, done. Resolving deltas: 100% (483/483), done. Checking connectivity... done. root@amax:/data/tenforflow# date 2023年 02月 15日 星期三 17:40:31 CST root@amax:/data/tenforflow# cd cppflow/examples/load_model root@amax:/data/tenforflow/cppflow/examples/load_model# mkdir build root@amax:/data/tenforflow/cppflow/examples/load_model# cd build/ root@amax:/data/tenforflow/cppflow/examples/load_model/build# cmake .. -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done (0.5s) -- Generating done (0.0s) -- Build files have been written to: /data/tenforflow/cppflow/examples/load_model/build root@amax:/data/tenforflow/cppflow/examples/load_model/build# make -j [ 50%] Building CXX object CMakeFiles/load_model.dir/main.cpp.o /data/tenforflow/cppflow/examples/load_model/main.cpp:36:25: fatal error: cppflow/ops.h: No such file or directory compilation terminated. CMakeFiles/load_model.dir/build.make:75: recipe for target 'CMakeFiles/load_model.dir/main.cpp.o' failed make[2]: [CMakeFiles/load_model.dir/main.cpp.o] Error 1 CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/load_model.dir/all' failed make[1]: [CMakeFiles/load_model.dir/all] Error 2 Makefile:90: recipe for target 'all' failed make: *** [all] Error 2
copy header file: cp -rf cppflow/include/cppflow /usr/local/include ; worked ### then try make again: cppflow/examples/load_model/build# make [ 50%] Building CXX object CMakeFiles/load_model.dir/main.cpp.o In file included from /usr/include/c++/5/type_traits:35:0, from /usr/local/include/cppflow/datatype.h:39, from /usr/local/include/cppflow/tensor.h:52, from /usr/local/include/cppflow/ops.h:38, from /data/tenforflow/cppflow/examples/load_model/main.cpp:36: /usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
^
In file included from /usr/local/include/cppflow/tensor.h:51:0,
from /usr/local/include/cppflow/ops.h:38,
from /data/tenforflow/cppflow/examples/load_model/main.cpp:36:
/usr/local/include/cppflow/context.h:57:18: error: expected ‘,’ or ‘...’ before ‘&&’ token
context(context&&) noexcept;
^
/usr/local/include/cppflow/context.h:57:20: error: invalid constructor; you probably meant ‘cppflow::context (const cppflow::context&)’
context(context&&) noexcept;
^
/usr/local/include/cppflow/context.h:57:20: error: expected ‘;’ at end of member declaration
/usr/local/include/cppflow/context.h:57:22: error: ‘noexcept’ does not name a type
context(context&&) noexcept;
^
/usr/local/include/cppflow/context.h:57:22: note: C++11 ‘noexcept’ only available with -std=c++11 or -std=gnu++11
/usr/local/include/cppflow/context.h:62:29: error: expected ‘,’ or ‘...’ before ‘&&’ token
context& operator=(context&&) noexcept;
^
/usr/local/include/cppflow/context.h:62:31: error: expected ‘;’ at end of member declaration
context& operator=(context&&) noexcept;
^
/usr/local/include/cppflow/context.h:62:33: error: ‘noexcept’ does not name a type
context& operator=(context&&) noexcept;
^
/usr/local/include/cppflow/context.h:62:33: note: C++11 ‘noexcept’ only available with -std=c++11 or -std=gnu++11
/usr/local/include/cppflow/context.h:54:47: error: ‘nullptr’ was not declared in this scope
explicit context(TFE_ContextOptions opts = nullptr);
^
/usr/local/include/cppflow/context.h:70:28: error: ‘nullptr’ was not declared in this scope
TFE_Context tfe_context{nullptr};
^
/usr/local/include/cppflow/context.h:70:35: error: cannot convert ‘
Same I constantly get the following error on Mac, Intel chip:
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
@Dazzid have you found a solution?
i am facing the same problem now
I changed the relative paths in main.cpp and most .h files for which this error was appearing. seems like this error has been fixed. now I get the next error $ make -j [ 50%] Linking CXX executable load_model /usr/bin/ld: cannot find -lcppflow: No such file or directory collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/load_model.dir/build.make:97: load_model] Error 1 make[1]: [CMakeFiles/Makefile2:83: CMakeFiles/load_model.dir/all] Error 2 make: *** [Makefile:91: all] Error 2
btw seems like i found a way to fix it i used commands
git clone https://github.com/serizba/cppflow
cd cppflow
mkdir build
cd build
cmake -DBUILD_EXAMPLES=OFF ..
make -j
sudo make install
and it installed successfully
Following the installation instructions, when running 'make' I have this error:
`/Users/david/Desktop/cppflow/examples/load_model/main.cpp:3:10: fatal error: 'cppflow/ops.h' file not found
include "cppflow/ops.h"`
I might be messing a step?