Re: Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))

2019-12-13 Thread Andrey Rahmatullin
On Fri, Dec 13, 2019 at 03:49:22PM +0100, Andreas Tille wrote:
> > g++ -o pdb2pka/substruct/Algorithms.cpython-37m-x86_64-linux-gnu.so 
> > -Wl,-z,relro -Wl,-z,now -shared pdb2pka/substruct/Algorithms.os -L/usr/lib 
> > -lpython3.7m -lpython3.7
> > /usr/bin/ld: cannot find -lpython3.7
> > collect2: error: ld returned 1 exit status
> > ...
> > 
> > AAArgh, now we just need to get rid of the unwanted stuff.  Any scons
> > expert around?
> 
> I think at least this is solved now:
> 
>
> https://salsa.debian.org/med-team/pdb2pqr/commit/1f4ee901456641140ef18ca8e91e4701e1175410

Nice catch, "env.Append(LIBS=[python_lib])" where "python_lib = 'python' +
gcv('VERSION')" is definitely the cause.

-- 
WBR, wRAR


signature.asc
Description: PGP signature


Re: Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))

2019-12-13 Thread Andreas Tille
On Fri, Dec 13, 2019 at 03:16:32PM +0100, Andreas Tille wrote:
> 
> ...
> g++ -o pdb2pka/substruct/Algorithms.cpython-37m-x86_64-linux-gnu.so 
> -Wl,-z,relro -Wl,-z,now -shared pdb2pka/substruct/Algorithms.os -L/usr/lib 
> -lpython3.7m -lpython3.7
> /usr/bin/ld: cannot find -lpython3.7
> collect2: error: ld returned 1 exit status
> ...
> 
> AAArgh, now we just need to get rid of the unwanted stuff.  Any scons
> expert around?

I think at least this is solved now:

   
https://salsa.debian.org/med-team/pdb2pqr/commit/1f4ee901456641140ef18ca8e91e4701e1175410

I might come back with other issues

 Andreas.

-- 
http://fam-tille.de



Re: Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))

2019-12-13 Thread Andreas Tille
On Fri, Dec 13, 2019 at 05:46:42PM +0500, Andrey Rahmatullin wrote:
> > 
> > Thanks for that additional hint.  I can confirm that I checked whether
> > pkgconfig can be used before I was asking here.  But we seem to agree
> > that this is not the case.  I admit I have no real clue how to convince
> > scons to link to the correct library name. :-(
> I have no idea either. It seems that it just uses the scons compilation
> code by creating an env.LoadableModule.

I tried a patch to use pkg-config which **partly** works:

...
g++ -o pdb2pka/substruct/Algorithms.cpython-37m-x86_64-linux-gnu.so 
-Wl,-z,relro -Wl,-z,now -shared pdb2pka/substruct/Algorithms.os -L/usr/lib 
-lpython3.7m -lpython3.7
/usr/bin/ld: cannot find -lpython3.7
collect2: error: ld returned 1 exit status
...

AAArgh, now we just need to get rid of the unwanted stuff.  Any scons
expert around?

Kind regards, Andreas.


[1] 
https://salsa.debian.org/med-team/pdb2pqr/commit/dbee7b96cdb8cad7b60e8c6acffea068664ebe7c

-- 
http://fam-tille.de



Re: Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))

2019-12-13 Thread Andrey Rahmatullin
On Fri, Dec 13, 2019 at 01:40:34PM +0100, Andreas Tille wrote:
> > > g++ -o pdb2pka/substruct/Algorithms.cpython-37m-x86_64-linux-gnu.so 
> > > -Wl,-z,relro -Wl,-z,now -shared pdb2pka/substruct/Algorithms.os 
> > > -L/usr/lib -lpython3.7
> > > /usr/bin/ld: cannot find -lpython3.7
> > Actually, it's a different problem, sorry.
> > There is no -lpython3.7, only -lpython3.7m. If the build system used
> > pkgconfig it would know that. I guess the library name is hardcoded
> > instead? I see that it got -I/usr/include/python3.7m from somewhere, so
> > it's not completely broken.
> 
> Thanks for that additional hint.  I can confirm that I checked whether
> pkgconfig can be used before I was asking here.  But we seem to agree
> that this is not the case.  I admit I have no real clue how to convince
> scons to link to the correct library name. :-(
I have no idea either. It seems that it just uses the scons compilation
code by creating an env.LoadableModule.

-- 
WBR, wRAR


signature.asc
Description: PGP signature


Re: Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))

2019-12-13 Thread Andreas Tille
Hi Andrey,

On Fri, Dec 13, 2019 at 05:18:45PM +0500, Andrey Rahmatullin wrote:
> On Fri, Dec 13, 2019 at 09:49:47AM +0100, Andreas Tille wrote:
> > g++ -o pdb2pka/substruct/Algorithms.cpython-37m-x86_64-linux-gnu.so 
> > -Wl,-z,relro -Wl,-z,now -shared pdb2pka/substruct/Algorithms.os -L/usr/lib 
> > -lpython3.7
> > /usr/bin/ld: cannot find -lpython3.7
> Actually, it's a different problem, sorry.
> There is no -lpython3.7, only -lpython3.7m. If the build system used
> pkgconfig it would know that. I guess the library name is hardcoded
> instead? I see that it got -I/usr/include/python3.7m from somewhere, so
> it's not completely broken.

Thanks for that additional hint.  I can confirm that I checked whether
pkgconfig can be used before I was asking here.  But we seem to agree
that this is not the case.  I admit I have no real clue how to convince
scons to link to the correct library name. :-(

Kind regards

  Andreas.

-- 
http://fam-tille.de



Re: Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))

2019-12-13 Thread Andrey Rahmatullin
On Fri, Dec 13, 2019 at 09:49:47AM +0100, Andreas Tille wrote:
> g++ -o pdb2pka/substruct/Algorithms.cpython-37m-x86_64-linux-gnu.so 
> -Wl,-z,relro -Wl,-z,now -shared pdb2pka/substruct/Algorithms.os -L/usr/lib 
> -lpython3.7
> /usr/bin/ld: cannot find -lpython3.7
Actually, it's a different problem, sorry.
There is no -lpython3.7, only -lpython3.7m. If the build system used
pkgconfig it would know that. I guess the library name is hardcoded
instead? I see that it got -I/usr/include/python3.7m from somewhere, so
it's not completely broken.

-- 
WBR, wRAR


signature.asc
Description: PGP signature


Re: Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))

2019-12-13 Thread Andreas Tille
On Fri, Dec 13, 2019 at 03:23:19PM +0500, Andrey Rahmatullin wrote:
> On Fri, Dec 13, 2019 at 09:49:47AM +0100, Andreas Tille wrote:
> > So how can I enable proper linking to -lpython3.7 which is obviously not
> > in the library search path (but package libpython3.7 is definitely
> > installed in the pbuilder chroot).
> To link to a library you need to install its -dev package (this is not just
> for libpython*).

Thus python3-dev is in the Build-Depends, yes.  The library is just not found
by the linker.

Kind regards

  Andreas.

-- 
http://fam-tille.de



Re: Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))

2019-12-13 Thread Andrey Rahmatullin
On Fri, Dec 13, 2019 at 09:49:47AM +0100, Andreas Tille wrote:
> So how can I enable proper linking to -lpython3.7 which is obviously not
> in the library search path (but package libpython3.7 is definitely
> installed in the pbuilder chroot).
To link to a library you need to install its -dev package (this is not just
for libpython*).

-- 
WBR, wRAR


signature.asc
Description: PGP signature


Re: Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))

2019-12-13 Thread Andreas Tille
Hi Scott,

On Thu, Dec 12, 2019 at 04:34:09PM -0500, Scott Talbert wrote:
> On Thu, 12 Dec 2019, Andreas Tille wrote:
> > mkdir -p /build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr
> > scons \
> >URL="http://localhost/pdb2pqr/; \
> >PREFIX="/build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr"
> > scons: Reading SConscript files ...
> > not using opal
> > scons: done reading SConscript files.
> > scons: Building targets ...
> > CopySubAction("pdb2pqr.py", "pdb2pqr.py.in")
> > scons: *** [pdb2pqr.py] Can't write target file pdb2pqr.py
> > scons: building terminated because of errors.
> 
> I think you need to change the other open() call in that function to write
> in text mode also.

Thanks a lot for your patience and your always helpful hints.  After
changing this and some other issues with the C++ code I was (hopefully)
able to solve myself[1] I'm facing the next stumbling stone which is
most probably easy to solve for someone more experienced than me:


...
scons \
URL="http://localhost/pdb2pqr/; \
PREFIX="/usr/share/pdb2pqr"
scons: Reading SConscript files ...
not using opal 
scons: done reading SConscript files.
scons: Building targets ...
CopySubAction("pdb2pqr.py", "pdb2pqr.py.in")
Chmod("pdb2pqr.py", 0755)
CopySubAction("apbs_cgi.cgi", "apbs_cgi.py")
Chmod("apbs_cgi.cgi", 0755)
CopySubAction("visualize.cgi", "visualize.py")
Chmod("visualize.cgi", 0755)
CopySubAction("querystatus.cgi", "querystatus.py")
Chmod("querystatus.cgi", 0755)
CopySubAction("src/aconf.py", "src/aconf.py.in")
CopySubAction("html/server.html", "html/server.html.in")
Copy("pdb2pqr.cgi", "pdb2pqr.py")
g++ -o pdb2pka/substruct/Algorithms.os -c -g -fPIC -I/usr/include/python3.7m 
-I/usr/lib/python3/dist-packages/numpy/core/include 
pdb2pka/substruct/Algorithms.cpp
In file included from /usr/include/python3.7m/numpy/ndarraytypes.h:1830,
 from /usr/include/python3.7m/numpy/ndarrayobject.h:12,
 from /usr/include/python3.7m/numpy/arrayobject.h:4,
 from pdb2pka/substruct/Algorithms.cpp:43:
/usr/include/python3.7m/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning 
"Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API 
NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
  |  ^~~
pdb2pka/substruct/Algorithms.cpp: In function 'PyObject* initAlgorithms()':
pdb2pka/substruct/Algorithms.cpp:333:1: warning: control reaches end of 
non-void function [-Wreturn-type]
  333 | };
  | ^
g++ -o pdb2pka/substruct/Algorithms.cpython-37m-x86_64-linux-gnu.so 
-Wl,-z,relro -Wl,-z,now -shared pdb2pka/substruct/Algorithms.os -L/usr/lib 
-lpython3.7
/usr/bin/ld: cannot find -lpython3.7
collect2: error: ld returned 1 exit status
scons: *** [pdb2pka/substruct/Algorithms.cpython-37m-x86_64-linux-gnu.so] Error 
1
scons: building terminated because of errors.

TARGETS: ['pdb2pqr.py', 'apbs_cgi.cgi', 'visualize.cgi', 'querystatus.cgi', 
'src/aconf.py', 'html/server.html', 'pdb2pqr.cgi', 
'pdb2pka/substruct/Algorithms.cpython-37m-x86_64-linux-gnu.so', 
'pdb2pka/_pMC_mult.cpython-37m-x86_64-linux-gnu.so']


Configuration Parameters


Version: 2.1.1
Install directory: /usr/share/pdb2pqr/
pdb2pka and ligand support: True
Path to the website directory: http://localhost/pdb2pqr/
PDB2PQR jobs run via the web interface will be forked on the server.

The preferred way to configure the build is by editing the file build_config.py

Run scons with the python3 that you intend to use with pdb2pqr.
For example: "scons" will setup pdb2pqr to be run with Debian default Python3 
interpreter

Run "scons install" to install pdb2pqr in /usr/share/pdb2pqr/

Run "scons basic-test" for a basic functionality test
Run "scons advanced-test" for a single test of ligand and PROPKA support. 
Requires numpy and PDB2PKA support compiled.
Run "scons complete-test" for a complete test of all functionality EXCEPT 
PDB2PKA. Requires numpy and PDB2PKA support compiled.
Run "scons pdb2pka-test" for a test of PDB2PKA functionality.
Requires numpy, PDB2PKA support compiled AND the APBS python3 libraries 
compiled and installed in the pdb2pka directory.

To setup a web service create a symbolic link to /usr/share/pdb2pqr/ that 
enables you to view http://localhost/pdb2pqr/ after running "scons install"

Run "scons msvs" to build Visual Studio projects for the Algorithms and 
pMC_mult modules.
VS project generation is not well supported in scons. Resulting projects should 
build using NMAKE but cannot be used for debugging.
The resulting projects will need to modified to use VS natively to compile the 
code or debug.

FAILED
Failed building pdb2pka/substruct/Algorithms.cpython-37m-x86_64-linux-gnu.so: 
Error 1
...


So how can I enable proper linking to -lpython3.7 which is obviously not
in the library search path (but package libpython3.7 is definitely
installed in the pbuilder 

Re: Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))

2019-12-12 Thread Scott Talbert

On Thu, 12 Dec 2019, Andreas Tille wrote:


That hint was helpful anyway and I get further now.  I think now the
problem is to convince scons to install in $(CURDIR)/debian/tmp which
seems to try rather /usr/share/pdb2pqr directly:


Looks like the debian/rules file is specifying /usr/share/pdb2pqr as PREFIX:

https://salsa.debian.org/med-team/pdb2pqr/blob/master/debian/rules#L33


Arrghh, good if somebody else is proof-reading.  However, setting this
does not help:



mkdir -p /build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr
scons \
   URL="http://localhost/pdb2pqr/; \
   PREFIX="/build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr"
scons: Reading SConscript files ...
not using opal
scons: done reading SConscript files.
scons: Building targets ...
CopySubAction("pdb2pqr.py", "pdb2pqr.py.in")
scons: *** [pdb2pqr.py] Can't write target file pdb2pqr.py
scons: building terminated because of errors.


I think you need to change the other open() call in that function to write 
in text mode also.


Scott



Re: Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye))

2019-12-12 Thread Andreas Tille
On Thu, Dec 12, 2019 at 03:49:13PM -0500, Scott Talbert wrote:
> > 
> > That hint was helpful anyway and I get further now.  I think now the
> > problem is to convince scons to install in $(CURDIR)/debian/tmp which
> > seems to try rather /usr/share/pdb2pqr directly:
> 
> Looks like the debian/rules file is specifying /usr/share/pdb2pqr as PREFIX:
> 
> https://salsa.debian.org/med-team/pdb2pqr/blob/master/debian/rules#L33

Arrghh, good if somebody else is proof-reading.  However, setting this
does not help:



mkdir -p /build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr
scons \
URL="http://localhost/pdb2pqr/; \
PREFIX="/build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr"
scons: Reading SConscript files ...
not using opal 
scons: done reading SConscript files.
scons: Building targets ...
CopySubAction("pdb2pqr.py", "pdb2pqr.py.in")
scons: *** [pdb2pqr.py] Can't write target file pdb2pqr.py
scons: building terminated because of errors.

TARGETS: ['pdb2pqr.py', 'apbs_cgi.cgi', 'visualize.cgi', 'querystatus.cgi', 
'src/aconf.py', 'html/server.html', 'pdb2pqr.cgi', 
'pdb2pka/substruct/Algorithms.cpython-37m-x86_64-linux-gnu.so', 
'pdb2pka/_pMC_mult.cpython-37m-x86_64-linux-gnu.so']


Configuration Parameters


Version: 2.1.1
Install directory: /build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr/
pdb2pka and ligand support: True
Path to the website directory: http://localhost/pdb2pqr/
PDB2PQR jobs run via the web interface will be forked on the server.

The preferred way to configure the build is by editing the file build_config.py

Run scons with the python3 that you intend to use with pdb2pqr.
For example: "scons" will setup pdb2pqr to be run with Debian default Python3 
interpreter

Run "scons install" to install pdb2pqr in 
/build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr/

Run "scons basic-test" for a basic functionality test
Run "scons advanced-test" for a single test of ligand and PROPKA support. 
Requires numpy and PDB2PKA support compiled.
Run "scons complete-test" for a complete test of all functionality EXCEPT 
PDB2PKA. Requires numpy and PDB2PKA support compiled.
Run "scons pdb2pka-test" for a test of PDB2PKA functionality.
Requires numpy, PDB2PKA support compiled AND the APBS python3 libraries 
compiled and installed in the pdb2pka directory.

To setup a web service create a symbolic link to 
/build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr/ that enables you to 
view http://localhost/pdb2pqr/ after running "scons install"

Run "scons msvs" to build Visual Studio projects for the Algorithms and 
pMC_mult modules.
VS project generation is not well supported in scons. Resulting projects should 
build using NMAKE but cannot be used for debugging.
The resulting projects will need to modified to use VS natively to compile the 
code or debug.

FAILED
Failed building pdb2pqr.py: Can't write target file pdb2pqr.py
make[1]: *** [debian/rules:29: override_dh_auto_configure] Error 2
make[1]: Leaving directory '/build/pdb2pqr-2.1.1+dfsg'
make: *** [debian/rules:13: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
I: copying local configuration
E: Failed autobuilding of package


I intentionally created the dir
  /build/pdb2pqr-2.1.1+dfsg/debian/tmp/usr/share/pdb2pqr/
before the fixed scons call - but the result is the same. :-(

Kind regards

  Andreas.


-- 
http://fam-tille.de