0

I am trying to install "TAUCS" (http://www.tau.ac.il/~stoledo/taucs/) library. However, I am getting following error:

/usr/bin/ld: skipping incompatible external/lib/linux/libmetis.a when searching for -lmetis
/usr/bin/ld: cannot find -lmetis
/usr/bin/ld: cannot find -lg2c
collect2: error: ld returned 1 exit status
make: [build/linux/taucs_config_tests.h] Error 1 (ignored)
obj/linux/taucs_c99_complex_test build/linux/taucs_config_tests.h
make: obj/linux/taucs_c99_complex_test: Command not found
make: [build/linux/taucs_config_tests.h] Error 127 (ignored)
cc -c -O3 -Wall -Werror -std=c99    -DMACHTYPE_ -I src/ -I build/linux/ -I external/src/   \
      progs/taucs_cilk_test.c \
      -oobj/linux/taucs_cilk_test.o
progs/taucs_cilk_test.c:8:19: fatal error: cilk.h: No such file or directory
 #include <cilk.h> 
                   ^

more errors follow.

I think that this error arises as I already use gcc which uses gfortran instead of g77.

1) I could get the old file by doing this:

wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/libg2c0_3.4.6-6ubuntu5_i386.deb
sudo dpkg -i --force-all libg2c0_3.4.6-6ubuntu5_i386.deb

This created following files in /usr/lib/

libg2c.so.0
libg2c.so.0.0.0

2) After that, I found online link which suggests to create soft link, like this:

cd /usr/lib
ln -s libg2c.so.0 libg2c.so

I guess that I have include this along with

CILKC=$(CC)

So, I commented out this line and added soft link.

But, I get the following error:

build/linux/makefile:11: *** commands commence before first target.  Stop.

Some guidance would be appreciated?

Update based on @steeldriver answer: After I did as suggested by aforementioned user, everything complied fine. But, I am getting some warnings which I am VERY concerned about.

usr/bin/ld: skipping incompatible external/lib/linux/liblapack.a when searching for -llapack
....
/usr/bin/ld: skipping incompatible external/lib/linux/libf77blas.a when searching for -lf77blas
...
/usr/bin/ld: skipping incompatible external/lib/linux/libcblas.a when searching for -lcblas
....
/usr/bin/ld: skipping incompatible external/lib/linux/libatlas.a when searching for -latlas
....
/usr/bin/ld: skipping incompatible external/lib/linux/libmetis.a when searching for -lmetis

I think that issue could be that these library may be 64 bits vs 32 bits. Is it possible to have both versions of libraries? I could put less frequent in /usr/local/lib. How could I ensure that a particular versions of libraries are linked in makefile?

Garima Singh
  • 167
  • 3
  • 10

2 Answers2

1

I don't know if it build correctly, but I was able to build TAUCS 2.2 on 32-bit Ubuntu 12.04 using gfortran as follows

  1. Download the Version 2.2 of the code, with external libraries, tgz format

    wget http://www.tau.ac.il/~stoledo/taucs/2.2/taucs_full.tgz
    
  2. Unpack it in your chosen location

    mkdir taucs_full
    
    tar xvf taucs_full.tgz -C taucs_full
    
    cd taucs_full
    
  3. If you didn't already do so, install libf2c2-dev (for libf2c)

    sudo apt-get install libf2c2-dev
  4. Remove the -Werror flag from the global compiler options file (there are going to be warnings, so it will never build if we treat them as errors)

    sed -i 's/-Werror//g' config/linux.mk
    
  5. Now run the configure script

    ./configure
    
  6. Finally we need to do some command and library wrangling for the actual make

    make "CC=gcc" "FC=gfortran -ff2c" "LIBF77=-Wl,-Bdynamic -lgfortran"
    

You should get a binary executable in ./bin/linux - I don't have any means to test it functionally but it at least runs:

$ bin/linux/taucs_run 
taucs_run: there is no matrix!
steeldriver
  • 136,215
  • 21
  • 243
  • 336
  • After I did as suggested by you , everything complied fine. But, I am getting some warnings which I am VERY concerned about. Please have a look at my update in the original question. – Garima Singh Jan 22 '15 at 10:44
  • Well provided that it is finding the compatible libraries (which it must be, I think - else ld would complain and wouldn't build the executables) you should be OK. OTOH the reason I used taucs_full is I couldn't identify the correct metis library: if you have libmetis on your system, I suggest trying again using the version without the external libs but otherwise following the same steps. – steeldriver Jan 22 '15 at 13:18
1

@steeldriver's answer didn't work as-is for me, so I adapted it as follows. I only changed steps 3 and 6, and added the Testing part.

I'm using a completely fresh Ubuntu 14.04 32 bit. (Note that using 64 bit makes things more complicated.)

Compiling

  1. Download the Version 2.2 of the code, with external libraries, tgz format

    wget http://www.tau.ac.il/~stoledo/taucs/2.2/taucs_full.tgz
    
  2. Unpack it in your chosen location

    mkdir taucs_full
    
    tar xvf taucs_full.tgz -C taucs_full
    
    cd taucs_full
    
  3. Install the packages gfortran and libf2c2-dev. (I don't know why @steeldriver removed installing the lib from his list.)

    sudo apt-get install gfortran libf2c2-dev
    
  4. Remove the -Werror flag from the global compiler options file (there are going to be warnings, so it will never build if we treat them as errors)

    sed -i 's/-Werror//g' config/linux.mk
    
  5. Now run the configure script

    ./configure

  6. Finally we need to do some command and library wrangling for the actual make. (This command is different from the one in @steeldriver's solution.)

    make "CC=gcc" "FC=gfortran -ff2c" "LIBF77=-Wl,-Bdynamic -lgfortran -lf2c -u MAIN__"
    

You should get a binary executable in ./bin/linux and the lib in ./lib/linux.

Testing

To test the lib I used the file test_taucs.cpp from this site:

  1. Put test_taucs.cpp in the taucs_full folder
  2. Install g++

    sudo apt-get install g++
    
  3. Compile the cpp file

    g++ test_taucs.cpp -I ./src -I ./build/linux/ -L lib/linux/ -ltaucs -L external/lib/linux -llapack -lf77blas -lcblas -latlas -lmetis -Wl,-Bdynamic -lgfortran -lm -lf2c  -u MAIN__
    
  4. Run a.out

    ./a.out
    

The output should contain the solution (0 2 0 4) as described in the linked blog post.

gebi
  • 111
  • 1