I'm trying to compile C++ code with python embedded in it. The compiler does not compile my code with '-fPIE' flag even though I've added it in CMakeList.txt. Here's my CMakeList:
cmake_minimum_required(VERSION 3.3)
project(TestCython)
add_executable(main main.cpp)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result -Wsign-compare -g -fdebug-prefix-map=/build/python3.8-6QL2k7/python3.8-3.8.2=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector -Wformat -Werror=format-security -DNDEBUG -g -fwrapv -O3 -Wall -fPIE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result -Wsign-compare -g -fdebug-prefix-map=/build/python3.8-6QL2k7/python3.8-3.8.2=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector -Wformat -Werror=format-security -DNDEBUG -g -fwrapv -O3 -Wall -fPIE")
# Eigen
find_package(Eigen3 3.3 REQUIRED NO_MODULE)
# Embedded Python Includes
include_directories(/usr/include/python3.8
/usr/include/eigen3/ )
# Embedded Python Linker
link_directories(/usr/lib/python3.8/config-3.8-x86_64-linux-gnu
/usr/lib)
target_link_libraries( main
python3.8
crypt
pthread
dl
util
m )
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
If I run the generated make file, it will report a lot of similar errors and ask me to recompile with '-fPIE', like this one:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libpython3.8.a(call.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
The compilation succeeds if I don't use cmake:
g++ -I/usr/include/python3.8 -Wno-unused-result -Wsign-compare -g -fdebug-prefix-map=/build/python3.8-6QL2k7/python3.8-3.8.2=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector -Wformat -Werror=format-security -DNDEBUG -g -fwrapv -O3 -Wall -fPIE main.cpp -o main -L/usr/lib/python3.8/config-3.8-x86_64-linux-gnu -L/usr/lib -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm
Cmake version is 3.16.3. Python version is 3.8.2. System is Ubuntu 20.04
How can I solve those errors?
Note that most of the time this error has nothing to do with the PIE flag but is rather something else screwy about your build, unfortunately it’s a bit hard to tell because your CMake config is a bit screwy.
This particular error however is probably because you’re setting your properties incorrectly; Setting CMAKE_CXX_FLAGS and similar variables does nothing if you do it after defining your target with add_executable. This can be avoided entirely by using a more modern CMake style (out of scope for this answer, just google Modern CMake for some examples), in this particular case instead of setting flags on those variables you could for example do
target_compile_options(main PRIVATE -fpie)
I had similar error when I linked my library env2048 (having a file called ppo_buffer) to my bindings module env2048bindings:
[build] FAILED: python/env2048bindings.cpython-37m-x86_64-linux-gnu.so
[build] : && /usr/bin/g++-7 -fPIC -g -shared -o python/env2048bindings.cpython-37m-x86_64-linux-gnu.so python/CMakeFiles/env2048bindings.dir/env2048/bindings.cpp.o src/libenv2048.a -pthread && :
[build] /usr/bin/ld: src/libenv2048.a(ppo_buffer.cpp.o): relocation R_X86_64_PC32 against symbol `_ZSt3minIlERKT_S2_S2_' can not be used when making a shared object; recompile with -fPIC
[build] /usr/bin/ld: final link failed: Bad value
I had to set the properties for the library to make it work with:
set_target_properties(env2048 PROPERTIES POSITION_INDEPENDENT_CODE ON)
From these, I would make the guess that you might need this:
set_target_properties(python3.8 PROPERTIES POSITION_INDEPENDENT_CODE ON)
I built IPOPT from source at /usr/local/
Then I tried to install ipopt for python python setup.py install
However the installer complained (error) that it could not locate IpStdCInterface.h
I then modified the content of setup.py file as follows: (line 1 and 3 had wrong paths)
IPOPT_ICLUDE_DIRS=['/usr/local/include/coin']
IPOPT_LIBS=['ipopt', 'coinhsl', 'coinlapack', 'coinblas', 'coinmumps', 'coinmetis']
IPOPT_LIB_DIRS=['/usr/local/lib/']
IPOPT_DLL=None
I modified the first and third line to point to the correct directory.
Now, the lib directory path (in the third line above) contains a library file named libipopt.so, libipopt.so.0, libipopt.la (same name, different extensions).
The setup is now not complaining about IpStdCInterface.h but it is unable to find the libs
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/cyipopt.o -L/usr/local/lib/ -lipopt -lcoinhsl -lcoinlapack -lcoinblas -lcoinmumps -lcoinmetis -o build/lib.linux-x86_64-2.7/ipopt/cyipopt.so
/usr/bin/ld: cannot find -lcoinhsl
/usr/bin/ld: cannot find -lcoinlapack
/usr/bin/ld: cannot find -lcoinblas
/usr/bin/ld: cannot find -lcoinmumps
/usr/bin/ld: cannot find -lcoinmetis
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Those libs should be provided by the libipopt.so file? Or do I need to install some other package?
Well, i have a same problem as you. My solution was add the following commands in .bashrc:
export IPOPT_HOME="/opt/CoinIpopt"
export PATH="${PATH}:${IPOPT_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${IPOPT_HOME}/lib"
/opt/CoinIpopt is the path which the IpOpt was installed.
I installed Cython 0.24.1 on my Raspberry Pi by doing this:
Pasted below is the command and terminal output.
pi#raspberrypi:~ $ sudo pip3 install --upgrade cython==0.24.1
Downloading/unpacking cython==0.24.1
Downloading Cython-0.24.1.tar.gz (1.7MB): 1.7MB downloaded
Running setup.py (path:/tmp/pip-build-hprgsgiw/cython/setup.py) egg_info for package cython
Unable to find pgen, not compiling formal grammar.
warning: no files found matching '*.pyx' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.h' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Utility'
Installing collected packages: cython
Running setup.py install for cython
Unable to find pgen, not compiling formal grammar.
cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Plex/Scanners.py to /tmp/pip-build-hprgsgiw/cython/Cython/Plex/Scanners.c
building 'Cython.Plex.Scanners' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Plex/Scanners.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Plex/Scanners.o
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Plex/Scanners.o -o build/lib.linux-armv7l-3.4/Cython/Plex/Scanners.cpython-34m.so
cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Plex/Actions.py to /tmp/pip-build-hprgsgiw/cython/Cython/Plex/Actions.c
building 'Cython.Plex.Actions' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Plex/Actions.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Plex/Actions.o
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Plex/Actions.o -o build/lib.linux-armv7l-3.4/Cython/Plex/Actions.cpython-34m.so
cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Lexicon.py to /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Lexicon.c
building 'Cython.Compiler.Lexicon' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Lexicon.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Lexicon.o
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Lexicon.o -o build/lib.linux-armv7l-3.4/Cython/Compiler/Lexicon.cpython-34m.so
cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Scanning.py to /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Scanning.c
building 'Cython.Compiler.Scanning' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Scanning.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Scanning.o
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Scanning.o -o build/lib.linux-armv7l-3.4/Cython/Compiler/Scanning.cpython-34m.so
cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Parsing.py to /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Parsing.c
building 'Cython.Compiler.Parsing' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Parsing.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Parsing.o
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Parsing.o -o build/lib.linux-armv7l-3.4/Cython/Compiler/Parsing.cpython-34m.so
cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Visitor.py to /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Visitor.c
building 'Cython.Compiler.Visitor' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Visitor.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Visitor.o
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Visitor.o -o build/lib.linux-armv7l-3.4/Cython/Compiler/Visitor.cpython-34m.so
cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/FlowControl.py to /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/FlowControl.c
building 'Cython.Compiler.FlowControl' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/FlowControl.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/FlowControl.o
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/FlowControl.o -o build/lib.linux-armv7l-3.4/Cython/Compiler/FlowControl.cpython-34m.so
cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Code.py to /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Code.c
building 'Cython.Compiler.Code' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Code.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Code.o
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Code.o -o build/lib.linux-armv7l-3.4/Cython/Compiler/Code.cpython-34m.so
cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Runtime/refnanny.pyx to /tmp/pip-build-hprgsgiw/cython/Cython/Runtime/refnanny.c
building 'Cython.Runtime.refnanny' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Runtime/refnanny.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Runtime/refnanny.o
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Runtime/refnanny.o -o build/lib.linux-armv7l-3.4/Cython/Runtime/refnanny.cpython-34m.so
cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Tempita/_tempita.py to /tmp/pip-build-hprgsgiw/cython/Cython/Tempita/_tempita.c
building 'Cython.Tempita._tempita' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Tempita/_tempita.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Tempita/_tempita.o
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Tempita/_tempita.o -o build/lib.linux-armv7l-3.4/Cython/Tempita/_tempita.cpython-34m.so
warning: no files found matching '*.pyx' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.h' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Utility'
Installing cygdb script to /usr/local/bin
Installing cython script to /usr/local/bin
Installing cythonize script to /usr/local/bin
Successfully installed cython
Cleaning up...
Looks like the installation has completed fine. But after this, if I do the following, it still return the old version. What am I missing?
pi#raspberrypi:~ $ python3 -c "import cython;print(cython.__version__)"
0.21.1
From the log, I can read Installing cython script to /usr/local/bin. I extrapolate that the library has installed in /usr/local/python3something. Two alternatives:
re-install using pip3 install --user --upgrade cython==0.24.1 and make sure that ~/.local/bin is in your PATH environment variable.
add /usr/local/bin to your PATH environment variable and /usr/local/python3something/site-packages to your LD_LIBRARY_PATH environment variable.
Indeed, the python3something part must be changed to reflect the exact path on your system. Option "1" above should work even if my extrapolation is wrong.
I have Matplotlib 1.3.1 installed on my Ubuntu 14.04 system and thought it was time to upgrade to 1.4.2. I never get the latest version for compatibility reasons (some packages that use Matplotlib might stop working). I then downloaded the tarball, uncompressed its contents into a folder and executed "sudo python setup.py build". However, I got the following error (last few lines only):
c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/ft2font.o build/temp.linux-x86_64-2.7/src/mplutils.o build/temp.linux-x86_64-2.7/extern/CXX/cxxsupport.o build/temp.linux-x86_64-2.7/extern/CXX/cxx_extensions.o build/temp.linux-x86_64-2.7/extern/CXX/IndirectPythonInterface.o build/temp.linux-x86_64-2.7/extern/CXX/cxxextensions.o -L/usr/local/lib -L/usr/local/lib64 -lfreetype -lstdc++ -lm -o build/lib.linux-x86_64-2.7/matplotlib/ft2font.so
/usr/bin/ld: /usr/local/lib64/libstdc++.a(si_class_type_info.o): relocation R_X86_64_32S against `_ZTVN10__cxxabiv120__si_class_type_infoE' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib64/libstdc++.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
error: command 'c++' failed with exit status 1
I then tried the same with Matplotlib 1.4.3 (why not?) and got the same results.
What's going on here?
Thanks so much for any help.
Fausto
I'm having troubles with an odd error. I use Cython to compile some c++ files. It works perfectly fine under OS X but under Linux i have the following error.
clang++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/test.o build/temp.linux-x86_64-2.7/ocv.o build/temp.linux-x86_64-2.7/fructueux.o build/temp.linux-x86_64-2.7/Face_keypoint_extractor_minimal.o build/temp.linux-x86_64-2.7/tools/mimic.o build/temp.linux-x86_64-2.7/Unrestricted_local_binary_pattern_modified.o build/temp.linux-x86_64-2.7/Over_sampling.o -L -o /home/AM/Documents/code_dw/Python_deep_dev/Cython_interface/First_import/test.so -L/usr/local/lib -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -ltbb -lrt -lpthread -lm -ldl -lboost_system -lboost_filesystem ./libFD.a
=> -L -o /home/AM/Documents/code_dw/Python_deep_dev/Cython_interface/First_import/test.so
clang: error: no such file or directory: '/home/AM/Documents/code_dw/Python_deep_dev/Cython_interface/First_import/test.so'
The -o is perfectly normal but i don't know the effect of the -L just before and i guess it is the reason it crashes.
Does someone has an idea of the reason why distutils and/or clang could produce such an output ?
PS : I have never written the string "test.so" in any of my file.
Stupid but it always happens
in the setup.py :
library_dirs=[""]
Create the -L in the compiler command and the -L ignore the -o and get the next path.