Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Are external libraries required or not? #106

Closed
ktakashi opened this issue May 16, 2014 · 8 comments
Closed

Are external libraries required or not? #106

ktakashi opened this issue May 16, 2014 · 8 comments
Labels

Comments

@ktakashi
Copy link
Contributor

The very first section of README says no external library is required however the section 'Requirement' says it requires some external libraries. Are these mere optional or actually required?

@nyuichi
Copy link
Member

nyuichi commented May 18, 2014

@ktakashi

A short answer: please refer to https://github.com/wasabiz/picrin#requirement.

And a long answer:
Currently there are two optional libraries supported: readline and regex. If you omit libreadline, the repl reads your input directly via fscanf, and you will not be able to use realine's advanced line editing assistance. When regex.h is not found on your environment, you just cannot (import (picrin regex)). As the development continues, note that more optional libraries can be added to this list.

There, however, are two libraries required when you build picrin (please do not confuse with execute). Actually, to proceed building the picrin binary you need install flex the lexer generator, though this is not the case when you just want to run picrin. The only business of flex is to generate c files from scan.l at building time, so you don't need any external libraries on your running environment.
Another requirement is getopt. IMO getopt is one of the 'magor' functions available on almost all environment, seriously. I don't think the dependency on getopt is at high risk, nor there's an urgent request to substitute it with our own implementation.

@ktakashi
Copy link
Contributor Author

I've tried to build from almost scratch Cygwin environment and found out some of issues on required libraries;

These are, I think, generic issues.

  • git is required for cloning submodule. (if you donwload zip file cmake would complain)
  • python is required. (Cygwin doesn't have python by default)

Below is only Cygwin issue. (I believe all other POSIX environment have pkg-config)

  • pkg-config is required.

About getopt. IMHO, it would be better to check if it's there as long as it's not a standard library. But I agree that it's one of the most major libraries and you can expect to be there.

@nyuichi
Copy link
Member

nyuichi commented May 18, 2014

I've tried to build from almost scratch Cygwin environment and found out some of issues on required libraries;

Thanks for your trying picrin :)

git is required for cloning submodule. (if you donwload zip file cmake would complain)

Git's submodule functionality is something I like so much in git parts. With her, we don't even need worry about everything related to version difference of external library. I love her convenience and
have no idea about changing this into other system. And, more importantly, picrin is hosted on 'git'hub.

python is required. (Cygwin doesn't have python by default)

Sorry, this is my fault. I fixed it and the change should be already available for you. Please pull it.

pkg-config is required.

I'm not familiar with pkg-config and its usage on Windows (cygwin) cmake. We need further investigation.

About getopt. IMHO, it would be better to check if it's there as long as it's not a standard library. But I agree that it's one of the most major libraries and you can expect to be there.

Agreed. If it were a checker guard, warnings should be more understandable.

@ktakashi
Copy link
Contributor Author

I agree with the opinion about submodule, (I even wish mercurial has it.), and I'm not talking about changing the build process but missing required module on README. I think it's unfriendly let user investigate what's missing. (Well, if a user build picrin from the source, this may be an irrelevant though.)

So my suggestion is putting 2 lines on Requirement section, git and python commands. Especially python, I needed to grep all files to figure out if it's picrin's issue or other build process issue.

@nyuichi
Copy link
Member

nyuichi commented May 18, 2014

@ktakashi

So my suggestion is putting 2 lines on Requirement section, git and python commands.

I just pushed the fix. Could you check it?

@ktakashi
Copy link
Contributor Author

It's checked if python is installed and completed the process. So I've still got the command not found error. Below is the part of the log;

-- Found Regex: /usr/lib/libc.a
-- Found FLEX: /usr/bin/flex.exe (found version "flex 2.5.35")
-- Could NOT find PythonInterp (missing:  PYTHON_EXECUTABLE)
-- Found PkgConfig: /usr/bin/pkg-config.exe (found version "0.23")
-- Could NOT find readline (missing:  READLINE_LIBRARY READLINE_INCLUDE_DIR)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/takashi/work/picrin

% make
[  2%] [FLEX][scan] Building scanner with flex flex 2.5.35
[  5%] Generating src/load_piclib.c
make[2]: PYTHON_EXECUTABLE-NOTFOUND: Command not found
CMakeFiles/picrin.dir/build.make:56: recipe for target 'src/load_piclib.c' failed
make[2]: *** [src/load_piclib.c] Error 127
CMakeFiles/Makefile2:125: recipe for target 'CMakeFiles/picrin.dir/all' failed
make[1]: *** [CMakeFiles/picrin.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2

@nyuichi
Copy link
Member

nyuichi commented May 18, 2014

@ktakashi

So I've still got the command not found error.

Great. The last thing you have to do is install python. Good luck.

@nyuichi
Copy link
Member

nyuichi commented May 19, 2014

@ktakashi

Hi, I just got rid of libemb.py (the evil) and replaced it with a perl script e1bf77d. Meanwhile I'm closing this issue. If you encounter any kind of problem, please report on this thread.

@nyuichi nyuichi closed this as completed May 19, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants