Cannot Compile "Embed" Demo
See original GitHub issueI was looking for a way to create executable from cython, and I found the demo at (https://github.com/cython/cython/tree/master/Demos/embed).
I downloaded the repo as I already had Cython Installed, I ran the command make
on terminal but it failed with the following terminal message.
palash@ash:~/Downloads/cython-master/Demos/embed$ make
gcc -pthread -B /home/palash/anaconda3/compiler_compat -Wl,--sysroot=/ -c embedded.c -I/home/palash/anaconda3/include/python3.6m -I/home/palash/anaconda3/include/python3.6m
gcc -pthread -B /home/palash/anaconda3/compiler_compat -Wl,--sysroot/ -o embedded embedded.o -L/home/palash/anaconda3/lib -L/home/palash/anaconda3/lib/python3.6/config-3.6m-i386-linux-gnu -lpython3.6m -lpthread -ldl -lutil -lrt -lm -Xlinker -export-dynamic
/home/palash/anaconda3/compiler_compat/ld: unrecognized option '--sysroot/'
/home/palash/anaconda3/compiler_compat/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
Makefile:19: recipe for target 'embedded' failed
make: *** [embedded] Error 1
MY OS : Ubuntu 17.04 32bit GCC :
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/7/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7-20170407-0ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=i686-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 7.0.1 20170407 (experimental) [trunk revision 246759] (Ubuntu 7-20170407-0ubuntu2)
PYTHON : 3.6 Anaconda Distribution
Anyone With Help?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
go:embed produces error when "go.mod" has go version ...
Introducing embed dependency in an existing library (module) seems to effectively mean issuing a major version. Because isolating embed in a new ...
Read more >How to Use //go:embed - The Ethically-Trained Programmer
The basic idea of embedding is that by adding a special comment to your code, Go will know to include a file or...
Read more >possible inconsistency in the embed package documentation
This implies that any embedded file must be in the module's own file tree. It cannot be in a parent directory above the...
Read more >embed - Go Packages
Package embed provides access to files embedded in the running Go program. Go source files that import "embed" can use the //go:embed directive...
Read more >Embedding Python in C, linking fails with undefined reference ...
I am trying to compile the example from the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can set an
rpath
using-Wl,-rpath=...
.See (and search for
rpath
in) https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.htmlI think I solved the problem. Here’s my new makefile, I tweaked the
LINKCC
a little to make it workI ran the test
make test
and it gave meFiles identical
outputBut I Have a Question… If i run
./embedded
it gives me thisbut if i run this
PYTHONHOME=/home/palash/anaconda3 LD_LIBRARY_PATH=/home/palash/anaconda3/lib:$LD_LIBRARY_PATH ./embedded
as mentioned inmake test
it works perfectly.So My Question Is, can’t I just invoke the command
./embedded
and it runs or I have to run the lengthy command (mentioned above) every time to run my program?and
Is there any way to fix the
LINKCC
problem permanently so I don’t have to tweak Makefiles every time?