agraef / pure-lang

Pure programming language
https://agraef.github.io/pure-lang/
315 stars 20 forks source link

compilation on Debian stretch fail. #23

Closed emviveros closed 6 years ago

emviveros commented 6 years ago

Hello!

I'm trying to compile [lv2plugin~] object and for that I need to compile pure.

After read this page, I follow this way in debian:

install from debian stable repository

sudo apt install autoconf automake gcc make flex bison emacs libltdl-dev libgmp-dev libmpfr-dev libpcre++-dev libreadline-dev git fig2ps binfmt-support

and manually download and install llvm3.5-dev package, for that I installed in order:

after that I went to pure directory (cloned from this git) but compilation fail... :/

Some suggestion? or anyway some binaries for debian stretch?

follow the result of my compilation attempt:

esteban-deb@MacBookPro-Esteban:~/Modelos/pure-lang$ cd pure
esteban-deb@MacBookPro-Esteban:~/Modelos/pure-lang/pure$ autoreconf
esteban-deb@MacBookPro-Esteban:~/Modelos/pure-lang/pure$ ./configure --enable-release
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for bison... bison
checking for flex... flex
checking for emacs... /usr/bin/emacs
checking whether g++ supports C++11 features by default... yes
checking whether the linker accepts -l:libm.a... yes
checking for texmacs... no
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking size of void *... 8
checking size of long... 8
checking size of size_t... 8
checking for __gmpz_init in -lgmp... yes
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking for mpfr_init in -lmpfr... yes
checking mpfr.h usability... yes
checking mpfr.h presence... yes
checking for mpfr.h... yes
checking for cos in -lm... yes
checking for libiconv in -liconv... no
checking for iconv in -liconv... no
checking for glob in -lglob... no
checking for regcomp in -lregex... no
checking for a readline compatible library... -lreadline
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking edit/readline/readline.h usability... no
checking edit/readline/readline.h presence... no
checking for edit/readline/readline.h... no
checking editline/readline.h usability... no
checking editline/readline.h presence... no
checking for editline/readline.h... no
checking whether readline supports history... yes
checking readline/history.h usability... yes
checking readline/history.h presence... yes
checking for readline/history.h... yes
checking edit/readline/history.h usability... no
checking edit/readline/history.h presence... no
checking for edit/readline/history.h... no
checking for history_set_history_state... yes
checking for a sed that does not truncate output... /bin/sed
checking whether gcc is Clang... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking for iconv... yes
checking for iconv declaration... 
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for nl_langinfo and CODESET... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for ftime... yes
checking for gettimeofday... yes
checking for nanosleep... yes
checking for usleep... yes
checking whether time.h declares the daylight variable... yes
checking whether struct tm has tm_gmtoff member... yes
checking for strptime... yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking for readdir... yes
checking sys/fcntl.h usability... yes
checking sys/fcntl.h presence... yes
checking for sys/fcntl.h... yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking for mkstemp... yes
checking for fstat... yes
checking for _setjmp... yes
checking for _longjmp... yes
checking for struct stat.st_rdev... yes
checking return type of signal handlers... void
checking for type of signal functions... posix
checking if signal handlers must be reinstalled when invoked... no
checking for _Complex float... yes
checking for _Complex double... yes
checking for llvm-config... no
checking for llvm-config-3.5... llvm-config-3.5
checking for shared LLVM library... -L/usr/lib/llvm-3.5/lib -lLLVM-3.5.0
checking for new LLVM IRBuilder class (LLVM >= 3.3)... yes
checking for new llvm::raw_fd_ostream interface (LLVM >= 2.7)... no
checking for new llvm::raw_fd_ostream interface (LLVM >= 3.4)... yes
checking for new user_iterator class (LLVM >= 3.5)... yes
checking for llvm/Support/DynamicLibrary.h... yes
checking for llvm/Support/CallSite.h... no
checking how to run the C++ preprocessor... g++ -E
checking llvm/Support/raw_ostream.h usability... yes
checking llvm/Support/raw_ostream.h presence... yes
checking for llvm/Support/raw_ostream.h... yes
checking llvm/Support/raw_os_ostream.h usability... yes
checking llvm/Support/raw_os_ostream.h presence... yes
checking for llvm/Support/raw_os_ostream.h... yes
checking llvm/ModuleProvider.h usability... no
checking llvm/ModuleProvider.h presence... no
checking for llvm/ModuleProvider.h... no
checking llvm/TypeSymbolTable.h usability... no
checking llvm/TypeSymbolTable.h presence... no
checking for llvm/TypeSymbolTable.h... no
checking llvm/DataLayout.h usability... no
checking llvm/DataLayout.h presence... no
checking for llvm/DataLayout.h... no
checking llvm/IR/DataLayout.h usability... yes
checking llvm/IR/DataLayout.h presence... yes
checking for llvm/IR/DataLayout.h... yes
checking llvm/DerivedTypes.h usability... no
checking llvm/DerivedTypes.h presence... no
checking for llvm/DerivedTypes.h... no
checking llvm/IRBuilder.h usability... no
checking llvm/IRBuilder.h presence... no
checking for llvm/IRBuilder.h... no
checking llvm/IR/IRBuilder.h usability... yes
checking llvm/IR/IRBuilder.h presence... yes
checking for llvm/IR/IRBuilder.h... yes
checking llvm/IR/Verifier.h usability... yes
checking llvm/IR/Verifier.h presence... yes
checking for llvm/IR/Verifier.h... yes
checking llvm/IR/CallSite.h usability... yes
checking llvm/IR/CallSite.h presence... yes
checking for llvm/IR/CallSite.h... yes
checking llvm/Linker/Linker.h usability... yes
checking llvm/Linker/Linker.h presence... yes
checking for llvm/Linker/Linker.h... yes
checking llvm/Support/TargetSelect.h usability... yes
checking llvm/Support/TargetSelect.h presence... yes
checking for llvm/Support/TargetSelect.h... yes
checking whether llvm::PerformTailCallOpt is declared... no
checking whether llvm::GuaranteedTailCallOpt is declared... no
checking whether llvm::parseBitcodeFile is declared... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating examples/Makefile
config.status: creating pure.pc
config.status: creating run-test
config.status: creating run-tests
config.status: creating config.h

Pure 0.67 is now configured for LLVM 3.5.0 on x86_64-unknown-linux-gnu.

  Source directory:     .
  Installation prefix:  /usr/local
  Versioned install:    no
  C compiler:           gcc -g0 -O3  -DNDEBUG -DDEBUG=0
  C++ compiler:         g++ -g0 -O3  -DNDEBUG -DDEBUG=0
  Linker:               g++  -lm -lmpfr -lgmp 
  LLVM tool prefix:     
  Readline support: -lreadline
  Perl regex support:   no (use --with-pcre to enable)
  POSIX threads:    -pthread 
  Build libpure:        yes
  fastcc/TCO support:   yes

Now run 'make' to build everything, and 'make install' to install this
software on your system. To remove the installed software at a later
time use the 'make uninstall' command.

esteban-deb@MacBookPro-Esteban:~/Modelos/pure-lang/pure$ make
bison -v -o ./parser.cc parser.yy
if test "`cat parser.cc | sed -n 1p | sed -e 's/^.*GNU Bison \([0-9][.][0-9]\).*$/\1/'`" = "3.0"; then echo "#define HAVE_BISON30 1" >> ./parser.hh; fi
g++ -g0 -O3 -DNDEBUG -DDEBUG=0 -I/usr/lib/llvm-3.5/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -pthread -I. -I. -DGITREVISION='"r5842.4e6e4514"' -DPURELIB='"/usr/local/lib/pure"' -c -o pure.o pure.cc
g++ -g0 -O3 -fPIC -DNDEBUG -DDEBUG=0 -I/usr/lib/llvm-3.5/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I. -I. -c -o expr.o expr.cc
g++ -g0 -O3 -fPIC -DNDEBUG -DDEBUG=0 -I/usr/lib/llvm-3.5/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -pthread  -I. -I. -DLIBDIR='"/usr/local/lib"' -DLIBPURE='"libpure.so.8"' -c -o interpreter.o interpreter.cc
g++ -g0 -O3 -fPIC -DNDEBUG -DDEBUG=0 -I/usr/lib/llvm-3.5/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I. -I. -c -o matcher.o matcher.cc
g++ -g0 -O3 -fPIC -DNDEBUG -DDEBUG=0 -I/usr/lib/llvm-3.5/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I. -I. -c -o printer.o printer.cc
g++ -g0 -O3 -fPIC -DNDEBUG -DDEBUG=0 -I/usr/lib/llvm-3.5/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -pthread  -I. -I. -DGITREVISION='"r5842.4e6e4514"' -DPURELIB='"/usr/local/lib/pure"' -c -o runtime.o runtime.cc
g++ -g0 -O3 -fPIC -DNDEBUG -DDEBUG=0 -I/usr/lib/llvm-3.5/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I. -I. -c -o symtable.o symtable.cc
g++ -g0 -O3 -fPIC -DNDEBUG -DDEBUG=0 -I/usr/lib/llvm-3.5/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I. -I. -c -o util.o util.cc
flex -o ./lexer.cc lexer.ll
g++ -g0 -O3 -fPIC -DNDEBUG -DDEBUG=0 -I/usr/lib/llvm-3.5/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I. -I. -c -o lexer.o lexer.cc
g++ -g0 -O3 -fPIC -DNDEBUG -DDEBUG=0 -I/usr/lib/llvm-3.5/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I. -I. -c -o parser.o parser.cc
g++ -shared -Wl,-soname,libpure.so.8 -o libpure.so.8.0  -pthread expr.o interpreter.o matcher.o printer.o runtime.o symtable.o util.o lexer.o parser.o   -L/usr/lib/llvm-3.5/lib -lLLVM-3.5.0 -L/usr/lib/llvm-3.5/lib  -lm -lmpfr -lgmp  
ln -sf libpure.so.8.0 libpure.so.8
ln -sf libpure.so.8.0 libpure.so
g++ -o pure -L.  -pthread pure.o -lpure  -L/usr/lib/llvm-3.5/lib -lLLVM-3.5.0 -L/usr/lib/llvm-3.5/lib  -lm -lmpfr -lgmp  -lreadline 
./libpure.so: undefined reference to `llvm::sys::DynamicLibrary::getPermanentLibrary(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
./libpure.so: undefined reference to `llvm::raw_fd_ostream::raw_fd_ostream(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, llvm::sys::fs::OpenFlags)'
./libpure.so: undefined reference to `llvm::DataLayout::getStringRepresentation[abi:cxx11]() const'
./libpure.so: undefined reference to `llvm::Linker::LinkModules(llvm::Module*, llvm::Module*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
collect2: error: ld returned 1 exit status
Makefile:259: recipe for target 'pure' failed
make: *** [pure] Error 1

Cheers

agraef commented 6 years ago

fig2ps? binfmt-support? That's not listed anywhere in INSTALL and you don't need it.

Other than that, you did everything right, and the compile goes through all right up until that linkage command.

My guess is that you installed the wrong LLVM packages. E.g., https://packages.debian.org/jessie/amd64/llvm-3.5-runtime/download points to a Jessie package, you can't expect that to work on Stretch. Aren't there any LLVM 3.5 packages in Stretch? In that case you may want to try the LLVM 3.5 packages from my Ubuntu 17.10 PPA: https://launchpad.net/~dr-graef/+archive/ubuntu/pure-lang.artful/+sourcepub/8560755/+listing-archive-extra (make sure that you run make clean and reconfigure Pure afterwards).

If that doesn't work either then I'm afraid that you'll have to build LLVM 3.5 from source yourself (instructions are in the INSTALL file).

or anyway some binaries for debian stretch?

No, sorry.

agraef commented 6 years ago

No response, so closing.