Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Solidity compiler available in fresh geth installation from source #2598

Closed
giacecco opened this issue May 23, 2016 · 13 comments
Closed

No Solidity compiler available in fresh geth installation from source #2598

giacecco opened this issue May 23, 2016 · 13 comments

Comments

@giacecco
Copy link
Contributor

giacecco commented May 23, 2016

System information

Geth version: 1.4.4-stable-8ea3c88e
OS & Version: Linux (tested on Ubuntu and Fedora)

Expected behaviour

In the geth console, eth.getCompilers() returns ['Solidity' ] as described at https://www.ethereum.org/greeter .

Actual behaviour

eth.getCompilers() returns [ ]

Steps to reproduce the behaviour

Build geth from source, run the executable in build/bin, attach to it and execute the eth.getCompilers() command.

Note that I've also tried installing Solidity globally using npn -g solc as described at http://solidity.readthedocs.io/en/latest/installing-solidity.html . Checked that NODE_PATH was defined. Killed and re-started geth. There was no change. It has to be noted that the node repl can import the library, so it must be visible to geth, too.

@karalabe
Copy link
Member

Unless I'm mistaking, node.js installs packages into its own specific data/binary folders. Geth doesn't really have anything to do with node.js so I don't see how/why it should detect node modules on the system. Geth currently looks for the the solc binary at /usr/bin/solc if I remember correctly. You can override this via --solc or admin.setSolc from the console.

@remyroy
Copy link
Contributor

remyroy commented May 24, 2016

I'm having the same issue with Geth/v1.4.5-stable/windows/go1.6.2. Even if I try to specify the full path to solc.exe with --solc, eth.getCompilers() returns [ ].

I'm investigating.

@giacecco
Copy link
Contributor Author

@remyroy I believe the problems are different.

In my case, I had missed that solc is part of the C++ command line tools only, so of course I couldn't find it. It still looks odd to me, given that it looks like the C++ tools are being phased out or are close to it.

My current hypothesis is that the Ethereum people these days expect us to use the new NodeJS console only, while geth is intended to be used as a "server" only. AND, because the it's NodeJS, perhaps it can import the NodeJS Solidity compiler I was talking about in my original post.

If you agree with me, please close this issue, as it was a misunderstanding my side, not a real issue.

@remyroy
Copy link
Contributor

remyroy commented May 26, 2016

@giacecco There was a real bug with eth.getCompilers() that would return [ ] even if solc was present and properly installed. I fixed it with #2612.

I am unaware about the other stuff you mentioned.

@sagargohil
Copy link

i am facing same issue, i am connecting my tx node using putty (from windows operating system)
please tell me how to install solc compiler.

@remyroy
Copy link
Contributor

remyroy commented Feb 24, 2017

@sagargohil You can download the latest solc compiler on https://github.com/ethereum/solidity/releases . Just extract the solc binaries in the same directory as geth and it should be able to find it easily.

@JohnSmall
Copy link

@remyroy Errr, it doesn't work.

I did exactly as you said. I downloaded the binaries and extracted them into the same directory as geth which was /usr/bin . Then I restarted my geth console session typed

 eth.getCompilers()

and got back

 []

So now I'm stuck. How do I get a solidity compiler into my geth console?

@JohnSmall
Copy link

Ah!!! Something is different after putting the solc binaries in the same directory as geth. It's still not working though. This is what I do;-

  source = "contract test { function multiply(uint a) returns(uint d) { return a * 7; } }"
  contract = eth.compile.solidity(source).test

and this is what I get back

 Error: solc: exit status 127
   solc: error while loading shared libraries: libboost_filesystem.so.1.54.0: cannot open shared      object file: No such file or directory

   at web3.js:3104:20
   at web3.js:6191:15
   at web3.js:5004:36
   at <anonymous>:1:12

@remyroy
Copy link
Contributor

remyroy commented Mar 1, 2017

@JohnSmall It seems you are missing some dependencies from solidity. Solidity has a script that detects your os and install those automatically for you. Run https://github.com/ethereum/solidity/blob/develop/scripts/install_deps.sh with sudo and it should work.

@btcunbranded
Copy link

Have just started with geth on windows.
when i type eth.getCompilers()
it returns (anonymous): Line 1:19 Unexpected identifier, any ideas please?

@magictoy
Copy link

+1

@karalabe
Copy link
Member

Please use https://remix.ethereum.org.

@Gonzser
Copy link

Gonzser commented Apr 13, 2018

How do you use, https://remix.ethereum.org for multiple contract files, and how to get ABI and BIN files from https://remix.ethereum.org? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants