mschwartz / SilkJS

V8 Based JavaScript Swiss Army Knife (and HTTP Server!)
https://github.com/decafjs/decaf
Other
323 stars 37 forks source link

Directory not found for option '-Lv8-read-only/out/x64.release' #32

Closed Kirkman closed 11 years ago

Kirkman commented 11 years ago

I am trying to make SilkJS on my Mac (Mountain Lion 10.8.3), but it errors and dies with this output:

x cairo/cairo.h /usr/bin/g++ -rdynamic -o silkjs main.o base64.o global.o console.o process.o net.o fs.o buffer.o http.o gd.o ncurses.o sem.o logfile.o v8.o md5.o sqlite3.o xhrhelper.o curl.o ssh2.o sftp.o memcached.o ftplib.o ftp.o editline.o popen.o linenoise.o cairo.o expat.o async.o time.o mysql.o watchdog.o /Users/kirkman/SilkJS/src/osx_dependencies/lib/mysql/libmysqlclient.a /Users/kirkman/SilkJS/src/osx_dependencies/lib/libcurl.a /Users/kirkman/SilkJS/src/osx_dependencies/lib/libmm.a /Users/kirkman/SilkJS/src/osx_dependencies/lib/libfreetype.a /Users/kirkman/SilkJS/src/osx_dependencies/lib/libgd.a /Users/kirkman/SilkJS/src/osx_dependencies/lib/libjpeg.a /Users/kirkman/SilkJS/src/osx_dependencies/lib/libpng.a /Users/kirkman/SilkJS/src/osx_dependencies/lib/libmemcached.a /Users/kirkman/SilkJS/src/osx_dependencies/lib/libssh2.a -Lv8-read-only/out/x64.release -lv8 -lncurses -lpthread -lsqlite3 -L/usr/X11/lib -lcairo -lexpat -lz -lssl -lcrypto -lpng -lfreetype -lxpm -liconv -lfontconfig -ldl -lsasl2 -lbz2 -Wl,-rpath,/usr/local/silkjs/src/v8,-rpath,v8-read-only/out/x64.release ld: warning: directory not found for option '-Lv8-read-only/out/x64.release' ld: library not found for -lv8 collect2: ld returned 1 exit status make[1]: *** [SilkJS] Error 1 make: *** [all] Error 2

mschwartz commented 11 years ago

It looks like v8 did not get checked out and built.

I build SilkJS in my ~/src directory.

These commands should work, assuming you've removed SilkJS from your ~/src directory:

$ cd ~/src
$ git clone https://github.com/mschwartz/SilkJS
$ cd SilkJS
$ make
$ sudo make install

test to see it build (from the command line):

$ silkjs

I just tested this on my workstation and I don't see the problem.

It looks like you may have just done the sudo make install step?

Kirkman commented 11 years ago

Originally I used the instructions on the GitHub front page:

git clone https://github.com/mschwartz/SilkJS SilkJS cd SilkJS make

I just tried your suggested commands, but it during the sudo make install, it errors out with this:

g++ -fexceptions -fomit-frame-pointer -fdata-sections -ffunction-sections -fno-strict-aliasing -fvisibility=hidden -Wall -W -Wno-unused-function -Wno-unused-parameter -Wnon-virtual-dtor -m64 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -fno-strict-aliasing -c -I/usr/X11/include -I/Users/kirkman/src/SilkJS/src/osx_dependencies/include -I/Users/kirkman/src/SilkJS/src/mysql-5.1.63/include -I/Users/kirkman/src/SilkJS/src/libssh2-1.2.8/include -Iv8-read-only/include -o logfile.o logfile.cpp logfile.cpp:29:16: error: mm.h: No such file or directory logfile.cpp:37: error: ISO C++ forbids declaration of 'MM' with no type logfile.cpp:37: error: expected ';' before '*' token logfile.cpp: In constructor 'STATE::STATE(char*)': logfile.cpp:48: error: 'struct STATE' has no member named 'mm' logfile.cpp:48: error: 'mm_create' was not declared in this scope logfile.cpp:49: error: 'mm' was not declared in this scope logfile.cpp:49: error: 'mm_malloc' was not declared in this scope logfile.cpp: In destructor 'STATE::~STATE()': logfile.cpp:71: error: 'struct STATE' has no member named 'mm' logfile.cpp:71: error: 'mm_destroy' was not declared in this scope make[1]: *** [logfile.o] Error 1 make: *** [install] Error 2

mschwartz commented 11 years ago

What version of OSX? <<<< important :) I haven't built on lion in a long time, but it should work. It definitely works on mountain lion. I haven't really tried to build it for any previous version of OSX.

Sorry if this email seems long, a lot of it is showing you output from my console during a working make.

You can always do:

    $ make realclean
    $ make

The make realclean will erase all the libraries and v8 that a previous make downloaded and built. It will cause the following make command to redownload and build everything SilkJS depends on (v8, libmm, libgd, etc.).

libmm is part of the SIlkJS repository. It is built on OSX - and the missing header file causing your error message would be found by this part of the g++ command you copied below: -I/Users/kirkman/src/SilkJS/src/osx_dependencies/include

This is what's on my hard disk after SilkJS is built. All this should be compiled and installed here by the make you ran:

    mschwartz@dionysus:~/src/SilkJS$ ls src/osx_dependencies/include/
    cairo               freetype2           gd_io.h             gdfontl.h           gdfontt.h           jerror.h            libhashkit          libssh2.h           mm.h                pngconf.h
    curl                ft2build.h          gdcache.h           gdfontmb.h          gdfx.h              jmorecfg.h          libmemcached        libssh2_publickey.h mysql
    entities.h          gd.h                gdfontg.h           gdfonts.h           jconfig.h           jpeglib.h           libpng12            libssh2_sftp.h      png.h

More details…

From Makefile.osx in the source directory:

    DEPENDENCIES = $(MYSQL) $(JPEG) $(PNG) $(FREETYPE) $(GD2) $(MM) $(CURL) $(SSH2) $(MEMCACHED) $(CAIRO)

It is going to unpack and build MySQL, libjpg, libpng, libfreetype, libgd2, libmm, lib curl, libssh2, libmemcached, and libcairo. All of these would be installed in SilkJS/src/osx_dependencies.

Looking at the output of make on a fresh git clone on my mac, I see (after it's built libjpg, libpng, libfreetype, and libgd2:

(the /usr/bin/install at the top is installing libgd2 in SilkJS/src/osx_dependencies, then it unpacks and installs libmm)

    /usr/bin/install -c -m 644 'gdfontmb.h' '/Users/mschwartz/src/SilkJS/src/osx_dependencies/include/gdfontmb.h'
    /usr/bin/install -c -m 644 'gdfonts.h' '/Users/mschwartz/src/SilkJS/src/osx_dependencies/include/gdfonts.h'
    /usr/bin/install -c -m 644 'gdfontt.h' '/Users/mschwartz/src/SilkJS/src/osx_dependencies/include/gdfontt.h'
    /usr/bin/install -c -m 644 'entities.h' '/Users/mschwartz/src/SilkJS/src/osx_dependencies/include/entities.h'
    tar xzvfp dependencies/mm_1.4.2.orig.tar.gz
    x mm-1.4.2/ChangeLog
    x mm-1.4.2/INSTALL
    x mm-1.4.2/LICENSE
    x mm-1.4.2/Makefile.in
    x mm-1.4.2/PORTING
    x mm-1.4.2/README
    x mm-1.4.2/THANKS
    x mm-1.4.2/aclocal.m4
    x mm-1.4.2/config.guess
    x mm-1.4.2/config.h.in
    x mm-1.4.2/config.sub
    x mm-1.4.2/configure
    x mm-1.4.2/configure.ac
    x mm-1.4.2/libtool.m4
    x mm-1.4.2/ltmain.sh
    x mm-1.4.2/mm-config.1
    x mm-1.4.2/mm-config.in
    x mm-1.4.2/mm-config.pod
    x mm-1.4.2/mm.3
    x mm-1.4.2/mm.h
    x mm-1.4.2/mm.pod
    x mm-1.4.2/mm_alloc.c
    x mm-1.4.2/mm_core.c
    x mm-1.4.2/mm_global.c
    x mm-1.4.2/mm_lib.c
    x mm-1.4.2/mm_test.c
    x mm-1.4.2/mm_vers.c
    x mm-1.4.2/shtool
    cd /Users/mschwartz/src/SilkJS/src/mm-1.4.2 && ./configure --prefix /Users/mschwartz/src/SilkJS/src/osx_dependencies && make && make install
    Configuring OSSP mm (Shared Memory Allocation), Version 1.4.2 (15-Aug-2006)
    Copyright (c) 1999-2006 Ralf S. Engelschall <rse@engelschall.com>
    Copyright (c) 1999-2006 The OSSP Project <http://www.ossp.org/>
    Platform: i386-apple-darwin12.3.0

    Build Tools:
    …

As you can see, I moved my old SilkJS out of the way, did a fresh git clone, and make from scratch. You should have seen something like this:

    mschwartz@dionysus:~/src$ mv SilkJS old
    mschwartz@dionysus:~/src$ git clone git@github.com:mschwartz/SilkJS
    Cloning into 'SilkJS'...
    remote: Counting objects: 4602, done.
    remote: Compressing objects: 100% (1879/1879), done.
    remote: Total 4602 (delta 2692), reused 4542 (delta 2640)
    Receiving objects: 100% (4602/4602), 69.78 MiB | 5.41 MiB/s, done.
    Resolving deltas: 100% (2692/2692), done.
    mschwartz@dionysus:~/src$ cd SilkJS
    mschwartz@dionysus:~/src/SilkJS$ make
    cd src && make -fMakefile.osx
    echo "svn checkout"
    svn checkout
    svn checkout -r 12823 http://v8.googlecode.com/svn/trunk/ v8-read-only
    A    v8-read-only/test
    …

On May 25, 2013, at 9:13 AM, Josh Renaud notifications@github.com wrote:

Originally I used the instructions on the GitHub front page:

git clone https://github.com/mschwartz/SilkJS SilkJS cd SilkJS make

I just tried your suggested commands, but it during the sudo make install, it errors out with this:

g++ -fexceptions -fomit-frame-pointer -fdata-sections -ffunction-sections -fno-strict-aliasing -fvisibility=hidden -Wall -W -Wno-unused-function -Wno-unused-parameter -Wnon-virtual-dtor -m64 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -fno-strict-aliasing -c -I/usr/X11/include -I/Users/kirkman/src/SilkJS/src/osxdependencies/include -I/Users/kirkman/src/SilkJS/src/mysql-5.1.63/include -I/Users/kirkman/src/SilkJS/src/libssh2-1.2.8/include -Iv8-read-only/include -o logfile.o logfile.cpp logfile.cpp:29:16: error: mm.h: No such file or directory logfile.cpp:37: error: ISO C++ forbids declaration of 'MM' with no type logfile.cpp:37: error: expected ';' before '' token logfile.cpp: In constructor 'STATE::STATE(char_)': logfile.cpp:48: error: 'struct STATE' has no member named 'mm' logfile.cpp:48: error: 'mm_create' was not declared in this scope logfile.cpp:49: error: 'mm' was not declared in this scope logfile.cpp:49: error: 'mm_malloc' was not declared in this scope logfile.cpp: In destructor 'STATE::~STATE()': logfile.cpp:71: error: 'struct STATE' has no member named 'mm' logfile.cpp:71: error: 'mm_destroy' was not declared in this scope make[1]: * [logfile.o] Error 1 make: * [install] Error 2

— Reply to this email directly or view it on GitHub.

Kirkman commented 11 years ago

Starting over with make realclean did the trick. Thanks for your help.