javascript — Node-gyp пытается скомпилировать libraw как зависимость

Я пытаюсь скомпилировать libraw как зависимость для моего проекта node.js.

У меня есть два разных файла .gyp: ./binding.gyp а также ./vendor/raw.gyp

Я скачал текущую версию libraw и демосакции, все они можно найти на ./vendor/ папка как:

LibRaw-0.17.1
LibRaw-demosaic-pack-GPL2-0.17.1
LibRaw-demosaic-pack-GPL3-0.17.1

Вот мои два файла:

./binding.gyp

{
"includes": [ "vendor/raw.gyp" ],
"targets": [
{
"target_name": "node_libraw",
"sources": [ "node_libraw.cc" ],
"include_dirs" : [
"build/Release",
"vendor/LibRaw-0.17.1",
"<!(node -e \"require('nan')\")"],
"libraries": [
"-lraw",
"-Wl,-rpath=./build/Release/obj.target/"]
}
],
}

./vendor/raw.gyp

{
"targets": [
{
"default_configuration": "Release",
"target_name": "raw",
"type": "static_library",
"sources": [
"LibRaw-0.17.1/internal/dcraw_common.cpp",
"LibRaw-0.17.1/internal/dcraw_fileio.cpp",
"LibRaw-0.17.1/internal/demosaic_packs.cpp",
"LibRaw-0.17.1/src/libraw_cxx.cpp",
"LibRaw-0.17.1/src/libraw_datastream.cpp",
"LibRaw-0.17.1/src/libraw_c_api.cpp"],
"include_dirs": [
"./LibRaw-demosaic-pack-GPL2-0.17.1",
"./LibRaw-demosaic-pack-GPL3-0.17.1",
"./LibRaw-0.17.1"],
"libraries": [
"-ljpeg8"],
"cflags": [
"-Wdeprecated-declarations",
"-pthread -w"],
"cflags_cc": [
"-pthread -w",
"-fexceptions",
"-I./LibRaw-demosaic-pack-GPL2-0.17.1",
"-DLIBRAW_DEMOSAIC_PACK_GPL2",
"-I./LibRaw-demosaic-pack-GPL3-0.17.1",
"-DLIBRAW_DEMOSAIC_PACK_GPL3",
"-DUSE_JPEG8"]
}
]
}

Проблема в том, что, когда я пытаюсь скомпилировать библиотеку с node-gyp configure build Я получаю следующую ошибку:

/usr/bin/ld: cannot find -lraw
collect2: error: ld returned 1 exit status
node_libraw.target.mk:124: recipe for target 'Release/obj.target/node_libraw.node' failed

Вот полный вывод:

$ node-gyp configure build
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn python2
gyp info spawn args [ '/usr/share/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/node-libraw/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/share/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/include/nodejs/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/usr/include/nodejs',
gyp info spawn args   '-Dnode_gyp_dir=/usr/share/node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=/node-libraw',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/node-libraw/build'
CXX(target) Release/obj.target/node_libraw/node_libraw.o
In file included from ../vendor/LibRaw-0.17.1/libraw/libraw.h:40:0,
from ../node_libraw.cc:6:
../vendor/LibRaw-0.17.1/libraw/libraw_datastream.h:96:10: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
std::auto_ptr<std::streambuf> f; /* will close() automatically through dtor */
^
In file included from /usr/include/c++/5/memory:81:0,
from ../vendor/LibRaw-0.17.1/libraw/libraw_datastream.h:38,
from ../vendor/LibRaw-0.17.1/libraw/libraw.h:40,
from ../node_libraw.cc:6:
/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here
template<typename> class auto_ptr;
^
In file included from ../vendor/LibRaw-0.17.1/libraw/libraw.h:40:0,
from ../node_libraw.cc:6:
../vendor/LibRaw-0.17.1/libraw/libraw_datastream.h:97:10: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
std::auto_ptr<std::streambuf> saved_f; /* when *f is a subfile, *saved_f is the
^
In file included from /usr/include/c++/5/memory:81:0,
from ../vendor/LibRaw-0.17.1/libraw/libraw_datastream.h:38,
from ../vendor/LibRaw-0.17.1/libraw/libraw.h:40,
from ../node_libraw.cc:6:
/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here
template<typename> class auto_ptr;
^
SOLINK_MODULE(target) Release/obj.target/node_libraw.node
/usr/bin/ld: cannot find -lraw
collect2: error: ld returned 1 exit status
node_libraw.target.mk:124: recipe for target 'Release/obj.target/node_libraw.node' failed
make: *** [Release/obj.target/node_libraw.node] Error 1
make: Leaving directory '/node-libraw/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.3.0-6-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "configure" "build"gyp ERR! cwd /node-libraw
gyp ERR! node -v v4.2.4
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok

И URL проекта: https://github.com/m0g/node-libraw/tree/batteries

Спасибо

1

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]