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

how to use it on centos system? #18

Closed
liaowang0125 opened this issue May 10, 2017 · 11 comments
Closed

how to use it on centos system? #18

liaowang0125 opened this issue May 10, 2017 · 11 comments
Labels
help wanted/question Extra attention is needed

Comments

@liaowang0125
Copy link

Issue summary

can i use it on centos7?

Your system configuration

Operating system (centos7):
CUDA version (cuda8):

@gineshidalgo99 gineshidalgo99 added the help wanted/question Extra attention is needed label May 10, 2017
@gineshidalgo99
Copy link
Member

I am sorry, but we do not have any Centos machine to try it.

The OpenPose code uses c++11 and the same dependencies than Caffe. So if you are able to compile Caffe (with CUDA and cuDNN) of you own on Centos, you should be able to install OpenPose too.

Please, if you are able to install it, a few lines with the basic steps would be highly appreciated for other Centos users.

@liaowang0125
Copy link
Author

Compiled OpenPose successfully.

Just as you say,modify the CAFFE_DIR ,and have an compiled caffe is enough.

When I first comment,I met the google::protobuf undefined reference problem,I solved it and can install OpenPose.

@ZheC
Copy link
Member

ZheC commented May 11, 2017

Great, thanks for letting us know.

@ZheC ZheC closed this as completed May 11, 2017
@saxenarohan97
Copy link

saxenarohan97 commented Jun 5, 2017

@liaowang0125 How did you modify the CAFFE_DIR, can you please elaborate? Maybe post your makefile?

@liaowang0125
Copy link
Author

modify it to the path to your compiled caffe,like: path/caffe @saxenarohan97

@ankit204
Copy link

Just writing down the steps I ended up running to make things work on centOS.
Create and move to build directory.
Use this command to point cmake to correct libs and include dirs for an existing caffe build:
$ cmake -DCaffe_INCLUDE_DIRS=/caffe-rc3/include/ -DCaffe_LIBS=/caffe-rc3/build/lib/libcaffe.so -DBUILD_CAFFE=OFF ..
It gave the following error issuing make:

Linking CXX executable openpose.bin
/bin/ld: /usr/local/lib/libgflags.a(gflags.cc.o): undefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5'
/bin/ld: note: 'pthread_rwlock_wrlock@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [examples/openpose/openpose.bin] Error 1
make[1]: *** [examples/openpose/CMakeFiles/openpose.bin.dir/all] Error 2

To resolve this, I added a flag to CMakeLists.txt after which the unix sub-case looks like this:

elseif (UNIX AND NOT APPLE)
  # Turn on C++11
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lpthread")
  add_definitions(-std=c++11)
  set(CMAKE_CXX_FLAGS_RELEASE "-O3")

After the change, issuing cmake and make should build successfully.
When running the demo, make sure to use --display 0 if you face X11 issues. Full command:
$ ./build/examples/openpose/openpose.bin --net_resolution "64x48" --image_dir examples/media/ --display 0 --write_json out

@gineshidalgo99
Copy link
Member

gineshidalgo99 commented Apr 12, 2018

@ankit204
Thanks for the feed-back. I've just pushed a fix to include pthread as you did. Could you try the latest OpenPose and let me know if it works by default? Thanks!

