LLVM-IR binary

206 views
Skip to first unread message

Kseniya Nikolaeva

unread,
Jan 19, 2017, 5:27:38 AM1/19/17
to llgo-dev
Hey everybody!

I need to get only LLVM-IR binary file based on input .go-source file, so, what is enough to install in this case? Maybe somebody could give me short "how to" instructions.

As I found it's not easy just to install llgo using README from llvm.org. There are a lot of different error while installing and I'm very new in this llvm-area, so to say)

Thank in advance!

Andrew Wilkins

unread,
Jan 21, 2017, 11:08:28 PM1/21/17
to llgo...@googlegroups.com
Hi Kseniya,

Sorry for the late reply. If you share the errors you're seeing, someone may be able to help you.

Which OS are you using? If you're using Ubuntu, then I'll look at updating my snap package to expose the llgo executable. Then you needn't compile it yourself.

Cheers,
Andrew

--
You received this message because you are subscribed to the Google Groups "llgo-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to llgo-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kseniya Nikolaeva

unread,
Jan 24, 2017, 1:15:15 PM1/24/17
to llgo-dev
Hi Andrew,

Thank you for the answer!


Which OS are you using? If you're using Ubuntu, then I'll look at updating my snap package to expose the llgo executable. Then you needn't compile it yourself.
It would be great! I'm using ubuntu 16.04.1.


If you share the errors you're seeing, someone may be able to help you.
Yes, sorry for non-constructivism.

What I've done:
followed this README and gave ARM parameter as LLVM_TRGETS_TO_BUILD.


What I've got:
make[2]: *** No rule to make target 'bin/llvm-go', needed by 'bin/llgo'.  Stop.
CMakeFiles/Makefile2:45946: recipe for target 'tools/llgo/CMakeFiles/llgo.dir/all' failed
make[1]: *** [tools/llgo/CMakeFiles/llgo.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

than I've done this:
sudo make llvm-go
sudo make install

And the last error was gone, but I've got another one:
...
[ 88%] Built target scan-view
[ 88%] Building Go executable llgo
[ 88%] Built target llgo
Scanning dependencies of target libffi
[ 88%] Clobbering libffi build directory...
[ 88%] Creating directories for 'libffi'
[ 88%] No download step for 'libffi'
[ 88%] No update step for 'libffi'
[ 88%] No patch step for 'libffi'
[ 88%] No force-reconfigure step for 'libffi'
[ 88%] Performing configure step for 'libffi'
CMake Error at /home/ckyhc/llvm-build/tools/llgo/libffi-prefix/src/libffi-stamp/libffi-configure-Debug.cmake:16 (message):
  Command failed: 77

   '/home/ckyhc/llvm/tools/llgo/third_party/gofrontend/libffi/configure' '--disable-multilib' 'CC=/home/ckyhc/llvm-build/bin/clang '

  See also

    /home/ckyhc/llvm-build/tools/llgo/libffi-prefix/src/libffi-stamp/libffi-configure-*.log


tools/llgo/CMakeFiles/libffi.dir/build.make:109: recipe for target 'tools/llgo/libffi-prefix/src/libffi-stamp/libffi-configure' failed
make[2]: *** [tools/llgo/libffi-prefix/src/libffi-stamp/libffi-configure] Error 1
CMakeFiles/Makefile2:46547: recipe for target 'tools/llgo/CMakeFiles/libffi.dir/all' failed
make[1]: *** [tools/llgo/CMakeFiles/libffi.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

libffi-configure-out.log contains:
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for makeinfo... ${SHELL} /home/ckyhc/llvm/tools/llgo/third_party/gofrontend/missing --run makeinfo
checking for modern makeinfo... no
checking generated-files-in-srcdir... no
checking for gcc... /home/ckyhc/llvm-build/bin/clang
checking for C compiler default output file name...

libffi-configure-err.log contains:
configure: error: in `/home/ckyhc/llvm-build/tools/llgo/libffi':
configure: error: C compiler cannot create executables
See `config.log' for more details.

That's all, I suppose, thanks in advance again!

Best,
Kseniia

четверг, 19 января 2017 г., 13:27:38 UTC+3 пользователь Kseniya Nikolaeva написал:

Andrew Wilkins

unread,
Jan 24, 2017, 6:36:44 PM1/24/17
to llgo...@googlegroups.com
On Wed, 25 Jan 2017 at 02:15 Kseniya Nikolaeva <n.c...@gmail.com> wrote:
Hi Andrew,

Thank you for the answer!


Which OS are you using? If you're using Ubuntu, then I'll look at updating my snap package to expose the llgo executable. Then you needn't compile it yourself.
It would be great! I'm using ubuntu 16.04.1.


If you share the errors you're seeing, someone may be able to help you.
Yes, sorry for non-constructivism.

What I've done:
followed this README and gave ARM parameter as LLVM_TRGETS_TO_BUILD.

llgo currently only supports targeting Linux x86-64. Even if it did support ARM, I don't think the build system is set up for cross-building.

What are you looking for? You want the IR, but does it need to be targeting ARM?

By the way, I've just remembered that there is a Docker image for llgo. See the thread here: https://groups.google.com/forum/#!topic/llgo-dev/Dd2Wu7nHa1U

Cheers,
Andrew

--

Kseniya Nikolaeva

unread,
Jan 27, 2017, 9:53:18 AM1/27/17
to llgo-dev
What are you looking for? You want the IR, but does it need to be targeting ARM?
Then, I don't understand something. Which options should I give to cmake to build it with minimal needs to get LLVM IR, because I don't have a lot of free space?

P.S. Thanks for link!

Best.
Kseniia


четверг, 19 января 2017 г., 13:27:38 UTC+3 пользователь Kseniya Nikolaeva написал:
Hey everybody!

Andrew Wilkins

unread,
Feb 3, 2017, 1:50:26 AM2/3/17
to llgo...@googlegroups.com
On Fri, 27 Jan 2017 at 22:53 Kseniya Nikolaeva <n.c...@gmail.com> wrote:
What are you looking for? You want the IR, but does it need to be targeting ARM?
Then, I don't understand something. Which options should I give to cmake to build it with minimal needs to get LLVM IR, because I don't have a lot of free space?

Sorry for the delay in responding. If you pass "-DLLVM_TARGETS_TO_BUILD=host" to cmake, then it will build only the targets for the build host. That should cut down on some space.

HTH,
Andrew

P.S. Thanks for link!

Best.
Kseniia


четверг, 19 января 2017 г., 13:27:38 UTC+3 пользователь Kseniya Nikolaeva написал:
Hey everybody!

I need to get only LLVM-IR binary file based on input .go-source file, so, what is enough to install in this case? Maybe somebody could give me short "how to" instructions.

As I found it's not easy just to install llgo using README from llvm.org. There are a lot of different error while installing and I'm very new in this llvm-area, so to say)

Thank in advance!

--

Kseniya Nikolaeva

unread,
Feb 5, 2017, 3:52:35 AM2/5/17
to llgo-dev
It helped, thank you very much!


четверг, 19 января 2017 г., 13:27:38 UTC+3 пользователь Kseniya Nikolaeva написал:
Hey everybody!

Arpit Aggarwal

unread,
Feb 6, 2017, 4:32:37 AM2/6/17
to llgo-dev
Hey Kseniya Nikolaeva,
Can you please tell me the procedure you followed to install llgo(how you resolved the errors and all)?
That would be a great help.
Thanks in advance

Regards,
Arpit

Kseniya Nikolaeva

unread,
Feb 6, 2017, 5:13:52 AM2/6/17
to llgo-dev
Hi Arpit!

First three steps are exactly like in README:

# Checkout LLVM:
svn co http://llvm.org/svn/llvm-project/llvm/trunk /path/to/llvm # Checkout Clang:
cd /path/to/llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
 
# Checkout llgo:
svn co http://llvm.org/svn/llvm-project/llgo/trunk llgo
 
# Build LLVM, Clang and llgo: (see also http://llvm.org/docs/CMake.html)
mkdir /path/to/llvm-build
cd /path/to/llvm-build

The next step I did: 
cmake /path/to/llvm -DCMAKE_INSTALL_PREFIX=/path/to/llvm-inst -DLLVM_TARGET_TO_BUILD=host

And than:
sudo make install

After that I saw error:
make[2]: *** No rule to make target 'bin/llvm-go', needed by 'bin/llgo'.  Stop.
CMakeFiles/Makefile2:45946: recipe for target 'tools/llgo/CMakeFiles/llgo.dir/all' failed
make[1]: *** [tools/llgo/CMakeFiles/llgo.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

than I've done this:
sudo make llvm-go
sudo make install

And everything was installed into /path/to/llvm-inst folder.
So, last step I did was setting PATH variable:
export PATH=$PATH:/path/to/llvm-ins/bin

Sometimes I had "collect 2 error", but that's not because of llgo. That's just because of not very big RAM and adding swap-file helped me. This error is easy to google, I solved it like in this page.

Best,
Kseniia

понедельник, 6 февраля 2017 г., 12:32:37 UTC+3 пользователь Arpit Aggarwal написал:

Arpit Aggarwal

unread,
Feb 6, 2017, 6:39:13 AM2/6/17
to llgo-dev
Thanks a lot Kseniya.
I will follow your steps and lets see if I am able to completely install it

Thanks,
Arpit

Arpit Aggarwal

unread,
Feb 6, 2017, 10:43:15 AM2/6/17
to llgo-dev
Hi, Kseniya and Andrew,

I followed your steps Kseniya and got the following error after resolving the llvm-go by sudo make llvm-go :

make[2]: *** No rule to make target 'bin/clang', needed by 'tools/llgo/libffi-prefix/src/libffi-stamp/libffi-clobber'.  Stop.
CMakeFiles/Makefile2:56343: recipe for target 'tools/llgo/CMakeFiles/libffi.dir/all' failed
make[1]: *** [tools/llgo/CMakeFiles/libffi.dir/all] Error 2

Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

Thanks in advance!

Regards,
Arpit

Kseniya Nikolaeva

unread,
Feb 9, 2017, 3:10:47 AM2/9/17
to llgo-dev
Sorry for late reply.

I did not have this error, and I cannot imagine real reasons, but if I was you I would probably tried "sudo make clang".

понедельник, 6 февраля 2017 г., 18:43:15 UTC+3 пользователь Arpit Aggarwal написал:
Message has been deleted

Arpit Aggarwal

unread,
Feb 11, 2017, 9:42:50 AM2/11/17
to llgo-dev
tried sudo make clang,
but the error stays

Thanks,
Arpit

Arpit Aggarwal

unread,
Feb 21, 2017, 5:32:15 AM2/21/17
to llgo-dev
Hi Kseniya,
Can you please provide me the llgo source code that you used to build llgo (in folder where_you_downloaded_from_svn/llvm/tools/llgo)?
Also can you please provide me the llvm and clang versions you are using. That would be a great help!

Thanks,
Arpit
Reply all
Reply to author
Forward
0 new messages