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

Build on lunix failed #2

Open
tusharkarumudi opened this issue Nov 28, 2017 · 15 comments
Open

Build on lunix failed #2

tusharkarumudi opened this issue Nov 28, 2017 · 15 comments

Comments

@tusharkarumudi
Copy link

I have cloned the code for uroboros and installed all the required packages like opam, ocaml, batteries etc
But while running ./build file the operation is failing.

@AindriyaBarua
Copy link

Facing the same issue:

  • ocamlfind -nodynlink -c -g -annot -bin-annot -thread -package deriving,deriving.syntax -syntax camlp4o -package batteries,parmap -I plugins -o type.cmx type.ml
    Usage: ocamlfind query [-help | other options] <package_name> ...
    or: ocamlfind ocamlc [-help | other options] ...
    or: ocamlfind ocamlcp [-help | other options] ...
    or: ocamlfind ocamlmklib [-help | other options] ...
    or: ocamlfind ocamlmktop [-help | other options] ...
    or: ocamlfind ocamlopt [-help | other options] ...
    or: ocamlfind ocamloptp [-help | other options] ...
    or: ocamlfind ocamldep [-help | other options] ...
    or: ocamlfind ocamlbrowser [-help | other options]
    or: ocamlfind ocamldoc [-help | other options] ...
    or: ocamlfind install [-help | other options] <package_name> ...
    or: ocamlfind remove [-help | other options] <package_name>
    or: ocamlfind printppx [-help | other options] <package_name> ...
    or: ocamlfind printconf [-help] [variable]
    or: ocamlfind lint [-help]
    or: ocamlfind list
    or: ocamlfind pkg/cmd arg ...
    Select toolchain with:
    ocamlfind -toolchain
    Abbreviations:
    e.g. ocamlfind opt instead of ocamlfind ocamlopt
    Command exited with code 2.
    Compilation unsuccessful after building 3 targets (2 cached) in 00:00:00.

@ajaymas
Copy link
Contributor

ajaymas commented May 8, 2020

Try you to install a specific version of the compiler i.e., OCaml 4.01.0 (as listed in the Readme file) and dependencies.
use below command to install the specific version
opam init --comp 4.01.0

For compiler version installation, the below link may help
https://www.youtube.com/watch?v=Cqi5ENX77AE

@dinghaowu
Copy link
Collaborator

I have cloned the code for uroboros and installed all the required packages like opam, ocaml, batteries etc
But while running ./build file the operation is failing.

can you be a bit more specific? What error are you getting?

@AindriyaBarua
Copy link

This is what I get wheb i run ./build
My Ocaml version is 4.02.3

  • ocamlfind -nodynlink -c -g -annot -bin-annot -thread -package deriving,deriving.syntax -syntax camlp4o -package batteries,parmap -I plugins -o type.cmx type.ml
    Usage: ocamlfind query [-help | other options] <package_name> ...
    or: ocamlfind ocamlc [-help | other options] ...
    or: ocamlfind ocamlcp [-help | other options] ...
    or: ocamlfind ocamlmklib [-help | other options] ...
    or: ocamlfind ocamlmktop [-help | other options] ...
    or: ocamlfind ocamlopt [-help | other options] ...
    or: ocamlfind ocamloptp [-help | other options] ...
    or: ocamlfind ocamldep [-help | other options] ...
    or: ocamlfind ocamlbrowser [-help | other options]
    or: ocamlfind ocamldoc [-help | other options] ...
    or: ocamlfind install [-help | other options] <package_name> ...
    or: ocamlfind remove [-help | other options] <package_name>
    or: ocamlfind printppx [-help | other options] <package_name> ...
    or: ocamlfind printconf [-help] [variable]
    or: ocamlfind lint [-help]
    or: ocamlfind list
    or: ocamlfind pkg/cmd arg ...
    Select toolchain with:
    ocamlfind -toolchain
    Abbreviations:
    e.g. ocamlfind opt instead of ocamlfind ocamlopt
    Command exited with code 2.
    Compilation unsuccessful after building 3 targets (2 cached) in 00:00:00.

@ajaymas
Copy link
Contributor

ajaymas commented May 18, 2020

@AindriyaBarua the current version of the Uroboros works only on the OCaml compiler version 4.01.0. Please check the version of your compiler and let me know.

@s3team
Copy link
Owner

s3team commented May 18, 2020 via email

@ajaymas
Copy link
Contributor

ajaymas commented May 19, 2020

@AindriyaBarua @aruncgowda
To build and run the current version Uroboros on ubuntu 18.04 or 16.04 follow the steps below:
We will be releasing a docker file for the Uroboros soon.

$ sudo apt-get update
$ sudo apt-get install opam
$ opam init --comp 4.01.0
$ eval opam config env
$ opam depext conf-m4
$ opam install deriving ocamlfind parmap batteries ocamlbuild

git clone https://github.com/s3team/uroboros.git
cd uroboros/src$ ./build
cd uroboros/src$ python uroboros.py bzip

Let me know if you get any errors with these steps.

@AindriyaBarua
Copy link

@ajaymas
I followed the steps you mentioned. This is the error on doing ./build:

+ ocamlfind ocamldep -package deriving,deriving.syntax -syntax camlp4o -package batteries,parmap -modules type.ml > type.ml.depends
ocamlfind: Package `deriving' not found
Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.

I tried this:
aindriya@aindriya:~/uroboros/src/uroboros/src$ opam install deriving
[NOTE] Package deriving is already installed (current version is 0.7.1).

@arunchannaraju18
Copy link

@AindriyaBarua

If you have already installed any other version of opam , please remove that opam
version using below command
$sudo apt-get autoremove opam #it will remove opam and all its dependencies

After this goto Files and delete the .opam folder.
(if you don’t find .opam folder press[Ctrl+h])
[If you are a new installer of opam please ignore the above commands]
New Installation
$sudo apt-get update
$sudo apt-get install opam
$opam init --comp 4.01.0 #Givey(Yes)foreverything
$env$(opam env)
$opam env OR $opam configenv
$opam depext conf-m4
$opam install deriving
$opam install ocamlfind
$opam install batteries
$opam install parmap
#if the system asks anything to install between these commands please install it.
Uroboros
$gitclonehttps://github.com/s3team/uroboros.git
$cd uroboros/src
$./build
#if you find any error after ./build command just restart your system and try again.
$python uroboros.py bzip

@AindriyaBarua
Copy link

AindriyaBarua commented May 21, 2020

@ajaymas @aruncgowda
I am still facing this:

(base) aindriya@aindriya:~/uroboros/src$ ./build
+ ocamlfind ocamldep -package deriving,deriving.syntax -syntax camlp4o -package batteries,parmap -modules type.ml > type.ml.depends
ocamlfind: Package `deriving' not found
Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
(base) aindriya@aindriya:~/uroboros/src$ opam install deriving
[NOTE] Package deriving is already installed (current version is 0.7.1).

Thanks in advance!

@s3team
Copy link
Owner

s3team commented May 21, 2020 via email

@ajaymas
Copy link
Contributor

ajaymas commented May 21, 2020

@AindriyaBarua
This is a docker file created for the Uroboros-OCaml version. It's working without any issue you can try this.

FROM ubuntu:18.04
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y
git
opam
autoconf
automake
debianutils
m4

RUN opam init --comp 4.01.0 -y
RUN opam install -y
deriving.0.7
ocamlfind.1.5.5
parmap.1.0-rc6
batteries.2.3.1

RUN git clone https://github.com/s3team/uroboros.git
WORKDIR "/uroboros/src"
RUN eval $(opam config env) && ./build

@gasche
Copy link

gasche commented Jun 9, 2020

This build failure was reported on your issue tracker in 2017, with a proposed fix.

@eschulte
Copy link

eschulte commented Jul 20, 2021

The following successfully builds Uroboros on Linux,

FROM ubuntu:20.04

RUN export DEBIAN_FRONTEND=noninteractive
RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
RUN apt-get -y update && \
    apt-get -y install build-essential binutils opam camlp4-extra git

RUN opam init --comp 4.01.0 -a --disable-sandboxing
RUN opam install -y deriving.0.7 ocamlfind.1.5.5 parmap batteries.2.3.1

RUN git clone https://github.com/s3team/uroboros.git /uroboros
WORKDIR "/uroboros/src"
RUN sed -i 's/\(command\|system\)(\("\|"\)python /\1("python2 /' *.py *.ml **/*.py **/*.ml
RUN sed -i "s/system('python /system('python2 /" *.py *.ml **/*.py **/*.ml
RUN eval $(opam config env) && ./build

however, the resulting install is throwing errors. Is the install somehow broken, or is Uroboros not expected to rewrite this file for some reason?

root@13ba65c42deb:/uroboros/src# echo -e "#include <stdio.h>\nint main(){puts(\"hello\"); return 0;}"|gcc -x c - -no-pie -fno-pie -o hello
root@13ba65c42deb:/uroboros/src# file hello
hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=4d2852b475257ab95abff6f50b82fe0709dab6c1, for GNU/Linux 3.2.0, not stripped
root@13ba65c42deb:/uroboros/src# python2 uroboros.py hello
rm: cannot remove 'final_*.txt': No such file or directory
rm: cannot remove 'final_data.s': No such file or directory
rm: cannot remove 'useless_func.info': No such file or directory
rm: cannot remove 'main.info': No such file or directory
Traceback (most recent call last):
  File "main_discover.py", line 78, in <module>
    main_symbol =main_symbol.split('0x')[1]
IndexError: list index out of range
rm: cannot remove 'final.s': No such file or directory
rm: cannot remove 'inline_symbols.txt': No such file or directory
1: linearly disassemble
Fatal error: exception Parser.ParseError
exception, processing failed
root@13ba65c42deb:/uroboros/src#

Thanks for any information you can provide.

@eschulte
Copy link

My unconfirmed suspicion is that objdump has changed its output format since 2016 and that the corresponding parser in Uroboros needs to be updated.

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

8 participants