seq-lang / seq

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

undefined reference to seq_alloc when seqc build #246

Closed orangeSi closed 2 years ago

orangeSi commented 2 years ago

hello, eveyone. when I test the demo code fib, seqc run works, but seqc build get this error:

$ seqc --version
Seq 0.11.0

$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

$ cat x.seq
def fib(n):
    a, b = 0, 1
    while a < n:
        print(a, end=' ')
        a, b = b, a+b
    print()
fib(1000)

$ seqc run x.seq
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 

$ clang -v
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Selected multilib: .;@m64

$ seqc build x.seq
x.o: In function `std.internal.internal.Import.__new__.2':
/home/ubuntu/biofast/fqcnt/./<generated>:141: undefined reference to `seq_alloc'
x.o: In function `std.internal.types.collections.dict.Dict.__new__.17':
/home/ubuntu/biofast/fqcnt/./<generated>:153: undefined reference to `seq_alloc'
x.o: In function `std.internal.types.collections.dict.Dict.__new__.55':
/home/ubuntu/biofast/fqcnt/./<generated>:153: undefined reference to `seq_alloc'
x.o: In function `Tuple.N1[int]:Tuple.N1.__iter__[Tuple.N1[int]].63':
/home/ubuntu/biofast/fqcnt/./<generated>:398: undefined reference to `seq_alloc'
x.o: In function `int.__str__[int].69':
/home/ubuntu/.seq/lib/seq/stdlib/internal/types/int.seq:26: undefined reference to `seq_str_int'
x.o: In function `std.internal.builtin.print[Tuple.N1[int],str,str,Ptr[byte],bool].73':
/home/ubuntu/.seq/lib/seq/stdlib/internal/builtin.seq:28: undefined reference to `seq_print_full'
/home/ubuntu/.seq/lib/seq/stdlib/internal/builtin.seq:27: undefined reference to `seq_print_full'
/home/ubuntu/.seq/lib/seq/stdlib/internal/builtin.seq:30: undefined reference to `seq_print_full'
x.o: In function `std.internal.types.ptr.List.__new__.75':
/home/ubuntu/biofast/fqcnt/./<generated>:(.text+0x7d7): undefined reference to `seq_alloc'
x.o: In function `Ptr.__new__.76':
/home/ubuntu/.seq/lib/seq/stdlib/internal/types/ptr.seq:8: undefined reference to `seq_alloc_atomic'
x.o: In function `std.internal.types.ptr.List[int]:std.internal.types.ptr.List.__iter__[std.internal.types.ptr.List[int]].81':
/home/ubuntu/.seq/lib/seq/stdlib/internal/types/collections/list.seq:21: undefined reference to `seq_alloc'
x.o: In function `Tuple.N0.__iter__[Tuple.N0].82':
/home/ubuntu/.seq/lib/seq/stdlib/internal/types/collections/list.seq:21: undefined reference to `seq_alloc'
x.o: In function `std.internal.builtin.print[Tuple.N0,str,str,Ptr[byte],bool].83':
/home/ubuntu/.seq/lib/seq/stdlib/internal/builtin.seq:28: undefined reference to `seq_print_full'
/home/ubuntu/.seq/lib/seq/stdlib/internal/builtin.seq:27: undefined reference to `seq_print_full'
/home/ubuntu/.seq/lib/seq/stdlib/internal/builtin.seq:30: undefined reference to `seq_print_full'
x.o: In function `main.0':
/home/ubuntu/biofast/fqcnt/x.seq:14: undefined reference to `seq_stdout'
/home/ubuntu/biofast/fqcnt/x.seq:11: undefined reference to `seq_is_macos'
x.o: In function `main':
/home/ubuntu/biofast/fqcnt/x.seq:7: undefined reference to `seq_alloc'
/home/ubuntu/biofast/fqcnt/x.seq:7: undefined reference to `seq_init'
x.o: In function `seq.proxy_main':
/home/ubuntu/biofast/fqcnt/x.seq:7: undefined reference to `seq_terminate'
x.o:(.eh_frame+0x34b): undefined reference to `seq_personality'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: process for 'clang' exited with status 1
markhend commented 2 years ago

Hi @orangeSi! I suspect you need to add a Seq path to LD_LIBRARY_PATH. Try export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ubuntu/.seq/lib/seq

orangeSi commented 2 years ago

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ubuntu/.seq/lib/seq

yes, it works! Thanks!

I used https://seq-lang.org/install.sh to install seq, so if add a notation add export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.seq/lib/seq to ~/.bashrc to the install.sh, will be better for the newbie.

markhend commented 2 years ago

You're welcome. Thanks for the feedback. We want to make the installation process as smooth as possible.