seq-lang / seq

A high-performance, Pythonic language for bioinformatics
https://seq-lang.org
Apache License 2.0
698 stars 50 forks source link

Compiling on M1 Mac #237

Closed rkimoakbioinformatics closed 3 years ago

rkimoakbioinformatics commented 3 years ago

Hi, I'm trying to run seq on M1 MacBook Air. I have tried the following.

  1. ./scripts/deps.sh 2 on the native terminal.

This gave an error "No rule to make target none.o', needed bylibasmrun.a'. Stop.", which seems to be related to OCaml (https://github.com/rescript-lang/rescript-compiler/issues/4997).

  1. /bin/bash -c "$(curl -fsSL https://seq-lang.org/install.sh)" on the Rosetta-based terminal.
test.seq:
print('hello world')

seqc run test.seq ran fine. seqc build test.seq gave an error:

ld: library not found for -lseqrt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: process for 'clang' exited with status 1

I'd appreciate any help.

markhend commented 3 years ago

Hi @rkimoakbioinformatics. Thanks for giving it a try. If you are just wanting to install and run, /bin/bash -c "$(curl -fsSL https://seq-lang.org/install.sh)" should get you up and running. deps.sh is to install the dependencies if you would like to go down the route of building from source.

Since seqc run is working, you got most of the way there. Currently, there are some issues with seqc build related to static linking that are being fixed for the upcoming release. I see similar issues on Linux.

Being able to build is nice. If you're up for experimenting, you may be able to get an older release to work, e.g. v0.10.1. I download a binary to my home directory and then:

$ rm -fr .seq
$ tar zxvf seq-linux-x86_64_v10_1.tar.gz
$ mv seq-deploy/ .seq
$ seqc -version
Seq 0.10.1
$ seqc build hello.seq
$ ./hello
hello
~$ tree -L 3 .seq
.seq
├── bin
│   └── seqc
└── lib
    └── seq
        ├── libomp.so
        ├── libseq.so
        ├── libseqrt.so
        └── stdlib
arshajii commented 3 years ago

This particular issue should be resolvable if you just set DYLD_LIBRARY_PATH:

export DYLD_LIBRARY_PATH=/Users/<username>/.seq/lib/seq

Let me know if this works!

rkimoakbioinformatics commented 3 years ago

@arshajii That worked on the rosetta terminal (M1 MacBook). Thanks. Hope M1 Mac will be able to run seq natively in the future!

rkimoakbioinformatics commented 3 years ago

@markhend Oh and thanks for your reply.