Nathan,
Thanks for that catch. Sorry... that was a mixup in my copy and paste.
They're actually both now "planetforge.node".
Actually, I think I found the issue. But, I'm not entirely sure. I
ran sudo /sbin/ldconfig -- but only after uninstalling node and building it
from source, then switching the project to a node-gyp builder.
But, both node-gyp and node-waf work. And, for anyone else who might need
help, here are the two files:
wscript:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def set_options(opt):
opt.tool_options("compiler_cxx")
def configure(conf):
conf.check_tool("compiler_cxx")
conf.check_tool("node_addon")
conf.check_cfg(package='libpng', args='--cflags --libs',
atleast_version="1.5.0", uselib_store='LIBPNG', mandatory=True)
def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.uselib = ['LIBPNG']
obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE",
"-Wall"]
obj.target = "planetforge"
obj.source = "planetforge.cc"
obj.includes = "/usr/local/include/libpng15"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
And, planetforge.gyp:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
'link_settings': {
'library_dirs': [
'/usr/lib',
],
},
'targets': [
{
'target_name': 'planetforge',
'type': '<(library)',
'cflags': ['-fPIC', '-Wall'],
'libraries': ['-lpng'],
'sources': [ 'planetforge.cc' ]
}
]
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Scott
On Wednesday, February 29, 2012 11:05:14 PM UTC-5, Nathan Rajlich wrote:
>
> It looks like you are requiring "forge.node" but in your wscript you have
> "planetforge". Those two values must match.
>
> On Wed, Feb 29, 2012 at 5:54 PM, Scott Straley wrote:
>
>> Hi,
>>
>> I've gotten a little further. This will now configure and compile, but
>> I'm getting an error "Error: Unable to load shared
>> library /node/site/src/forge/build/Release/forge.node". Here's my new
>> wscript:
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~**~~~~~~~~~~~
>>
>> def set_options(opt):
>> opt.tool_options("compiler_cxx")
>>
>> def configure(conf):
>> conf.check_tool("compiler_cxx")
>> conf.check_tool("node_addon")
>> conf.check_cfg(package='libpng', args='--cflags --libs',
>> atleast_version="1.5.0", uselib_store='LIBPNG')
>>
>> def build(bld):
>> obj = bld.new_task_gen("cxx", "shlib", "node_addon")
>> obj.uselib = ['LIBPNG']
>> obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE",
>> "-Wall"]
>> obj.target = "planetforge"
>> obj.source = "planetforge.cc"
>> #obj.source = "hello.cc"
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~**~~~~~~~~~~~
>>
>> ~ Scott
>>
>>
>>
>>
>> On Wednesday, February 29, 2012 3:35:15 PM UTC-5, Scott Straley wrote:
>>>
>>> Hi,
>>>
>>> I'm trying to build a module with node-waf, and it's not seeing
>>> libpng. I started with the default ubuntu libpng12, then downloaded
>>> and compiled and installed libpng15. Neither work. I've been running
>>> around in circles trying to reconfigure wscript, but nada. My wscript
>>> looks like:
>>>
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~**~~~~~~~~~~~
>>>
>>> import Options
>>> from os import unlink, symlink, popen
>>> from os.path import exists
>>>
>>> srcdir = "."
>>> blddir = "build"
>>> VERSION = "0.0.1"
>>>
>>> def set_options(opt):
>>> opt.tool_options("compiler_**cxx")
>>>
>>> def configure(conf):
>>> conf.check_tool("compiler_cxx"**)
>>> conf.check_tool("node_addon")
>>> conf.check(lib='png', libpath=['/lib', '/usr/lib', '/usr/local/lib',
>>> '/usr/local/libpng/lib', '/home/straley/downloads/**libpng-1.5.9'])
>>>
>>>
>>> def build(bld):
>>> obj = bld.new_task_gen("cxx", "shlib", "node_addon")
>>> obj.target = "forge"
>>> obj.source = "forge.cc"
>>> obj.uselib = "PNG"
>>> obj.cxxflags = ["-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE"]
>>>
>>> def shutdown():
>>> if Options.commands['clean']:
>>> if exists('planetforge.node'): unlink('planetforge.node')
>>> if exists('build/Release/**planetforge.node') and not
>>> exists('planetforge.node'):
>>> symlink('build/Release/**planetforge.node', 'planetforge.node')
>>>
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~**~~~~~~~~~~~
>>>
>>> when I run node-waf configure, I get:
>>>
>>> Checking for program g++ or c++ : /usr/bin/g++
>>> Checking for program cpp : /usr/bin/cpp
>>> Checking for program ar : /usr/bin/ar
>>> Checking for program ranlib : /usr/bin/ranlib
>>> Checking for g++ : ok
>>> Checking for node path : ok /usr/bin/node
>>> Checking for node prefix : ok /usr
>>> Checking for library png : not found
>>>
>>> With the -vvv option, the snippet near the "library png" line, looks
>>> like:
>>>
>>> 12:25:19 build Build cache loading failed
>>> 12:25:19 build srcnode is .conf_check_0 and srcdir /node/site/src/
>>> forge/build/.conf_check_0
>>> 12:25:19 build init variants
>>> 12:25:19 build list of variants is ['Release']
>>> 12:25:19 build compile called
>>> 12:25:19 build delayed operation TaskGen.flush() called
>>> 12:25:19 task_gen posting objects (normal)
>>> 12:25:19 group group None
>>> 12:25:19 group <task_gen 'testprog' of type task_gen defined in
>>> dir:///node/site/src/forge/**build/.conf_check_0>
>>> 12:25:19 task_gen posting <task_gen 'testprog' of type task_gen
>>> defined in dir:///node/site/src/forge/**build/.conf_check_0> 453397520
>>> 12:25:19 task_gen -> apply_verif (453397520)
>>> 12:25:19 task_gen -> exec_rule (453397520)
>>> 12:25:19 task_gen -> default_cc (453397520)
>>> 12:25:19 task_gen -> vars_target_cprogram (453397520)
>>> 12:25:19 task_gen -> apply_core (453397520)
>>> 12:25:19 task_gen -> apply_link (453397520)
>>> 12:25:19 task_gen -> default_link_install (453397520)
>>> 12:25:19 task_gen -> add_extra_flags (453397520)
>>> 12:25:19 task_gen -> init_cxx (453397520)
>>> 12:25:19 task_gen -> apply_type_vars (453397520)
>>> 12:25:19 task_gen -> apply_lib_vars (453397520)
>>> 12:25:19 task_gen -> apply_incpaths (453397520)
>>> 12:25:19 task_gen -> apply_obj_vars_cxx (453397520)
>>> 12:25:19 task_gen -> apply_defines_cxx (453397520)
>>> 12:25:19 task_gen -> apply_obj_vars (453397520)
>>> 12:25:19 task_gen -> apply_objdeps (453397520)
>>> 12:25:19 task_gen posted testprog
>>> 12:25:19 build executor starting
>>> 12:25:19 envhash '\x00\x85\xf8\x02\xb2Z4\x9d\**x8e\x977\xb4.\xc2<
>>> \xcd' ["['/usr/bin/g++']", "['-g']", '[]', '[]', '[]', '', "['-c', '-
>>> o', '']", '[]']
>>> 12:25:19 ccroot _scan_preprocessor(self, node, env, path_lst)
>>> 12:25:19 preproc scanning test.cpp (in .conf_check_0)
>>> 12:25:19 preproc reading file '/node/site/src/forge/
>>> build/.conf_check_0/test.cpp'
>>>
>>> 12:25:19 preproc reading file '/node/site/src/forge/
>>> build/.conf_check_0/test.cpp'
>>> 12:25:19 deps deps for
>>> src:///node/site/src/forge/**build/.conf_check_0/test.cpp:
>>>
>>> []; unresolved []
>>> 12:25:19 deps scanner for cxx: build/.conf_check_0/test.cpp ->
>>> build/.conf_check_0/testbuild/**Release/test_1.o
>>> returned [] []
>>> 12:25:19 task task
>>> {task: cxx test.cpp -> test_1.o} must run as it was never run
>>> before or the task code changed
>>> 12:25:19 runner system command -> ['/usr/bin/g++', '-g', '../
>>> test.cpp', '-c', '-o', 'Release/test_1.o']
>>> 12:25:19 envhash '\x8f?\xc3\x16\\1\xf3A\x87\**xbe\xc5\xde\xceA
>>> \xeb!' ["['/usr/bin/g++']", '', "['-o', '']", "['-L/lib', '-L/usr/
>>> lib', '-L/usr/local/lib', '-L/usr/local/libpng/lib', '-L/home/straley/
>>> downloads/libpng-1.5.9', '-Wl,-Bdynamic', '-lpng']"]
>>> 12:25:19 task task
>>> {task: cxx_link test_1.o -> testprog} must run as it was never
>>> run before or the task code changed
>>> 12:25:19 runner system command -> ['/usr/bin/g++', 'Release/test_1.o',
>>> '-o', '/node/site/src/forge/build/.**conf_check_0/testbuild/**Release/
>>> testprog', '-L/lib', '-L/usr/lib', '-L/usr/local/lib', '-L/usr/local/
>>> libpng/lib', '-L/home/straley/downloads/**libpng-1.5.9', '-Wl,-
>>> Bdynamic', '-lpng']
>>>
>>> Running libpng-config with the following flags, yields me:
>>>
>>> --prefix : /usr/local
>>> --libdir: /usr/local
>>> --libs: -lpng15
>>> --cflags: -I/usr/local/include/libpng15
>>> --I_opts: -I/usr/local/include/libpng15
>>> --L_opts: -L/usr/local/lib
>>> --ldflags: -L/usr/local/lib -lpng15
>>>
>>> /usr/local/include/libpng15 has:
>>>
>>> -rw-r--r-- 1 root root 115248 Feb 29 10:16 png.h
>>> -rw-r--r-- 1 root root 21354 Feb 29 10:16 pngconf.h
>>> -rw-r--r-- 1 root root 6033 Feb 29 10:16 pnglibconf.h
>>>
>>> /usr/local/lib has:
>>>
>>> lrwxrwxrwx 1 root root 10 Feb 29 10:16 libpng.a -> libpng15.a
>>> lrwxrwxrwx 1 root root 11 Feb 29 10:16 libpng.la -> libpng15.la
>>> lrwxrwxrwx 1 root root 11 Feb 29 10:16 libpng.so -> libpng15.so
>>> -rw-r--r-- 1 root root 1041456 Feb 29 10:16 libpng15.a
>>> -rwxr-xr-x 1 root root 936 Feb 29 10:16 libpng15.la
>>> lrwxrwxrwx 1 root root 18 Feb 29 10:16 libpng15.so ->
>>> libpng15.so.15.9.0
>>> lrwxrwxrwx 1 root root 18 Feb 29 10:16 libpng15.so.15 ->
>>> libpng15.so.15.9.0
>>> -rwxr-xr-x 1 root root 601026 Feb 29 10:16 libpng15.so.15.9.0
>>>
>>> And, in my forge.cc file, I'm attempting to include libpng with:
>>>
>>> #include <png.h>
>>>
>>> So... I think that's all the relevant info. If anyone has any ideas,
>>> I'd greatly appreciate it. I've been chasing ghosts for two days on
>>> this.
>>>
>>> Thanks,
>>> Scott
>>>
>>>
>>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>
>
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en