Closed gururajrkatti closed 3 years ago
Hi, here are some options you can use:
spoa_optimize_for_native
: builds with -march=native
spoa_optimize_for_portability
: builds with -msse4.1spoa_use_simde
: builds with SIMDe for porting vectorized codespoa_use_simde_nonvec
: uses SIMDe library for nonvectorized codespoa_use_simde_openmp
: uses SIMDe support for OpenMP SIMDspoa_generate_dispatch
: uses SIMDe to generate x86 dispatchFor example, you can disable -march=native
with -Dspoa_optimize_for_native=OFF
while running cmake.
Best regards, Robert
Hi @rvaser, thanks for your response. Using this option, I was able to pass through native error, however I get a link error related to pthread. Detailed logs below.
[100%] Linking CXX executable bin/spoa_test
/usr/local/lib/libgtest.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::~ThreadLocal()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED5Ev]+0x30): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED5Ev]+0x58): undefined reference to `pthread_key_delete'
/usr/local/lib/libgtest.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::TraceInfo> > >::~ThreadLocal()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED2Ev[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED5Ev]+0x30): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED2Ev[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED5Ev]+0x58): undefined reference to `pthread_key_delete'
/usr/local/lib/libgtest.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::TraceInfo> > >::GetOrCreateValue() const':
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv]+0x34): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv]+0xd0): undefined reference to `pthread_setspecific'
/usr/local/lib/libgtest.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::CreateKey()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE9CreateKeyEv[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE9CreateKeyEv]+0x30): undefined reference to `pthread_key_create'
/usr/local/lib/libgtest.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::TraceInfo> > >::CreateKey()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE9CreateKeyEv[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE9CreateKeyEv]+0x30): undefined reference to `pthread_key_create'
/usr/local/lib/libgtest.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::GetOrCreateValue() const':
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv]+0x34): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv]+0xd0): undefined reference to `pthread_setspecific'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/spoa_test] Error 1
make[1]: *** [CMakeFiles/spoa_test.dir/all] Error 2
make: *** [all] Error 2
You can try adding the commands bellow before https://github.com/rvaser/spoa/blob/master/CMakeLists.txt#L146:
find_package(Threads REQUIRED)
target_link_libraries(${PROJECT_NAME}_test
Threads::Threads)
Alternatively, try using -Dgtest_disable_pthreads=ON
while running cmake.
Hi @rvaser, I am able to fix the pthread issue by adding below lines to CMakeLists.txt. Will be raising a PR with these changes. Hope it is ok
diff CMakeLists.txt.org CMakeLists.txt
15a16,20
> set(CMAKE_THREAD_LIBS_INIT "-lpthread")
> set(CMAKE_HAVE_THREADS_LIBRARY 1)
> set(CMAKE_USE_WIN32_THREADS_INIT 0)
> set(CMAKE_USE_PTHREADS_INIT 1)
> set(THREADS_PREFER_PTHREAD_FLAG ON)
As spoa does not use threading, only googletest does, the PR is not necessary and will not be considered, sorry.
@gururajrkatti You might want to check out the Debian patches for spoa, we've been building on ppc64le this year: https://buildd.debian.org/status/package.php?p=spoa
https://sources.debian.org/src/spoa/3.4.0+ds-2/debian/patches/
Here are the flags we pass to cmake: https://sources.debian.org/src/spoa/3.4.0+ds-2/debian/rules/#L8
Currently we develop the Debian source package for spoa at https://salsa.debian.org/med-team/spoa
Hope this helps!
Hi , I am working on building this on linux on power little endian architecture. I found that it fails during build stage due to usage of -march=native option. This is not supported on ppc64le. Is this option needed ? Could you pl. take a look into the same and see if something can be done
Below is the exact error message
https://travis-ci.com/github/gururajrkatti/spoa/jobs/461198016