You are not logged in.
I find myself stumped as to building this program with cmake. I have a draft PKGBUILD here (needs work) but the key now is that the build fails and am seeking advice as I am totally unfamiliar with cmake.
pkgname=calcpi
pkgver=1.0.0
pkgrel=1
epoch=
pkgdesc="pending"
arch=('x86_64')
url="http://calcpi.sourceforge.net/docs.html"
license=('GPL')
makedepends=('cmake')
depends=('wxgtk' 'boost' 'gmp' 'mpfr' 'eigen')
source=(http://heanet.dl.sourceforge.net/project/calcpi/CalcPi/$pkgver/CalcPi_src_$pkgver.7z)
sha256sums=('73e94b727286dd3c5dfad6f70011275bf9ae9e25e083273edd1adeb0f9f48b40')
build() {
cd src
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make
}
package() {
cd src
make DESTDIR="$pkgdir/" install
}
Right now, it fails with this error:
==> Starting build()...
-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is GNU 5.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- GMP libs: /usr/lib64/libgmp.so /usr/lib64/libgmpxx.so
-- Found GMP: /usr/include
/usr/lib64/libgmp.so
-- MPFR libs: /usr/lib64/libmpfr.so
-- Found MPFR: /usr/include
/usr/lib64/libmpfr.so
wxWidgets_ROOT_DIR =
-- Found wxWidgets: -pthread;;;-lwx_baseu_net-3.0;-lwx_gtk2u_gl-3.0;-lwx_gtk2u_adv-3.0;-lwx_gtk2u_core-3.0;-lwx_baseu-3.0 (found version "3.0.2")
wxWidgets_INCLUDE_DIRS = /usr/lib/wx/include/gtk2-unicode-3.0;/usr/include/wx-3.0
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Boost version: 1.60.0
-- Found the following Boost libraries:
-- date_time
-- thread
-- system
-- chrono
-- atomic
Boost_LIBRARIES = /usr/lib64/libboost_date_time.a;/usr/lib64/libboost_thread.a;/usr/lib64/libboost_system.a;/usr/lib64/libboost_chrono.a;/usr/lib64/libboost_atomic.a
CMake Warning at CMakeLists.txt:88 (FIND_PACKAGE):
By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Eigen3", but
CMake did not find one.
Could not find a package configuration file provided by "Eigen3" (requested
version 3.0.0) with any of the following names:
Eigen3Config.cmake
eigen3-config.cmake
Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set
"Eigen3_DIR" to a directory containing one of the above files. If "Eigen3"
provides a separate development package or SDK, be sure it has been
installed.
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp
-- Configuring done
-- Generating done
-- Build files have been written to: /scratch/calcpi/src/src
Scanning dependencies of target calc_pi
[ 6%] Building CXX object CMakeFiles/calc_pi.dir/CalcPiMainFrameBase.cpp.o
[ 12%] Building CXX object CMakeFiles/calc_pi.dir/CalcPiApp.cpp.o
[ 18%] Building CXX object CMakeFiles/calc_pi.dir/CalculatePIMPFR.cpp.o
[ 25%] Building CXX object CMakeFiles/calc_pi.dir/CalcPiWorkerThread.cpp.o
[ 37%] Building CXX object CMakeFiles/calc_pi.dir/CalculatePIChudnovsky.cpp.o
[ 37%] Building CXX object CMakeFiles/calc_pi.dir/CalculatorFactory.cpp.o
[ 43%] Building CXX object CMakeFiles/calc_pi.dir/CalcPiMainFrame.cpp.o
[ 50%] Building CXX object CMakeFiles/calc_pi.dir/CalculateEMPFR.cpp.o
[ 56%] Building CXX object CMakeFiles/calc_pi.dir/CalcPiVirtualListControl.cpp.o
[ 62%] Building CXX object CMakeFiles/calc_pi.dir/CalculatePIChudnovskyOMP.cpp.o
[ 68%] Building CXX object CMakeFiles/calc_pi.dir/CalcPiBenchmarkThread.cpp.o
[ 75%] Building CXX object CMakeFiles/calc_pi.dir/CalcPiFitBenchmarkResults.cpp.o
[ 81%] Building C object CMakeFiles/calc_pi.dir/getRSS.c.o
[ 87%] Building CXX object CMakeFiles/calc_pi.dir/CalculatePIBoost.cpp.o
[ 93%] Building C object CMakeFiles/calc_pi.dir/getMemorySize.c.o
[100%] Linking CXX executable calc_pi
/usr/bin/ld: CMakeFiles/calc_pi.dir/CalculatePIChudnovsky.cpp.o: undefined reference to symbol '__gmpf_add'
/usr/lib/libgmp.so.10: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/calc_pi.dir/build.make:469: recipe for target 'calc_pi' failed
make[2]: *** [calc_pi] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/calc_pi.dir/all' failed
make[1]: *** [CMakeFiles/calc_pi.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Thanks for any insights.
Last edited by graysky (2016-05-02 19:42:59)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
That generally means it's missing the flag to link it to the necessary lib (-l<lib>).
Offline
Seems like there are multiple errors with it.... First is the missing eigen3 stuff and 2nd are the actual make errors at the bottom. Perhaps they are related? I tried using pkgfile to locate the needed file but wasn't successful. Is this is packaging problem with our stuff or within the upstream code I am trying to compile?
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Both are likely upstream problems. For eigen3, the cmake files are not installed with a normal "make install", when they probably should be. We could work around that in the eigen packaging, of course. The second is a problem in the build system you're trying to compile now. To work around it, try adding `export LD_FLAGS="-lgmpxx -lgmp $LD_FLAGS"` to the build function (assuming it honors LD_FLAGS).
Last edited by Scimmia (2016-05-02 11:11:00)
Offline
@Scimmia - No dice adding the export statement to the build function. Ends in the same error as above
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline