marcomaggi / vicare

A native compiler for Scheme compliant with R6RS
http://marcomaggi.github.com/vicare.html
Other
200 stars 34 forks source link

Importing libraries #91

Closed stefanhusmann closed 8 years ago

stefanhusmann commented 8 years ago

I am using Vicare Scheme in the stable version from bitbucket and the most recent github version on a Arch Linux system (64 bit). The following is happening with the unstable version

> vicare
Vicare Scheme version 0.4d0, 64-bit
Build 2016-04-27

Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors
Copyright (c) 2011-2015 Marco Maggi and contributors

vicare> (import (srfi :19))
Unhandled exception
Condition components:
1. &error
2. &who: expander
3. &message: "cannot locate library"
4. &library-resolution:
library: (srfi :19)
files: ()
vicare>

If I run the unstable version with -L /usr/lib/vicare-scheme/ or the stable version, everything seems fine.

Vicare Scheme version 0.4d0, 64-bit
Build 2016-04-27

Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors
Copyright (c) 2011-2015 Marco Maggi and contributors

vicare> (import (srfi :19))
vicare> 
marcomaggi commented 8 years ago

I cannot replicate the problem. Actually, there is no stable version. When I build from the 0.4pre4 tarball with:

$ ./configure --prefix=/usr/local --libdir=/usr/local/lib64

I leave the environment variables VICARE_LIBRARY_PATH and VICARE_SOURCE_PATH empty; then I run the REPL and I see:

vicare> (import (vicare libraries))
vicare> (library-source-search-path)
$1 = ()
vicare> (library-binary-search-path)
$1 = ("/usr/local/lib64/vicare-scheme")
vicare> (import (srfi :19))
vicare> (current-date)
$1 = (struct date (nanosecond 197758000) (second 1) (minute 47)
  (hour 6) (day 8) (month 5) (year 2016) (zone-offset 3600))
vicare> 

What do you see?

stefanhusmann commented 8 years ago

The tarball is fine, the repo version seems to need the -L option to find the libs.

marcomaggi commented 8 years ago

By repo version you mean the HEAD of the master branch? And what do you see when you build it, install it, and inspect the libraries search paths? Try to run vicare with the options:

$ vicare  --option print-loaded-libraries --option debug-messages

and then load (srfi :19); what is the output? Is this library the only one having problems? The other libraries load fine?

stefanhusmann commented 8 years ago

I did so, and it seems that explicitely setting exec-prefix at build time as configure-option fixes the issue. file.txt But shouldn't be $exec_prefix equal to $prefix if not set explicitely?

marcomaggi commented 8 years ago

The problem should be in the way @-substitutions are performed in the file ikarus.config.scm. It should be fixed in the HEAD of the master branch.

stefanhusmann commented 8 years ago

The file ikarus.config.scm is missing, did you push it?

marcomaggi commented 8 years ago

Makefile problem. Should be fixed now.

stefanhusmann commented 8 years ago

Thanks, all is fixed now.

marcomaggi commented 8 years ago

Thank you for reporting and investigating.