Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not compile lanms #156

Open
tsing-cv opened this issue May 11, 2018 · 18 comments
Open

can not compile lanms #156

tsing-cv opened this issue May 11, 2018 · 18 comments

Comments

@tsing-cv
Copy link

tsing-cv commented May 11, 2018

make: Entering directory '/home/????/EAST-master/lanms'
g++ -o adaptor.so -I include  -std=c++11 -O3 -I/home/??/anaconda2/envs/tf3_w/include/python3.5m -I/home/??/anaconda2/envs/tf3_w/include/python3.5m  -Wno-unused-result -Wsign-compare -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -I/home/??/anaconda2/envs/tf3_wqq/include -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -flto -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -L/home/??/anaconda2/envs/tf3_w/lib/python3.5/config-3.5m -L/home/??/anaconda2/envs/tf3_w/lib -lpython3.5m -lpthread -ldl  -lutil -lrt -lm  -Xlinker -export-dynamic adaptor.cpp include/clipper/clipper.cpp --shared -fPIC
g++: error: unrecognized command line option-fno-pltMakefile:10: recipe for target 'adaptor.so' failed
make: *** [adaptor.so] Error 1
make: Leaving directory '/home/????/EAST-master/lanms'
Traceback (most recent call last):
  File "eval.py", line 9, in <module>
    import lanms
  File "/home/????/EAST-master/lanms/__init__.py", line 8, in <module>
    raise RuntimeError('Cannot compile lanms: {}'.format(BASE_DIR))
RuntimeError: Cannot compile lanms: /home/????/EAST-master/lanms

when i tempt to execute eval.py, raise this error, can you help me ??

@zxytim
Copy link
Collaborator

zxytim commented May 12, 2018 via email

@tsing-cv
Copy link
Author

tsing-cv commented May 12, 2018

gcc version 5.4.0 20160609@zxytim

@vsd-dev
Copy link

vsd-dev commented May 31, 2018

I have the same issue, my gcc version is 'g++ (Ubuntu 7.3.0-16ubuntu3) 7.3.0'

@YHCodes
Copy link

YHCodes commented Jun 4, 2018

I have the same issue, my g++ version is also 5.4.0 20160609

@vsd-dev
Copy link

vsd-dev commented Jun 4, 2018

@YHCodes @tsing-cv
You have to compile inside the lanms directory

@maichm
Copy link

maichm commented Jun 5, 2018

@YHCodes
if you have both python3.5 and python3.6 in your Ubantu, please point out which python version to be used in lanms/Makefile.
like:
CXXFLAGS = -I include -std=c++11 -O3 $(shell python3.5-config --cflags)
LDFLAGS = $(shell python3.5-config --ldflags)
or:
CXXFLAGS = -I include -std=c++11 -O3 $(shell python3.6-config --cflags)
LDFLAGS = $(shell python3.6-config --ldflags)

@YHCodes
Copy link

YHCodes commented Jun 8, 2018

@maichm Your answer helps me , thanks ~!

@janzd
Copy link

janzd commented Jul 11, 2018

It seems that you need gcc 6 or higher for -fno-plt option. I was running the code on two computers, Ubuntu 14.04 on which it's supposedly difficult to upgrade gcc to version 6 according to a stackoverflow Q&A, and a server with gcc 5.4 where I don't have root access so I couldn't try to upgrade gcc.
However, I've found a workaround solution. I first printed python-config --cflags in the terminal, then copied the output, removed -fno-plt, and replaced $(shell python-config --cflags) in the makefile with it.

@jiangmiaotong
Copy link

I tried to solve the same problem as kurapan did(I use python 3.6, gcc 4.8), it came across another problem:
adaptor.cpp:1:0: error: bad value (haswell) for -mtune= switch
#include "pybind11/pybind11.h"
^
include/clipper/clipper.cpp:1:0: error: bad value (haswell) for -mtune= switch
/*******************************************************************************
^
so, as the same thoughts with kurapan, I print python2-config --cflag, found that python2.7 use -mtune= generic, but python3.6 use -mtune= switch, just replace it, I resolved my problem.

@kungwanin
Copy link

Anybody solved this issue?

@DongHwanJang
Copy link

@jiangmiaotong this helped me a lot!!

@sudo-thamaraikannan
Copy link

I tried to solve the same problem as kurapan did(I use python 3.6, gcc 4.8), it came across another problem:
adaptor.cpp:1:0: error: bad value (haswell) for -mtune= switch
#include "pybind11/pybind11.h"
^
include/clipper/clipper.cpp:1:0: error: bad value (haswell) for -mtune= switch
/*******************************************************************************
^
so, as the same thoughts with kurapan, I print python2-config --cflag, found that python2.7 use -mtune= generic, but python3.6 use -mtune= switch, just replace it, I resolved my problem.

Anyone can help regarding ,LANMS Compile cmds for Ubuntu 16.04 LTS with G++ Compiler 5.4.0. When try compile, got this below error.

g++ -o adaptor adaptor.cpp
adaptor.cpp:1:31: fatal error: pybind11/pybind11.h: No such file or directory

@vietnvri
Copy link

Solution can be found in the below link!
https://blog.csdn.net/weixin_39461307/article/details/95881408

@sudo-thamaraikannan
Copy link

Thank you

@lidongliang-cloud
Copy link

There is a simple solution for Mac user:

  1. open folder "lanms",
  2. change the name of the file "adapter.pcc" to "adapter.pyd",
  3. open the file "init.py" and delete/comment line 7-8.

This works for me. Good luck :)

@uchreet-godara
Copy link

i have gcc version 6.3.0but still getting same error..any solution?

@vidkr
Copy link

vidkr commented Jul 10, 2020

i solved lanms issue with windows 10 using below link.
https://www.codeleading.com/article/65452401345/
updated as per the instructions & now executing without any error

@sdjsngs
Copy link

sdjsngs commented Oct 31, 2022

window10
1 install Visual Studio 2019 or higher version
2 git clone https://github.com/gen-ko/lanms-neo.git
3 python setup.py install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests