how to compile files, modules, shared libraries, programs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

how to compile files, modules, shared libraries, programs

Marco Maggi
Ciao,

  I was  not able to find  documentation about how to  compile libraries
and programs with Chicken 5, using  a Makefile.  There are bits here and
there but nothing complete enough for a newbie like me.

  Is there a project somewhere that does this?

TIA
--
Marco Maggi

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile files, modules, shared libraries, programs

Peter Bex
On Tue, Mar 26, 2019 at 06:52:44AM +0100, Marco Maggi wrote:
> Ciao,
>
>   I was  not able to find  documentation about how to  compile libraries
> and programs with Chicken 5, using  a Makefile.  There are bits here and
> there but nothing complete enough for a newbie like me.
>
>   Is there a project somewhere that does this?

Hi Marco,

Perhaps git-fs by Evan, one of our core maintainers will be helpful:
http://git.foldling.org/git-fs.git/

Just git clone it (I think there's no code browser on the site).

Cheers,
Peter

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: how to compile files, modules, shared libraries, programs

Marco Maggi
Peter Bex wrote:

> On Tue, Mar 26, 2019 at 06:52:44AM +0100, Marco Maggi wrote:
>> Ciao,

>>   I was  not able to find  documentation about how to  compile libraries
>> and programs with Chicken 5, using  a Makefile.  There are bits here and
>> there but nothing complete enough for a newbie like me.

>>   Is there a project somewhere that does this?

> Hi Marco,

> Perhaps git-fs by Evan, one of our core maintainers will be helpful:
> http://git.foldling.org/git-fs.git/

> Just git clone it (I think there's no code browser on the site).

Thanks for  the suggestion, but  that project  only has a  single source
file; not what I need.  I want to make the following package work:

<https://github.com/marcomaggi/mmux-chicken-template>

Notice that I  am still in the  phase: I know what I  want, I understand
nothing of what I need.

TIA
--
Marco Maggi

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile files, modules, shared libraries, programs

Kristian Lein-Mathisen

Hi Marco,

So what is it that you want? Your Makefile looks ok to me, though I think all of it might have been less complicated to do with just an .egg-file.

K.

On Tue, Mar 26, 2019, 11:23 Marco Maggi <[hidden email] wrote:
Peter Bex wrote:

> On Tue, Mar 26, 2019 at 06:52:44AM +0100, Marco Maggi wrote:
>> Ciao,

>>   I was  not able to find  documentation about how to  compile libraries
>> and programs with Chicken 5, using  a Makefile.  There are bits here and
>> there but nothing complete enough for a newbie like me.

>>   Is there a project somewhere that does this?

> Hi Marco,

> Perhaps git-fs by Evan, one of our core maintainers will be helpful:
> http://git.foldling.org/git-fs.git/

> Just git clone it (I think there's no code browser on the site).

Thanks for  the suggestion, but  that project  only has a  single source
file; not what I need.  I want to make the following package work:

<https://github.com/marcomaggi/mmux-chicken-template>

Notice that I  am still in the  phase: I know what I  want, I understand
nothing of what I need.

TIA
--
Marco Maggi

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile files, modules, shared libraries, programs

Marco Maggi
Kristian Lein-Mathisen wrote:

> Hi Marco,

> So what is  it that you want?  Your Makefile looks ok to  me, though I
> think all of  it might have been  less complicated to do  with just an
> .egg-file.

I  have written  this Makefile  fully guessing  everything, because  the
available documentation is not enough for me.  Besides, it does not work
as it is:

$ make all
csc -I.  -c -o module-for-expand.o module-for-expand.scm
csc -library -shared -L.  -o library-for-expand.so module-for-expand.o
/usr/bin/ld: module-for-expand.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
module-for-expand.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

Error: shell command terminated with non-zero exit status 256: 'gcc' 'module-for-expand.o' -o 'library-for-expand.so' -shared -shared -L. -L/opt/chicken/5.0.0/lib64 -Wl,-R/opt/chicken/5.0.0/lib64 -lchicken -lm -ldl
Makefile:36: recipe for target 'library-for-expand.so' failed
make: *** [library-for-expand.so] Error 1

--
Marco Maggi

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile files, modules, shared libraries, programs

Marco Maggi
In reply to this post by Marco Maggi
Marco Maggi wrote:

> [...] I want to make the following package work:

> <https://github.com/marcomaggi/mmux-chicken-template>

I managed to make it work, I think.  I am not quite "there", yet.

  I still  have some problems with  modules: if a source  file defines a
module, and  it is linked  into a library, can  such source file  have a
name different from the module name itself?  When I tried I succeeded in
one case but failed in another...
--
Marco Maggi

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile files, modules, shared libraries, programs

Kristian Lein-Mathisen

I'm glad you got it working, Marco!

The Makefile is a bit complicated, and since I'm not sure of what you're trying to acheive, it's a bit hard to help out. What's the reason you don't want to use chicken-install to build?

K.

On Wed, Mar 27, 2019, 15:14 Marco Maggi <[hidden email] wrote:
Marco Maggi wrote:

> [...] I want to make the following package work:

> <https://github.com/marcomaggi/mmux-chicken-template>

I managed to make it work, I think.  I am not quite "there", yet.

  I still  have some problems with  modules: if a source  file defines a
module, and  it is linked  into a library, can  such source file  have a
name different from the module name itself?  When I tried I succeeded in
one case but failed in another...
--
Marco Maggi

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile files, modules, shared libraries, programs

Marco Maggi
Kristian Lein-Mathisen wrote:

> [...]   What's the  reason you  don't want  to use  chicken-install to
> build?

I already have a too long list of things to learn.  I am used to the GNU
Autotools and I can recycle this knowledge.  Less things, better life...
--
Marco Maggi

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile files, modules, shared libraries, programs

Kooda
Marco Maggi <[hidden email]> wrote:
> I already have a too long list of things to learn.  I am used to the GNU
> Autotools and I can recycle this knowledge.  Less things, better life...

You might want to check this project out, which uses autotools. :)
https://github.com/drewt/scmus

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile files, modules, shared libraries, programs

Marco Maggi
[hidden email] wrote:

> Marco Maggi <[hidden email]> wrote:
>> I already have a too long list of things to learn.  I am used to the GNU
>> Autotools and I can recycle this knowledge.  Less things, better life...

> You might want to check this project out, which uses autotools. :)
> https://github.com/drewt/scmus

Makefile functions!  I used them,  too, many years ago, before switching
to GNU  Automake and  never looking  back.  They looked  cool to  me, at
first, but then they are a nightmare to maintain; especially if you want
someone else to contribute to your project.

  I have moved my experiments here:

   <https://github.com/marcomaggi/mmux-chicken-compiler-use-examples>

and the template project is coming along:

         <https://github.com/marcomaggi/mmux-chicken-template>

"distcheck",  parallel compilation  and parallel  testing work  fine.  I
have  to develop  more the  inspection in  the GNU  Autoconf macro  that
detects CHICKEN and its installation paths.

--
Marco Maggi

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users