Re: chicken (un)install, deployment
Hi Al, On Sat, 3 Feb 2024 12:22:46 +0200 Al wrote: > I'd like to distribute a project that uses chicken and a number of > eggs. In the Makefile, I'm trying to add a target that ensures the > user has those eggs installed. However, > > * chicken-install seems to proceed unconditionally (even if egg is > already installed). Right. If you ask chicken-install to install an egg, it'll do so. It might skip its dependencies in case they are already installed. chicken-install might skip fetching/compiling eggs in case they can be found in the chicken-install cache (typically ~/.cache/chicken-install). > * I see no chicken-uninstall, or at least chicken-remove-all-eggs, so > that at least I can test things in a clean-room installation, > without rebuilding chicken-uninstall is part of the installation of chicken. It should be available in the same directory where chicken-install is located. > I came up with a way sed hack to extract all imports, transform those > to arguments for "chicken-status -list", and generate a > chicken-status.scm file (which can then be processed by > "chicken-install -from-list"). But still it installs > unconditionally. I could add an extra step to check if "csi import > egg... > > What to do? Maybe I should convert my project to egg format? That probably would be the easiest way. All the best. Mario -- http://parenteses.org/mario
chicken (un)install, deployment
Hi, I'd like to distribute a project that uses chicken and a number of eggs. In the Makefile, I'm trying to add a target that ensures the user has those eggs installed. However, * chicken-install seems to proceed unconditionally (even if egg is already installed). * I see no chicken-uninstall, or at least chicken-remove-all-eggs, so that at least I can test things in a clean-room installation, without rebuilding I came up with a way sed hack to extract all imports, transform those to arguments for "chicken-status -list", and generate a chicken-status.scm file (which can then be processed by "chicken-install -from-list"). But still it installs unconditionally. I could add an extra step to check if "csi import egg... What to do? Maybe I should convert my project to egg format? -- Al
Re: 【Deployment】
mber >>> (string-chop (list-ref ls1 1) 2)) >>> ,(list-ref ls1 2) >>> ,(list-ref ls1 4)) ls0) (read-line)) >>> (loop ls0 (read-line) >>> >>> Sorry, some Japanese are mixed. But. Anyway. >>> I try compiling with your way, and gcc gives me an error like this. >>> >>> /usr/bin/ld: /tmp/ccxVWfZy.o: in function `f_223': >>> poichan-01-1.c:(.text+0x765): undefined reference to `C_extras_toplevel' >>> /usr/bin/ld: /tmp/ccxVWfZy.o: in function `f_226': >>> poichan-01-1.c:(.text+0x92d): undefined reference to >>> `C_data_2dstructures_toplevel' >>> collect2: error: ld returned 1 exit status >>> >>> H Is there something wrong on the code? >>> What are the C_extras_toplevel and C_data_wdstructures_toplevel? >>> >>> If I used some libraries from chicken-install, should I use the compiled >>> "scheme to c" file too? >>> >>> There must be something more to learn around the Chicken Scheme more. >>> >>> Anyway, you have helped me a lot! Thank you. >>> >>> >>> 2020年8月13日(木) 14:56 Kristian Lein-Mathisen : >>> >>>> >>>> Hi, >>>> >>>> I managed to get something working on my termux, maybe that can help >>>> you: >>>> >>>> ~/o/chicken-5.2.0rc1 ➤ >>>> echo '(print "hello")' > hello.scm ~/o/chicken-5.2.0rc1 ➤ >>>> ./csc -t hello.scm >>>> ~/o/chicken-5.2.0rc1 ➤ >>>> gcc -DHAVE_CHICKEN_CONFIG_H hello.c -I . runtime.c library.c eval.c >>>> expand.c modules.c internal.c chicken-syntax.c build-version.c -lm -llog -o >>>> hello >>>> ~/o/chicken-5.2.0rc1 ➤ ldd hello >>>> libm.so >>>> liblog.so >>>> libdl.so >>>> libc.so >>>> ~/o/chicken-5.2.0rc1 ➤ ./hello >>>> hello >>>> >>>> You can ignore -llog unless you're on Android. >>>> >>>> So you don't need buildtag.h. Is there a reason you can't "csc -static >>>> hello.scm" or "csc -static -C -static hello.scm" which is a more common >>>> use-case? >>>> >>>> Cheers, >>>> K. >>>> >>>> On Thu, Aug 13, 2020, 03:27 亀田馬志 wrote: >>>> >>>>> Thanks for your reply. >>>>> >>>>> > It seems there is a chicken-bin for U20.04LTS >>>>> >>>>> Yes, there is BINARY. I mean I could not find a SOURCE CODE package. >>>>> (Usually, you can take source code from the Ubuntu repository if you >>>>> wished to.) >>>>> >>>> >>>> >>>>> > did you try compiling hello.scm to hello.c with that? >>>>> >>>>> Yes, I did. >>>>> To write a single file with Scheme codes, and to compile to a SINGLE c >>>>> file, it is a piece of cake. >>>>> >>>>> > Are you reading the manual for Chicken 5 >>>>> >>>>> Yes, of course. I followed the instructions on it. >>>>> You may see there: >>>>> >>>>> "Compiled to C, we get hello.c. We need the files chicken.h, >>>>> chicken-config.h, buildtag.h and runtime.c, which contain the basic >>>>> runtime system, plus the library files build-version.c, >>>>> chicken-syntax.c, eval.c, expand.c, internal.c, library.c and >>>>> modules.c, which contain the same functionality as the library that >>>>> is linked into plain CHICKEN-compiled applications:" >>>>> >>>>> However, as you may notice, there is no buildtag.h generated even >>>>> though you built Chicken Scheme from its source code. >>>>> Therefore, you can not proceed to the rest process using /tmp >>>>> described next. >>>>> >>>>> > perhaps the manual is outdated? >>>>> >>>>> OMBuddha. If what you are saying were rightwhat should I do!? >>>>> >>>>> Thanks. >>>>> >>>>> >>>>> >>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> >>>>> ウイルス >>>>> フリー。 www.avast.com >>>>> <https://www.avast.co
Re: 【Deployment】
Thanks for your reply. >>>> >>>> > It seems there is a chicken-bin for U20.04LTS >>>> >>>> Yes, there is BINARY. I mean I could not find a SOURCE CODE package. >>>> (Usually, you can take source code from the Ubuntu repository if you >>>> wished to.) >>>> >>> >>> >>>> > did you try compiling hello.scm to hello.c with that? >>>> >>>> Yes, I did. >>>> To write a single file with Scheme codes, and to compile to a SINGLE c >>>> file, it is a piece of cake. >>>> >>>> > Are you reading the manual for Chicken 5 >>>> >>>> Yes, of course. I followed the instructions on it. >>>> You may see there: >>>> >>>> "Compiled to C, we get hello.c. We need the files chicken.h, >>>> chicken-config.h, buildtag.h and runtime.c, which contain the basic >>>> runtime system, plus the library files build-version.c, >>>> chicken-syntax.c, eval.c, expand.c, internal.c, library.c and modules.c, >>>> which contain the same functionality as the library that is linked into >>>> plain CHICKEN-compiled applications:" >>>> >>>> However, as you may notice, there is no buildtag.h generated even >>>> though you built Chicken Scheme from its source code. >>>> Therefore, you can not proceed to the rest process using /tmp described >>>> next. >>>> >>>> > perhaps the manual is outdated? >>>> >>>> OMBuddha. If what you are saying were rightwhat should I do!? >>>> >>>> Thanks. >>>> >>>> >>>> >>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> >>>> ウイルス >>>> フリー。 www.avast.com >>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> >>>> <#m_-6073722823685365973_m_-3771291668364076337_m_2995656887587357561_m_-6378871799878235639_m_-3841790857946966358_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >>>> >>>> 2020年8月13日(木) 6:39 Kristian Lein-Mathisen : >>>> >>>>> >>>>> Hi, >>>>> >>>>> It seems there is a chicken-bin for U20.04LTS [1], did you try >>>>> compiling hello.scm to hello.c with that? What is it that you're trying to >>>>> acheive? >>>>> >>>>> I don't seem to have any buildtag.h either, perhaps the manual is >>>>> outdated? >>>>> >>>>> Are you reading the manual for Chicken 5 [2]? >>>>> >>>>> K. >>>>> [1]: https://packages.ubuntu.com/focal/interpreters/chicken-bin >>>>> [2]: >>>>> http://wiki.call-cc.org/man/5/Deployment#distributing-compiled-c-files >>>>> >>>>> >>>>> On Mon, Aug 10, 2020, 21:28 亀田馬志 wrote: >>>>> >>>>>> Hello. >>>>>> >>>>>> I tried following and obeying the instructions described in >>>>>> Deployment, the manual of Chicken Scheme, in order to cock-a-do-do >>>>>> "Distributing compiled C files", but it did not work well. >>>>>> >>>>>> 1. Ubuntu Repository provides no source code of Chicken Scheme >>>>>> >>>>>> I'm using Ubuntu 20.04 LTS, currently an OS under the feather, and I >>>>>> could not find the source code of Chicken Scheme in its repository. >>>>>> Neither >>>>>> in Debian? I do not know. >>>>>> Hen_ce, I had to build Chicken Scheme from its source code. >>>>>> >>>>>> 2. Where the chick can I find buildtag.h? >>>>>> >>>>>> I switched to using Windows 10, and made an environment of Ubuntu >>>>>> with WSL(Windows Subsystem for Linux). There I built a Chicken Scheme >>>>>> from >>>>>> its source, and followed the instructions. BUT. I could not find >>>>>> buildtag.h >>>>>> there even though the manual says "generated by the build process". Did >>>>>> I miss something? Is there any special way to get buildtag.h? >>>>>> >>>>>> 3. Anyway tried compiling "Hello World", but getting a bunch of error >>>>>> messages. >>>>>> >>>>>> I did not know whether compiling with gcc worked well or not without >>>>>> buildtag.h, but I tried. The result was a bunch of errors, something like >>>>>> this: >>>>>> >>>>>> "/usr/bin/ld: /tmp/ccJKB9L5.o: in function `C_modules_toplevel': >>>>>> modules.c:(.text+0xad58): undefined reference to >>>>>> `C_chicken_2dsyntax_toplevel' >>>>>> collect2: error: ld returned 1 exit status" >>>>>> >>>>>> Something related to toplevel stuff did not work well. As >>>>>> egg-spected? Maybe, yes. >>>>>> >>>>>> Well, is there any technique of "Distributing compiled C files" >>>>>> outside of the manual, or is there anything I did wrong(especially in the >>>>>> building process)? >>>>>> >>>>>> Thanks, >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> >>>>>> ウイルス >>>>>> フリー。 www.avast.com >>>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> >>>>>> <#m_-6073722823685365973_m_-3771291668364076337_m_2995656887587357561_m_-6378871799878235639_m_-3841790857946966358_m_692582290224770852_m_6593347720704535955_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >>>>>> >>>>>
Re: 【Deployment】
~/o/chicken-5.2.0rc1 ➤ ldd hello > libm.so > liblog.so > libdl.so > libc.so > ~/o/chicken-5.2.0rc1 ➤ ./hello > hello > > You can ignore -llog unless you're on Android. > > So you don't need buildtag.h. Is there a reason you can't "csc -static > hello.scm" or "csc -static -C -static hello.scm" which is a more common > use-case? > > Cheers, > K. > > On Thu, Aug 13, 2020, 03:27 亀田馬志 <mailto:masashi.kam...@gmail.com>> wrote: > Thanks for your reply. > > > It seems there is a chicken-bin for U20.04LTS > > Yes, there is BINARY. I mean I could not find a SOURCE CODE package. > (Usually, you can take source code from the Ubuntu repository if you wished > to.) > > > > did you try compiling hello.scm to hello.c with that? > > Yes, I did. > To write a single file with Scheme codes, and to compile to a SINGLE c file, > it is a piece of cake. > > > Are you reading the manual for Chicken 5 > > Yes, of course. I followed the instructions on it. > You may see there: > > "Compiled to C, we get hello.c. We need the files chicken.h, > chicken-config.h, buildtag.h and runtime.c, which contain the basic runtime > system, plus the library files build-version.c, chicken-syntax.c, eval.c, > expand.c, internal.c, library.c and modules.c, which contain the same > functionality as the library that is linked into plain CHICKEN-compiled > applications:" > > However, as you may notice, there is no buildtag.h generated even though you > built Chicken Scheme from its source code. > Therefore, you can not proceed to the rest process using /tmp described next. > > > perhaps the manual is outdated? > > OMBuddha. If what you are saying were rightwhat should I do!? > > Thanks. > > > > <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> > ウイルス フリー。 www.avast.com > <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> > > > 2020年8月13日(木) 6:39 Kristian Lein-Mathisen <mailto:kristianl...@gmail.com>>: > > Hi, > > It seems there is a chicken-bin for U20.04LTS [1], did you try compiling > hello.scm to hello.c with that? What is it that you're trying to acheive? > > I don't seem to have any buildtag.h either, perhaps the manual is outdated? > > Are you reading the manual for Chicken 5 [2]? > > K. > [1]: https://packages.ubuntu.com/focal/interpreters/chicken-bin > <https://packages.ubuntu.com/focal/interpreters/chicken-bin> > [2]: http://wiki.call-cc.org/man/5/Deployment#distributing-compiled-c-files > <http://wiki.call-cc.org/man/5/Deployment#distributing-compiled-c-files> > > On Mon, Aug 10, 2020, 21:28 亀田馬志 <mailto:masashi.kam...@gmail.com>> wrote: > Hello. > > I tried following and obeying the instructions described in Deployment, the > manual of Chicken Scheme, in order to cock-a-do-do "Distributing compiled C > files", but it did not work well. > > 1. Ubuntu Repository provides no source code of Chicken Scheme > > I'm using Ubuntu 20.04 LTS, currently an OS under the feather, and I could > not find the source code of Chicken Scheme in its repository. Neither in > Debian? I do not know. > Hen_ce, I had to build Chicken Scheme from its source code. > > 2. Where the chick can I find buildtag.h? > > I switched to using Windows 10, and made an environment of Ubuntu with > WSL(Windows Subsystem for Linux). There I built a Chicken Scheme from its > source, and followed the instructions. BUT. I could not find buildtag.h there > even though the manual says "generated by the build process". Did I miss > something? Is there any special way to get buildtag.h? > > 3. Anyway tried compiling "Hello World", but getting a bunch of error > messages. > > I did not know whether compiling with gcc worked well or not without > buildtag.h, but I tried. The result was a bunch of errors, something like > this: > > "/usr/bin/ld: /tmp/ccJKB9L5.o: in function `C_modules_toplevel': > modules.c:(.text+0xad58): undefined reference to `C_chicken_2dsyntax_toplevel' > collect2: error: ld returned 1 exit status" > > Something related to toplevel stuff did not work well. As egg-spected? Maybe, > yes. > > Well, is there any technique of "Distributing compiled C files" outside of > the manual, or is there anything I did wrong(especially in the building > process)? > > Thanks, > > > > > > <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> > ウイルス フリー。 www.avast.com > <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> > >
Re: 【Deployment】
t; >> Cheers, >> K. >> >> On Thu, Aug 13, 2020, 03:27 亀田馬志 wrote: >> >>> Thanks for your reply. >>> >>> > It seems there is a chicken-bin for U20.04LTS >>> >>> Yes, there is BINARY. I mean I could not find a SOURCE CODE package. >>> (Usually, you can take source code from the Ubuntu repository if you >>> wished to.) >>> >> >> >>> > did you try compiling hello.scm to hello.c with that? >>> >>> Yes, I did. >>> To write a single file with Scheme codes, and to compile to a SINGLE c >>> file, it is a piece of cake. >>> >>> > Are you reading the manual for Chicken 5 >>> >>> Yes, of course. I followed the instructions on it. >>> You may see there: >>> >>> "Compiled to C, we get hello.c. We need the files chicken.h, >>> chicken-config.h, buildtag.h and runtime.c, which contain the basic >>> runtime system, plus the library files build-version.c, chicken-syntax.c >>> , eval.c, expand.c, internal.c, library.c and modules.c, which contain >>> the same functionality as the library that is linked into plain >>> CHICKEN-compiled applications:" >>> >>> However, as you may notice, there is no buildtag.h generated even though >>> you built Chicken Scheme from its source code. >>> Therefore, you can not proceed to the rest process using /tmp described >>> next. >>> >>> > perhaps the manual is outdated? >>> >>> OMBuddha. If what you are saying were rightwhat should I do!? >>> >>> Thanks. >>> >>> >>> >>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> >>> ウイルス >>> フリー。 www.avast.com >>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> >>> <#m_-3771291668364076337_m_2995656887587357561_m_-6378871799878235639_m_-3841790857946966358_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >>> >>> 2020年8月13日(木) 6:39 Kristian Lein-Mathisen : >>> >>>> >>>> Hi, >>>> >>>> It seems there is a chicken-bin for U20.04LTS [1], did you try >>>> compiling hello.scm to hello.c with that? What is it that you're trying to >>>> acheive? >>>> >>>> I don't seem to have any buildtag.h either, perhaps the manual is >>>> outdated? >>>> >>>> Are you reading the manual for Chicken 5 [2]? >>>> >>>> K. >>>> [1]: https://packages.ubuntu.com/focal/interpreters/chicken-bin >>>> [2]: >>>> http://wiki.call-cc.org/man/5/Deployment#distributing-compiled-c-files >>>> >>>> >>>> On Mon, Aug 10, 2020, 21:28 亀田馬志 wrote: >>>> >>>>> Hello. >>>>> >>>>> I tried following and obeying the instructions described in >>>>> Deployment, the manual of Chicken Scheme, in order to cock-a-do-do >>>>> "Distributing compiled C files", but it did not work well. >>>>> >>>>> 1. Ubuntu Repository provides no source code of Chicken Scheme >>>>> >>>>> I'm using Ubuntu 20.04 LTS, currently an OS under the feather, and I >>>>> could not find the source code of Chicken Scheme in its repository. >>>>> Neither >>>>> in Debian? I do not know. >>>>> Hen_ce, I had to build Chicken Scheme from its source code. >>>>> >>>>> 2. Where the chick can I find buildtag.h? >>>>> >>>>> I switched to using Windows 10, and made an environment of Ubuntu with >>>>> WSL(Windows Subsystem for Linux). There I built a Chicken Scheme from its >>>>> source, and followed the instructions. BUT. I could not find buildtag.h >>>>> there even though the manual says "generated by the build process". Did >>>>> I miss something? Is there any special way to get buildtag.h? >>>>> >>>>> 3. Anyway tried compiling "Hello World", but getting a bunch of error >>>>> messages. >>>>> >>>>> I did not know whether compiling with gcc worked well or not without >>>>> buildtag.h, but I tried. The result was a bunch of errors, something like >>>>> this: >>>>> >>>>> "/usr/bin/ld: /tmp/ccJKB9L5.o: in function `C_modules_toplevel': >>>>> modules.c:(.text+0xad58): undefined reference to >>>>> `C_chicken_2dsyntax_toplevel' >>>>> collect2: error: ld returned 1 exit status" >>>>> >>>>> Something related to toplevel stuff did not work well. As egg-spected? >>>>> Maybe, yes. >>>>> >>>>> Well, is there any technique of "Distributing compiled C files" >>>>> outside of the manual, or is there anything I did wrong(especially in the >>>>> building process)? >>>>> >>>>> Thanks, >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> >>>>> ウイルス >>>>> フリー。 www.avast.com >>>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> >>>>> <#m_-3771291668364076337_m_2995656887587357561_m_-6378871799878235639_m_-3841790857946966358_m_692582290224770852_m_6593347720704535955_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >>>>> >>>>
Re: 【Deployment】
41790857946966358_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >> >> 2020年8月13日(木) 6:39 Kristian Lein-Mathisen : >> >>> >>> Hi, >>> >>> It seems there is a chicken-bin for U20.04LTS [1], did you try compiling >>> hello.scm to hello.c with that? What is it that you're trying to acheive? >>> >>> I don't seem to have any buildtag.h either, perhaps the manual is >>> outdated? >>> >>> Are you reading the manual for Chicken 5 [2]? >>> >>> K. >>> [1]: https://packages.ubuntu.com/focal/interpreters/chicken-bin >>> [2]: >>> http://wiki.call-cc.org/man/5/Deployment#distributing-compiled-c-files >>> >>> >>> On Mon, Aug 10, 2020, 21:28 亀田馬志 wrote: >>> >>>> Hello. >>>> >>>> I tried following and obeying the instructions described in Deployment, >>>> the manual of Chicken Scheme, in order to cock-a-do-do "Distributing >>>> compiled C files", but it did not work well. >>>> >>>> 1. Ubuntu Repository provides no source code of Chicken Scheme >>>> >>>> I'm using Ubuntu 20.04 LTS, currently an OS under the feather, and I >>>> could not find the source code of Chicken Scheme in its repository. Neither >>>> in Debian? I do not know. >>>> Hen_ce, I had to build Chicken Scheme from its source code. >>>> >>>> 2. Where the chick can I find buildtag.h? >>>> >>>> I switched to using Windows 10, and made an environment of Ubuntu with >>>> WSL(Windows Subsystem for Linux). There I built a Chicken Scheme from its >>>> source, and followed the instructions. BUT. I could not find buildtag.h >>>> there even though the manual says "generated by the build process". Did >>>> I miss something? Is there any special way to get buildtag.h? >>>> >>>> 3. Anyway tried compiling "Hello World", but getting a bunch of error >>>> messages. >>>> >>>> I did not know whether compiling with gcc worked well or not without >>>> buildtag.h, but I tried. The result was a bunch of errors, something like >>>> this: >>>> >>>> "/usr/bin/ld: /tmp/ccJKB9L5.o: in function `C_modules_toplevel': >>>> modules.c:(.text+0xad58): undefined reference to >>>> `C_chicken_2dsyntax_toplevel' >>>> collect2: error: ld returned 1 exit status" >>>> >>>> Something related to toplevel stuff did not work well. As egg-spected? >>>> Maybe, yes. >>>> >>>> Well, is there any technique of "Distributing compiled C files" outside >>>> of the manual, or is there anything I did wrong(especially in the building >>>> process)? >>>> >>>> Thanks, >>>> >>>> >>>> >>>> >>>> >>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> >>>> ウイルス >>>> フリー。 www.avast.com >>>> <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> >>>> <#m_-6378871799878235639_m_-3841790857946966358_m_692582290224770852_m_6593347720704535955_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >>>> >>>
Re: 【Deployment】
Hi, It seems there is a chicken-bin for U20.04LTS [1], did you try compiling hello.scm to hello.c with that? What is it that you're trying to acheive? I don't seem to have any buildtag.h either, perhaps the manual is outdated? Are you reading the manual for Chicken 5 [2]? K. [1]: https://packages.ubuntu.com/focal/interpreters/chicken-bin [2]: http://wiki.call-cc.org/man/5/Deployment#distributing-compiled-c-files On Mon, Aug 10, 2020, 21:28 亀田馬志 wrote: > Hello. > > I tried following and obeying the instructions described in Deployment, > the manual of Chicken Scheme, in order to cock-a-do-do "Distributing > compiled C files", but it did not work well. > > 1. Ubuntu Repository provides no source code of Chicken Scheme > > I'm using Ubuntu 20.04 LTS, currently an OS under the feather, and I could > not find the source code of Chicken Scheme in its repository. Neither in > Debian? I do not know. > Hen_ce, I had to build Chicken Scheme from its source code. > > 2. Where the chick can I find buildtag.h? > > I switched to using Windows 10, and made an environment of Ubuntu with > WSL(Windows Subsystem for Linux). There I built a Chicken Scheme from its > source, and followed the instructions. BUT. I could not find buildtag.h > there even though the manual says "generated by the build process". Did > I miss something? Is there any special way to get buildtag.h? > > 3. Anyway tried compiling "Hello World", but getting a bunch of error > messages. > > I did not know whether compiling with gcc worked well or not without > buildtag.h, but I tried. The result was a bunch of errors, something like > this: > > "/usr/bin/ld: /tmp/ccJKB9L5.o: in function `C_modules_toplevel': > modules.c:(.text+0xad58): undefined reference to > `C_chicken_2dsyntax_toplevel' > collect2: error: ld returned 1 exit status" > > Something related to toplevel stuff did not work well. As egg-spected? > Maybe, yes. > > Well, is there any technique of "Distributing compiled C files" outside of > the manual, or is there anything I did wrong(especially in the building > process)? > > Thanks, > > > > > > <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> > ウイルス > フリー。 www.avast.com > <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> > <#m_6593347720704535955_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >
【Deployment】
Hello. I tried following and obeying the instructions described in Deployment, the manual of Chicken Scheme, in order to cock-a-do-do "Distributing compiled C files", but it did not work well. 1. Ubuntu Repository provides no source code of Chicken Scheme I'm using Ubuntu 20.04 LTS, currently an OS under the feather, and I could not find the source code of Chicken Scheme in its repository. Neither in Debian? I do not know. Hen_ce, I had to build Chicken Scheme from its source code. 2. Where the chick can I find buildtag.h? I switched to using Windows 10, and made an environment of Ubuntu with WSL(Windows Subsystem for Linux). There I built a Chicken Scheme from its source, and followed the instructions. BUT. I could not find buildtag.h there even though the manual says "generated by the build process". Did I miss something? Is there any special way to get buildtag.h? 3. Anyway tried compiling "Hello World", but getting a bunch of error messages. I did not know whether compiling with gcc worked well or not without buildtag.h, but I tried. The result was a bunch of errors, something like this: "/usr/bin/ld: /tmp/ccJKB9L5.o: in function `C_modules_toplevel': modules.c:(.text+0xad58): undefined reference to `C_chicken_2dsyntax_toplevel' collect2: error: ld returned 1 exit status" Something related to toplevel stuff did not work well. As egg-spected? Maybe, yes. Well, is there any technique of "Distributing compiled C files" outside of the manual, or is there anything I did wrong(especially in the building process)? Thanks, <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> ウイルス フリー。 www.avast.com <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Re: [Chicken-users] Windows deployment - Numbers egg
Matt, I tried -deploy, -deploy -static, -static combinations. "csc -deploy -static Pi-Ch.scm" creates a deploy directory, and the resulting executable is 1.6MB vs 77KB, but it still throws the "cannot the load the extension: numbers". I then tried putting libchicken.dll in the deploy directory that was created, and making numbers.so a numbers.dll file, since Windows does not use .so files, only .dll. I used chicken-install -r to retrieve the numbers egg into the current directory. I then tried "csc -dll numbers.scm" and it created numbers.so. I tried putting it in the deploy directory, but no luck. I changed the .so to .dll, and again no luck. I know why some people fall back on Java or Clojure: One example is Nightcode or Nightmod. They both have a single jar file, Nightmod or Nightcode, that is a full IDE, and can deploy to all platforms with a single click, no fuss (except you're on the JVM!). I really don't like Clojure or Java, but I can only get CHICKEN working within MinGW on Windows, and then I am still not able to deploy a working exe file to anybody else who does not have a full install of CHICKEN and MinGW. Please help me stay in the CHICKEN :) Please! Rob On 4 October 2015 at 13:31, Matt Wellandwrote: > An alternative to statically compiling is to use the deploy feature of csc > to make a directory with all the items you need. When you start working > with IUP I think it will be your only choice. Here is a snippet of a > Makefile that I used to deploy a project to a directory on windows. You can > then use Inno Setup to make an installer > http://www.jrsoftware.org/isinfo.php with the directory contents or just > zip it up and share. > > =Makefile example=== > > PROXY = > > CHICKEN_INSTALL=chicken-install $(PROXY) -deploy -p farmsim > > farmsim/farmsim : farmsim.scm boxes.scm common.scm ezxcolors.scm > simevents.scm farmsim/coops.so farmsim/format.so farmsim/ezxdisp.so > farmsim/ezxgui.so farmsim/qtree.so farmsim/vcd.so farmsim/geolib.so > farmsim/pdf.so farmsim/regex.so > csc -deploy farmsim.scm > > farmsim/coops.so : > $(CHICKEN_INSTALL) coops > > farmsim/ezxdisp.so : > $(CHICKEN_INSTALL) ezxdisp > > farmsim/regex.so : > $(CHICKEN_INSTALL) regex > > farmsim/pdf.so : > $(CHICKEN_INSTALL) pdf > > farmsim/format.so : > $(CHICKEN_INSTALL) format > > farmsim/regex.so : > $(CHICKEN_INSTALL) regex > > farmsim/qtree.so : # $(MATTSUTILS)/qtree/qtree.scm > $(CHICKEN_INSTALL) qtree -l $(MATTSUTILS) -transport local > > farmsim/vcd.so : # $(MATTSUTILS)/vcd/vcd.scm > $(CHICKEN_INSTALL) vcd -l $(MATTSUTILS) -transport local > > farmsim/ezxgui.so : # $(MATTSUTILS)/ezxgui/ezxgui.scm > $(CHICKEN_INSTALL) ezxgui -l $(MATTSUTILS) -transport local > > farmsim/geolib.so : # $(MATTSUTILS)/geolib/geolib.scm > $(CHICKEN_INSTALL) geolib -l $(MATTSUTILS) -transport local > > > On Sat, Oct 3, 2015 at 6:50 PM, Robert Herman wrote: > >> I have been learning Chicken by incrementally building a program that >> returns a number of digits of Pi based on an already-existing algorithm >> that implements the Chudnovsky method. I have a command line version >> working, thanks to all of the help here, that writes the file as well as >> displays the output in the command line. >> If I just: csc Pi-Ch.scm I get a 77kB exe that runs fine on my machine. >> In order to share it with my son, I need to statically compile it with all >> of its dependencies, like so: >> >> csc -deploy -static Pi-Ch.scm >> >> I returns an error: >> >> Error: (require) cannot load extension: numbers >> Call history: >> Pi-Ch.scm:16: ##sys#require <-- >> >> I found the numbers.so file, but Windows needs a dll file. I plan on >> downloading the numbers egg source, and seeing if there's any reason I >> could not compile the numbers.so file to numbers.dll. Any leads or tips? >> >> Next step will be to create an IUP GUI for the program to complete the >> exercise. >> >> Thanks! >> >> Rob >> >> PS: Here's the code to date: >> >> ;;; Program to use the chudnovsky formula to compute pi. >> ;;; Written by Bakul Shah. >> ;;; Changed by Bradley Lucier to use standard arithmetic operations >> ;;; available in Gambit Scheme and to replace (floor (/ ...)) by >> ;;; (quotient ...) >> >> ;; Don't try running this benchmark with Gauche, it'll consume all >> ;; your computer's memory! >> >> I removed the conditional statements to make it run across different >> scheme implementations. >> I added the use numbers and extras at the top, and the last 8 lines >> to prompt user and to display the results and write to a file. >> TODO: Deploy to Windows 32-bit, and create an IUP-based GUI for it. >> RPH - 4/10/2015 >> >> (use numbers extras) >> >> (define integer-sqrt exact-integer-sqrt) >> >> (define ch-A 13591409) >> (define ch-B 545140134) >> (define ch-C 640320) >>
Re: [Chicken-users] Windows deployment - Numbers egg
On Sun, Oct 04, 2015 at 10:51:49PM +0800, Robert Herman wrote: > Whoa! Hold on. When I ran "csc -deploy Pi-Ch.scm" it created a 77kb exe > Pi-Ch.exe in a newly-created directory, Pi-Ch. When I look at the command > line information, I found this error: > > C:\Users\Robert\Desktop\Chicken-IUP-Examples\Pi>csc -deploy Pi-Ch.scm > The system cannot find the file specified. > > Error: shell command terminated with non-zero exit status 1: "copy /Y > "c:\chicken-iup\lib\libchicken.dll" "Pi-Ch"" This looks like you may have renamed the chicken directory. Is that possible? > I manually copied numbers.so into the Pi-Ch directory and libchicken.dll, > and it ran! Thanks to all. I'm not sure if that's going to work in the general case. If you include an egg that itself depends on other eggs, it might not be able to load them because the egg doesn't know it's linked into a deployed executable. > Next question is what does 'csc -static' do? It's supposed to generate a statically linked executable. > I don't mind sending libchicken.dll and numbers.so along with the exe, > but why does 'csc -dynamic -static Pi-Ch.scm' do the same, I think those options are supposed to be mutually exclusive, but maybe the latter overrides the former. Compiling a program statically only works if you also have static versions of all the libraries it uses. Most eggs don't install static copies of their libraries (neither does numbers). Besides, (use numbers) says "load the numbers module dynamically". If you want to compile statically, you'd have to do something like (declare (uses numbers)) (import numbers) But I'm not 100% sure. This is going to be made easier in CHICKEN 5, at least that's the plan. > but the exe is now 1.6mb vs 77kb? It does include libchicken.dll (but not numbers because you didn't declare it statically) > I was hoping the two csc switches would combine numbers.os and > libchicken.dll in the exe, in other words, statically link them. You can't load a .dll file statically; it's inherently dynamic. However, if you have libchicken.a, you can link _that_ statically into your program. Like I said, you'll also need to somehow create a "numbers.a" file to link into your program. > Also, I guess there is some issue with the copy command in > MinGW64-32 bit or paths, but the format looks correct even in the > Error line? Does the file it mentions exist? Cheers, Peter signature.asc Description: Digital signature ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Windows deployment - Numbers egg
Yes, I read the manual. All of the examples seem to be a linux host with .so files. Windows uses .dll files. When I try to deploy a static build of the exe, it makes an exe, and the size makes you think it has bundled any dependencies like numbers (from 77kb to 1.6mb), but on MinGW64-32 bit, it hasn't. If you try and run the exe on a different Windows box, or through a non-MinGW command line on the same Windows box, it complains it cannot find the numbers extension. My guess is that it has statically linked and bundled libchicken.dll in the exe, but not the numbers extension that is in a '(use numbers)' statement in the source file. If I simply compile the file in the MinGW command line, the exe works perfectly. It knows where to find the numbers library it needs, my guess from the CHICKEN install directory. The program works. What I am trying to do is make a static exe with the dependencies all in the exe. This way I can give it to somebody who is not a programmer and does not have CHICKEN installed, to run as is. Later I would like to dynamically compile, so the user only needs the libchicken.dll once, but I would like to statically link any program-specific libs (like numbers). This way the user only needs one copy of libchicken.dll in a directory, and any exe I send them will have the oddball dependencies statically linked right in the exe. For instance, the same program on a Gambit-C MinGW64-64 bit system is compiled: "gsc -exe "file.scm"" The resulting exe (4 mb) runs to whomever I send it on their Windows box. It includes all of what it needs, i.e. the gambit runtime dll, and any libs (like numbers). I guess they made Gambit-C more Windows friendly, but it alas it does not have the packages CHICKEN has. On the other hand, if the packages (eggs) only work if you have MinGW64-32 bit installed with a CHICKEN dev environment, it sort of defeats the purpose of being able to create stand alone exe files. I apologize for the lengthy description, and I am grateful for the help! I hope I was clear (need sleep) :) Rob On 4 October 2015 at 21:30, Peter Bex <pe...@more-magic.net> wrote: > On Sun, Oct 04, 2015 at 08:50:59PM +0800, Robert Herman wrote: > > Matt, > > > > "csc -deploy -static Pi-Ch.scm" creates a deploy directory, and the > > resulting executable is 1.6MB vs 77KB, but it still throws the "cannot > the > > load the extension: numbers". > > > > I then tried putting libchicken.dll in the deploy directory that was > > created, and making numbers.so a numbers.dll file, since Windows does not > > use .so files, only .dll. > > I think this is incorrect; looking at my VM mingw install, and all the eggs > (even all the import libraries from CHICKEN core), it uses .so for all the > dynamically loaded extensions. And if I install it normally, and type > (use numbers) at the REPL, it prints that it's loaded /path/to/numbers.so > > Renaming manually is something I would definitely not recommend, because > then you would be messing with the names that CHICKEN expects. > > > I used chicken-install -r to retrieve the numbers > > egg into the current directory. I then tried "csc -dll numbers.scm" and > it > > created numbers.so. I tried putting it in the deploy directory, but no > > luck. I changed the .so to .dll, and again no luck. > > I've tried to do it "by the book" on mingw (msys): > > $ /path/to/chicken-install.exe numbers > $ echo '(use numbers) (print 1/2)' > foo.scm > $ /path/to/csc.exe -deploy -X numbers-syntax foo.scm > $ /path/to/chicken-install.exe -deploy -prefix foo numbers > $ # To prove that it's not loading numbers from install dir: > $ /path/to/chicken-uninstall.exe numbers > $ ./foo/foo.exe > 1/2 > > This works perfectly. The book, incidentally, is here: > http://wiki.call-cc.org/man/4/Deployment > > Hope this helps, > Peter > ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Windows deployment - Numbers egg
On Sun, Oct 04, 2015 at 08:50:59PM +0800, Robert Herman wrote: > Matt, > > "csc -deploy -static Pi-Ch.scm" creates a deploy directory, and the > resulting executable is 1.6MB vs 77KB, but it still throws the "cannot the > load the extension: numbers". > > I then tried putting libchicken.dll in the deploy directory that was > created, and making numbers.so a numbers.dll file, since Windows does not > use .so files, only .dll. I think this is incorrect; looking at my VM mingw install, and all the eggs (even all the import libraries from CHICKEN core), it uses .so for all the dynamically loaded extensions. And if I install it normally, and type (use numbers) at the REPL, it prints that it's loaded /path/to/numbers.so Renaming manually is something I would definitely not recommend, because then you would be messing with the names that CHICKEN expects. > I used chicken-install -r to retrieve the numbers > egg into the current directory. I then tried "csc -dll numbers.scm" and it > created numbers.so. I tried putting it in the deploy directory, but no > luck. I changed the .so to .dll, and again no luck. I've tried to do it "by the book" on mingw (msys): $ /path/to/chicken-install.exe numbers $ echo '(use numbers) (print 1/2)' > foo.scm $ /path/to/csc.exe -deploy -X numbers-syntax foo.scm $ /path/to/chicken-install.exe -deploy -prefix foo numbers $ # To prove that it's not loading numbers from install dir: $ /path/to/chicken-uninstall.exe numbers $ ./foo/foo.exe 1/2 This works perfectly. The book, incidentally, is here: http://wiki.call-cc.org/man/4/Deployment Hope this helps, Peter signature.asc Description: Digital signature ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Windows deployment - Numbers egg
On Sun, Oct 04, 2015 at 10:23:26PM +0800, Robert Herman wrote: > Yes, I read the manual. All of the examples seem to be a linux host with > .so files. Windows uses .dll files. Hi again Robert, This is of course true, but the .so files that CHICKEN generates on mingw are just misnamed .dll-files. Try running "file" on it to inspect the type; it'll let you know that they're DLL files. I suppose because CHICKEN loads those dynamically, the extension is irrelevant. > When I try to deploy a static build of the exe, it makes an exe, and the > size makes you think it has bundled any dependencies like numbers (from > 77kb to 1.6mb), but on MinGW64-32 bit, it hasn't. If you try and run the > exe on a different Windows box, or through a non-MinGW command line on the > same Windows box, it complains it cannot find the numbers extension. My > guess is that it has statically linked and bundled libchicken.dll in the > exe, but not the numbers extension that is in a '(use numbers)' statement > in the source file. I don't know about static linking on Windows, but the deploy mode should take care of this. > On the other hand, if the packages (eggs) only work if you have > MinGW64-32 bit installed with a CHICKEN dev environment, it sort of defeats > the purpose of being able to create stand alone exe files. This is also true of course. However, I tested again on the Windows Vista box I tried earlier. I even renamed the chicken directory so it couldn't possibly be found by the binary I produced. Worked like a charm. > I apologize for the lengthy description, and I am grateful for the help! I > hope I was clear (need sleep) :) If you're really tired, perhaps tomorrow you can take a look at it with a fresh mind. Just follow the steps I did, and you'll see it'll produce a directory which includes the binary and any dependencies, and you can take it and move to another Windows machine, and it will "just work". If it still doesn't work, can you provide is with _exactly_ the steps you did, so we can try to reproduce it? Cheers, Peter signature.asc Description: Digital signature ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Windows deployment - Numbers egg
Whoa! Hold on. When I ran "csc -deploy Pi-Ch.scm" it created a 77kb exe Pi-Ch.exe in a newly-created directory, Pi-Ch. When I look at the command line information, I found this error: C:\Users\Robert\Desktop\Chicken-IUP-Examples\Pi>csc -deploy Pi-Ch.scm The system cannot find the file specified. Error: shell command terminated with non-zero exit status 1: "copy /Y "c:\chicke n-iup\lib\libchicken.dll" "Pi-Ch"" I manually copied numbers.so into the Pi-Ch directory and libchicken.dll, and it ran! Thanks to all. Next question is what does 'csc -static' do? I don't mind sending libchicken.dll and numbers.so along with the exe, but why does 'csc -dynamic -static Pi-Ch.scm' do the same, but the exe is now 1.6mb vs 77kb? I was hoping the two csc switches would combine numbers.os and libchicken.dll in the exe, in other words, statically link them. Also, I guess there is some issue with the copy command in MinGW64-32 bit or paths, but the format looks correct even in the Error line? Rob On 4 October 2015 at 22:23, Robert Herman <rpjher...@gmail.com> wrote: > Yes, I read the manual. All of the examples seem to be a linux host with > .so files. Windows uses .dll files. > When I try to deploy a static build of the exe, it makes an exe, and the > size makes you think it has bundled any dependencies like numbers (from > 77kb to 1.6mb), but on MinGW64-32 bit, it hasn't. If you try and run the > exe on a different Windows box, or through a non-MinGW command line on the > same Windows box, it complains it cannot find the numbers extension. My > guess is that it has statically linked and bundled libchicken.dll in the > exe, but not the numbers extension that is in a '(use numbers)' statement > in the source file. > If I simply compile the file in the MinGW command line, the exe works > perfectly. It knows where to find the numbers library it needs, my guess > from the CHICKEN install directory. The program works. What I am trying to > do is make a static exe with the dependencies all in the exe. This way I > can give it to somebody who is not a programmer and does not have CHICKEN > installed, to run as is. Later I would like to dynamically compile, so the > user only needs the libchicken.dll once, but I would like to statically > link any program-specific libs (like numbers). This way the user only needs > one copy of libchicken.dll in a directory, and any exe I send them will > have the oddball dependencies statically linked right in the exe. > For instance, the same program on a Gambit-C MinGW64-64 bit system is > compiled: "gsc -exe "file.scm"" The resulting exe (4 mb) runs to whomever I > send it on their Windows box. It includes all of what it needs, i.e. the > gambit runtime dll, and any libs (like numbers). I guess they made Gambit-C > more Windows friendly, but it alas it does not have the packages CHICKEN > has. On the other hand, if the packages (eggs) only work if you have > MinGW64-32 bit installed with a CHICKEN dev environment, it sort of defeats > the purpose of being able to create stand alone exe files. > > I apologize for the lengthy description, and I am grateful for the help! I > hope I was clear (need sleep) :) > > Rob > > On 4 October 2015 at 21:30, Peter Bex <pe...@more-magic.net> wrote: > >> On Sun, Oct 04, 2015 at 08:50:59PM +0800, Robert Herman wrote: >> > Matt, >> > >> > "csc -deploy -static Pi-Ch.scm" creates a deploy directory, and the >> > resulting executable is 1.6MB vs 77KB, but it still throws the "cannot >> the >> > load the extension: numbers". >> > >> > I then tried putting libchicken.dll in the deploy directory that was >> > created, and making numbers.so a numbers.dll file, since Windows does >> not >> > use .so files, only .dll. >> >> I think this is incorrect; looking at my VM mingw install, and all the >> eggs >> (even all the import libraries from CHICKEN core), it uses .so for all the >> dynamically loaded extensions. And if I install it normally, and type >> (use numbers) at the REPL, it prints that it's loaded /path/to/numbers.so >> >> Renaming manually is something I would definitely not recommend, because >> then you would be messing with the names that CHICKEN expects. >> >> > I used chicken-install -r to retrieve the numbers >> > egg into the current directory. I then tried "csc -dll numbers.scm" and >> it >> > created numbers.so. I tried putting it in the deploy directory, but no >> > luck. I changed the .so to .dll, and again no luck. >> >> I've tried to do it "by the book" on mingw (msys): >> >> $ /path/to/chicken
Re: [Chicken-users] Windows deployment - Numbers egg
Peter, Thank you, that explains everything I was confused about! The only issue remaining is the error with the compile deploy process trying to copy files from the CHICKEN directory. I didn't rename the CHICKEN directory to CHICKEN-IUP, that's what the pre-built binary for Windows with IUP called it, and the path is correct, but libchicken.dll is in c:\chicken-iup\bin not c:\chicken-iup\lib. Instead, c:\chicken-iup\lib has libchicken.a and libchicken.dll.a within it. I only needed to manually copy numbers.so from the C:\chicken-iup\lib\chicken\7 directory to make it work. Rob On 4 October 2015 at 23:00, Peter Bexwrote: > On Sun, Oct 04, 2015 at 10:51:49PM +0800, Robert Herman wrote: > > Whoa! Hold on. When I ran "csc -deploy Pi-Ch.scm" it created a 77kb exe > > Pi-Ch.exe in a newly-created directory, Pi-Ch. When I look at the command > > line information, I found this error: > > > > C:\Users\Robert\Desktop\Chicken-IUP-Examples\Pi>csc -deploy Pi-Ch.scm > > The system cannot find the file specified. > > > > Error: shell command terminated with non-zero exit status 1: "copy /Y > > "c:\chicken-iup\lib\libchicken.dll" "Pi-Ch"" > > This looks like you may have renamed the chicken directory. Is that > possible? > > > I manually copied numbers.so into the Pi-Ch directory and libchicken.dll, > > and it ran! Thanks to all. > > I'm not sure if that's going to work in the general case. If you > include an egg that itself depends on other eggs, it might not be > able to load them because the egg doesn't know it's linked into a > deployed executable. > > > Next question is what does 'csc -static' do? > > It's supposed to generate a statically linked executable. > > > I don't mind sending libchicken.dll and numbers.so along with the exe, > > but why does 'csc -dynamic -static Pi-Ch.scm' do the same, > > I think those options are supposed to be mutually exclusive, but > maybe the latter overrides the former. > > Compiling a program statically only works if you also have static > versions of all the libraries it uses. Most eggs don't install > static copies of their libraries (neither does numbers). Besides, > (use numbers) says "load the numbers module dynamically". If you > want to compile statically, you'd have to do something like > > (declare (uses numbers)) > (import numbers) > > But I'm not 100% sure. This is going to be made easier in CHICKEN 5, > at least that's the plan. > > > but the exe is now 1.6mb vs 77kb? > > It does include libchicken.dll (but not numbers because you didn't > declare it statically) > > > I was hoping the two csc switches would combine numbers.os and > > libchicken.dll in the exe, in other words, statically link them. > > You can't load a .dll file statically; it's inherently dynamic. > However, if you have libchicken.a, you can link _that_ statically > into your program. Like I said, you'll also need to somehow create > a "numbers.a" file to link into your program. > > > Also, I guess there is some issue with the copy command in > > MinGW64-32 bit or paths, but the format looks correct even in the > > Error line? > > Does the file it mentions exist? > > Cheers, > Peter > ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Windows deployment - Numbers egg
Peter Bex scripsit: > On Sun, Oct 04, 2015 at 10:23:26PM +0800, Robert Herman wrote: > > Yes, I read the manual. All of the examples seem to be a linux host with > > .so files. Windows uses .dll files. > > Hi again Robert, > > This is of course true, but the .so files that CHICKEN generates on mingw > are just misnamed .dll-files. Try running "file" on it to inspect the > type; it'll let you know that they're DLL files. I suppose because > CHICKEN loads those dynamically, the extension is irrelevant. Right. When Chicken loads something dynamically on Windows, it uses the equivalent of Linux dlopen(): it understands LDLIBRARYPATH and its defaults, and it doesn't really care what the extension is. But when an executable file has libraries linked into it, there is no LDLIBRARYPATH (it uses PATH instead), and it insists on the extension "DLL". That's because the brain-dead Windows loader has to be used, as your application does not yet have control. -- John Cowan http://www.ccil.org/~cowanco...@ccil.org In politics, obedience and support are the same thing. --Hannah Arendt ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] Windows deployment - Numbers egg
I have been learning Chicken by incrementally building a program that returns a number of digits of Pi based on an already-existing algorithm that implements the Chudnovsky method. I have a command line version working, thanks to all of the help here, that writes the file as well as displays the output in the command line. If I just: csc Pi-Ch.scm I get a 77kB exe that runs fine on my machine. In order to share it with my son, I need to statically compile it with all of its dependencies, like so: csc -deploy -static Pi-Ch.scm I returns an error: Error: (require) cannot load extension: numbers Call history: Pi-Ch.scm:16: ##sys#require <-- I found the numbers.so file, but Windows needs a dll file. I plan on downloading the numbers egg source, and seeing if there's any reason I could not compile the numbers.so file to numbers.dll. Any leads or tips? Next step will be to create an IUP GUI for the program to complete the exercise. Thanks! Rob PS: Here's the code to date: ;;; Program to use the chudnovsky formula to compute pi. ;;; Written by Bakul Shah. ;;; Changed by Bradley Lucier to use standard arithmetic operations ;;; available in Gambit Scheme and to replace (floor (/ ...)) by ;;; (quotient ...) ;; Don't try running this benchmark with Gauche, it'll consume all ;; your computer's memory! I removed the conditional statements to make it run across different scheme implementations. I added the use numbers and extras at the top, and the last 8 lines to prompt user and to display the results and write to a file. TODO: Deploy to Windows 32-bit, and create an IUP-based GUI for it. RPH - 4/10/2015 (use numbers extras) (define integer-sqrt exact-integer-sqrt) (define ch-A 13591409) (define ch-B 545140134) (define ch-C 640320) (define ch-C^3 (expt 640320 3)) (define ch-D 12) (define (ch-split a b) (if (= 1 (- b a)) (let ((g (* (- (* 6 b) 5) (- (* 2 b) 1) (- (* 6 b) 1 (list g (quotient (* ch-C^3 (expt b 3)) 24) (* (expt -1 b) g (+ (* b ch-B) ch-A (let* ((mid (quotient (+ a b) 2)) (gpq1 (ch-split a mid)); (gpq2 (ch-split mid b)); (g1 (car gpq1)) (p1 (cadr gpq1)) (q1 (caddr gpq1)) (g2 (car gpq2)) (p2 (cadr gpq2)) (q2 (caddr gpq2))) (list (* g1 g2) (* p1 p2) (+ (* q1 p2) (* q2 g1)) (define (pich digits) (let* ((num-terms (inexact->exact (floor (+ 2 (/ digits 14.181647462) (sqrt-C (integer-sqrt (* ch-C (expt 100 digits) (let* ((gpq (ch-split 0 num-terms)) (gs (car gpq)) (p (cadr gpq)) (q (caddr gpq))) (quotient (* p ch-C sqrt-C) (* ch-D (+ q (* p ch-A))) (print "How many digits of Pi to compute?") (define digits (read)) (print "Here you go:") (print (pich digits)) (define file-name "pidigits.txt") (with-output-to-file file-name (lambda () (format #t "~A~%" (pich digits ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Windows deployment - Numbers egg
An alternative to statically compiling is to use the deploy feature of csc to make a directory with all the items you need. When you start working with IUP I think it will be your only choice. Here is a snippet of a Makefile that I used to deploy a project to a directory on windows. You can then use Inno Setup to make an installer http://www.jrsoftware.org/isinfo.php with the directory contents or just zip it up and share. =Makefile example=== PROXY = CHICKEN_INSTALL=chicken-install $(PROXY) -deploy -p farmsim farmsim/farmsim : farmsim.scm boxes.scm common.scm ezxcolors.scm simevents.scm farmsim/coops.so farmsim/format.so farmsim/ezxdisp.so farmsim/ezxgui.so farmsim/qtree.so farmsim/vcd.so farmsim/geolib.so farmsim/pdf.so farmsim/regex.so csc -deploy farmsim.scm farmsim/coops.so : $(CHICKEN_INSTALL) coops farmsim/ezxdisp.so : $(CHICKEN_INSTALL) ezxdisp farmsim/regex.so : $(CHICKEN_INSTALL) regex farmsim/pdf.so : $(CHICKEN_INSTALL) pdf farmsim/format.so : $(CHICKEN_INSTALL) format farmsim/regex.so : $(CHICKEN_INSTALL) regex farmsim/qtree.so : # $(MATTSUTILS)/qtree/qtree.scm $(CHICKEN_INSTALL) qtree -l $(MATTSUTILS) -transport local farmsim/vcd.so : # $(MATTSUTILS)/vcd/vcd.scm $(CHICKEN_INSTALL) vcd -l $(MATTSUTILS) -transport local farmsim/ezxgui.so : # $(MATTSUTILS)/ezxgui/ezxgui.scm $(CHICKEN_INSTALL) ezxgui -l $(MATTSUTILS) -transport local farmsim/geolib.so : # $(MATTSUTILS)/geolib/geolib.scm $(CHICKEN_INSTALL) geolib -l $(MATTSUTILS) -transport local On Sat, Oct 3, 2015 at 6:50 PM, Robert Hermanwrote: > I have been learning Chicken by incrementally building a program that > returns a number of digits of Pi based on an already-existing algorithm > that implements the Chudnovsky method. I have a command line version > working, thanks to all of the help here, that writes the file as well as > displays the output in the command line. > If I just: csc Pi-Ch.scm I get a 77kB exe that runs fine on my machine. In > order to share it with my son, I need to statically compile it with all of > its dependencies, like so: > > csc -deploy -static Pi-Ch.scm > > I returns an error: > > Error: (require) cannot load extension: numbers > Call history: > Pi-Ch.scm:16: ##sys#require <-- > > I found the numbers.so file, but Windows needs a dll file. I plan on > downloading the numbers egg source, and seeing if there's any reason I > could not compile the numbers.so file to numbers.dll. Any leads or tips? > > Next step will be to create an IUP GUI for the program to complete the > exercise. > > Thanks! > > Rob > > PS: Here's the code to date: > > ;;; Program to use the chudnovsky formula to compute pi. > ;;; Written by Bakul Shah. > ;;; Changed by Bradley Lucier to use standard arithmetic operations > ;;; available in Gambit Scheme and to replace (floor (/ ...)) by > ;;; (quotient ...) > > ;; Don't try running this benchmark with Gauche, it'll consume all > ;; your computer's memory! > > I removed the conditional statements to make it run across different > scheme implementations. > I added the use numbers and extras at the top, and the last 8 lines > to prompt user and to display the results and write to a file. > TODO: Deploy to Windows 32-bit, and create an IUP-based GUI for it. > RPH - 4/10/2015 > > (use numbers extras) > > (define integer-sqrt exact-integer-sqrt) > > (define ch-A 13591409) > (define ch-B 545140134) > (define ch-C 640320) > (define ch-C^3 (expt 640320 3)) > (define ch-D 12) > > (define (ch-split a b) > (if (= 1 (- b a)) > (let ((g (* (- (* 6 b) 5) (- (* 2 b) 1) (- (* 6 b) 1 > (list g > (quotient (* ch-C^3 (expt b 3)) 24) > (* (expt -1 b) g (+ (* b ch-B) ch-A > (let* ((mid (quotient (+ a b) 2)) > (gpq1 (ch-split a mid)); > (gpq2 (ch-split mid b)); > (g1 (car gpq1)) (p1 (cadr gpq1)) (q1 (caddr gpq1)) > (g2 (car gpq2)) (p2 (cadr gpq2)) (q2 (caddr gpq2))) > (list (* g1 g2) > (* p1 p2) > (+ (* q1 p2) (* q2 g1)) > > (define (pich digits) > (let* ((num-terms (inexact->exact (floor (+ 2 (/ digits 14.181647462) > (sqrt-C (integer-sqrt (* ch-C (expt 100 digits) > (let* ((gpq (ch-split 0 num-terms)) >(gs (car gpq)) (p (cadr gpq)) (q (caddr gpq))) > (quotient (* p ch-C sqrt-C) (* ch-D (+ q (* p ch-A))) > > (print "How many digits of Pi to compute?") > (define digits (read)) > > (print "Here you go:") > (print (pich digits)) > (define file-name "pidigits.txt") > (with-output-to-file file-name > (lambda () > (format #t "~A~%" (pich digits > > ___ > Chicken-users mailing list > Chicken-users@nongnu.org >
[Chicken-users] Question about deployment.
Hello You have been very helpfull and I thank you. Now I have a question about deployment? Did you try to deploy a chicken cgi or fastcgi applictaion (or chicken framework) in a web hosting service? How much did it cost? Which one of the web hosing services did you use? Thanks in advance Yuval ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Question about deployment.
Hi Yuval, On Tue, 15 May 2012 15:40:00 +0200 yuval ylan...@gmail.com wrote: You have been very helpfull and I thank you. Now I have a question about deployment? Did you try to deploy a chicken cgi or fastcgi applictaion (or chicken framework) in a web hosting service? How much did it cost? Which one of the web hosing services did you use? I've mostly seen CHICKEN web applications running on dedicated servers. Evan Hanson has some code and information about how to use Heroku to host CHICKEN apps: https://github.com/evhan/heroku-buildpack-chicken Best wishes. Mario -- http://parenteses.org/mario ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Deployment test failure (latest sources, FreeBSD)
* Vitaly Magerya vmage...@gmail.com [20 23:47]: Christian Kellermann ck...@pestilenz.org wrote: I have also tried it with the attached patch, that should give the correct flags, maybe we are still missing something... Does the patch improve the situation for you? Indeed it does for me. Cool! Since it doesn't work for you on OpenBSD, I propose to test it on NetBSD and DragonFlyBSD too, and then commit a similar patch that would only add -Wl,-z,origin where it is know to work. Yes, that has been my intention. Do we have NetBSD and/or DragonFlyBSD people on board? Could you perform the test described earlier? Peter and Alaric are NetBSD users, let's wait for feedback from them. I will see that I get it to work on OpenBSD. In any case, I'll try to get virtual machines with those systems going in a day, and will report back (if no-one will beat me to it). Looking forward to it! I am glad that we get -deploy to work on more systems again. Thanks for your help! Christian -- Who can (make) the muddy water (clear)? Let it be still, and it will gradually become clear. Who can secure the condition of rest? Let movement go on, and the condition of rest will gradually arise. -- Lao Tse. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Deployment test failure (latest sources, FreeBSD)
Christian Kellermann ck...@pestilenz.org wrote: Since it doesn't work for you on OpenBSD, I propose to test it on NetBSD and DragonFlyBSD too, and then commit a similar patch that would only add -Wl,-z,origin where it is know to work. Yes, that has been my intention. Cool. In any case, I'll try to get virtual machines with those systems going in a day, and will report back (if no-one will beat me to it). Looking forward to it! I am glad that we get -deploy to work on more systems again. Here are my findings. DragonFly does not seem to support $ORIGIN. I can build executables with $ORIGIN in RPATH, but it is ignored (with or without -Wl,-z,origin), the system-wide library is always used instead. NetBSD supports $ORIGIN but only partially. I can build executables with that in RPATH, and ldd shows that library resolution works correctly, but when I try to run the resulting executable I get this error: execname not specified in AUX vector: No such file or directory Strangely, but it works correctly when you invoke the executable by it's full path. On FreeBSD, as I said earlier, setting RPATH to $ORIGIN and adding -Wl,-z,origin works as it should. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] Deployment test failure (latest sources, FreeBSD)
Hi, folks. While running gmake check the deployment test fails, saying: /libexec/ld-elf.so.1: Shared object libchicken.so.6 not found, required by rev-app The full log is at [1]. The chicken in question is bootstrapped using 4.7.0, and installed into /tmp/c0 (see the log for full details). The problem seems to be that while rev-app is linked with libchicken.so.6, and even though that library is copied into the same directory as rev-file, the linker does not want to find it: $ ldd tests/rev-app/rev-app tests/rev-app/rev-app: libchicken.so.6 = not found (0x0) libm.so.5 = /lib/libm.so.5 (0x800648000) libthr.so.3 = /lib/libthr.so.3 (0x800768000) libc.so.7 = /lib/libc.so.7 (0x800881000) It's possible to specify the library path directly: $ env LD_LIBRARY_PATH=tests/rev-app ldd tests/rev-app/rev-app tests/rev-app/rev-app: libchicken.so.6 = tests/rev-app/libchicken.so.6 (0x800648000) libm.so.5 = /lib/libm.so.5 (0x800d51000) libthr.so.3 = /lib/libthr.so.3 (0x800e71000) libc.so.7 = /lib/libc.so.7 (0x800f8a000) ... but the tests specifically unset LD_LIBRARY_PATH, so this shouldn't be required. So, is this a known issue? If not, how do I diagnose it further? The machine in question is a FreeBSD 8.2-RELEASE amd64 box. GCC version is 4.2.1 (same behavior with gcc 4.6.1). [1] http://tx97.net/~magv/chicken-2011-11-20-check.log ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Deployment test failure (latest sources, FreeBSD)
* Vitaly Magerya vmage...@gmail.com [20 17:40]: So, is this a known issue? If not, how do I diagnose it further? -deploy is known to be broken for NetBSD and OpenBSD. Does FreeBSD support the $ORIGIN setting for RPATH? Maybe this test should be skipped on BSDs... HTH, Christian -- Who can (make) the muddy water (clear)? Let it be still, and it will gradually become clear. Who can secure the condition of rest? Let movement go on, and the condition of rest will gradually arise. -- Lao Tse. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Deployment test failure (latest sources, FreeBSD)
So, is this a known issue? If not, how do I diagnose it further? -deploy is known to be broken for NetBSD and OpenBSD. Does FreeBSD support the $ORIGIN setting for RPATH? It appears that it does, but you need to additionally pass -z origin to the linker. For example deploying like this seems to work: csc -deploy -L -z origin sources Maybe this test should be skipped on BSDs... Actually, judging by the man pages [1-2] NetBSD and OpenBSD may require the same trick. This needs to be tested though. Here's the test: rm -rf /rmp/cd mkdir -p /tmp/cd cd /tmp/cd echo '(write 555)' | tee a.scm b.scm csc -deploy a.scm ldd a/a csc -deploy -L -z origin b.scm ldd b/b Can any of you folks on NetBSD, OpenBSD or any other OS try those commands report the output here? Here is mine output: a/a: libchicken.so.6 = /usr/local/lib/libchicken.so.6 (0x2808e000) libm.so.5 = /lib/libm.so.5 (0x284dd000) libthr.so.3 = /lib/libthr.so.3 (0x284f7000) libc.so.7 = /lib/libc.so.7 (0x2850c000) b/b: libchicken.so.6 = /tmp/cd/b/libchicken.so.6 (0x2808e000) libm.so.5 = /lib/libm.so.5 (0x284dd000) libthr.so.3 = /lib/libthr.so.3 (0x284f7000) libc.so.7 = /lib/libc.so.7 (0x2850c000) ... which means that deployment doesn't work out of the box, but works with -z origin added. [1] http://man.freebsd.org/query=ldmanpath=NetBSD [2] http://man.freebsd.org/query=ldmanpath=OpenBSD ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Deployment test failure (latest sources, FreeBSD)
I wrote: Here's the test: rm -rf /rmp/cd mkdir -p /tmp/cd cd /tmp/cd Ugh, typo over there, it's /tmp/cd, not /rmp/cd. You have been warned. echo '(write 555)' | tee a.scm b.scm csc -deploy a.scm ldd a/a csc -deploy -L -z origin b.scm ldd b/b ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Deployment test failure (latest sources, FreeBSD)
* Vitaly Magerya vmage...@gmail.com [20 19:26]: Actually, judging by the man pages [1-2] NetBSD and OpenBSD may require the same trick. This needs to be tested though. Here's the test: rm -rf /rmp/cd mkdir -p /tmp/cd cd /tmp/cd echo '(write 555)' | tee a.scm b.scm csc -deploy a.scm ldd a/a csc -deploy -L -z origin b.scm ldd b/b This fails to compile for me on OpenBSD 5.0. Even giving the correct -L -Wl,-z,origin parameter instead of -L -z origin does compile but not load. It shows $ORIGIN as RPATH value in objdump -x b/b but ldd still complains about the libchicken shared object. -- Who can (make) the muddy water (clear)? Let it be still, and it will gradually become clear. Who can secure the condition of rest? Let movement go on, and the condition of rest will gradually arise. -- Lao Tse. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Deployment test failure (latest sources, FreeBSD)
* Vitaly Magerya vmage...@gmail.com [20 19:26]: So, is this a known issue? If not, how do I diagnose it further? -deploy is known to be broken for NetBSD and OpenBSD. Does FreeBSD support the $ORIGIN setting for RPATH? It appears that it does, but you need to additionally pass -z origin to the linker. For example deploying like this seems to work: csc -deploy -L -z origin sources Maybe this test should be skipped on BSDs... Actually, judging by the man pages [1-2] NetBSD and OpenBSD may require the same trick. This needs to be tested though. I have also tried it with the attached patch, that should give the correct flags, maybe we are still missing something... Does the patch improve the situation for you? It is against master's csc.scm of my development repo but I don't think it is different from the master repo at call-cc.org. HTH, Christian -- What's the first thing you think about when you wake up? asked Piglet. I wonder what's for breakfast said Pooh. I wonder what exiting things will happen today said Piglet. Oh, that's the same said Winnie the Pooh. diff --git a/csc.scm b/csc.scm index b5da715..38ba4ce 100644 --- a/csc.scm +++ b/csc.scm @@ -69,6 +69,8 @@ (define osx (eq? (software-version) 'macosx)) (define win mingw) (define netbsd (eq? (software-version) 'netbsd)) +(define openbsd (eq? (software-version) 'openbsd)) +(define freebsd (eq? (software-version) 'freebsd)) (define cygwin (eq? (build-platform) 'cygwin)) (define elf @@ -262,13 +264,16 @@ (list (conc -L\ library-dir \) (conc -Wl,-R\ -(if (and deployed (not netbsd)) -\\$ORIGIN -(prefix lib -(if host-mode -INSTALL_LIB_HOME -TARGET_RUN_LIB_HOME))) -\)) ) + (if deployed + \\$ORIGIN + (prefix lib + (if host-mode + INSTALL_LIB_HOME + TARGET_RUN_LIB_HOME))) + \ + (if (and deployed (or freebsd openbsd netbsd)) + -Wl,-z,origin + (else (list (conc -L\ library-dir \ (cond ((get-environment-variable CHICKEN_C_LIBRARY_PATH) = ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Deployment test failure (latest sources, FreeBSD)
Christian Kellermann ck...@pestilenz.org wrote: I have also tried it with the attached patch, that should give the correct flags, maybe we are still missing something... Does the patch improve the situation for you? Indeed it does for me. Since it doesn't work for you on OpenBSD, I propose to test it on NetBSD and DragonFlyBSD too, and then commit a similar patch that would only add -Wl,-z,origin where it is know to work. Do we have NetBSD and/or DragonFlyBSD people on board? Could you perform the test described earlier? In any case, I'll try to get virtual machines with those systems going in a day, and will report back (if no-one will beat me to it). ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Deployment of Linux binaries
That's nice. I think that's the actual method used by Mozilla et al. Thanks, Thomas! cheers, felix On 4/25/06, Thomas Chust [EMAIL PROTECTED] wrote: On Mon, 24 Apr 2006, felix winkelmann wrote: [...] While trying to figure out deployment models for binaries, I came up with some hack for Linux: http://galinha.ucpel.tche.br/coop?page=Deploying%20Linux%20binaries [...] Hello, the basic idea behind this mechanism is fine, but the implementation is very Linux specific in my eyes. I have posted an alternative approach that tries to be more portable on the wiki page. cu, Thomas ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Deployment of Linux binaries
On Mon, 24 Apr 2006, felix winkelmann wrote: [...] While trying to figure out deployment models for binaries, I came up with some hack for Linux: http://galinha.ucpel.tche.br/coop?page=Deploying%20Linux%20binaries [...] Hello, the basic idea behind this mechanism is fine, but the implementation is very Linux specific in my eyes. I have posted an alternative approach that tries to be more portable on the wiki page. cu, Thomas ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] Deployment of Linux binaries
Hi! While trying to figure out deployment models for binaries, I came up with some hack for Linux: http://galinha.ucpel.tche.br/coop?page=Deploying%20Linux%20binaries (this is roughly the model used by Mozilla/Firefox, for example) cheers, felix ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users