Problems building firebreath with external boost - firebreath

I'm trying to use boost 1.46.0 with firebreath. I have read the firebreath wiki on building with external boost but haven't been able to figure it out.
I downloaded boost to ~/boost_1_46_0 and compiled it with bjam. I call prepmake.sh like so:
prepmake.sh projectdir builddir -DCMAKE_BUILD_TYPE="Release" \
-DVERBOSE=1 \
-DWITH_SYSTEM_BOOST=1 \
-DBOOST_ROOT="~/boost_1_46_0/" \
-DBoost_USE_STATIC_LIBS=on \
-DBoost_USE_STATIC_RUNTIME=off
Prepmake succeeds. I then call make in the firebreath build directory but run into linking errors toward the end.
Linking CXX shared library ../../bin/Test/npTest.so
../../ScriptingCore/libScriptingCore.a(URI.cpp.o): In function `global constructors keyed to URI.cpp':
URI.cpp:(.text+0x637): undefined reference to `boost::system::generic_category()'
URI.cpp:(.text+0x643): undefined reference to `boost::system::generic_category()'
URI.cpp:(.text+0x64f): undefined reference to `boost::system::system_category()'
URI.cpp:(.text+0x65b): undefined reference to `boost::system::system_category()'
../../ScriptingCore/libScriptingCore.a(URI.cpp.o): In function `FB::URI::isLocalhost() const':
URI.cpp:(.text+0x3065): undefined reference to `boost::system::system_category()'
URI.cpp:(.text+0x3095): undefined reference to `boost::system::system_category()'
URI.cpp:(.text+0x32ed): undefined reference to `boost::system::system_category()'
../../ScriptingCore/libScriptingCore.a(URI.cpp.o):URI.cpp:(.text+0x3569): more undefined references to `boost::system::system_category()' follow
Thanks -Darren

Looks like you're missing the boost-system library

I had to set the boost libraries firebreath uses in my project's PluginConfig.cmake:
add_boost_library(date_time)
add_boost_library(regex)
add_boost_library(system)
add_boost_library(thread)
Weird thing is it seems like firebreath finds them automatically (see below) but unless I manually specify add_boost_library the linker isn't aware of them:
-- Boost version: 1.46.0
-- Found the following Boost libraries:
-- thread
-- system
-- Boost version: 1.46.0
-- Found the following Boost libraries:
-- thread
-- system
-- date_time
-- Boost version: 1.46.0
-- Found the following Boost libraries:
-- thread
-- system
-- date_time
-- regex
-- Configuring done
-- Generating done

I had a similiar issue where (using external boost 1.56 on windows with VS2013) the linking failed saying it can't find the libraries for boost date_time and regex.
Adding them using
add_boost_library(date_time)
add_boost_library(regex)
had no effect, however this fixed the problem for me:
link_boost_library(${PLUGIN_NAME} date_time)
link_boost_library(${PLUGIN_NAME} regex)
For future references in case anyone stumbles upon this issue.

Related

Identifier "cusparseXXX" is undefined on cuda11

I'm building a package tested for CUDA 9,10 from source, trying to compile it for CUDA11.
I've already changed gencode=arch=compute_70 (was set on 30), and added
target_link_libraries(tsnecuda ${CUDA_cusparse_LIBRARY})
Unfortunately, I still get
tsne-cuda/src/util/math_utils.cu(153): error: identifier "cusparseScsr2csc" is undefined
tsne-cuda/src/util/math_utils.cu(165): error: identifier "cusparseXcsrgeamNnz" is undefined
tsne-cuda/src/util/math_utils.cu(195): error: identifier "cusparseScsrgeam" is undefined
3 errors detected in the compilation of "tsne-cuda/src/util/math_utils.cu".
CMake Error at tsnecuda_generated_math_utils.cu.o.cmake:276 (message):
Error generating file
tsne-cuda/build/CMakeFiles/tsnecuda.dir/src/util/./tsnecuda_generated_math_utils.cu.o
Is there a chance the build process somehow ignores my target_link_libraries? Should I add something else?
Undefined identifier is a compilation issue, not a linking issue.
At least part of the problem here is that CUDA deprecated and removed some functionality from cusparse, including cusparse<t>csr2csc(). The code would need to be rewritten to compile correctly under the latest versions of CUDA 11.x.
For example, for csr2csc, the call to cusparseScsr2csc might be refactored to use this function instead.
One example of deprecation/removal notice for cusparse<t>csr2csc is given here.

Remove debugger keyword during compilation in google closure

UPDATE:
The JS version of closure-compiler is no longer supported or maintained.
https://github.com/google/closure-compiler-npm/blob/master/packages/google-closure-compiler-js/readme.md
Im trying to find if there is a way to remove the "debugger" keyword during compilation process, im using the javascript version google-closure-compiler with gulp.
Looking through the documentation it is clear we can set the flag to stop/show error messages during compilation by doing the following.
https://github.com/google/closure-compiler/wiki/Flags-and-Options
--jscomp_off
translating this to gulp, it is:
const googleClosureOptions = {
...
jscomp_error:"checkDebuggerStatement"
}
however this works on stopping the compilation by throwing error or to show a warning.
zyxcdafg.js:1444: ERROR - [JSC_DEBUGGER_STATEMENT_PRESENT] Using the debugger statement can halt your application if the user has a JavaScript debugger running.
debugger;
^^^^^^^^^
but what I am trying to achieve is to remove the debugger keyword. Is this possible to achieve using googleclosure. I can not find any flags or options relating to this.
UPDATE:
The JS version of closure-compiler is no longer supported or maintained.
https://github.com/google/closure-compiler-npm/blob/master/packages/google-closure-compiler-js/readme.md
No I don't think so. I'd suggest you use something else to do it. Like sed:
find dist -name "*.js" -exec sed -i 's/\sdebugger;//' {} +
Something like that will find files in your dist folder that end with .js and then exec-ute sed to replace all instances of debugger; with nothing.
You could add that to a script that calls your Closure Compiler build.
The compiler doesn't have a command-line api for defining custom code removal passes, but the compiler's architecture does allow for registering custom passes and a pass to remove a debugger statement should be trivial:
if (n.isDebugger()) {
compiler.reportChangeToEnclosingScope(n);
n.detach();
}
The general structure would follow:
https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/CheckDebuggerStatement.java

compiling cuda using cmake works only after calling make twice

I want to use cmake to compile CUDA with '-arch=sm_12', but cmake/make behave strangely.
I have following CMakeLists.txt:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(test)
FIND_PACKAGE(CUDA REQUIRED)
CUDA_ADD_EXECUTABLE(test prog.cu)
SET(CUDA_NVCC_FLAGS "-arch=sm_12")
SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} CACHE STRING "Forced" FORCE)
but 'cmake ../src && make' leads to a executable for sm_20.
The flag seems to be ignored.
EDIT: If I call 'make' again (without any modification in CMakeListss.txt) it uses the Flag. - But only if I force the flag to cache (last line)
Am I doing anything wrong?
EDIT: After checking again: I have to call 'make' twice to work correctly. Does anybody know this behaviour?
inJeans was right:
FindCUDA-docs https://cmake.org/cmake/help/v3.3/module/FindCUDA.html
This is the essential information:
"Note that any of these flags can be changed multiple times in the same directory before calling CUDA_ADD_EXECUTABLE, CUDA_ADD_LIBRARY, CUDA_COMPILE, CUDA_COMPILE_PTX, CUDA_COMPILE_FATBIN, CUDA_COMPILE_CUBIN or CUDA_WRAP_SRCS:"

HTML 5 - GRUNT BUILD : Fatal error: Object has no method 'compact'

I'm trying to build a project with GRUNT. it throws the following error,
Running "cuff:dev" (cuff) task
>> Building src/pages/home
Fatal error: Object home.less has no method 'compact'
src/pages/home/ -> home.less file,
section#home {
}
I didn't have any method in home.less. What i did wrong?. I can't understand the meaning of this error.
the info you provided is too less, my guess is dev target of cuff task has nested tasks probably something related to home task taking less as target, but grunt is not able to load less target. ( probably not defined at all or part of a grunt plugin you forgot to load )
That kind of errors are thrown when you call a target/task but grunt can not find/load it.
use grunt --help to load all available commands in your context ( commands from plugins are not shown by this command)

NPAPI plugin: nsScriptablePeer.obj : error LNK2019: unresolved external symbol _NPN_Evaluate referenced in function

I am trying to compile NPAPI plugin under Win-XP and VS 2008.
Its giving me error as nsScriptablePeer.obj : error LNK2019: unresolved external symbol _NPN_Evaluate referenced in function when I try to use NPN_Evaluate to call javascript function . I have added all libraries from xulrunner-sdk/lib and xullrunner-sdk/sdk/lib in additional library directories. Is there any other library needs to be included to use NPN_Evaluate function ?
The functions beginning with NPN_ are only accessible through the pointer passed during the initialization NP_Initialize phase. I've been caught by this situation and I decided to document a bit here.
In other words, you don't have to link a library but you have to catch the pointer to the NPN browser functions during the NP_Initialize call to your plugin.
You can find a brief rundown of npapi plugins in general here:
http://colonelpanic.net/2009/03/building-a-firefox-plugin-part-one/
it's a little disjointed, but my goal was to answer some of the not-well-explained parts of NPAPI, like the one you ran into here =]
Incidently, if you're using nsScriptablePeer, you're using an outdated example that still uses XPCOM instead of NPObjects. XPCOM will no longer be supported in future versions of firefox (starting 3.6, I believe)
A little more about that here: http://colonelpanic.net/2009/08/building-a-firefox-plugin-%E2%80%93-part-three/