Page 2 of 3

Re: libtclSDDS.so not in sources

Posted: 20 Dec 2021, 10:03
by blanco-garcia
Dear Soliday,

when using sddsedit to open some file and 'save as' test.mmap (momentum aperture) file I see that it is corrupted.
The sddsedit application reports : Error saving data : sdds save : invalid type given.

What could this error mean ?
The new sdds file is saved but it is not possible to inspect it.

For example, sddsprintout shows :
$ sddsprintout test.twi -param
Error for sddsprintout:
Unable to read layout--no header lines found (SDDS_ReadLayout)

Best regards,
o

Re: libtclSDDS.so not in sources

Posted: 20 Dec 2021, 12:36
by soliday
Can you post the original file?

Re: libtclSDDS.so not in sources

Posted: 21 Dec 2021, 06:14
by blanco-garcia
Dear Soliday,

I attach the original file test.mmap and the file I save with the function "save as" in sddsedit.
The file corruption happens when I use the local sdds dir in the TCLLIBPATH.
(In that local sdds dir I have pkgIndex.tcl and libtclSDDS.so)

On the other hand I am able to save a file when I remove the local sdds dir from the TCLLIBPATH; I guess the compiled sddsedit could be using some other libtclSDDS.so present in the system.

Re: libtclSDDS.so not in sources

Posted: 21 Dec 2021, 17:57
by soliday
You should be able to find the SDDS package it is loading by running oagwish and typing "puts $tcl_pkgPath"
One of the listed directories should contain an sdds subdirectory. But yes, there must be some issue with your local compiled version. It is hard to say what the problem is, but it looks like we don't have to debug it if you have a working solution.

Re: libtclSDDS.so not in sources

Posted: 22 Dec 2021, 05:33
by blanco-garcia
It seems that saving as requires something more than pkgIndex.tcl and libtclSDDS.so in the same folder.
It could be calling something additional from /usr/lib/sdds that I don't have in my local sdds.

Best regards,
o

Re: libtclSDDS.so not in sources

Posted: 03 Jan 2022, 12:25
by blanco-garcia
Dear Soliday,

the problem is the libtclSDDS.a file.
Is there any additional command or order of compilation that should be used to generate a correct libtclSDDS.a file ?

Best regards,
o

Re: libtclSDDS.so not in sources

Posted: 03 Jan 2022, 16:21
by soliday
There shouldn't be a libtclSDDS.a file, it should be libtclSDDS.so
If the version in /usr/lib/sdds/ is working, then you can copy that version.
Or remind me what version of linux you are using and I will post the libtclSDDS.so file for that version of linux.

Re: libtclSDDS.so not in sources

Posted: 04 Jan 2022, 04:56
by blanco-garcia
Dear Soliday,

When using the .so and .a files from an old installation (2018), I see that "save as" in sddsedit works.
It is true that we can copy them as a short term workaround, but, it would be better to be able to compile them from the available sources.
I believe that the problem with the recently compiled .so and .a files IS NOT related to the linux version because the old .so and .a files work well when just copied to the new RHEL 8.3.

I would go through the current state of the compilation for those two files.
From my tests :
'libtclSDDS.so' is required to launch geneticOptimizer and open files with sddsedit,
'libtclSDDS.a' is required, to use the "save as" option.
They are stored in a 'oag/apps/lib/linux-x86_64/' which is a valid dir because it has been added to the TCLLIBPATH variable.

Inside 'oag/apps/lib/linux-x86_64/' I have created a 'sdds' dir with a copy of 'libtclSDDS.so' and 'pkgIndex.tcl'.

The .so and .a files were compiled from the sources using the APS files except for EPICS BASE R3.16.2.
Although the binaries are produced, they are not working properly because the "save as" option gives the invalid type given error.

When doing make inside 'oag/apps/src/tcltkinterp/extensions/sdds' the compilation is normal except for the following warnings :

Code: Select all

../tclSDDS.c: In function ‘tclSDDSSetArray’:
../tclSDDS.c:2932:3: warning: ‘result’ is deprecated: use Tcl_GetStringResult/Tcl_SetResult [-Wdeprecated-declarations]
   if (Tcl_GetInt(interp,interp->result,&elements) != TCL_OK) {
   ^~
In file included from ../tclSDDS.h:67,
                 from ../tclSDDS.c:119:
/usr/include/tcl.h:503:11: note: declared here
     char *result TCL_DEPRECATED_API("use Tcl_GetStringResult/Tcl_SetResult");
           ^~~~~~
../tclSDDS.c: In function ‘tclSDDSSave’:
../tclSDDS.c:5100:3: warning: ‘result’ is deprecated: use Tcl_GetStringResult/Tcl_SetResult [-Wdeprecated-declarations]
   (Tcl_GetInt(interp,interp->result,&elements) != TCL_OK)) {
   ^
In file included from ../tclSDDS.h:67,
                 from ../tclSDDS.c:119:
/usr/include/tcl.h:503:11: note: declared here
     char *result TCL_DEPRECATED_API("use Tcl_GetStringResult/Tcl_SetResult");
           ^~~~~~
There is a warning related to tclSDDSSave due to a deprecated usage of result.
We use TCL/TK 8.6.

Re: libtclSDDS.so not in sources

Posted: 04 Jan 2022, 12:42
by soliday
I found the problem. I was unaware I was working with an uncommitted bug fix that didn't make it to the last release. Replace your oag/apps/src/tcltkinterp/extensions/sdds/tclSDDS.c file with the one I have attached. Then rebuild in the same directory with "make clean all"

You can verify the change works by running oagtclsh at the command line and typing:
load /home/oxygen/SOLIDAY/oag/apps/src/tcltkinterp/extensions/sdds/O.linux-x86_64/libtclSDDS.so
sdds load test.mmap data
sdds save test2.mmap data
exit

You will have to change the full pathname for your libtclSDDS.so

I will update the OAG Tcl/Tk releases later today with the bug fix.

Re: libtclSDDS.so not in sources

Posted: 05 Jan 2022, 06:19
by blanco-garcia
The "save as " option in sddsedit works !

Thank you very much dear Soliday.

Best regards,
o