Giter Site home page Giter Site logo

Comments (9)

abhi-agg avatar abhi-agg commented on July 25, 2024

I am not sure what your Makefile does but if building on Ubuntu using the instructions given in README doesn't work then we can take a look 👍

from bergamot-translator.

jerinphilip avatar jerinphilip commented on July 25, 2024

What exactly is WASM_COMPATIBLE_SOURCES vs COMPILE_WASM now?

from bergamot-translator.

jerinphilip avatar jerinphilip commented on July 25, 2024

I did a make VERBOSE=1 to extract the command:

Context (pre)

jphilip@var:~/code/cached-builds$ BRANCH=main make wasm VERBOSE=1
mkdir -p /mnt/Storage/jphilip/bergamot /mnt/Storage/jphilip/bergamot/build /mnt/Storage/jphilip/bergamot/build/native /mnt/Storage/jphilip/bergamot/build/wasm /mnt/Storage/jphilip/bergamot/build/models.gz.d
git -C /mnt/Storage/jphilip/bergamot/bergamot-translator pull || git clone https://github.com/browsermt/bergamot-translator /mnt/Storage/jphilip/bergamot/bergamot-translator
Already up to date.
git -C /mnt/Storage/jphilip/bergamot/bergamot-translator checkout main
M       3rd_party/marian-dev
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
git -C /mnt/Storage/jphilip/bergamot/bergamot-translator submodule update --init --recursive
Submodule path '3rd_party/marian-dev': checked out '370fdb5a212cfcd2d1c5fca9fffc041d2787a432'
/mnt/Storage/jphilip/bergamot/emsdk/emsdk activate latest &> /tmp/error.log || cat /tmp/error.log

source /mnt/Storage/jphilip/bergamot/emsdk/emsdk_env.sh && cd /mnt/Storage/jphilip/bergamot/build/wasm && \
        emcmake /home/jphilip/.local/bin/cmake -L \
                -DCMAKE_BUILD_TYPE=Release \
                -DCOMPILE_WASM=on \
                /mnt/Storage/jphilip/bergamot/bergamot-translator

Context (post)

Adding directories to PATH:
PATH += /mnt/Storage/jphilip/bergamot/emsdk
PATH += /mnt/Storage/jphilip/bergamot/emsdk/upstream/emscripten
PATH += /mnt/Storage/jphilip/bergamot/emsdk/node/14.15.5_64bit/bin

Is this not per instruction?

from bergamot-translator.

abhi-agg avatar abhi-agg commented on July 25, 2024

As I said, running these build commands should work on Ubuntu,

emcmake cmake -DCOMPILE_WASM=on ../
emmake make -j

If they don't then we can look into it 👍

from bergamot-translator.

jerinphilip avatar jerinphilip commented on July 25, 2024

Do you read what I write? Also I don't have an emmake in Ubuntu.

from bergamot-translator.

jerinphilip avatar jerinphilip commented on July 25, 2024
source ${EMSDK}/emsdk_env.sh && \\
    emcmake cmake -L \
        -DCMAKE_BUILD_TYPE=Release \
        -DCOMPILE_WASM=on \
        .. && \
        &&  emmake make -f -j40

Here's what you see if you take effort to read through Makefile, or even the generated command. It's still a failure. Also this script worked before, it fails now.

Here's a full error log.

from bergamot-translator.

jerinphilip avatar jerinphilip commented on July 25, 2024

Was probably an artifact of an old-ssplit compile, which left the folders with the o and didn't recompile after. I'm not sure if this triggers a CMake change as a fix wherein ssplit-cpp has to be rebuilt if COMPILE_WASM switches are on. But since this is a corner case, I'm closing the issue.

Removing all folders and rebuilding fixes the issue.

from bergamot-translator.

abhi-agg avatar abhi-agg commented on July 25, 2024

It compiles fine for me on Linux.

Platform information:
4.15.0-132-generic #136-Ubuntu SMP Tue Jan 12 14:58:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Do you read what I write? Also I don't have an emmake in Ubuntu.

emmake is coming from emscripten installation. If you don't have emmake, you should never be able to compile bergamot-translator to WASM on any platform.

from bergamot-translator.

jerinphilip avatar jerinphilip commented on July 25, 2024

emmake is irrelevant to the process (as CMake seems to generate stuff with whatever is required), it's the same as make, it works. My hypothesis is that I was experimenting with pcre2 from sources before and compiled libraries from source for Linux. Since the part (USE_INTERNAL_PCR2) didn't change, CMake/Make silently refused to recompile the (pcre2) targets and it remained for Linux, not WASM.

emscripten-core/emscripten#9988

Fresh clone solved this. This is infact a bug of sorts, but too much a corner case to not bother.

from bergamot-translator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.