Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I downloaded and try to installed the package "wfconvert" from this link but I got some error.

here what I did:

  1. copy the wfconvert folder in root "/"
  2. cd /wfconvert/build/

    root@geant4:/wfconvert/build# cmake ..
    -- Current revision : 65 modified on 2013-01-16 22:14:53 +0330 (Wed, 16 Jan 2013)  
    -- Found mpi.h and libraries. Check for working mpi compiler  
    -- MPI is disabled  
    -- Failed to link LAPACK, BLAS, ATLAS libraries with environments. Going to search standard paths.  
    -- LAPACK_LIBRARIES=/usr/lib/  
    -- BLAS_LIBRARIES=/usr/lib/  
    -- CXX compiler flags:  -g -O3 -ftemplate-depth-60 -Drestrict=__restrict__ -funroll-all-loops   -finline-limit=1000 -Wno-deprecated  -mmmx -msse -msse2 -msse3 -fopenmp  
    -- CC  compiler flags:  -O3 -Drestrict=__restrict__ -funroll-all-loops   -finline-limit=1000 -std=gnu99 -fomit-frame-pointer  -mmmx -msse -msse2 -msse3  
    -- LIBXML2_INCLUDE_DIR=/usr/include/libxml2  
    -- LIBXML2_LIBRARIES=/usr/lib/  
    -- HDF5_INCLUDE_DIR=/usr/include  
    -- HDF5_LIBRARIES=/usr/lib/  
    -- FFTW_INCLUDE_DIR=/usr/include  
    -- FFTW_LIBRARIES=/usr/lib/  
    -- Ready to build qmcpack  
    -- Configuring done  
    -- Generating done  
    -- Build files have been written to: /wfconvert/build  
  3. make command

    root@geant4:/wfconvert/build# make
    [  1%] Building C object src/einspline/CMakeFiles/einspline.dir/bspline_create.c.o  
    In file included from /wfconvert/src/einspline/bspline_base.h:24:0,  
             from /wfconvert/src/einspline/bspline_create.h:24,  
             from /wfconvert/src/einspline/bspline_create.c:21:  
    /wfconvert/build/src/Common/config.h:65:17: fatal error: cmath: No such file or directory  
     #include <cmath> 
    compilation terminated.    
    make[2]: *** [src/einspline/CMakeFiles/einspline.dir/bspline_create.c.o] Error 1  
    make[1]: *** [src/einspline/CMakeFiles/einspline.dir/all] Error 2  
    make: *** [all] Error 2  

I don`t know what to do!
here is my cmath file list:

root@geant4:/# find -name cmath


root@geant4:/# uname -a
Linux geant4 3.0.0-32-generic-pae #51-Ubuntu SMP Thu Mar 21 16:09:48 UTC 2013 i686 i686 i386 GNU/Linux

Please help me.

share|improve this question

I would suspect corrupt installation of development tools or something like that. First thing I would do is re install build package

sudo apt-get purge build-essential
sudo apt-get install build-essential

If the problem still persists post it back

Just curious: How did you install GCC 4.8? I have 13.04 and it have 4.7.3 So that might be an issue if was not done properly!

share|improve this answer
I did your instruction but the problem did not solve. for installing gcc-4.8 refer to the link :… – alireza yousefi Jun 18 '13 at 7:41
Can you upload CmakeList.txt or screenshot of CMake GUI configurations? What happens if you cahnge line from <cmath> to <cmath.h>? – Stefano Mtangoo Jun 18 '13 at 11:51
download the CmakeList.txt , and when I replace the <cmath> with <cmath.h> the error remain the same. – alireza yousefi Jun 19 '13 at 10:40

Is libm automatically linked too, while compiling ?

libm is for compiler g++ and is automatically linked. If you use gcc as compiler you need to link manually with math.h

I found this link here about different compilers generally :

By the way - there is

You could compile and include with boost-libraries too.

share|improve this answer
how can I linked manually to math.h – alireza yousefi Jun 18 '13 at 7:58
with gcc it looks this: gcc example.c -o example -lm for more precise compiling you do this: gcc -ggdb -Wall example.c -o example -lm – dschinn1001 Jun 18 '13 at 17:19
with gcc it looks this: gcc example.c -o example -lm for more precise compiling you do this: gcc -ggdb -Wall example.c -o example -lm (provided - there is: #include <math.h> at the beginning of example.c) – dschinn1001 Jun 18 '13 at 17:32

with gcc it looks this:

gcc example.c -o example -lm

for more precise compiling (with debugging output in case of failures) you do this:

gcc -ggdb -Wall example.c -o example -lm

lm is here the linking with the math-library of gcc (there is #include math.h at the beginning of example.c).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.