poco icon indicating copy to clipboard operation
poco copied to clipboard

Trying to Compile with emscripten: Target architecture was not detected as supported by Double-Conversion

Open suriya1611 opened this issue 5 years ago • 3 comments

Trying to compile the poco (1.9.0) libraries using emscripten compiler. Getting error in utils.h file in double-conversion. I guess latest double-conversion is not updated in poco source code. Can you please add the latest version of double-conversion? Or is it available already in develop branch?

suriya1611 avatar May 27 '19 15:05 suriya1611

As a temporary fix you could manually add the following to the end of the architecture list (in utils.h): defined(__EMSCRIPTEN__) just before the line #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1

NOTE 1: Also do a project search and replace for: defined(EMSCRIPTEN) to defined(__EMSCRIPTEN__)

I read that the former is not always defined but the latter is.

NOTE 2: You may get errors on the NET library also (as raw sockets are not supported in Emscripten), to fix this add the following to the main CMakeLists.txt file add_definitions(-DPOCO_NO_LINUX_IF_PACKET_H)

To compile with cmake do the following:

mkdir -p ./cmake_build rm -r ./cmake_build/* cd cmake_build emconfigure cmake -S .. -B . emmake make

mahergreg avatar Oct 16 '19 04:10 mahergreg

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Jan 21 '22 02:01 github-actions[bot]

This issue was closed because it has been inactive for 60 days since being marked as stale.

github-actions[bot] avatar Apr 20 '22 03:04 github-actions[bot]

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Nov 24 '23 02:11 github-actions[bot]

There are more issues when trying to compile code from latest devel (pre-1.13) with emscripten.

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.5 ()

[ 20%] Building CXX object Foundation/CMakeFiles/Foundation.dir/src/Thread.cpp.o
In file included from /home/ubuntu/git/graudata/warp/warpdrive-src/deps-2.4/poco/poco-src/Foundation/src/Thread.cpp:32:
/home/ubuntu/git/graudata/warp/warpdrive-src/deps-2.4/poco/poco-src/Foundation/src/Thread_POSIX.cpp:368:11: error: no member named 'syscall' in the global namespace
        return ::syscall(SYS_gettid);
               ~~^
/home/ubuntu/git/graudata/warp/warpdrive-src/deps-2.4/poco/poco-src/Foundation/src/Thread_POSIX.cpp:368:19: error: use of undeclared identifier 'SYS_gettid'
        return ::syscall(SYS_gettid);
                         ^

matejk avatar Nov 30 '23 16:11 matejk

Initially reported issue with double conversion was fixed in 1.12 (commit d294391c94ea0f0c31bdc2ba71d0c9d1035792f7).

Other issues are being resolved for release 1.13.

matejk avatar Dec 04 '23 08:12 matejk

Created PR #4318.

matejk avatar Dec 04 '23 09:12 matejk