Installing Python 3.8.1 --with-openssl --without-root/apt/yum - python

i need to install Python3 with ssl in a different userdir. I'm working on Debian without root privileges. I'm really trying to find a solution by myself, but after spending serveral hours I'm still not able to get it correctly done.
The Path to install ssl and python is $HOME/.local/
$HOME is always an absolute path like /path/to/install
Logs below
Things I've already tried:
1. Creating installation folders
cd $HOME
mkdir .local
cd .local
mkdir ssl
mkdir python
mkdir src
cd src
2. Downloading latest tar versions of Python and openssl
wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz
tar xvfz Python-3.8.1.tgz
tar xvfz openssl-1.1.1d.tar.gz
3. Configure, Make, Install Openssl (in $HOME/.local/ssl)
cd openssl-1.1.1d
./config --prefix=$HOME/.local/ssl
make && make install
4. Edit Modules/Setup, Make, Install Python
cd $HOME/.local/src/Python-3.8.1
cd Modules
vi Setup
Modules/Setup
210 SSL=$HOME/.local/ssl
211 _ssl _ssl.c \
212 -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
213 -L$(SSL)/lib -lssl -lcrypto
configure
cd $HOME/.local/src/Python-3.8.1
./configure --prefix=$Home/.local/python
Log-Snippets
Configure Python
checking for openssl/ssl.h in /usr/local/ssl... no
checking for openssl/ssl.h in /usr/lib/ssl... no
checking for openssl/ssl.h in /usr/ssl... no
checking for openssl/ssl.h in /usr/pkg... no
checking for openssl/ssl.h in /usr/local... no
checking for openssl/ssl.h in /usr... no
checking whether compiling and linking against OpenSSL works... no
Alternative Log: Seems it doesn't look in the right places. Already tried to give a hint while configure
./configure --prefix=$Home/.local/python --with-openssl=$HOME/.local/ssl
Log while Configure Changes in:
checking for openssl/ssl.h in $HOME/.local/ssl... yes
checking whether compiling and linking against OpenSSL works... yes
checking for X509_VERIFY_PARAM_set1_host in libssl... yes
checking for --with-ssl-default-suites... python
But then make throws error
Include/internal -I. -I./Include -DPy_BUILD_CORE \
-DGITVERSION="\"`LC_ALL=C `\"" \
-DGITTAG="\"`LC_ALL=C `\"" \
-DGITBRANCH="\"`LC_ALL=C `\"" \
-o Modules/getbuildinfo.o ./Modules/getbuildinfo.c
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I./Include/internal -I. -I./Include -DPy_BUILD_CORE -o Python/frozen.o Python/frozen.c
rm -f libpython3.8.a
ar rcs libpython3.8.a Modules/getbuildinfo.o Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/token.o Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o Objects/abstract.o Objects/accu.o Objects/boolobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/bytesobject.o Objects/call.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/interpreteridobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/odictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o Objects/object.o Objects/obmalloc.o Objects/picklebufobject.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/unicodeobject.o Objects/unicodectype.o Objects/weakrefobject.o Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/ast_opt.o Python/ast_unparse.o Python/bltinmodule.o Python/ceval.o Python/codecs.o Python/compile.o Python/context.o Python/dynamic_annotations.o Python/errors.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/hamt.o Python/import.o Python/importdl.o Python/initconfig.o Python/marshal.o Python/modsupport.o Python/mysnprintf.o Python/mystrtoul.o Python/pathconfig.o Python/peephole.o Python/preconfig.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pyhash.o Python/pylifecycle.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/pytime.o Python/bootstrap_hash.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/thread.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/pystrhex.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o Python/dynload_shlib.o Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/_weakref.o Modules/_functoolsmodule.o Modules/_operator.o Modules/_collectionsmodule.o Modules/_abc.o Modules/itertoolsmodule.o Modules/atexitmodule.o Modules/signalmodule.o Modules/_stat.o Modules/timemodule.o Modules/_threadmodule.o Modules/_localemodule.o Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o Modules/faulthandler.o Modules/_tracemalloc.o Modules/hashtable.o Modules/symtablemodule.o
Modules/_ssl.o Modules/xxsubtype.o Python/frozen.o
gcc -pthread -L$HOME/.local/ssl/lib -L$HOME/htdocs/.local/ssl/lib -Xlinker -export-dynamic -o python Programs/python.o libpython3.8.a -lcrypt -lpthread -ldl -lutil -lm -L$HOME/.local/ssl/lib -lssl -lcrypto -lm
./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
./python: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
generate-posix-vars failed
Makefile:592: recipe for target 'pybuilddir.txt' failed
make: *** [pybuilddir.txt] Error 1
Guess the Error occurs because of following line
./python: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Has somebody a clue where libssl.so.1.1 is supposed to be?
Thanks in advance.
Wip

Solved Issue by adding Path to LD_LIBRARY_PATH
Needed Libs can be found in path/to/ssl/lib
For me adding following Line in .profiles or .bashrc fixed the Issue
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/ssl/lib

Related

Makefile:179: recipe for target 'obj/demo.o' failed make: *** [obj/demo.o] Error 1

When I run !make command in yolov4, I face the issue:
chmod +x *.sh
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c demo.c -o obj/demo.o
demo.c:1:10: fatal error: network.h: No such file or directory
#include "network.h"
^~~~~~~~~~~
compilation terminated.
Makefile:179: recipe for target 'obj/demo.o' failed
make: \*\*\* \[obj/demo.o\] Error 1
Firstly it work fine, then I change in the darknet/src/dectector.c file for early save weights after 500 iteration and also change in the cfg/yolov4-custom.cfg file change the max_batches values 500500 to 500.
I don't think so it should create issue during the execution of !make file.
Someone have any suggestion? Anyone face this issue please guide me.
I run training command for yolov4 I face the issue access denied then I again run !make file at this command error came.

Error during compilling on python/fortran of Siesta libraries (Error: Line truncated)

I'm currently trying to install libraries for Siesta modelling soft. I have zero programming expirience and tried work with manuals and guides. I work with Ubuntu on Windows 10. I install all uppdates and soft that was asked (not 100% sure though) During programm compiling I got error that can't be solved with software update (part of compiler text below). All I have found that this error probably connected with number of symbols in line but I don't know how th change compiler settings. Would appreciate any help in solution of this problem. Libraries was taken here: https://gitlab.com/ElectronicStructureLibrary/esl-bundle
make -j 9 Making all in src make[1]: Entering directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src' Making all in wxml make[2]: Entering directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/wxml' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/wxml' Making all in cml make[2]: Entering directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/cml' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/cml' Making all in sax make[2]: Entering directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/sax' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/sax' Making all in xpath make[2]: Entering directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/xpath' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/xpath' Making all in dom make[2]: Entering directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/dom' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/dom' Making all in . make[2]: Entering directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src' /bin/bash ../libtool --tag=FC --mode=compile gfortran -g -O2 -c -o xmlf90_info.lo xmlf90_info.f90 libtool: compile: gfortran -g -O2 -c xmlf90_info.f90 -fPIC -o .libs/xmlf90_info.o libtool: compile: gfortran -g -O2 -c xmlf90_info.f90 -o xmlf90_info.o >/dev/null 2>&1 /bin/bash ../libtool --tag=FC --mode=link gfortran -g -O2 -version-info 0:0:0 -L/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/install/lib -L/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/install/lib -o libxmlf90.la -rpath /mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/install/lib xmlf90_info.lo cml/libxmlf90_cml.la dom/libxmlf90_dom.la sax/libxmlf90_sax.la wxml/libxmlf90_wxml.la xpath/libxmlf90_xpath.la libtool: link: rm -fr .libs/libxmlf90.a .libs/libxmlf90.la .libs/libxmlf90.lai .libs/libxmlf90.so .libs/libxmlf90.so.0 .libs/libxmlf90.so.0.0.0 libtool: link: gfortran -shared -fPIC .libs/xmlf90_info.o -Wl,--whole-archive cml/.libs/libxmlf90_cml.a dom/.libs/libxmlf90_dom.a sax/.libs/libxmlf90_sax.a wxml/.libs/libxmlf90_wxml.a xpath/.libs/libxmlf90_xpath.a -Wl,--no-whole-archive -L/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/install/lib -g -O2 -Wl,-soname -Wl,libxmlf90.so.0 -o .libs/libxmlf90.so.0.0.0 libtool: link: (cd ".libs" && rm -f "libxmlf90.so.0" && ln -s "libxmlf90.so.0.0.0" "libxmlf90.so.0") libtool: link: (cd ".libs" && rm -f "libxmlf90.so" && ln -s "libxmlf90.so.0.0.0" "libxmlf90.so") libtool: link: (cd .libs/libxmlf90.lax/libxmlf90_cml.a && ar x "/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/cml/.libs/libxmlf90_cml.a") libtool: link: (cd .libs/libxmlf90.lax/libxmlf90_dom.a && ar x "/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/dom/.libs/libxmlf90_dom.a") libtool: link: (cd .libs/libxmlf90.lax/libxmlf90_sax.a && ar x "/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/sax/.libs/libxmlf90_sax.a") libtool: link: (cd .libs/libxmlf90.lax/libxmlf90_wxml.a && ar x "/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/wxml/.libs/libxmlf90_wxml.a") libtool: link: (cd .libs/libxmlf90.lax/libxmlf90_xpath.a && ar x "/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src/xpath/.libs/libxmlf90_xpath.a") libtool: link: ar cru .libs/libxmlf90.a xmlf90_info.o .libs/libxmlf90.lax/libxmlf90_cml.a/m_wcml.o .libs/libxmlf90.lax/libxmlf90_cml.a/m_wstml.o .libs/libxmlf90.lax/libxmlf90_cml.a/xmlf90_cml.o .libs/libxmlf90.lax/libxmlf90_dom.a/m_dom_attribute.o .libs/libxmlf90.lax/libxmlf90_dom.a/m_dom_debug.o .libs/libxmlf90.lax/libxmlf90_dom.a/m_dom_document.o .libs/libxmlf90.lax/libxmlf90_dom.a/m_dom_element.o .libs/libxmlf90.lax/libxmlf90_dom.a/m_dom_error.o .libs/libxmlf90.lax/libxmlf90_dom.a/m_dom_namednodemap.o .libs/libxmlf90.lax/libxmlf90_dom.a/m_dom_node.o .libs/libxmlf90.lax/libxmlf90_dom.a/m_dom_nodelist.o .libs/libxmlf90.lax/libxmlf90_dom.a/m_dom_parse.o .libs/libxmlf90.lax/libxmlf90_dom.a/m_dom_strings.o .libs/libxmlf90.lax/libxmlf90_dom.a/m_dom_types.o .libs/libxmlf90.lax/libxmlf90_dom.a/m_dom_utils.o .libs/libxmlf90.lax/libxmlf90_dom.a/xmlf90_dom.o .libs/libxmlf90.lax/libxmlf90_sax.a/m_sax_buffer.o .libs/libxmlf90.lax/libxmlf90_sax.a/m_sax_charset.o .libs/libxmlf90.lax/libxmlf90_sax.a/m_sax_converters.o .libs/libxmlf90.lax/libxmlf90_sax.a/m_sax_debug.o .libs/libxmlf90.lax/libxmlf90_sax.a/m_sax_dictionary.o .libs/libxmlf90.lax/libxmlf90_sax.a/m_sax_elstack.o .libs/libxmlf90.lax/libxmlf90_sax.a/m_sax_entities.o .libs/libxmlf90.lax/libxmlf90_sax.a/m_sax_fsm.o .libs/libxmlf90.lax/libxmlf90_sax.a/m_sax_reader.o .libs/libxmlf90.lax/libxmlf90_sax.a/m_xml_error.o .libs/libxmlf90.lax/libxmlf90_sax.a/m_xml_parser.o .libs/libxmlf90.lax/libxmlf90_sax.a/xmlf90_sax.o .libs/libxmlf90.lax/libxmlf90_wxml.a/m_wxml_array_str.o .libs/libxmlf90.lax/libxmlf90_wxml.a/m_wxml_buffer.o .libs/libxmlf90.lax/libxmlf90_wxml.a/m_wxml_core.o .libs/libxmlf90.lax/libxmlf90_wxml.a/m_wxml_dictionary.o .libs/libxmlf90.lax/libxmlf90_wxml.a/m_wxml_elstack.o .libs/libxmlf90.lax/libxmlf90_wxml.a/m_wxml_error.o .libs/libxmlf90.lax/libxmlf90_wxml.a/m_wxml_escape.o .libs/libxmlf90.lax/libxmlf90_wxml.a/m_wxml_overloads.o .libs/libxmlf90.lax/libxmlf90_wxml.a/m_wxml_text.o .libs/libxmlf90.lax/libxmlf90_wxml.a/xmlf90_wxml.o .libs/libxmlf90.lax/libxmlf90_xpath.a/m_xpath_api.o .libs/libxmlf90.lax/libxmlf90_xpath.a/xmlf90_xpath.o ar: u' modifier ignored since D' is the default (see U')
libtool: link: ranlib .libs/libxmlf90.a
libtool: link: rm -fr .libs/libxmlf90.lax
libtool: link: ( cd ".libs" && rm -f "libxmlf90.la" && ln -s "../libxmlf90.la" "libxmlf90.la" )
make[2]: Leaving directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src'
make[1]: Leaving directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/src'
Making all in doc
make[1]: Entering directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/doc'
Making all in Examples
make[2]: Entering directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/doc/Examples'
Making all in cml
make[3]: Entering directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/doc/Examples/cml'
/bin/bash ../../../libtool --tag=FC --mode=link gfortran -I../../../src/cml -I../../../src/wxml -g -O2 -L/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/install/lib -L/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/install/lib -o example example.o ../../../src/libxmlf90.la
libtool: link: gfortran -I../../../src/cml -I../../../src/wxml -g -O2 -o .libs/example example.o -L/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/install/lib ../../../src/.libs/libxmlf90.so -Wl,-rpath -Wl,/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/install/lib
make[3]: Leaving directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/doc/Examples/cml'
Making all in dom
make[3]: Entering directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/doc/Examples/dom'
gfortran -DPACKAGE_NAME="XMLF90" -DPACKAGE_TARNAME="xmlf90" -DPACKAGE_VERSION="1.5.4" -DPACKAGE_STRING="XMLF90\ 1.5.4" -DPACKAGE_BUGREPORT="https://bugs.launchpad.net/xmlf90\" -DPACKAGE_URL="https://launchpad.net/xmlf90\" -DPACKAGE="xmlf90" -DVERSION="1.5.4" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -I. -I/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom -I../../../src/dom -I../../../src/sax -DDOM_DATA_DIR="/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/" -I../../../src/dom -I../../../src/sax -g -O2 -c -o data.o /mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/data.F90
gfortran -DPACKAGE_NAME="XMLF90" -DPACKAGE_TARNAME="xmlf90" -DPACKAGE_VERSION="1.5.4" -DPACKAGE_STRING="XMLF90\ 1.5.4" -DPACKAGE_BUGREPORT="https://bugs.launchpad.net/xmlf90\" -DPACKAGE_URL="https://launchpad.net/xmlf90\" -DPACKAGE="xmlf90" -DVERSION="1.5.4" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -I. -I/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom -I../../../src/dom -I../../../src/sax -DDOM_DATA_DIR="/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/" -I../../../src/dom -I../../../src/sax -g -O2 -c -o features.o /mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/features.F90
gfortran -DPACKAGE_NAME="XMLF90" -DPACKAGE_TARNAME="xmlf90" -DPACKAGE_VERSION="1.5.4" -DPACKAGE_STRING="XMLF90\ 1.5.4" -DPACKAGE_BUGREPORT="https://bugs.launchpad.net/xmlf90\" -DPACKAGE_URL="https://launchpad.net/xmlf90\" -DPACKAGE="xmlf90" -DVERSION="1.5.4" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -I. -I/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom -I../../../src/dom -I../../../src/sax -DDOM_DATA_DIR="/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/" -I../../../src/dom -I../../../src/sax -g -O2 -c -o pseudo.o /mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/pseudo.F90
gfortran -DPACKAGE_NAME="XMLF90" -DPACKAGE_TARNAME="xmlf90" -DPACKAGE_VERSION="1.5.4" -DPACKAGE_STRING="XMLF90\ 1.5.4" -DPACKAGE_BUGREPORT="https://bugs.launchpad.net/xmlf90\" -DPACKAGE_URL="https://launchpad.net/xmlf90\" -DPACKAGE="xmlf90" -DVERSION="1.5.4" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -I. -I/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom -I../../../src/dom -I../../../src/sax -DDOM_DATA_DIR="/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/" -I../../../src/dom -I../../../src/sax -g -O2 -c -o pseudo_dom.o /mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/pseudo_dom.F90
gfortran -DPACKAGE_NAME="XMLF90" -DPACKAGE_TARNAME="xmlf90" -DPACKAGE_VERSION="1.5.4" -DPACKAGE_STRING="XMLF90\ 1.5.4" -DPACKAGE_BUGREPORT="https://bugs.launchpad.net/xmlf90\" -DPACKAGE_URL="https://launchpad.net/xmlf90\" -DPACKAGE="xmlf90" -DVERSION="1.5.4" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -I. -I/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom -I../../../src/dom -I../../../src/sax -DDOM_DATA_DIR="/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/" -I../../../src/dom -I../../../src/sax -g -O2 -c -o text.o /mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/text.F90
/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/features.F90:9:132:
myDoc => parsefile(DOM_DATA_DIR//"test.xml" ) !! , verbose=.true.)
1
Error: Line truncated at (1) [-Werror=line-truncation]
/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/features.F90:9:132:
myDoc => parsefile(DOM_DATA_DIR//"test.xml" ) !! , verbose=.true.)
1
Error: Syntax error in argument list at (1)
f951: some warnings being treated as errors
/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/pseudo.F90:27:132:
myDoc => parsefile(DOM_DATA_DIR//"pseudo.xml") ! ,verbose=.true.)
1
Error: Line truncated at (1) [-Werror=line-truncation]
Makefile:679: recipe for target 'features.o' failed
/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/pseudo.F90:27:123:
myDoc => parsefile(DOM_DATA_DIR//"pseudo.xml") ! ,verbose=.true.)
1
Error: Unterminated character constant beginning at (1)
make[3]: *** [features.o] Error 1
make[3]: *** Waiting for unfinished jobs....
/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/data.F90:9:132:
myDoc => parsefile(DOM_DATA_DIR//"pseudo.xml",verbose=.true.)
1
Error: Line truncated at (1) [-Werror=line-truncation]
/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/data.F90:9:123:
myDoc => parsefile(DOM_DATA_DIR//"pseudo.xml",verbose=.true.)
1
Error: Unterminated character constant beginning at (1)
/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/text.F90:13:132:
myDoc => parsefile(DOM_DATA_DIR//"big-file.xml")!! , verbose=.true.)
1
Error: Line truncated at (1) [-Werror=line-truncation]
/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/pseudo_dom.F90:32:132:
myDoc => parsefile(DOM_DATA_DIR//"pseudo.xml") ! ,verbose=.true.)
1
Error: Line truncated at (1) [-Werror=line-truncation]
/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/text.F90:13:123:
myDoc => parsefile(DOM_DATA_DIR//"big-file.xml")!! , verbose=.true.)
1
Error: Unterminated character constant beginning at (1)
/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/checkouts/xmlf90-1.5.4/doc/Examples/dom/pseudo_dom.F90:32:123:
myDoc => parsefile(DOM_DATA_DIR//"pseudo.xml") ! ,verbose=.true.)
1
Error: Unterminated character constant beginning at (1)
f951: some warnings being treated as errors
f951: some warnings being treated as errors
f951: some warnings being treated as errors
Makefile:679: recipe for target 'data.o' failed
make[3]: *** [data.o] Error 1
f951: some warnings being treated as errors
Makefile:679: recipe for target 'pseudo.o' failed
make[3]: *** [pseudo.o] Error 1
Makefile:679: recipe for target 'text.o' failed
make[3]: *** [text.o] Error 1
Makefile:679: recipe for target 'pseudo_dom.o' failed
make[3]: *** [pseudo_dom.o] Error 1
make[3]: Leaving directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/doc/Examples/dom'
Makefile:478: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/doc/Examples'
Makefile:385: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/mnt/d/siesta-4.1-b4/esl-bundle-master/esl-bundle-master/my_build_dir/xmlf90/doc'
Makefile:528: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
...ending phase build module xmlf90 stderr: ########## Error running make -j 9
*** Error during phase build of xmlf90: ########## Error running make -j 9 *** [8/13]

Python subprocess.check_call works in a different way than bash

I'm trying to run Rscript via Python using subprocess.check_call.
Rscript is very simple it just checks if Rpackage exists, and if not it installs it.
local({r <- getOption("repos")
r["CRAN"] <- "https://cloud.r-project.org/"
options(repos=r)
})
if (!require("glue")) install.packages("glue")
When I run such command in bash
Rscript packages.R
it works fine.
But when I tried to run it using subprocess.check_call
subprocess.check_call(f"Rscript packages.R",
shell=True,
env=self.env)
I got such error:
* installing *source* package 'glue' ...
** package 'glue' successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c glue.c -o glue.o
gcc: error trying to exec 'cc1': execvp: No such file or directory
/usr/lib/R/etc/Makeconf:132: recipe for target 'glue.o' failed
make: *** [glue.o] Error 1
ERROR: compilation failed for package 'glue'
* removing '/usr/local/lib/R/site-library/glue'
The downloaded source packages are in
'/tmp/Rtmpym9Dy9/downloaded_packages'
You evidently took away (the useful value for) PATH by providing your own environment. If you want to be like the shell, make only the minimum necessary changes to the environment you inherit.

Python and C++ integration.Problems with dynamic library

I use Swig.(Mac os 10.13)
My shell script:
swig -c++ -python -o example_wrap.cpp example.i
g++ -c -std=c++17 -fPIC example.cpp
g++ -c -std=c++17 -fPIC example_wrap.cpp -o example_wrap.o \
-I/usr/local/Cellar//python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/include/python3.7m
ld -bundle -macosx_version_min 10.13 -flat_namespace \
-undefined suppress -o _example.so *.o
I spent enough time to seek how to create C++ dynamic library for Python, but I have never used the last line.Most often I create a library from an IDE.
g++ -shared is more familiar, but it doesn't work.
Many such errors appear:
Undefined symbols for architecture x86_64:
"_PyArg_ParseTuple", referenced from:
_wrap_printTree(_object*, _object*) in example_wrap.o
I know about this methods from Python.h.
So, the questions are - how does the last line work(ld -bundle ...)? Are there other methods to create the dynamic library?How can I use g++ -shared?
Here is a small CMakeLists.txt that should work for the example you posted:
cmake_minimum_required(VERSION 3.10) # change this to your needs
project(foo VERSION 0.0 LANGUAGES CXX C)
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
find_package(PythonLibs)
include_directories(${PYTHON_INCLUDE_PATH})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_SWIG_FLAGS "")
add_library(exampleImpl SHARED example.h example.cpp)
target_compile_features(exampleImpl PUBLIC cxx_std_17)
set_source_files_properties(example.i PROPERTIES CPLUSPLUS ON)
swig_add_library(example LANGUAGE python SOURCES example.i)
swig_link_libraries(example ${PYTHON_LIBRARIES} exampleImpl)
To make sure cmake uses the right python library, you can pass an appropriate option upon configure time, see here.

pip install uwsgi failing with "cannot find -lz"

I want to install uwsgi but I am unable to do so. It is a Fedora 18 64-bit system. python is version 2.7 and yum install zlib says: Package zlib-1.2.7-9.fc18.x86_64 already installed and latest version
Here is the last chunk of output when installing uwsgi.
*** uWSGI linking ***
gcc -pthread -o /usr/bin/uwsgi -L/usr/lib64 core/utils.o core/protocol.o core/socket.o core/logging.o core/master.o core/master_utils.o core/emperor.o core/notify.o core/mule.o core/subscription.o core/stats.o core/sendfile.o core/async.o core/master_checks.o core/offload.o core/io.o core/static.o core/websockets.o core/spooler.o core/snmp.o core/exceptions.o core/config.o core/setup_utils.o core/clock.o core/init.o core/buffer.o core/reader.o core/writer.o core/alarm.o core/cron.o core/plugins.o core/lock.o core/cache.o core/daemons.o core/errors.o core/hash.o core/master_events.o core/chunked.o core/queue.o core/event.o core/signal.o core/strings.o core/progress.o core/timebomb.o core/ini.o core/fsmon.o core/rpc.o core/gateway.o core/loop.o core/cookie.o core/querystring.o core/rb_timers.o core/transformations.o core/uwsgi.o proto/base.o proto/uwsgi.o proto/http.o proto/fastcgi.o proto/scgi.o lib/linux_ns.o core/zlib.o core/yaml.o core/dot_h.o plugins/python/python_plugin.o plugins/python/pyutils.o plugins/python/pyloader.o plugins/python/wsgi_handlers.o plugins/python/wsgi_headers.o plugins/python/wsgi_subhandler.o plugins/python/web3_subhandler.o plugins/python/pump_subhandler.o plugins/python/gil.o plugins/python/uwsgi_pymodule.o plugins/python/profiler.o plugins/python/symimporter.o plugins/python/tracebacker.o plugins/gevent/gevent.o plugins/gevent/hooks.o plugins/ping/ping_plugin.o plugins/cache/cache.o plugins/nagios/nagios.o plu/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../libz.so when searching for -lz
/bin/ld: skipping incompatible /lib/libz.so when searching for -lz
/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
gins/rrdtool/rrdtool.o plugins/carbon/carbon.o plugins/rpc/rpc_plugin.o plugins/corerouter/cr_common.o plugins/corerouter/cr_map.o plugins/corerouter/corerouter.o plugins/fastrouter/fastrouter.o plugins/http/http.o plugins/http/keepalive.o plugins/http/https.o plugins/http/spdy3.o plugins/ugreen/ugreen.o plugins/signal/signal_plugin.o plugins/syslog/syslog_plugin.o plugins/rsyslog/rsyslog_plugin.o plugins/logsocket/logsocket_plugin.o plugins/router_uwsgi/router_uwsgi.o plugins/router_redirect/router_redirect.o plugins/router_basicauth/router_basicauth.o plugins/zergpool/zergpool.o plugins/redislog/redislog_plugin.o plugins/mongodblog/mongodblog_plugin.o plugins/router_rewrite/router_rewrite.o plugins/router_http/router_http.o plugins/logfile/logfile.o plugins/router_cache/router_cache.o plugins/rawrouter/rawrouter.o plugins/router_static/router_static.o plugins/sslrouter/sslrouter.o plugins/spooler/spooler_plugin.o plugins/cheaper_busyness/cheaper_busyness.o plugins/symcall/symcall_plugin.o plugins/transformation_tofile/tofile.o plugins/transformation_gzip/gzip.o plugins/transformation_chunked/chunked.o plugins/transformation_offload/offload.o plugins/router_memcached/router_memcached.o plugins/router_redis/router_redis.o plugins/router_hash/router_hash.o plugins/router_expires/expires.o -lpthread -lm -rdynamic -ldl -lz -lpthread -ldl -lutil -lm -lpython2.7 -lcrypt
*** error linking uWSGI ***
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-QEHDKx-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/uwsgi
Storing complete log in /root/.pip/pip.log
First up, make sure you installed python-dev.
Next up, install zlib-devel.
yum install -y python-dev zlib-devel
First up, I wouldn't worry about:
/bin/ld: skipping incompatible /lib/libz.so when searching for -lz
/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
They're only showing up because -L adds a directory to the library search path so it's still examining the 32-bit areas as well (and ignoring them).
However, according to the RPM search page for your package, only the following files are provided:
/usr/lib64/libz.so.1
/usr/lib64/libz.so.1.2.7
/usr/share/doc/zlib-1.2.7
/usr/share/doc/zlib-1.2.7/ChangeLog
/usr/share/doc/zlib-1.2.7/FAQ
/usr/share/doc/zlib-1.2.7/README
You may want to examine that directory to see if there is a libz.so soft-linked to the libz.so.1 entry. If not, create one with a command like:
ln -s /usr/lib64/libz.so.1 /usr/lib64/libz.so
(you may need to be root). Looking at the libz stuff in /lib should show you what it should look like, like:
lrwxrwxrwx 1 root root 18 Apr 24 2012 libxyzzy.so -> libxyzzy.so.2.1.0

Categories

Resources