I tried to re-compile vim with ruby support because I noticed that vim was still using 1.8.7 (which is the default ruby version on Snow Leopard). Ruby 1.9.2 is installed via rvm.
When compiling with
./configure --enable-rubyinterp --enable-gui=no --disable-nls --enable-cscope --prefix=/Users/madhatter
I get the following error from make:
ld: library not found for -lruby.1.9.1
collect2: ld returned 1 exit status
make[1]: *** [vim] Error 1
make: *** [first] Error 2
I then cloned the actual repository from googlecode and tried to build that. There were no errors in make, but starting vim resulted in the following error:
dyld: Symbol not found: _environ
Referenced from: /Users/madhatter/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.1.9.1.dylib
Expected in: flat namespace
in /Users/madhatter/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.1.9.1.dylib
[1] 41782 trace trap vim
Last thing I tried was adding some ruby information to the config.mk file
RUBY = /Users/madhatter/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
RUBY_SRC = if_ruby.c
RUBY_OBJ = objects/if_ruby.o
RUBY_PRO = if_ruby.pro
RUBY_CFLAGS = -I/Users/madhatter/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I/Users/madhatter/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-darwin10.8.0 -DRUBY_VERSION=19
RUBY_LIBS = -lruby.1.9.1 -lpthread -ldl -lobjc
Any other ideas what might work?
see Trying to compile vim on OS X? for an answer. Basically the answer is that you can't right now without fixing Vim.
This is what I'm using for vim + python
./configure --with-features=BIG --enable-pythoninterp=yes --enable-multibyte=yes --enable-cscope=yes
Looks like you're missing
--enable-rubyinterp=yes
Related
I am trying to install PythonMagick following these instructions. https://gist.github.com/tomekwojcik/2778301
When I get to $ make I get this error
Making all in pythonmagick_src
CXX libpymagick_la-_DrawableFillRule.lo
_DrawableFillRule.cpp:3:10: fatal error: 'boost/python.hpp' file not found
#include <boost/python.hpp>
^
1 error generated.
make[1]: *** [libpymagick_la-_DrawableFillRule.lo] Error 1
make: *** [all-recursive] Error 1
How do I get PythonMagick installed in my project? Any way that will work. I can't find useful instructions anywhere on the internet.
Make sure you have boost-python brew boost-python. Note the version number, as you'll need to replace 1.59.0 below with the correct version.
$ BOOST_ROOT=/usr/local/Cellar/boost/1.59.0
$ ./configure
Edit Makefile and pythonmagick_src/Makefile to include the boost library. You are looking for two lines: DEFAULT_INCLUDES and LDFLAGS. You'll add boost paths to the end of those lines, making them look something like this:
DEFAULT_INCLUDES = -I. -I$(top_builddir)/config -I/usr/local/Cellar/boost/1.59.0/include
LDFLAGS = -L/usr/local/Cellar/boost-python/1.59.0/lib
That should resolve the compile/link errors.
i already discussed this issue with the maintainer of ruby-build and followed his advice by googling for similar errors. i found similar ones but they do not seem to match my specific problem:
i'm trying to install ruby with rbenv install 2.0.0-p247 (using the ruby-build plugin) on archlinux – but the command fails.
here the last 10 log lines:
rbconfig.rb updated
generating enc.mk
compiling dln.c
compiling encoding.c
generating prelude.c
compiling prelude.c
linking static-library libruby-static.a
verifying static-library libruby-static.a
collect2: error: ld returned 1 exit status
make: *** [libruby-static.a] Error 1
i would appreciate any hints on this problem – thanks!
To find out what's wrong here, the best bet is to run the Ruby installation yourself to see exactly what's amiss. ruby-build typically downloads and extracts Ruby in /tmp (it should be the same path where it also saves the log file of the failed install).
Go to that directory and run:
$ ./configure
$ make
To see if you get the same error. If you do, then try to re-run the command that failed again. In your case this is probably:
$ ranlib libruby-static.a
To see why it fails.
Since several versions of GCC and Ubuntu I am experiencing annoying issues with paths and naming of several header and object files that are necessary for the installation of GCC.
Description: After installing ubuntu (e.g. in my case 12.04) and installing all prerequisites of the gcc, I run the following commands:
sudo mkdir /usr/local/stow/gcc-4.8.0
./configure --prefix /usr/local/stow/gcc-4.8.0
make
sudo make install
For the sake of completeness, the rest of the installation procedure:
cd /usr/local/stow
sudo stow -t /usr/local/ gcc-4.8.0
gcc -v
However, this simple and proper way of installing gcc has some issues during the 'make' step with the following error messages:
1.) The problem with 'stubs.h'
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
which can be fixed with the following commands added to ~/.bashrc:
if [ -z "$CPATH"]; then
export CPATH="/usr/include/i386-linux-gnu"
else
export CPATH=$CPATH:"/usr/include/i386-linux-gnu"
fi
2.) The problem with 'crti.o', 'crtn.o', and 'crt1.o'
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find crtn.o: No such file or directory
/usr/bin/ld: cannot find crt1.o: No such file or directory
which can be fixed with the very ugly solution:
sudo ln -s /usr/lib/i386-linux-gnu/crti.o /usr/lib/i386-linux-gnu/crtn.o /usr/lib/i386-linux-gnu/crt1.o /usr/lib
since - and I don't know why - the following commands do not solve the problem during linking steps of 'sudo make install'
if [ -z "$LIBRARY_PATH"]; then
export LIBRARY_PATH="/usr/lib/${multiarch}"
else
export LIBRARY_PATH=$LIBRARY_PATH:"/usr/lib/${multiarch}"
fi
if [ -z "$LD_LIBRARY_PATH"]; then
export LD_LIBRARY_PATH="/usr/lib/${multiarch}"
else
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/usr/lib/${multiarch}"
fi
(With these solutions I could compile GCC-4.7.2 on Ubuntu 12.04. - I have still issues compiling GCC-4.8.0 on Ubuntu 12.04, but that's different topic.)
My questions are: Does anybody know the reason/background that we have these issues? Does anybody know a proper solution? (With "proper solution" I mean a solution that does not require setting environment variables or symbolic linking libraries to different directories. To me these kind of changes are ugly, since they require changes to the system that one may not be able to trace back or redo.)
In the root folder of your GCC source execute ./contrib/download_prerequisites script.
These are the issues i encountered while compiling GCC 4.8.0 on Ubuntu 12.04 with solutions.
This might help you.
Compilation guide for compiling GCC 4.8 on ubuntu 12.04
ERROR 1
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
http://gcc.gnu.org/install/prerequisites.html for additional info. If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files. They may be located in separate packages.
SOLUTION
Download and install gmp version >=4.3.2 package because mpc needs higher version
download the source code from gmplib.org
compile the source code and install
while compiling gmp see ERROR 2 for help
Installed gmp version 5.1.1
Download and install mpfr package
Installed mpfr version 3.1.2
Download and install mpc package
Installed mpc version 1.0
Download the packages from
http://ftp.gnu.org
ERROR 2
Error while compiling gmp library
checking for suitable m4... configure: error: No usable m4 in $PATH or /usr/5bin
SOLUTION
sudo apt-get install m4
http://ubuntuforums.org/showthread.php?t=850491
ERROR 3
Cannot find g++ compiler
I got this error because I installed the OS recently and had not installed the compilers.
SOLUTION
sudo apt-get install build-essential
This installs all the standard build essential software
ERROR 4
checking for i686-pc-linux-gnu-gcc... /home/suhastheju/projects/gcc/gcc-4.8.0/host-i686-pc-linux-gnu/gcc/xgcc -B/home/suhastheju/projects/gcc/gcc-4.8.0/host-i686-pc-linux-gnu/gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem /usr/local/i686-pc-linux-gnu/sys-include
checking for suffix of object files... configure: error: in `/home/suhastheju/projects/gcc/gcc-4.8.0/i686-pc-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/suhastheju/projects/gcc/gcc-4.8.0'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/suhastheju/projects/gcc/gcc-4.8.0'
make: *** [all] Error 2
SOLUTION
Though gcc documentation specify , that , we can provide the path of gmp
and mpfr installtion through –with-gmp and –with-mpfr flag ,
but unfortunately , i tried to give the path but it didnt work.
I am not in position to say final word about , this , whether it is a bug
in build script or something else , but bellow is the solution of the problem.
while building , add gmp and mpfr installation path in LD_LIBRARY_PATH environment
variable. Do as follows
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
If you have the libraries in different path, add the path where libraries are present
ERROR 5
libbackend.a(tree-vect-data-refs.o):tree-vect-data-refs.c:(.text+0x87da): more undefined references to `vector_type_mode(tree_node const*)' follow
collect2: error: ld returned 1 exit status
make[3]: *** [cc1] Error 1
make[3]: Leaving directory `/home/suhastheju/projects/gcc/gcc-4.8.0/host-i686-pc-linux-gnu/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/home/suhastheju/projects/gcc/gcc-4.8.0'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/home/suhastheju/projects/gcc/gcc-4.8.0'
make: *** [all] Error 2
SOLUTION
recompiled the source code from begining, It worked magically
make clean all
ERROR 6
/home/suhastheju/projects/gcc/gcc-4.8.0/host-i686-pc-linux-gnu/gcc/../.././gcc/gcov.c:416: undefined reference to `gcc_init_libintl()'
collect2: ld returned 1 exit status
make[3]: *** [gcov] Error 1
make[3]: Leaving directory `/home/suhastheju/projects/gcc/gcc-4.8.0/host-i686-pc-linux-gnu/gcc'
SOLUTION
Added -I/usr/include
I upgraded rvm to 1.15.8, then went back down to 1.15.7 after having some problems in zsh. After downgrading, my Ruby 1.9+ versions went back in fine, but 1.8.7 won't install again.
There are two errors that are occurring:
Error running 'patch -F 25 -p1 -N -f <"/Users/me/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch"', please read /Users/me/.rvm/log/ruby-1.8.7-p352/patch.apply.stdout-rouge-fix.log
The contents of that file are:
[2012-09-11 01:05:59] patch -F 25 -p1 -N -f <"/Users/me/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch"
patching file lib/mkmf.rb
Hunk #1 FAILED at 201.
1 out of 1 hunk FAILED -- saving rejects to file lib/mkmf.rb.rej
and:
Error running 'make ', please read /Users/me/.rvm/log/ruby-1.8.7-p352/make.log
There has been an error while running make. Halting the installation.
and the contents of that file are (only the first few lines beginning with the errors):
Fail to find [tclConfig.sh, tkConfig.sh]
Use MacOS X Frameworks.
Find Tcl/Tk libraries. Make tcltklib.so which is required by Ruby/Tk.
gcc-4.2 -I. -I../.. -I../../. -I../.././ext/tk -DHAVE_RB_SAFE_LEVEL -DHAVE_RB_HASH_LOOKUP -DHAVE_RB_PROC_NEW -DHAVE_RB_OBJ_TAINT -DHAVE_ST_PTR -DHAVE_ST_LEN -DRUBY_VERSION=\"1.8.7\" -DRUBY_RELEASE_DATE=\"2011-06-30\" -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -DWITH_TCL_ENABLE_THREAD=0 -fno-common -g -O2 -fno-common -pipe -fno-common -c stubs.c
In file included from stubs.c:10:
/usr/include/tk.h:78:23: error: X11/Xlib.h: No such file or directory
In file included from stubs.c:10:
/usr/include/tk.h:549: error: expected declaration specifiers or ‘...’ before ‘Window’
/usr/include/tk.h:549: error: ‘Window’ declared as function returning a function
/usr/include/tk.h:552: error: expected declaration specifiers or ‘...’ before ‘XEvent’
/usr/include/tk.h:561: error: expected specifier-qualifier-list before ‘Tk_ClassCreateProc’
/usr/include/tk.h:655: error: expected specifier-qualifier-list before ‘Bool’
/usr/include/tk.h:677: error: expected specifier-qualifier-list before ‘Bool’
/usr/include/tk.h:756: error: expected specifier-qualifier-list before ‘Display’
/usr/include/tk.h:902: error: expected declaration specifiers or ‘...’ before ‘XPoint’
/usr/include/tk.h:996: error: expected declaration specifiers or ‘...’ before ‘Display’
One of the applications I support is 1.8.7. I am dead in the water. This looks like it might be a problem with Mountain Lion vs. rvm. Can anyone point me in the right direction?
UPDATE:
I got over the first error by doing "reinstall" instead of just "install". Even though 1.8.7-p352 was not in the list of rubies given by the command "rvm list rubies".
it is problem in detecting tcl/tk by ruby 1.8.7, the solution is to disable it:
rvm reinstall 1.8.7 --without-tcl --without-tk
the other solution when tcl/tk is needed: https://stackoverflow.com/a/11666019/497756
I think I ended up with two similar questions on sf here. My main problem was that the tcl.h include file on Mountain Lion (location: /usr/include/tcl.h symlinked) could not resolve an internal reference it had to "X11/Xlib.h". I thought that installing tcl and tk through homebrew would fix the problem by generating a path to Xlib.h that could be resolved. So I ran:
brew install tcl
and:
brew install tk
and:
rvm remove 1.8.7-p352
rvm install 1.8.7-p352
and it worked. But Michal's answer above would have worked just as well I think. This answer will serve to help people build it that need tcl and tk.
After I download UnitTest++ version 1.4 (from http://sourceforge.net/projects/unittest-cpp/) and do a make, I get:
$ make
src/AssertException.cpp
src/Test.cpp
src/Checks.cpp
src/TestRunner.cpp
src/TestResults.cpp
src/TestReporter.cpp
src/TestReporterStdout.cpp
src/ReportAssert.cpp
src/TestList.cpp
src/TimeConstraint.cpp
src/TestDetails.cpp
src/MemoryOutStream.cpp
src/DeferredTestReporter.cpp
src/DeferredTestResult.cpp
src/XmlTestReporter.cpp
src/CurrentTest.cpp
src/Posix/SignalTranslator.cpp
src/Posix/TimeHelpers.cpp
Creating libUnitTest++.a library...
src/tests/Main.cpp
src/tests/TestAssertHandler.cpp
src/tests/TestChecks.cpp
src/tests/TestUnitTest++.cpp
src/tests/TestTest.cpp
src/tests/TestTestResults.cpp
src/tests/TestTestRunner.cpp
src/tests/TestCheckMacros.cpp
src/tests/TestTestList.cpp
src/tests/TestTestMacros.cpp
src/tests/TestTimeConstraint.cpp
src/tests/TestTimeConstraintMacro.cpp
src/tests/TestMemoryOutStream.cpp
src/tests/TestDeferredTestReporter.cpp
src/tests/TestXmlTestReporter.cpp
src/tests/TestCurrentTest.cpp
Linking TestUnitTest++...
ld: in libUnitTest++.a, archive has no table of contents
collect2: ld returned 1 exit status
make: *** [TestUnitTest++] Error 1
A co-worker doesn't get this error on his Mac, with the same version of gcc (4.2.1). (Note: I can use the libUnitTest++.a built by my co-worker, so I'm not blocked, but I would like to troubleshoot this problem nonetheless.)
I did a Google search, and it sounds like ranlib has solved others' similar problems, but libUnitTest++.a isn't getting created so I can't run ranlib on it.
I've run into this problem myself, you need to run ranlib on the .a file before passing it along to g++. I've patched this in a homebrew recipe, enjoy:
https://github.com/pdex/homebrew/blob/master/Library/Formula/unittest-cpp.rb