I am trying to install SVM-Light
on the cluster that I am working on but I got the following error:
svm_hideo.o:(.bss 0x38): multiple definition of `verbosity'; svm_common.o:(.bss 0x8): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:59: svm_learn_hideo] Error 1
The steps that I have done for the installation are the following (I followed this tutorial):
wget https://download.joachims.org/svm_light/current/svm_light.tar.gz
gunzip -c svm_light.tar.gz | tar xvf -
ls
kernel.h Makefile svm_common.c svm_hideo.c svm_learn.h svm_light.tar.gz
LICENSE.txt svm_classify.c svm_common.h svm_learn.c svm_learn_main.c svm_loqo.c
make
gcc -c -O3 svm_learn_main.c -o svm_learn_main.o
gcc -c -O3 svm_learn.c -o svm_learn.o
gcc -c -O3 svm_common.c -o svm_common.o
svm_common.c: In function ‘read_model’:
svm_common.c:600:3: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
600 | fscanf(modelfl,"SVM-light Version %s\n",version_buffer);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svm_common.c:605:3: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
605 | fscanf(modelfl,"%ld%*[^\n]\n", &model->kernel_parm.kernel_type);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svm_common.c:606:3: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
606 | fscanf(modelfl,"%ld%*[^\n]\n", &model->kernel_parm.poly_degree);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svm_common.c:607:3: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
607 | fscanf(modelfl,"%lf%*[^\n]\n", &model->kernel_parm.rbf_gamma);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svm_common.c:608:3: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
608 | fscanf(modelfl,"%lf%*[^\n]\n", &model->kernel_parm.coef_lin);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svm_common.c:609:3: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
609 | fscanf(modelfl,"%lf%*[^\n]\n", &model->kernel_parm.coef_const);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svm_common.c:610:3: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
610 | fscanf(modelfl,"%[^#]%*[^\n]\n", model->kernel_parm.custom);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svm_common.c:612:3: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
612 | fscanf(modelfl,"%ld%*[^\n]\n", &model->totwords);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svm_common.c:613:3: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
613 | fscanf(modelfl,"%ld%*[^\n]\n", &model->totdoc);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svm_common.c:614:3: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
614 | fscanf(modelfl,"%ld%*[^\n]\n", &model->sv_num);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svm_common.c:615:3: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
615 | fscanf(modelfl,"%lf%*[^\n]\n", &model->b);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svm_common.c:623:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
623 | fgets(line,(int)ll,modelfl);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -c -O3 svm_hideo.c -o svm_hideo.o
gcc -O3 svm_learn_main.o svm_learn.o svm_common.o svm_hideo.o -o svm_learn -L. -lm
/mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: svm_hideo.o:(.bss 0x38): multiple definition of `verbosity'; svm_common.o:(.bss 0x8): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:59: svm_learn_hideo] Error 1
I have even tried to install it with conda
, but without no success.
conda create myenv
conda activate myenv
conda install -c bioconda svmlight
conda list
# packages in environment:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
svmlight 6.02 hec16e2b_4 bioconda
But when I check if the package was installed sucessfully... it is not found.
python
Python 3.9.7 (default, Sep 16 2021, 13:09:58)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import svmlight
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /home/.local/lib/python3.9/site-packages/svmlight.cpython-39-x86_64-linux-gnu.so: undefined symbol: PyCObject_Check
I also tried to install it using different ways:
conda install -c "bioconda/label/cf201901" svmlight
conda install -c bioconda svmlight
pip install svmlight
pip install --no-cache-dir --upgrade svmlight
But nothing...
Is there anybody who knows how to solve it?
Thanks in advance
CodePudding user response:
Solution:
In order to install svm-light
, it is necessary to install gcc 8.5.0 using the following code:
conda create myenv
conda activate myenv
conda install -c conda-forge gcc=8.5.0
CodePudding user response:
Bioconda packages are built with a very specific channel specification, namely:
# .condarc
channels:
- conda-forge
- bioconda
- defaults
In order to properly use any Bioconda package, one must adhere to that channel specification. That is, the package should be installed like
## note that one can give packages to the `create` command
conda create -n myenv -c conda-forge -c bioconda svmlight
Also, note that there are two packages, svmlight
, which is the compiled C library, and pysvmlight
, which is a Python wrapper (only supports Python 2.7).