(PS: Instead of -lpthread, I did it in the supposedly right CMake way with find_package, it works in Ubuntu, but I could not test it on CentOS as I don't have it)

@boris-lb
Copy link

@liaowang0125 ,can you tell me how do you solve the google::protobuf undefined reference problem?this is my error msg:
[ 91%] Linking CXX executable cpp_classification/classification
[ 93%] Linking CXX executable upgrade_net_proto_text
[ 93%] Linking CXX executable upgrade_net_proto_binary
[ 93%] Linking CXX executable caffe
[ 94%] Linking CXX executable upgrade_solver_proto_text
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::InitSCCImpl(google::protobuf::internal::SCCInfoBase*)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::WireFormatLite::Int64Size(google::protobuf::RepeatedField const&)’未定义的引用
collect2: 错误:ld 返回 1
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::InitSCCImpl(google::protobuf::internal::SCCInfoBase*)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::WireFormatLite::Int64Size(google::protobuf::RepeatedField const&)’未定义的引用
collect2: 错误:ld 返回 1
make[5]: *** [tools/convert_imageset] 错误 1
make[4]: *** [tools/CMakeFiles/convert_imageset.dir/all] 错误 2
make[4]: *** 正在等待未完成的任务....
make[5]: *** [examples/siamese/convert_mnist_siamese_data] 错误 1
make[4]: *** [examples/CMakeFiles/convert_mnist_siamese_data.dir/all] 错误 2
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::InitSCCImpl(google::protobuf::internal::SCCInfoBase*)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::WireFormatLite::Int64Size(google::protobuf::RepeatedField const&)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::AssignDescriptors(std::string const&, google::collect2: 错误:ld 返回 1
protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::InitSCCImpl(google::protobuf::internal::SCCInfoBase*)’未定义的引用
../lib/libcaffe.so.1.0.0:对‘google::protobuf::internal::WireFormatLite::Int64Size(google::protobuf::RepeatedField const&)’未定义的引用
collect2: 错误:ld 返回 1
make[5]: *** [examples/cifar10/convert_cifar_data] 错误 1
make[5]: *** [examples/mnist/convert_mnist_data] 错误 1
make[4]: *** [examples/CMakeFiles/convert_cifar_data.dir/all] 错误 2
make[4]: *** [examples/CMakeFiles/convert_mnist_data.dir/all] 错误 2

@JeBo89
Copy link

JeBo89 commented Apr 9, 2019

Just writing down the steps I ended up running to make things work on centOS.
Create and move to build directory.
Use this command to point cmake to correct libs and include dirs for an existing caffe build:
$ cmake -DCaffe_INCLUDE_DIRS=/caffe-rc3/include/ -DCaffe_LIBS=/caffe-rc3/build/lib/libcaffe.so -DBUILD_CAFFE=OFF ..
It gave the following error issuing make:

Linking CXX executable openpose.bin
/bin/ld: /usr/local/lib/libgflags.a(gflags.cc.o): undefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5'
/bin/ld: note: 'pthread_rwlock_wrlock@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [examples/openpose/openpose.bin] Error 1
make[1]: *** [examples/openpose/CMakeFiles/openpose.bin.dir/all] Error 2

To resolve this, I added a flag to CMakeLists.txt after which the unix sub-case looks like this:

elseif (UNIX AND NOT APPLE)
  # Turn on C++11
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lpthread")
  add_definitions(-std=c++11)
  set(CMAKE_CXX_FLAGS_RELEASE "-O3")

After the change, issuing cmake and make should build successfully.
When running the demo, make sure to use --display 0 if you face X11 issues. Full command:
$ ./build/examples/openpose/openpose.bin --net_resolution "64x48" --image_dir examples/media/ --display 0 --write_json out

Is this solution still applicable today?

@guker
Copy link

guker commented Apr 12, 2021

it works.
os system: centos7 , default( protobuf 2.6.1, gcc 4.8.5)

  1. git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose
  2. cd 3rdparty
  3. git clone https://github.com/CMU-Perceptual-Computing-Lab/caffe.git
  4. cd caffe
  5. cp Makefile.config.Ubuntu14_cuda8.example Makefile.config
  6. modify blas choice by changing BLAS := open
  7. make all # in caffe dir
  8. protoc src/caffe/proto/caffe.proto --cpp_out=.
  9. mkdir include/caffe/proto
  10. mv src/caffe/proto/caffe.pb.h include/caffe/proto
  11. cmake -DCaffe_INCLUDE_DIRS=/xxx/3rdparty/caffe/include/ -DCaffe_LIBS=/xxx/3rdparty/caffe/build/lib/libcaffe.so -DBUILD_CAFFE=OFF .. # here /xxx is absolute path of 3rdparty
  12. make -j[cpu count]

please keep protobuf version 2.6.1
if compile error, please update gcc version(such as gcc 7.3.1)
update gcc method:

  1. yum -y install centos-release-scl
  2. yum -y install devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils
  3. scl enable devtoolset-7 bash

@MLsmaller
Copy link

it works. os system: centos7 , default( protobuf 2.6.1, gcc 4.8.5)

  1. git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose
  2. cd 3rdparty
  3. git clone https://github.com/CMU-Perceptual-Computing-Lab/caffe.git
  4. cd caffe
  5. cp Makefile.config.Ubuntu14_cuda8.example Makefile.config
  6. modify blas choice by changing BLAS := open
  7. make all # in caffe dir
  8. protoc src/caffe/proto/caffe.proto --cpp_out=.
  9. mkdir include/caffe/proto
  10. mv src/caffe/proto/caffe.pb.h include/caffe/proto
  11. cmake -DCaffe_INCLUDE_DIRS=/xxx/3rdparty/caffe/include/ -DCaffe_LIBS=/xxx/3rdparty/caffe/build/lib/libcaffe.so -DBUILD_CAFFE=OFF .. # here /xxx is absolute path of 3rdparty
  12. make -j[cpu count]

please keep protobuf version 2.6.1 if compile error, please update gcc version(such as gcc 7.3.1) update gcc method:

  1. yum -y install centos-release-scl
  2. yum -y install devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils
  3. scl enable devtoolset-7 bash

Thank you very much. I successfully installed Openpose under centos according to your steps, and you saved me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted/question Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants