Csound Csound-dev Csound-tekno Search About

[Cs-dev] default visibility hidden

Date2012-03-04 22:33
FromFelipe Sateler
Subject[Cs-dev] default visibility hidden
Hi all,

CsoundAC does not work when built with CMake, at least on linux. This
is because CMakeLists.txt adds the -fvisibility=hidden[1] flag to the
whole project. It is my opinion that this is the right thing to do.
CsoundAC does not work because it is missing the export markers on
some classes. I was going to add these markers to CsoundAC but I'm not
sure if all the classes are meant to be public. Are they?



[1] That flag controls the exporting of symbols in the building of
shared libraries. Gcc by default exports all symbols, this flag
changes the default to not export symbols unless told otherwise (in
csound there is the PUBLIC macro to do this).
-- 

Saludos,
Felipe Sateler

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-03-04 23:11
FromMichael Gogins
SubjectRe: [Cs-dev] default visibility hidden
I know that the symbols are hidden by default, what the flags mean, and so on.

I have also explained in several earlier emails what the problem is. I
will try to explain it again. When I have built  CsoundAC as a shared
library with default visibility but with all necessary classes
exported, the library is not usable. I have already tried this several
times over the years. And I have tried it several times in the last
few weeks.

Therefore, I build the CsoundAC library as a static library.

This is the only way it works for all use cases right now as far as I
know. Please do it this way unless you are prepared to test your fixes
to the build system and library with all of the actual use cases, as I
have.

The use cases are:

(1) Support the Python wrapper for CsoundAC (this works with both
static and dynamic linkage because the only exported function required
is the init function).

(2) Support the Lua wrapper for CsoundAC (ditto).

(3) Support the Java wrapper for CsoundAC (works with both static and
dynamic linkage, as far as I know but haven't tested recently, because
SWIG generates its own exported functions for the JNI wrappers).

(4) Support using CsoundAC as a library for coding compositions
directly in C++. This is what does not work unless the CsoundAC
library is a static library. I repeat, I have tested this with default
visibility and exporting all of the user level classes, and that does
not work.

Everything works fine if the CsoundAC library itself is produced and
installed only as a static library.

Please feel free to get the whole shebang to work with CsoundAC as a
shared library, but only if you can get all four of the cases to work.
Since it does work for all cases as a static library, I wonder if that
would be the best use of your time.

Another option would be for me to withdraw the CsoundAC library from
the Csound repository and packages, and maintain it myself in my own
repository. I don't really know how many people use it...

Regards,
Mike

On Sun, Mar 4, 2012 at 5:33 PM, Felipe Sateler  wrote:
> Hi all,
>
> CsoundAC does not work when built with CMake, at least on linux. This
> is because CMakeLists.txt adds the -fvisibility=hidden[1] flag to the
> whole project. It is my opinion that this is the right thing to do.
> CsoundAC does not work because it is missing the export markers on
> some classes. I was going to add these markers to CsoundAC but I'm not
> sure if all the classes are meant to be public. Are they?
>
>
>
> [1] That flag controls the exporting of symbols in the building of
> shared libraries. Gcc by default exports all symbols, this flag
> changes the default to not export symbols unless told otherwise (in
> csound there is the PUBLIC macro to do this).
> --
>
> Saludos,
> Felipe Sateler
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-03-05 02:01
FromFelipe Sateler
SubjectRe: [Cs-dev] default visibility hidden
On Sun, Mar 4, 2012 at 20:11, Michael Gogins  wrote:
> I know that the symbols are hidden by default, what the flags mean, and so on.
>
> I have also explained in several earlier emails what the problem is. I
> will try to explain it again. When I have built  CsoundAC as a shared
> library with default visibility but with all necessary classes
> exported, the library is not usable. I have already tried this several
> times over the years. And I have tried it several times in the last
> few weeks.
>
> Therefore, I build the CsoundAC library as a static library.
>
> This is the only way it works for all use cases right now as far as I
> know. Please do it this way unless you are prepared to test your fixes
> to the build system and library with all of the actual use cases, as I
> have.

I am prepared to test the build system, of course. However, I'm not a
user of CsoundAC myself, so I probably need help in creating test
cases for each use case.

>
> The use cases are:
>
> (1) Support the Python wrapper for CsoundAC (this works with both
> static and dynamic linkage because the only exported function required
> is the init function).

I am using the examples in the git repository to test this use case.

>
> (2) Support the Lua wrapper for CsoundAC (ditto).

I Haven't tested this yet, but there is Lindenmayer.lua to test this too.

>
> (3) Support the Java wrapper for CsoundAC (works with both static and
> dynamic linkage, as far as I know but haven't tested recently, because
> SWIG generates its own exported functions for the JNI wrappers).
>
> (4) Support using CsoundAC as a library for coding compositions
> directly in C++. This is what does not work unless the CsoundAC
> library is a static library. I repeat, I have tested this with default
> visibility and exporting all of the user level classes, and that does
> not work.

These 2 use cases do not have an example in the csound repository.
Could you provide some examples I could use to test?

>
> Everything works fine if the CsoundAC library itself is produced and
> installed only as a static library.
>
> Please feel free to get the whole shebang to work with CsoundAC as a
> shared library, but only if you can get all four of the cases to work.
> Since it does work for all cases as a static library, I wonder if that
> would be the best use of your time.

In debian it is very frowned upon to use static libraries. So it is
either a shared CsoundAC or no CsoundAC in debian.

>
> Another option would be for me to withdraw the CsoundAC library from
> the Csound repository and packages, and maintain it myself in my own
> repository. I don't really know how many people use it...

I cannot comment on this one. It does seem to me that it could live in
a separate repository, but the fundamental issue remains.


-- 

Saludos,
Felipe Sateler

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sou

Date2012-03-05 14:50
FromFelipe Sateler
SubjectRe: [Cs-dev] default visibility hidden
On Sun, Mar 4, 2012 at 20:11, Michael Gogins  wrote:
> Another option would be for me to withdraw the CsoundAC library from
> the Csound repository and packages, and maintain it myself in my own
> repository. I don't really know how many people use it...

Some input from debian and ubuntu:

http://qa.debian.org/popcon-graph.php?packages=libcsoundac-dev+libcsoundac5.2+python-csoundac&show_installed=on&show_vote=on&want_legend=on&want_ticks=on&from_date=&to_date=&hlght_date=&date_fmt=%25Y-%25m&beenhere=1

For ubuntu you have to input the package names yourself
http://www.lesbonscomptes.com/upopcon/display.php


In total, at least some 400 installed copies of python-csoundac.
Although how many of these actually use it, I don't know.

-- 

Saludos,
Felipe Sateler

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-03-05 15:09
FromMichael Gogins
SubjectRe: [Cs-dev] default visibility hidden
Thanks for checking this. I think that's enough potential users to
keep CsoundAC in the packages. By the way, the Lindenmayer scripts are
what I use as tests for the scripting use cases, that is correct. Also
the StrangeAttractor script.

What I plan to do is this. I will make an attempt to build a shared
library with default visibility that exports user level classes and
that works in all use cases. I may solicit your help if I have
problems. If that fails, what do you think about exporting all symbols
from CsoundAC in the shared library? If that is acceptable and that
works, fine. Otherwise, if it's not possible to make a shared library
that works for all use cases, we will support only the shared library
and scripting use cases in the packages. I will create an optional
build configuration to build CsoundAC as a static library, under a
slightly different name so that the linker does not default to the
shared library, for users who wish to use C++ with CsoundAC.

Regards,
Mike

On Mon, Mar 5, 2012 at 9:50 AM, Felipe Sateler  wrote:
> On Sun, Mar 4, 2012 at 20:11, Michael Gogins  wrote:
>> Another option would be for me to withdraw the CsoundAC library from
>> the Csound repository and packages, and maintain it myself in my own
>> repository. I don't really know how many people use it...
>
> Some input from debian and ubuntu:
>
> http://qa.debian.org/popcon-graph.php?packages=libcsoundac-dev+libcsoundac5.2+python-csoundac&show_installed=on&show_vote=on&want_legend=on&want_ticks=on&from_date=&to_date=&hlght_date=&date_fmt=%25Y-%25m&beenhere=1
>
> For ubuntu you have to input the package names yourself
> http://www.lesbonscomptes.com/upopcon/display.php
>
>
> In total, at least some 400 installed copies of python-csoundac.
> Although how many of these actually use it, I don't know.
>
> --
>
> Saludos,
> Felipe Sateler
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-03-05 15:54
FromFelipe Sateler
SubjectRe: [Cs-dev] default visibility hidden
The idea behind default visibility hidden is to prevent accidental ABI
breakage, and to be able to monitor it better. C++ generates a massive
amount of symbols that should not be part of the ABI. Thus by
diminishing the amount of symbols, it makes the reporting of automated
tools easier to understand. That is why I would prefer to have default
visibility hidden.

I  have already added some SILENCE_PUBLIC markers and this seems to
make the python wrapper work. If you have a C++ test case I can test
that too and try to fix whatever is wrong.

On Mon, Mar 5, 2012 at 12:09, Michael Gogins  wrote:
> Thanks for checking this. I think that's enough potential users to
> keep CsoundAC in the packages. By the way, the Lindenmayer scripts are
> what I use as tests for the scripting use cases, that is correct. Also
> the StrangeAttractor script.
>
> What I plan to do is this. I will make an attempt to build a shared
> library with default visibility that exports user level classes and
> that works in all use cases. I may solicit your help if I have
> problems. If that fails, what do you think about exporting all symbols
> from CsoundAC in the shared library? If that is acceptable and that
> works, fine. Otherwise, if it's not possible to make a shared library
> that works for all use cases, we will support only the shared library
> and scripting use cases in the packages. I will create an optional
> build configuration to build CsoundAC as a static library, under a
> slightly different name so that the linker does not default to the
> shared library, for users who wish to use C++ with CsoundAC.
>
> Regards,
> Mike
>
> On Mon, Mar 5, 2012 at 9:50 AM, Felipe Sateler  wrote:
>> On Sun, Mar 4, 2012 at 20:11, Michael Gogins  wrote:
>>> Another option would be for me to withdraw the CsoundAC library from
>>> the Csound repository and packages, and maintain it myself in my own
>>> repository. I don't really know how many people use it...
>>
>> Some input from debian and ubuntu:
>>
>> http://qa.debian.org/popcon-graph.php?packages=libcsoundac-dev+libcsoundac5.2+python-csoundac&show_installed=on&show_vote=on&want_legend=on&want_ticks=on&from_date=&to_date=&hlght_date=&date_fmt=%25Y-%25m&beenhere=1
>>
>> For ubuntu you have to input the package names yourself
>> http://www.lesbonscomptes.com/upopcon/display.php
>>
>>
>> In total, at least some 400 installed copies of python-csoundac.
>> Although how many of these actually use it, I don't know.
>>
>> --
>>
>> Saludos,
>> Felipe Sateler
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
> --
> Michael Gogins
> Irreducible Productions
> http://www.michael-gogins.com
> Michael dot Gogins at gmail dot com
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 

Saludos,
Felipe Sateler

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-03-05 16:07
FromMichael Gogins
SubjectRe: [Cs-dev] default visibility hidden
I will send you a C++ test case this evening, if you have the current
Qt SDK (4.8) and qtcreator installed.

If you don't have Qt, let me know and I will quickly create a non-Qt test case.

Thanks,
Mike


On Mon, Mar 5, 2012 at 10:54 AM, Felipe Sateler  wrote:
> The idea behind default visibility hidden is to prevent accidental ABI
> breakage, and to be able to monitor it better. C++ generates a massive
> amount of symbols that should not be part of the ABI. Thus by
> diminishing the amount of symbols, it makes the reporting of automated
> tools easier to understand. That is why I would prefer to have default
> visibility hidden.
>
> I  have already added some SILENCE_PUBLIC markers and this seems to
> make the python wrapper work. If you have a C++ test case I can test
> that too and try to fix whatever is wrong.
>
> On Mon, Mar 5, 2012 at 12:09, Michael Gogins  wrote:
>> Thanks for checking this. I think that's enough potential users to
>> keep CsoundAC in the packages. By the way, the Lindenmayer scripts are
>> what I use as tests for the scripting use cases, that is correct. Also
>> the StrangeAttractor script.
>>
>> What I plan to do is this. I will make an attempt to build a shared
>> library with default visibility that exports user level classes and
>> that works in all use cases. I may solicit your help if I have
>> problems. If that fails, what do you think about exporting all symbols
>> from CsoundAC in the shared library? If that is acceptable and that
>> works, fine. Otherwise, if it's not possible to make a shared library
>> that works for all use cases, we will support only the shared library
>> and scripting use cases in the packages. I will create an optional
>> build configuration to build CsoundAC as a static library, under a
>> slightly different name so that the linker does not default to the
>> shared library, for users who wish to use C++ with CsoundAC.
>>
>> Regards,
>> Mike
>>
>> On Mon, Mar 5, 2012 at 9:50 AM, Felipe Sateler  wrote:
>>> On Sun, Mar 4, 2012 at 20:11, Michael Gogins  wrote:
>>>> Another option would be for me to withdraw the CsoundAC library from
>>>> the Csound repository and packages, and maintain it myself in my own
>>>> repository. I don't really know how many people use it...
>>>
>>> Some input from debian and ubuntu:
>>>
>>> http://qa.debian.org/popcon-graph.php?packages=libcsoundac-dev+libcsoundac5.2+python-csoundac&show_installed=on&show_vote=on&want_legend=on&want_ticks=on&from_date=&to_date=&hlght_date=&date_fmt=%25Y-%25m&beenhere=1
>>>
>>> For ubuntu you have to input the package names yourself
>>> http://www.lesbonscomptes.com/upopcon/display.php
>>>
>>>
>>> In total, at least some 400 installed copies of python-csoundac.
>>> Although how many of these actually use it, I don't know.
>>>
>>> --
>>>
>>> Saludos,
>>> Felipe Sateler
>>>
>>> ------------------------------------------------------------------------------
>>> Try before you buy = See our experts in action!
>>> The most comprehensive online learning library for Microsoft developers
>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>> http://p.sf.net/sfu/learndevnow-dev2
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>
>> --
>> Michael Gogins
>> Irreducible Productions
>> http://www.michael-gogins.com
>> Michael dot Gogins at gmail dot com
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
> --
>
> Saludos,
> Felipe Sateler
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net