EAST icon indicating copy to clipboard operation
EAST copied to clipboard

can not compile lanms

Open tsing-cv opened this issue 6 years ago • 18 comments

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-plt’
Makefile: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 ??

tsing-cv avatar May 11 '18 12:05 tsing-cv

Please paste the result of g++ --version

On Fri, May 11, 2018 at 8:25 PM tsing-cv [email protected] wrote:

make: Entering directory '/home/????/EAST-master/lanms' g++ -o adaptor.so -I include -std=c++11 -O3 -I/home/aikaka/anaconda2/envs/tf3_wqq/include/python3.5m -I/home/aikaka/anaconda2/envs/tf3_wqq/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_wqq/lib/python3.5/config-3.5m -L/home/??/anaconda2/envs/tf3_wqq/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-plt’ Makefile: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 import lanms File "/home/????/EAST-master/lanms/init.py", line 8, in 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 ??

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/argman/EAST/issues/156, or mute the thread https://github.com/notifications/unsubscribe-auth/AA2QT2DPmZMjRKNwilgm4pDvRKhQpFptks5txYMtgaJpZM4T7YMM .

zxytim avatar May 12 '18 05:05 zxytim

gcc version 5.4.0 20160609@zxytim

tsing-cv avatar May 12 '18 12:05 tsing-cv

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

vsd-dev avatar May 31 '18 05:05 vsd-dev

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

YHCodes avatar Jun 04 '18 06:06 YHCodes

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

vsd-dev avatar Jun 04 '18 12:06 vsd-dev

@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)

maichm avatar Jun 05 '18 02:06 maichm

@maichm Your answer helps me , thanks ~!

YHCodes avatar Jun 08 '18 06:06 YHCodes

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.

janzd avatar Jul 11 '18 13:07 janzd

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.

jiangmiaotong avatar Jan 20 '19 08:01 jiangmiaotong

Anybody solved this issue?

kungwanin avatar Feb 09 '19 06:02 kungwanin

@jiangmiaotong this helped me a lot!!

DongHwanJang avatar Mar 07 '19 10:03 DongHwanJang

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

sudo-thamaraikannan avatar Oct 23 '19 05:10 sudo-thamaraikannan

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

vietnvri avatar Feb 24 '20 09:02 vietnvri

Thank you

sudo-thamaraikannan avatar Feb 27 '20 10:02 sudo-thamaraikannan

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 :)

lidongliang-cloud avatar Apr 21 '20 02:04 lidongliang-cloud

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

uchreet-godara avatar May 07 '20 12:05 uchreet-godara

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

vidkr avatar Jul 10 '20 18:07 vidkr

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

sdjsngs avatar Oct 31 '22 13:10 sdjsngs