How do I run libsvm on linux? - linux

I'm having trouble installing libsvm, presently im running via a ubuntu virtual machine . When I follow the instructions such that on Unix systems, "type make' to build thesvm-train' and `svm-predict'programs. Run them without arguments to show the usages of them". This is my following error output: I am rather new to both libsvm and unix systems so any help would be greatly appreciated.
aaron#aaron-laptop:~$ cd Document
bash: cd: Document: No such file or directory
aaron#aaron-laptop:~$ cd Documents
aaron#aaron-laptop:~/Documents$ libsvm-3.12
libsvm-3.12: command not found
aaron#aaron-laptop:~/Documents$ cd libsvm-3.12
aaron#aaron-laptop:~/Documents/libsvm-3.12$ make
g++ -Wall -Wconversion -O3 -fPIC -c svm.cpp
make: g++: Command not found
make: *** [svm.o] Error 127
aaron#aaron-laptop:~/Documents/libsvm-3.12$

Open your terminal and type these commands in order.
sudo apt-get update
sudo apt-get install build-essential
If this still doesn't work,
open up your terminal, type in 'g+' (without the quotes) and press the button multiple times. It will show you if the name of the command g++ has been changed or not. (Sometimes updating your linux changes the name of g++ to g++-3.x (where x is a number).
If this is the case, in your installation instructions, replace every g++ by whatever number you got after pressing the key.

Related

Thrust has no member device_malloc error when compiling gDel3D (3D Delaunay Triangulation with GPU)

I tried several different methods of building this library and all have resulted in "thrust" has no member "device_malloc".
The following is a link to the git repo for gDel3D: [https://github.com/ashwin/gDel3D][1]
The following is the error I receive when typing: make
make
[ 7%] Building NVCC (Device) object CMakeFiles/gflip3d.dir/GDelFlipping/src/gDel3D/GPU/gflip3d_generated_ThrustWrapper.cu.o
/home/gDel3D/GDelFlipping/src/gDel3D/GPU/ThrustWrapper.cu(121): error: namespace "thrust" has no member "device_malloc"
/home/gDel3D/GDelFlipping/src/gDel3D/GPU/ThrustWrapper.cu(121): error: type name is not allowed
/home/gDel3D/GDelFlipping/src/gDel3D/GPU/ThrustWrapper.cu(121): error: expression must have class type
/home/gDel3D/GDelFlipping/src/gDel3D/GPU/GPUDecl.h(280): error: namespace "thrust" has no member "device_malloc"
/home/gDel3D/GDelFlipping/src/gDel3D/GPU/GPUDecl.h(280): error: type name is not allowed
5 errors detected in the compilation of "/tmp/tmpxft_00000a74_00000000-7_ThrustWrapper.compute_30.cpp1.ii".
CMake Error at gflip3d_generated_ThrustWrapper.cu.o.Release.cmake:279 (message):
Error generating file
/home/gDel3D/build/CMakeFiles/gflip3d.dir/GDelFlipping/src/gDel3D/GPU/./gflip3d_generated_ThrustWrapper.cu.o
CMakeFiles/gflip3d.dir/build.make:84: recipe for target 'CMakeFiles/gflip3d.dir/GDelFlipping/src/gDel3D/GPU/gflip3d_generated_ThrustWrapper.cu.o' failed
make[2]: *** [CMakeFiles/gflip3d.dir/GDelFlipping/src/gDel3D/GPU/gflip3d_generated_ThrustWrapper.cu.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/gflip3d.dir/all' failed
make[1]: *** [CMakeFiles/gflip3d.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I tried asking my question on the issues tab of the gDel3D forum, but thought it may be appropriate here as it seems to be a problem with configuring the thrust library. Thanks for the help!
Edit:
I tried the first suggestion below and have received more errors. I also tried switching OS. I am now running on Ubuntu 18.04
The following is the new error
user#user-Oryx-Pro:~/Documents/gFlip3D-Release_271/build$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/Documents/gFlip3D-Release_271/build
user#user-Oryx-Pro:~/Documents/gFlip3D-Release_271/build$ make
[ 7%] Building NVCC (Device) object CMakeFiles/gflip3d.dir/GDelFlipping/src/gDel3D/gflip3d_generated_GpuDelaunay.cu.o
/home/user/Documents/gFlip3D-Release_271/GDelFlipping/src/gDel3D/GpuDelaunay.cu(839): error: namespace "thrust" has no member "gather"
1 error detected in the compilation of "/tmp/tmpxft_00002cd3_00000000-8_GpuDelaunay.compute_50.cpp1.ii".
CMake Error at gflip3d_generated_GpuDelaunay.cu.o.Release.cmake:279 (message):
Error generating file
/home/Documents/gFlip3D-Release_271/build/CMakeFiles/gflip3d.dir/GDelFlipping/src/gDel3D/./gflip3d_generated_GpuDelaunay.cu.o
CMakeFiles/gflip3d.dir/build.make:924: recipe for target 'CMakeFiles/gflip3d.dir/GDelFlipping/src/gDel3D/gflip3d_generated_GpuDelaunay.cu.o' failed
make[2]: *** [CMakeFiles/gflip3d.dir/GDelFlipping/src/gDel3D/gflip3d_generated_GpuDelaunay.cu.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/gflip3d.dir/all' failed
make[1]: *** [CMakeFiles/gflip3d.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
if it helps, i ran cmake -LA .
cmake -LA .
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/Documents/gFlip3D-Release_271/build
-- Cache values
CMAKE_AR:FILEPATH=/usr/bin/ar
CMAKE_BUILD_TYPE:STRING=
CMAKE_COLOR_MAKEFILE:BOOL=ON
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-7
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-7
CMAKE_CXX_FLAGS:STRING=
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc
CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-7
CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-7
CMAKE_C_FLAGS:STRING=
CMAKE_C_FLAGS_DEBUG:STRING=-g
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF
CMAKE_INSTALL_PREFIX:PATH=/usr/local
CMAKE_LINKER:FILEPATH=/usr/bin/ld
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_NM:FILEPATH=/usr/bin/nm
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
CMAKE_SHARED_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
CMAKE_SKIP_RPATH:BOOL=NO
CMAKE_STATIC_LINKER_FLAGS:STRING=
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_STRIP:FILEPATH=/usr/bin/strip
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
CUDA_64_BIT_DEVICE_CODE:BOOL=ON
CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE:BOOL=ON
CUDA_BUILD_CUBIN:BOOL=OFF
CUDA_BUILD_EMULATION:BOOL=OFF
CUDA_CUDART_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libcudart.so
CUDA_CUDA_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libcuda.so
CUDA_GENERATED_OUTPUT_DIR:PATH=
CUDA_HOST_COMPILATION_CPP:BOOL=ON
CUDA_HOST_COMPILER:FILEPATH=/usr/bin/cc
CUDA_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda/bin/nvcc
CUDA_NVCC_FLAGS:STRING=
CUDA_NVCC_FLAGS_DEBUG:STRING=
CUDA_NVCC_FLAGS_MINSIZEREL:STRING=
CUDA_NVCC_FLAGS_RELEASE:STRING=
CUDA_NVCC_FLAGS_RELWITHDEBINFO:STRING=
CUDA_PROPAGATE_HOST_FLAGS:BOOL=ON
CUDA_SDK_ROOT_DIR:PATH=CUDA_SDK_ROOT_DIR-NOTFOUND
CUDA_SEPARABLE_COMPILATION:BOOL=OFF
CUDA_TOOLKIT_INCLUDE:PATH=/usr/local/cuda/include
CUDA_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda
CUDA_USE_STATIC_CUDA_RUNTIME:BOOL=ON
CUDA_VERBOSE_BUILD:BOOL=OFF
CUDA_VERSION:STRING=10.0
CUDA_cublas_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libcublas.so
CUDA_cublas_device_LIBRARY:FILEPATH=CUDA_cublas_device_LIBRARY-NOTFOUND
CUDA_cudadevrt_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libcudadevrt.a
CUDA_cudart_static_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libcudart_static.a
CUDA_cufft_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libcufft.so
CUDA_cupti_LIBRARY:FILEPATH=/usr/local/cuda/extras/CUPTI/lib64/libcupti.so
CUDA_curand_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libcurand.so
CUDA_cusolver_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libcusolver.so
CUDA_cusparse_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libcusparse.so
CUDA_nppc_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libnppc.so
CUDA_nppial_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libnppial.so
CUDA_nppicc_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libnppicc.so
CUDA_nppicom_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libnppicom.so
CUDA_nppidei_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libnppidei.so
CUDA_nppif_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libnppif.so
CUDA_nppig_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libnppig.so
CUDA_nppim_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libnppim.so
CUDA_nppist_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libnppist.so
CUDA_nppisu_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libnppisu.so
CUDA_nppitc_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libnppitc.so
CUDA_npps_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libnpps.so
CUDA_rt_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/librt.so
I tried the zip suggested by #Snowie and modifying CmakeLists.txt file
set(CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
-gencode arch=compute_35,code=sm_35
-gencode arch=compute_30,code=sm_30
-gencode arch=compute_50,code=sm_50)
Which also did not work.
Following Snowie's suggestion, I went ahead and added #include <thrust/gather.h> to GPUDelaunay. The build was successful but did not run.
I ran into a similar problem with GDel3D. A quick fix for this issue is to include necessary thrust files where needed. For device_malloc include <thrust/device_malloc.h>. Based on your error message it would seem you need to include it in gFlip3D-Release_271/GDelFlipping/src/gDel3D/GpuDelaunay.cu.
I also had better luck with a version of GDel3D you can get from this website:
https://www.comp.nus.edu.sg/~tants/gdel3d.html
more specifically from here:
https://www.comp.nus.edu.sg/~tants/gdel3d_files/gDel3D-Release_271.zip
Also you may want to try out different versions of CUDA Toolkit. And additionally you can modify the CMakeLists.txt file at the lines with "-gencode arch=compute_##,code=sm_##". That should allow you to specify different CUDA compute capabilities and such. I'm pretty new to CUDA myself so I might be wrong here.
I managed to run the version of GDel3D I linked to without any errors. It compiled and ran on GeForce GT 840m and CUDA 7.5.17 on Linux Mint (not sure of the version though exactly). Also I added includes for missing thrust functions and modified the CMakeLists.txt with "arch=compute_50,code=sm_50".
Hope any of this helps.
edit1:
Your new error indicates the fix worked, you just need to add all the thrust header files that are needed.
You have to read the error messages:
/home/user/Documents/gFlip3D-Release_271/GDelFlipping/src/gDel3D/GpuDelaunay.cu(839): error: namespace "thrust" has no member "gather"
this line tells you that you need to include header for gather function in gFlip3D-Release_271/GDelFlipping/src/gDel3D/GpuDelaunay.cu
Try googling for the proper header where this function is declared/defined if similar error comes up again. This time "#include <thrust/gather.h>" in gFlip3D-Release_271/GDelFlipping/src/gDel3D/GpuDelaunay.cu should fix the problem.
edit2:
Since you are using RTX 2070, you might want to try using this in your CMakelists.txt (make sure you are using CUDA Toolkit 10.0):
set(CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
-gencode arch=compute_75,code=sm_75)
or
set(CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
-D_FORCE_INLINES
-gencode arch=compute_75,code=sm_75)
This should make CUDA Toolkit use the most recent compute capability. Also you can try changing the ## parts in "compute_##" and "sm_##".
According to what I found on wiki your GPU is only supported by CUDA Toolkit versions 10.0–10.2 and these versions of the toolkit apparently support following compute capabilities: 3.0–7.5. So make sure you try these versions of CUDA Toolkit and these compute capabilities.
Before I go into the steps I took, I wanted to give a special thanks to #Snowie for their time and help in getting me to a solution.I started from a fresh install of ubuntu 18.04 with the following commands in the terminal. Some of these installs are not necessary but will save me time later.
sudo apt update
sudo ubuntu-drivers autoinstall
sudo apt-get install build essential
sudo apt-get install freeglut3 freeglut3-dev libxi-dev libxmu-dev
sudo apt install curl
sudo apt install software-properties-common
sudo apt install cmake
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt install gcc-6 g++-6 gcc-7 g++-7 gcc-8 g++-8 gcc-9 g++-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8 --slave /usr/bin/gcov gcov /usr/bin/gcov-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7 --slave /usr/bin/gcov gcov /usr/bin/gcov-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 --slave /usr/bin/gcov gcov /usr/bin/gcov-6
Now I can choose the version of gcc that I want to run:
sudo update-alternatives --config gcc
There are 4 choices for the alternative gcc (providing /usr/bin/gcc).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/gcc-9 90 auto mode
1 /usr/bin/gcc-6 60 manual mode
2 /usr/bin/gcc-7 70 manual mode
3 /usr/bin/gcc-8 80 manual mode
4 /usr/bin/gcc-9 90 manual mode
Press <enter> to keep the current choice[*], or type selection number:
In this case I choose 1 to select gcc-6
Now its time to install the cuda-toolkit
sudo apt install nvidia-cuda-toolkit
You should see output from nvcc --version similiar to
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2017 NVIDIA
Corporation Built on Fri_Nov__3_21:07:56_CDT_2017 Cuda compilation
tools, release 9.1, V9.1.85
Now download 3dDelaunay from here: “https://www.comp.nus.edu.sg/~tants/gdel3d_files/gDel3D-Release_271.zip”
Inside /home/user/Documents/gFlip3D-Release_271/GDelFlipping/src/gDel3D/GpuDelaunay.cu you need to add “#include <thrust/gather.h>”
Here is an example of what it looks like:
#include "GpuDelaunay.h"
#include<iomanip>
#include<iostream>
#include "GPU/CudaWrapper.h"
#include "GPU/HostToKernel.h"
#include "GPU/KerCommon.h"
#include "GPU/KerPredicates.h"
#include "GPU/KerDivision.h"
#include "GPU/ThrustWrapper.h"
#include <thrust/gather.h>
Now you need to set your target compute architecture. My video card is a RTX 2070. Accord to nvidia my compute architecture and compute capability are 7.5. I tried these numbers and it did not work. I thought maybe since the cuda version I ended up with was not 10.2 and was instead 10.1, that I needed to target a little less on my architecture. I targetted 7.0 compute capability and compute architecture instead.
Here is an example in the CMakeLists.txt file.
set(CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
-gencode arch=compute_70,code=sm_70)
Now lets go ahead and create the build folder from the gFlip3D-Release_271 folder
mkdir build
cd build
cmake ..
make
And last run ./gflip3d
Generating input... Constructing 3D Delaunay triangulation... Checking... V: 100001 E: 772552 F: 1345102 T: 672551 Euler: 0 Euler
check: Pass Orient check: Pass Adjacency check: Pass
Convex hull facets: 412
Delaunay check: Pass
---- SUMMARY ----
PointNum 100000 FP Mode Double
TotalTime (ms) 101.19 InitTime 139861894.77 SplitTime
5.20 FlipTime 68.93 RelocateTime 8.11 SortTime 1.05 OutTime 9.87 SplayingTime 3.65
# Flips 1422073
# Failed verts 109
# Final stars 243
Edit* I have found a possibly easier way to fix this issue with device_malloc than what i have listed above. In order to correct the missing member device_malloc add a reference to the file in the two files where it is used.
The two files you need to modify with the new reference
/home/gFlip3D-Release_271/GDelFlipping/src/gDel3D/GPU/ThrustWrapper.cu
/home/gFlip3D-Release_271/GDelFlipping/src/gDel3D/GPU/GPUDecl.h
The magical line to add
#include <thrust/device_malloc.h>
I hope this helps others with their research leveraging the gDel3D!

luci compilation error:iwinfo.h: No such file or directory

I downloaded the luci trunk from git https://github.com/openwrt/luci.git and got the following error when i compile it on centOS.
I already have iw package intalled but still got the error.
Package iw-3.10-4.el7.x86_64 already installed and latest version
How can i fix this issue?
make[1]: Entering directory `/home/mullex/Dev/Projects/openwrt-luci/modules/admin-full'
rm -f src/*.o src/luci-bwc
gcc -O2 --std=gnu99 -Wall -pedantic -fPIC -c -o src/luci-bwc.o src/luci-bwc.c
src/luci-bwc.c:35:20: fatal error: iwinfo.h: No such file or directory
#include <iwinfo.h>
^
compilation terminated.
make[1]: *** [src/luci-bwc.o] Error 1
make[1]: Leaving directory `/home/mullex/Dev/Projects/openwrt-luci/modules/admin-full'
*** Compilation of modules/admin-full failed!
make: *** [gccbuild] Error 1
I experienced this same problem this morning, when running the LuCI Makefile on Ubuntu, in order to get LuCI up and running on my PC for development purposes without the need to be connected to a router. I solved it in the following way:
At this web page...
http://luci.subsignal.org/trac/changeset/10377
... there is a description of lines that were added to two files to implement features requiring the iwinfo.h include file. I had already installed iw (by using the command "sudo apt-get install iw") but it seemed that this did not include iwinfo.h, which I understand is a file that you can only install on OpenWRT. Therefore, to solve the issue, I manually reverted the two files back to their original state by deleting the green lines and adding in the red lines. By green lines and red lines I mean those highlighted in the Diff output of the files given at the above web page. Hence, I ended up with two revised (rolled-back) versions of the following two files:
contrib/package/luci/Makefile and modules/admin-full/src/luci-bwc.c
I then ran the top-level LuCI Makefile again, using the following command while in the top-level directory:
sudo make runuhttpd
The Makefile completed without errors, and its final step was to start the web server at localhost:8080/luci/
At this point in the terminal window, the process waits (i.e. does not return to command prompt) because it is running the web server. In my web browser, at localhost:8080/luci/, I now successfully see the default index page. If I enter CTRL-C in the terminal window, to kill the process, the web server stops and the default index page is no longer viewable in the web browser.
To run the web server again, in the terminal I enter the last command that was executed by the Makefile, which is:
[my-top-level-LUCI-installation-directory]/host/usr/sbin/uhttpd -p 8080 -h [my-top-level-LUCI-installation-directory]/host/www -f
Hope this helps.

Sys_error using ocamlmklib on an object file

I am compiling a theorem prover on cygwin and I get this error:
$ make
ocamlmklib -o bin/minisatinterface minisat/core/Solver.o minisat/simp/SimpSolver
.o bin/Ointerface.o -lstdc++
** Fatal error: Error while reading minisat/core/Solver.o: Sys_error("Invalid ar
gument")
Makefile:49: recipe for target `bin/libminisatinterface.a' failed
make: *** [bin/libminisatinterface.a] Error 2
It is not clear what kind of invalid argument is here?
The only documentation I have found for ocamlmklib did not help on understanding the error message. Could it not read the file itself or there is a problem with the contents? ls does list the file:
$ ls -l minisat/core/Solver.o
-rw-r--r-- 1 gbuday mkpasswd 2096 jan. 22 10.42 minisat/core/Solver.o
update: if I remove Solver.o I get a different error message:
** Fatal error: Cannot find file "minisat/core/Solver.o"
So the above error message is about the contents of the object file.
I happen to know that this specifically has to do with the build of the ATP Satallax, which can be used with Isabelle Sledgehammer, and I was asked to look at this.
I have no expertise with make files and ocaml. My success at building Satallax v2.7 came purely from following the instruction in INSTALL, with some minimal ability at guessing at what error codes meant, which I mainly needed when building Satallax v2.6 over a year ago.
The first important thing to do is make sure that the tar file is unzipped while working in a Cygwin terminal, rather than under Windows with something like WinZip.
Assuming that you're working in a Cygwin terminal, these are the notes which I made. After that I'll include text from the Satallax INSTALL, and few comments.
Sources: http://www.ps.uni-saarland.de/~cebrown/satallax/
0) tar xvzf satallax-2.7.tar.gz
1) Cygwin Package (these are also for other's like Leo-II):
zlib-devel, make, OCaml devel, gcc devel, g++ devel, libstdc++6-devel
Ubuntu 12 Packages:
sudo apt-get install build-essential
zlibg-dev using the Ubuntu Software Center
ocaml and g++ if they don't come with "build-essential"
2) Put eprover.exe in the path so that ./configure can find it.
a) There are the following lines in the configure files, which shows
that it's configured to find picomus, eprover has to be in the path
or `which eprover` has to be edited.
# Optionally set picomus to your picomus executable
picomus=${PWD}/picosat-936/picomus
# Optionally set eprover to your E theorem prover executable
eprover=`which eprover`
3) Follow the instructions in INSTALL.
a) export MROOT=`pwd` takes care of this next note, which I had to do
for v2.6, info I keep in here in case I need it in the future.
b) export MROOT=<minisat-dir>, where you replace "minisat-dir" with the
/cygdrive/e\E_2\binp\isaprove\satallax-2.6\cygwin\minisat
3) OLD v2.6 NOTE: If you get an error, delete the old source and try
untaring the sources again.
My build of v2.7 went through without problems, other than the test giving errors.
With Satallax v2.7, there is now the requirement that the build find the eprover. Note STEP 3 of INSTALL tells you to modify configure, or put eprover.exe in the path before the build. I put it in the path, which for me is
E:\E_2\dev\Isabelle2013-2\contrib\e-1.8\x86-cygwin
The INSTALL file then gives short instructions:
* Short Instructions
cd minisat
export MROOT=`pwd`
cd core
make Solver.o
cd ../simp
make SimpSolver.o
cd ../../picosat-936
./configure
make
cd ..
./configure
make
./test | grep ERROR
After downloading all needed packages, and putting eprover.exe in the path, it built without errors for me other than the test, but the executable works when used by Isabelle Sledgehammer.
STEP 3 of INSTALL talks about providing the location of the picomus executable, but I'm pretty sure that there's not need to do that because picosat-936\picomus.exe gets built in this build.
If you watch the build messages, it'll tell you what it's looking for and what it finds.
For completeness, I include the text from INSTALL, except for the instructions related to what's pertinent for Coq.
There are a number of requirements in order to compile Satallax.
In short, you need make, ocaml, g++ and the zlib header files.
In Debian and derived Linux systems, you can get these from
the build-essential and zlib1g-dev packages. You need
ocamlopt to obtain a standalone executable.
If you're not the administrator of the computer on which you're installing,
you can quote the previous paragraph to the administrator.
* Short Instructions
cd minisat
export MROOT=`pwd`
cd core
make Solver.o
cd ../simp
make SimpSolver.o
cd ../../picosat-936
./configure
make
cd ..
./configure
make
./test | grep ERROR
./bin/satallax.opt is the native code executable to use.
See test for examples of how to use it.
* Long Instructions
STEP 1:
Compile minisat (see minisat/README)
cd minisat
export MROOT=<minisat-dir> (or setenv in cshell)
cd core
make Solver.o
cd ../simp
make SimpSolver.o
cd ../..
STEP 2 (Optional. Only needed to extract proof information for proof terms.) :
Build picosat (including picomus):
cd picosat-936
./configure
make
cd ..
STEP 3:
If desired, edit the configure script to give the location of your picomus
and eprover executables. (If the executables are not found by the configure script,
you will need to give the location of the executables to satallax via the command line
options -P <picomus> -E <eprover> if they are needed.)
Run the configure script for Satallax.
./configure
STEP 4:
make
uses ocamlopt to make a standalone executable
./bin/satallax.opt
and uses ocamlc to make a bytecode executable
./bin/satallax
that depends on ocamlrun
STEP 5:
Test satallax using the examples in the script file:
./test
As long as you don't see a line with the word ERROR, it should be working.

After checking the related posts, still cannot install GCC 4.7 on Linux without root privilege?

After checking the posts:
Install gcc on linux with no root privilege
https://stackoverflow.com/questions/9316118/installing-gcc-as-non-root
My problem still cannot be solved so I post it here.
I am trying to install GCC 4.7 on Linux with gcc version 4.1.2 20080704 (Red Hat 4.1.2-52).
I run configure with prefix to be my home directory.
./configure \
--with-gmp=/remote/home/gcc_4_7_2012_5_28/gmp505 \
--with-mpfr=/remote/home/gcc_4_7_2012_5_28/mpfr242 \
--with-mpc=/remote/home/gcc_4_7_2012_5_28/mpc081 \
--disable-libjava
Then, make is ok. But, make check is not ok, I got error:
make[1]: Entering directory `/remote/home/gcc_4_7_2012_5_28/trunk'
make[2]: Entering directory `/remote/gcc_4_7_2012_5_28/trunk/host-x86_64-unknown-linux-gnu/fixincludes'
autogen -T ../.././fixincludes/check.tpl ../.././fixincludes/inclhack.def
make[2]: execvp: autogen: Permission denied
make install is not ok.
make[1]: Entering directory `/remote/home/gcc_4_7_2012_5_28/trunk'
/bin/sh ./mkinstalldirs /usr/local /usr/local
make[2]: Entering directory `/remote/home/gcc_4_7_2012_5_28/trunk/host-x86_64-unknown-linux-gnu/fixincludes'
rm -rf /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/install-tools
/bin/sh ../.././fixincludes/../mkinstalldirs /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/install-tools
mkdir -p -- /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/install-tools
mkdir: cannot create directory `/usr/local/libexec/gcc': Permission denied
I cannot get root privilege.
Any help is appreciated.
Thanks !
When compiling GCC, you should never build it in its source tree!
You forgot a prefix in your configure arguments, perhaps something like
mkdir $HOME/gcc-build
cd $HOME/gcc-build
/your/path/to-source-tree/gcc-4.7.0/configure --prefix $HOME/pref \
--program-suffix -my4.7 \
# other configure arguments go here
of course, you'll find your compiler installed in $HOME/pref/bin/gcc-my4.7 so I recommend adding $HOME/pref/bin to your $PATH and $HOME/pref/lib to your $LD_LIBRARY_PATH
You might try to build the GCC MELT [meta-] plugin once you installed successfully your GCC 4.7
The gcc-help#gcc.gnu.org mailing list is a good place to get such help.
You need to check the config.log file, look for the "checking for suffix of object files". You should see an error message somewhere near there which should help you out.
Or, use EasyBuild for building GCC 4.7, which does everything for you, see http://hpcugent.github.com/easybuild.

Error while building glibc

I'm trying to install glibc to debug a C-framework I'm working on. But, I'm getting an error in the build process. Here's the error msg:
make[3]: Leaving directory `/root/glibc-source/glibc-2.14/elf'
/usr/bin/install -c /root/glibc-2.14-build/elf/ld.so /usr/local/myglibc/lib/ld-2.14.so.new
mv -f /usr/local/myglibc/lib/ld-2.14.so.new /usr/local/myglibc/lib/ld-2.14.so
/usr/bin/install -c /root/glibc-2.14-build/libc.so /usr/local/myglibc/lib/libc-2.14.so.new
mv -f /usr/local/myglibc/lib/libc-2.14.so.new /usr/local/myglibc/lib/libc-2.14.so
echo ld-2.14.so /usr/local/myglibc/lib/ld-linux-x86-64.so.2 >> /root/glibc-2.14-build/elf/symlink.list
/usr/bin/install -c /root/glibc-2.14-build/elf/sotruss-lib.so /usr/local/myglibc/lib/audit/sotruss-lib.so.new
mv -f /usr/local/myglibc/lib/audit/sotruss-lib.so.new /usr/local/myglibc/lib/audit/sotruss-lib.so
make[2]: *** No rule to make target `/root/glibc-2.14-build/dlfcn/libdl.so.2', needed by `/root/glibc-2.14-build/elf/sprof'. Stop.
make[2]: Leaving directory `/root/glibc-source/glibc-2.14/elf'
make[1]: *** [elf/subdir_install] Error 2
make[1]: Leaving directory `/root/glibc-source/glibc-2.14'
make: *** [install] Error 2
Is this a known problem?
I had built glibc on the same machine earlier last week without any errors. I'm rebuilding it because glibc is compiled with optimization level 2(-O2) by default and I'm unable to look into the values of a few variables inside the library functions from the code dump as they've been optimized out. I'm currently trying to compile with optimization level 1.
Thanks
It looks like you are trying to make install, without first doing a successful make all.
This is for the benefit of anyone who might be trying to build glibc on their ubuntu box.
I went through the following problems and resolved them the following way.
These problems were encountered in ubuntu 12.04
I created a directory glib-build on the same level as the glib-VERSION and ran the following command
$> ../glibc-2.16.0/configure --prefix=/home/gugovind/tsapp/glibc/glibc-build/
that gave me the following error that makeinfo is missing.
for that
$>sudo apt-get install texinfo
will resolve the problem.
It threw and error about LD_LIBRARY_PATH having the current directory (even if it does not exist)
for that run the following in your command prompt
$>set LD_LIBRARY_PATH
this will clear the LD_LIBRARY_PATH only for that console temporarily. Then run the configure again.
You might encounter another problem with configure..
"function strtonum never defined"
look at the config.log file and it might be missing mawk or gawk. install them using
sudo apt-get install gawk
This should get you through the configure part.
now run
make all
if in case you encounter a particular file not compiling.. just copy the gcc ... before that and paste it in the command prompt again after you have cd to that directory (the command lines before the error should tell you where to go.)
make install
You might get a warning about not able to find etc/ld.config... file. ignore that..
you are all set now.

Resources